views:

292

answers:

1

I'm trying to deploy an application built with VS2008 Express. The idea is to upload the files to a webserver (installation via website) and at the same time offer offline (CD) installations to some users which do not have Internet connection.

In the Publish options I left the Installation Folder URL blank, I unchecked the option The application should check for updates (since I'm taking care of the updates check manually) and I filled in the option Update location (if different than publish location).

When I'm trying to test the offline installation, the application cannot be installed. I get an error "Application download did not succeed. Check your network connection..." and when pressing the Details button, I'm reading the following error:

  • Activation of C:\Install\myapp.application resulted in exception. Following failure messages were detected:

Why is it that, although all files are present, the installation is trying to download the files from the Internet?

Finally, when I remove the server URL from the Update location, everything normally. Do I need to create two different setups each time I need to update the application? Or is there another solution?


Edit:

Further tests proved that offline installation works normally in Windows XP, but it doesn't work in Windows 7. In the later case, using the same installation files, the installer tries to download the application from the Internet, instead of using the local .deploy files.

No ClickOnce gurus available?

+4  A: 

The ClickOnce runner will attempt to connect to the specified URL, regardless of whether the files are already locally present or not. You will need two build configurations to support both CD and web-based deployments. Here is the relevant info from Microsoft's documentation.

To enable this deployment strategy in Visual Studio, click From a CD-ROM or DVD-ROM on the How Installed page of the Publish Wizard.

To enable this deployment strategy manually, change the deploymentProvider tag in the deployment manifest so that the value is blank. In Visual Studio, this property is exposed as Installation URL on the Publish page of the Project Designer. In Mage.exe, it is Start Location.

You can do this automatically, so you don't need to manually edit the project settings each time (and risk making even a small mistake that prevents your clients from updating). Unfortunately, the ClickOnce settings of the project do not appear to be controlled by standard build configurations, so you'll need to do some hand editing of the project file (which is also an MSBuild script) or a separate build script in whatever tool you use.

The value you need to override is the InstallUrl. It should be blank for the CD-ROM installation build. Your build will then need to build both configurations. There are copious examples on this site an others with instructions on how to do just that.

Jerry Bullard
I understand that having two different deployment strategies is the 'official' way to go, but why is it that my offline installation works ok on Windows XP but it fails when used in a network disconnected Windows 7?
Anax