ClickOnce application deployment woes

clickonce

I have a ClickOnce WPF application which is launched from a page on a web site. The URL parameters used to invoke the application tell the application what IP address to communicate with plus some authentication information. This "configuration" information is written to the registry for use in subsequent application execution in case the application is launched from the Start menu rather than the browser.

The same web site is available from multiple web servers (but with different data which the ClickOnce application uses).

Let us say that I have 2 websites, A & B, both of which have the same version of my ClickOnce application (v1.0.0.0).

I can browse to the site from website A and make the ClickOnce application be downlaoded, installed and execute. No problem so far.

If I now browse to website B and try to launch the ClickOnce application from the browser I get an error dialog saying "You cannot start application TestApplication from this location because it is already installed from a different location". There is an OK and Details button, the Details button gives a nice big log file telling me the application was installed from website A.

If I go and modify the configuration information stored in the registry to tell the application to talk to website B and then launch the application from the Start menu, it runs fine, communicates with the website to retrieve data specific to that host. Changing the registry settings manually is not an acceptable solution.

If I uninstall the application and then go to website B, the application is downloaded, installs and runs OK, but this is not really an acceptable solution.

My problem is that I want users to be able to launch the application from the browser from multiple different websites without getting this "You cannot start application…" problem.

I don't want to have to change the application name/identity for each different web site/webserver. The application is rolled out to the web site host machines as part of a larger software package which is generic, i.e. not unique or tailored to an individual machine.

I've seen questions/answers about deploying multiple versions of the same application to a single client machine by changing the application name/ID but that is not really the problem.

I guess my question is, how do I make it so my application can be launched from a web page on a different host to the one it has already been deployed from.

Best Answer

I don't have an answer, just a few thoughts.

Is there a reason why you're storing the setting in the registry? Could you add it as an application setting instead? If that would work, you could store all the web server end points as application settings and give the user a simple UI to choose which web site they want to use.

This doesn't solve the issue of installing from one server and launching from another server, but would work if the users installed the application from one server and then always launched it from the start menu.

Related Topic