locked
Auto Update WPF ClickOnce app with IIS 7.5 RRS feed

  • Question

  • Hi,

    Common problem.  Don't see standard solutions online.  Basically, IIS 7.5 is not compatible with FPSE, which are needed to easily deploy ClickOnce applications to a web server.

    Setup:
    1. Windows Server 2008 R2 running Hudson, which I use to build projects from SVN with
    2. Deploy script which copies app.publish folder to environment->version folder specified as script argument

    3. IIS 7.5 hosting that directory, giving users access to the .application clickOnce install

    This all works fine.  However, there is no auto updating.  If a user wants to update, they have to uninstall their app, and click on a new link.

    Directory structure is ENV->version->contents of app.publish

    From my elementary understanding, I need to put the .manifest file in the ENV folder, have the user install from that folder directly, then update the manifest to point to a new version folder when I create a new version.

    I've looked at the manifest file, and it's unclear to me what I need to change.  Has anyone done this, or have a better means to handle automatic application updating of a WPF application from windows server 2008 R2 running IIS 7.5?

    Thanks in advance.

    • Edited by nuculerman Friday, March 1, 2013 7:38 PM
    Friday, March 1, 2013 7:36 PM

Answers

  • If you want to deploy CLickOnce to a web server that does not have FPSE on it, the easiest way is to use FTP instead of HTTP.

    In the publishing file location, use something like ftp://myserver.com/myfolder/

    Then the installation URL would be the HTTP address that points to that location, such as http://myserver.com/myfolder/

    The problem you are having is caused by you not replicating the directory structure correctly. ClickOnce versions the folders under Application Files. You are versioning them for each deployment, which means the installation URL is different for each version. In order to use updates, you have to deploy all of the versions so they use the same installation URL. The deployment manifest in the top folder (.application file) determines which version (under Application Files) is installed.

    RobinDotNet


    Click here to visit my ClickOnce blog!
    Microsoft MVP, Client App Dev

    • Marked as answer by nuculerman Wednesday, March 6, 2013 4:28 PM
    Monday, March 4, 2013 7:29 AM

All replies

  • If you want to deploy CLickOnce to a web server that does not have FPSE on it, the easiest way is to use FTP instead of HTTP.

    In the publishing file location, use something like ftp://myserver.com/myfolder/

    Then the installation URL would be the HTTP address that points to that location, such as http://myserver.com/myfolder/

    The problem you are having is caused by you not replicating the directory structure correctly. ClickOnce versions the folders under Application Files. You are versioning them for each deployment, which means the installation URL is different for each version. In order to use updates, you have to deploy all of the versions so they use the same installation URL. The deployment manifest in the top folder (.application file) determines which version (under Application Files) is installed.

    RobinDotNet


    Click here to visit my ClickOnce blog!
    Microsoft MVP, Client App Dev

    • Marked as answer by nuculerman Wednesday, March 6, 2013 4:28 PM
    Monday, March 4, 2013 7:29 AM
  • Hi,

    Thanks for the help. Two things:

    1. I can never get this to work.  Let's call my server url "server.com".  I've started up and IIS 7.5 service, which hosts the directory "E:\ClickOnce".  To get to that directory from a different computer you use the address "http://server.com:8081/".  My server is Windows Server 2008 R2.  It has two drives.  C:\ and E:\.  In the publish wizard I set publish directory to: "ftp://server.com/ClickOnce."  I set the publish URL to "http://server.com:8081/".  I get the error: "Could not find web server at 'server.com'.  Please check to make sure the web server name is valid and your proxy settings are set correctly."  I'm assuming this means I need to do something on the server side to enable ftp'ing?  Any advice would help.

    2. If I'm running Hudson on the same server I'm hosting the application on, I'm assuming I don't need to use "ftp" in the publish location.  Do I just use the string of the actual directory in the .csproj file?  Does the URL remain the same?

    Thanks!

    EDIT:

    Forgot to mention that I have FTP Service and FTP Extensibility installed. 

    EDIT 2:

    I created an "FTP site" on my IIS server.  Still not working but I think it's progress.  I have both anonymous authentication and basic authentication enabled.  SSL settings are "Require SSL connections."  Authorization Rules are "Allow All Users : Read, Write".  It's set up to point at E:\ClickOnce with site server.com:8082.

    Now when I set publish directory to "ftp://server.com:8082" and publish URL to "http://server.com:8081/"  I get a login prompt.  I've tried both "connect using passive mode," "anonymous log on," both and neither and get the same error: "Failed to access ftp://server.com:8082.  Unable to create the web site 'ftp://server.com:8082'.  Request denied for policy reasons.

    I have Active Directory set up and I have admin rights on the server.

    • Edited by nuculerman Tuesday, March 5, 2013 3:23 PM
    Tuesday, March 5, 2013 2:51 PM
  • This is beyond what I can help you with. I have a systems engineer. :-) 

    The most I know about this is they provided me with a folder on the server, and I would ftp the files to that folder, which had a specific address, like ftp://myserver.com/robin. That folder also had an HTTP address that pointed to it, http://myserver.com/thisistheapp/. And they didn't put the folder directly under the root, it was on another disk entirely -- something about it being unsafe giving a developer access to the root of the webserver. Sheesh, imagine. ;-)

    For IIS questions, I'd try one of the IIS forums:

    http://forums.iis.net/

    RobinDotNet


    Click here to visit my ClickOnce blog!
    Microsoft MVP, Client App Dev

    Wednesday, March 6, 2013 12:41 AM
  • Thank you.  I've marked your first response as the answer.  I'm confident you set me down the right path.

    Random question though.  Should I be able to ftp to the same address I'm setting as the publish location?  So in your example, if I type "ftp myserver.com" in the command prompt, shouldn't I be given a login prompt?

    To be honest, I've only ever ftp'd to unix servers, and that command has always worked.  It doesn't work for my windows server 2008 R2 instance.  I get "Can't connect :Unknown error number".  When I include the port and/or folder I set up the ftp instance of IIS I get "Unknown host".  I'm hoping once I diagnose my ftp issues, the rest will follow.

    I'll start a thread on the iis forums as well.  Thanks for the link.


    • Edited by nuculerman Wednesday, March 6, 2013 4:36 PM
    Wednesday, March 6, 2013 4:35 PM
  • It depends on how the FTP alias is set up. For example, my address was something like ftp://myserver.com/robin/deploy/composer/ but my http link was http://myserver.com/composer.

    Our systems engineer set it up, so I can't tell you exactly how he did it.

    If you have ftp installed/enabled on the server, you should be able to type ftp myserver.com and get a prompt. You have to make sure you have ftp on the machine you're using, too, so see if just typing in "ftp" does anything.

    Good luck.

    RobinDotNet


    Click here to visit my ClickOnce blog!
    Microsoft MVP, Client App Dev

    Thursday, March 7, 2013 7:42 PM