tags:

views:

480

answers:

2

I have a ClickOnce app that is frequently launched from another application via a URL. The URL includes some command-line arguments that load data, etc.

Since the frequency of launching the app is so high, I want to cut out the check for version updates. So I implemented my own checking through the ApplicationDeployment class to avoid it. It works fine if you launch from the Start Menu once the app is installed.

However, we also want to preserve the launch via URL behavior because it is advantageous in so many ways. But when launching via URL, the update check is always performed -- it seems IE isn't smart enough to look for the app in the local download area to see if it is already installed or not...

Does anyone know of a way to get the "don't check for updates automatically" behavior while still using the URL launch mechanism?


Actually, it looks like the issue is a Catch-22 in the ClickOnce model. If you launch with a URL, IE will always touch base with the host and check the version, updating if necessary, regardless of whether or not the app is flagged as "Don't check version". However, if you launch from the Start Menu, ClickOnce disables command-line arguments.

Has anyone found any way around this, or know of a MS plan to fix it?

A: 

Have you considered registering the application to a custom URL protocol? This would presumably provide the properties you consider desirable: namely the ability to launch the application with arbitrary startup parameters from inside a web browser.

Mike
+1  A: 

There's nothing for Microsoft to "fix". This is the intended behavior of an online ClickOnce deployment. It checks to make sure it's online and checks to make sure it's running the most recent version, and then it runs. If you don't want it to do that, then you need to set it to run online and offline.

I think if you set it to offline and still invoke it through the http url, it's still going to check for updates, but I wouldn't swear to it. If it's an online/offline app, you can call it via the shortcut on the start menu instead.

If you are targeting .NET 3.5 SP-1 or .NET 4.0, you can pass arguments to the application if it is online/offline. To find out how to do that, check out this article.

RobinDotNet