简体   繁体   中英

Link to Start ClickOnce or MSI-Installed Application

An interesting requirement that came up for one of the applications I'm working on. We support both ClickOnce deployment for the majority of customers and traditional deployment with an MSI (WiX) package for those customers that require more control over the install process.

However, regardless of how the application is installed, when a user clicks the 'Launch' button on our website, I need it to launch the application. If it's already been installed via the MSI package for the current user, it should launch the currently installed copy; otherwise, it should install/update/run the ClickOnce package. I suppose I could make the ClickOnce version launch the MSI-installed version if it's present, then quickly close. This question gives me hope that it might be possible by simply making both applications have the same GUID, but I'm not sure how to do that, or if it's even a good idea.

It's trivial to make a link that launches the ClickOnce application:

<a href="/path/to/myapp.application">Launch</a>

And it's not too difficult to make a custom protocol handler that gets registered with the MSI:

<a href="myapp:launch">Launch</a>

However it doesn't seem possible to make the ClickOnce application be able to handle this new protocol, and even if I solve that problem, this won't work for new customers that don't have either installed.

Is there a relatively simple way to make a single web link that will launch an MSI-installed application or a ClickOnce application?

I've used this technique from a Silverlight application to invoke a local application. We had to sign the XAP and get it trusted for it to work though. I'm not sure how it would work from a normal HTML page.

Registering an Application to a URI Scheme

I think you're going about it backwards. If you want to invoke the ClickOnce app (check for updates and run the app), you can do a process.start(ieexplore.exe, " http://myserver.mydomain.com/myapplication/whatever/myapp.application ") (using the URL to the actual ClickOnce app). Rather than having the ClickOnce app invoke the msi, can you do it the other way around and have the msi invoke the ClickOnce app? Or write something to check which one to run/install and invoke it?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM