Windows Develop Bookmark and Share   
 index > ClickOnce and Setup & Deployment Projects > Identifying a ClickOnce deployment without separate setup at runtime
 

Identifying a ClickOnce deployment without separate setup at runtime

If I decide to just use ClickOnce deployment without creating a separate setup project, the application will simply run as part of the install. Is there a way to identify whether the application is running as part of the installation vs. running after having been installed?

Obviously I could set a flag once it has run which would identify the very first installation, but that won't work for subsequentreinstallationsunless the application is actuallyuninstalled first.

I'm using the Express Edition if it matters in any way.

sriesch  Friday, February 15, 2008 6:27 PM

Did you intend to determine whether the application is installed by ClickOnce or a setup project? What's the purpose of doing that?

Chunsheng Tang  Tuesday, February 19, 2008 3:39 AM
Chunsheng Tang - MSFT wrote:

Did you intend to determine whether the application is installed by ClickOnce or a setup project?

No. I wanted to determine whether the application is currently being installed by ClickOnce or is being run later after installation has already happened.

sriesch  Tuesday, February 19, 2008 3:43 AM
I am not sure whether I have understood the question completely. So your application is run when it is installed by ClickOnce, right? When it is run by ClickOnce, it is also the first time the application is run. So you can set a setting with an initial value and then change it when the application is run for the first time, so that you can determine between the two cases.

Chunsheng Tang  Thursday, February 21, 2008 6:20 AM

Chunsheng Tang - MSFT wrote:
So your application is run when it is installed by ClickOnce, right?

Yes.

Chunsheng Tang - MSFT wrote:
When it is run by ClickOnce, it is also the first time the application is run.

No, it could be the second time, or the third time, or the 87th time.

Chunsheng Tang - MSFT wrote:
So you can set a setting with an initial value and then change it when the application is run for the first time, so that you can determine between the two cases.

Unfortunately that won't work more than once unless the user happens to uninstall the application before reinstalling it. The second time I install the application, the settings are retained from the first installation and as far as I know, this installation cannot be distinguished from just running the program normally instead of installing it.
sriesch  Thursday, February 21, 2008 1:31 PM

You can use google to search for other answers

Custom Search

More Threads

• .Net project Publishing Problem
• Administrator cannot uninstall
• installutil.exe fails w/ release compile; successful w/ debug compile
• CLickOnce in AUG CTP doesn't display publisher info???
• "ClickNever" self - upgrade - is it possible with CLickOnce?
• Packaging My Program
• click once installation
• License Agreement is empty while running setup
• error message
• Wix installer is not clearing out shortcuts on uninstall after an upgrade.