ClickOnce CD setup tries to connect to the Internet
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:
- Downloading http://myserver.com/myapp.application did not succeed.
- Unable to connect to the remote server
- A socket operation was attempted to an unreachable network 195.42.142.11:80
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 开发者_JS百科available?
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.
I had an issue that was kind of similar except I was publishing an application for a more recent project in VS2015. My publish settings were:
- How will users install the application - "From a CD-ROM or DVD-ROM"
- The application will not check for updates
I would publish this from my dev machine (e.g. mymachine01
) and the .application file it bundles alongside Setup.exe would always contain a line like this:
<deploymentProvider codebase="http://mymachine01/Application20Name/Application20Name.application" />
I would zip that up then drop it onto another machine to test the installer and I would get an Application cannot be started. Contact the application vendor.
error. Clicking the details button would reveal a The remote name could not be resolved
error where the app had been trying to access mymachine01
. To fix that, I used the following steps:
- Right click project in VS and select properties
- Go to Publish tab
- Click "Options"
- Select "Manifests"
- Check "Exclude deployment provider URL"
精彩评论