Windows Develop Bookmark and Share   
 index > ClickOnce and Setup & Deployment Projects > Setup Project - DISABLEADVTSHORTCUTS and Uninstalling option
 

Setup Project - DISABLEADVTSHORTCUTS and Uninstalling option

Hi,

I have created a Setup project which has an uninstall option. This setup project is configured to place a Desktop shortcut as well as shortcuts in the User's Program Menu. The uninstall option is also provided using the the msiexec.exe file. So when the application is installed, it creates a shortcut for the msiexec.exe present in the %windows%\system32 folder. Thei s shortcut is placed in the User's Program Menu as well. Clicking on this, uninstalls the application.

Now I had to disable the advertised shortcut. So I use the SQL statement to insert the DISABLEADVTSHORTCUTS property in the property table in the PostBuildEvent of the Setup project.

Now when I install the application, and click on the Uninstall option, it uninstalls the application fine, but leaves the program folder in the User's Program Menu with the Uninstall shortcut. This happens when I try to uninstall using the Add/Remove Programs as well.

I removed the PostBuildEvent and tried again, the uninstall works prefectly. I am unable to understand what is it that the PostBuildEvent got to do with the uninstallation and why does it leave the program folder behind while uninstalling the rest of the application.

Kindly help.

Thank You,
-Bhaskar
bhaskar82in  Tuesday, September 15, 2009 1:56 PM
It doesn't seem to me that this is related to your PostBuild event because there is no mechanism that connects these.

The big question is about exactly how you are doing this.Visual Studio setups don't provide support for creating shortcuts to existing installed programs like msiexec.exe,so that means you must be doing something else. What exactly are you doing?Do you have a shortcut to a program that you installed and that program is calling msiexec.exe? Or have you written code in a custom action that creates a shortcut to msiexec.exe?
Phil Wilson
PhilWilson  Tuesday, September 15, 2009 8:19 PM
Hi,

I am doing the following:

1) In the Setup Project �gt; File System windows �gt; Right Click “File System on Target machine��gt; add a Special Folder, select System Folder;

2) Into this system folder Add a file. Browse for msiexec.exe from local System32 folder and add it. Override default properties of this file as follows:

Condition:=Not Installed (make sure you put ‘Not Installed�exactly like that, same case and everything), Permanent:=True, System:=True, Transitive:=True, Vital:=False.

3) Create a new shortcut under the ‘Users Program Menu� Set Target to the System Folder which you created in the step 1. and point it’s at the msiexec.exe. Rename the shortcut to ‘Uninstall Your Application� Set the Arguments property to /x{space}[ProductCode].

This gives me the uninstall shortcut which basically executes the msiexec.exe in the local system32 folder. This way the unistallation can be done.

But when I uninstall using this option or even Add/Remove Programs (when the PostBuildEvent is mentioned), the program folder from the User's Program Menu is stays behind with the Uninstall shortcut in it.

Hope this answers your question.

Thank You,

-Bhaskar

bhaskar82in  Wednesday, September 16, 2009 4:14 AM

You can use google to search for other answers

Custom Search

More Threads

• Uninstall shortcut
• ClickOnce and Circle References
• installutil.exe fails w/ release compile; successful w/ debug compile
• .NET 3.5 Installation problem
• Shortcuts: Program menu has no target (desktop does!)
• Winforms app usage is tracked, but it doesn't show in Start Menu list
• Warning while adding the primary output to the setup project
• Latest Office updates and previous Office updates won't install on my PC.
• ClickOnce Signing Problem
• CLickonce without the publish.htm