Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 available?

like image 273
Anax Avatar asked Nov 05 '09 11:11

Anax


People also ask

Is ClickOnce still supported?

ClickOnce and DirectInvoke are supported out of the box for all Windows users. Users that want to disable ClickOnce support can go to edge://flags/#edge-click-once and select Disabled from the dropdown list. You'll have to Restart the browser.

Does ClickOnce require admin rights?

Security permissions. Windows Installer deployment requires administrative permissions and allows only limited user installation; ClickOnce deployment enables non-administrative users to install and grants only those Code Access Security permissions necessary for the application.

Where does ClickOnce install to?

Every ClickOnce application installed on a local computer has a data directory, stored in the user's Documents and Settings folder. Any file included in a ClickOnce application and marked as a "data" file is copied to this directory when an application is installed.

How do I uninstall ClickOnce app?

To uninstall a ClickOnce application, users can go to the Control Panel and launch the "Add or Remove Programs" application. In the "Change or Remove Programs" section, users then select the application to uninstall and click the Change/Remove button.


2 Answers

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.

like image 179
Jerry Bullard Avatar answered Oct 26 '22 23:10

Jerry Bullard


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:

  1. Right click project in VS and select properties
  2. Go to Publish tab
  3. Click "Options"
  4. Select "Manifests"
  5. Check "Exclude deployment provider URL"
like image 25
Barrie Avatar answered Oct 26 '22 21:10

Barrie