tags:

views:

426

answers:

3

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.

A: 

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.

whatknott
The reason for using the registry for storing information is so that it can be easily stored on a per user basis, i.e. under HKEY_CURRENT_USER, rather than using a datafile and having to put that is a user specific location.Irrespective of that, a UI element could be provided to allow setting the host(s) to be communicated with - but as you observed, that does not help with the problem of trying to "launch" the application from a different web server.
A: 

I am also stuck with same problem. Have u found any solution. Please share it with me .

Thanks Shital

Shital
A: 

I think you're getting your sites confused. You could have a single website that is your ClickOnce install location and then your app (assuming it requires Full Trust) can communicate wherever it needs to (e.g. Web A, B, C, etc).

I'm assuming you're deploying a copy of the ClickOnce publication between your two install locations now, and therein lies your problem. ClickOnce builds a manifest and signs it to prevent tampering, basically the scenario you have described. MS didn't want Vendor A's code to run on Vendor B's site.

There has been improvements in the VS 2008 .NET 3.5SP1 release, but I haven't yet played with it to tell if you can get away with what you need. I suggest an overall architecture change (single install site, different config mechanism).

Brett Veenstra