2

I have made setup project with Visual Studio Installer. Project creates uninstall shortcut into User's programs menu. Setup works fine and uninstall shortcut uninstalls application.

Shortcut points to msiexec.exe with arguments /x [ProductCode].

So everything worked fine until I made application upgrading project. Upgrading project was made by the rules: different productcode, same upgradecode, higher version.

Upgrading application is succesfull. Problem is, that the uninstall shortcut does not work anymore. Clicking shortcut only gives error: "Component not used on this computer"

These reasons are excluded:

  1. New uninstall shorcut is created and old removed during uppgrading setup.
  2. Msiexec is not removed during uppgrading setup
  3. Upgrading project uses different productcode, same upgradecode, higher version.

Any help ?

UPDATE

Started from the beginning and created both projects again from the "clear desk". Problem still exists.

JasonMArcher
  • 14,195
  • 22
  • 56
  • 52

2 Answers2

2

Maybe the uninstall shortcut targets the earlier version of the package. Does the ProductCode used in the shortcut maches the ProductCode in the upgrade MSI?

Ciprian
  • 3,533
  • 1
  • 18
  • 22
  • Is seems the uninstall shortcut doesn't get properly updated. Create an install log for more details: http://stackoverflow.com/questions/7126077/create-an-msi-log-file – Ciprian Jan 17 '12 at 10:01
  • Problem with the log file. I placed this (/x [ProductCode] /l*v logpath) into Shortcut properties Arguments. But when this error appears log file is not created at all. – user1151735 Jan 17 '12 at 12:26
  • What I meant was to create a log when you install the upgrade MSI to see if the uninstall shortcut is updated properly. Sorry if I was vague – Ciprian Jan 17 '12 at 12:39
  • My mistake. Problem is gone, bad news is I don't what caused it and what I did to repair it. I created another testsetups from clear desk, and those worked ok. Then I compared those with earlier setups. Only difference was in SetupProjects System Folder. (Setup installs msiexec if it is not installed.) In msiexec properties permanent was set as False. So I changed that value in original (to False) And problem disappeard, then I changed it back to True and problem did not return. But this makes no sense. Msiexec is installed only if its "Not installed" and it should be set as permanent. – user1151735 Jan 17 '12 at 13:17
  • I don't understand why are you installing msiexec. This executable already exists on the system because it part of Windows Installer. No need to install it yourself. – Ciprian Jan 17 '12 at 15:12
  • I followed instructions from here (second answer). Msiexec is installed only if it is not already installed. http://stackoverflow.com/questions/1356160/in-a-visual-studio-setup-project-how-do-i-generate-an-uninstall-script – user1151735 Jan 17 '12 at 16:30
  • Im my opinion that is a VERY WRONG approach because you risk overwriting the msiexec from the target machine with the one from your computer. I would rather use this approach: http://endofstream.com/creating-uninstaller-in-a-visual-studio-project/ – Ciprian Jan 17 '12 at 19:59
  • Yes, it is heavy approach. But, there is this Condition "Not Installed". Doesn't it surely quarantee, that msiexec is not overwrited? – user1151735 Jan 18 '12 at 06:36
  • "Not Installed" translates to "install the whole package is not installed" – Ciprian Jan 18 '12 at 06:41
  • But those instructions says: The ‘Not Installed’ condition and Permananet:=True ensure that the msiexec.exe is only placed into the system folder as part of the install IF it doesn’t aready exist, and it is not removed on an uninstall – user1151735 Jan 18 '12 at 07:16
0

This seems to be an error that appears because the system is corrupted, which could when the machine is used intensive for testing/development. Have you tried testing the upgrade on a clean VM?

Bogdan Mitrache
  • 10,536
  • 19
  • 34
  • No, I have only tested in development environment. But, uninstalling via add/remove programs and via Setup project is successfull. Could that mean, that system corrupting is not the reason ? – user1151735 Jan 16 '12 at 13:08