3

The application (.NET C#) I'm working on is being deployed at our customer's own servers, on their IIS, so we can use ClickOnce to install the application on the customers work computers. Since it's the customer's own servers the IPs are never the same. This is a problem for standard ClickOnce update mechanism. Here's the scenario I'd like to end up with:

  • Remove the "The application should check for updates" from the project.
  • After start-up the application fetches application settings from the server (this is already implemented) and in those settings the update URL is provided.
  • Using the update URL the application uses ClickOnce to check for an update.
  • The application is updated and restarted.

Is this possible? And how?

I've read How to move a ClickOnce deployment package and this might work, but sometimes the customer decides to change the server IP.

Community
  • 1
  • 1
Paw Baltzersen
  • 2,662
  • 3
  • 24
  • 33

2 Answers2

7

You can publish the ClickOnce app and let them put it on their servers (same folder structure) and the user can install it from wherever it is, without having it be a specific URL. To do this, open the project properties, go to the Publish tab, then bring up the Options dialog.

On that dialog, go to the Manifests tab and check "Exclude deployment provider URL".

When the user installs it, ClickOnce will set the deployment provider URL to the installation location, and will look for updates at that location from thereon out.

If your customer then wants to move the deployment to another URL, they have to have everybody uninstall it and reinstall it.

blackgreen
  • 34,072
  • 23
  • 111
  • 129
RobinDotNet
  • 11,723
  • 3
  • 30
  • 33
  • I'm a bit busy with other work stuff atm, I'll look into it in the near future. – Paw Baltzersen Jun 04 '12 at 07:29
  • 1
    The "Exclude dep..." let me on the right track. I also needed to activate "check for updates" before the application starts up and enter some bogus URL. – Paw Baltzersen Jun 11 '12 at 11:49
  • You shouldn't set an update URL. You should leave it blank; it will use the deployment provider URL that it is installed from. – RobinDotNet Jun 19 '12 at 08:09
  • I cannot believe how long I had to look to find this. Thanks Robin! For reference though, I don't believe your above comment is right. Forthose who are having problems with a "please specify a deployment url", you DO have to enter a value in the update URL. As Paw alluded to - but wasn't clear enough for me to catch it first time, it doesn't matter what as long as it looks like a URL. It is ignored in the final manifest anyway. – statler May 07 '17 at 11:03
0

In the project properties publish tab click op the Updates button. There deselect 'The application should check for updates' option. (bullet 1).

The rest of the bullets check this blog http://bloggingabout.net/blogs/dennis/archive/2007/11/05/manual-check-for-updates-with-clickonce.aspx

Ralf de Kleine
  • 11,464
  • 5
  • 45
  • 87
  • This doesn't make it possible to change the update URL. There's even someone (nicolas) who is asking the same question but isn't answered. – Paw Baltzersen May 29 '12 at 14:02