0

During uninstallation of the Visual Studio Integration Package that I am writing, I need to run "devenv.exe /setup" to update the VS UI and remove the package info from the splash/help screen.

However, it must run after all the add-in and package files have been deleted. My current setup (using an Installer class custom action called during the Uninstall step) causes devenv.exe to run too early, before the files have actually been deleted. This means the splash screen info does not update.

Any ideas? I just need devenv to run at the end of install, somehow - I am not bound to custom actions.

muusbolla
  • 637
  • 7
  • 20

2 Answers2

0

You could write your custom action as Commit execution. This means that it will only run after a successful uninstallation. Condition it as REMOVE="ALL" to make sure it's only run on uninstall.

William Leara
  • 10,595
  • 4
  • 36
  • 58
  • this doesn't seem to work. I am already using my Installer class during Commit (install) and when it runs on rollback, it is run before the files are deleted. – muusbolla Jun 09 '09 at 15:09
  • What do you mean "rollback"? Rollback only happens when there is an error during an install and MSI has to undo all the changes it's made to the system. This is not the same as uninstall -- are you talking about rollback or uninstall? – William Leara Jun 09 '09 at 16:55
0

The trick, it turns out, was to use the new Deployment Tools Foundation from MS to wrap my managed functions into an unmanaged DLL, eschewing the Installer class completely. I then use Orca (MSI editor) to add the custom action at a specific time in the install.

The Installer class only supports "deferred" custom actions, which must be run at a specific time.

muusbolla
  • 637
  • 7
  • 20
  • Yes, you should add the custom action deferred and probably right before InstallFinalize - which ends the installation transaction that was started at InstallInitialize. System changes should only be done in this transaction to allow for proper system rollback if an error occurs. Make sure your custom action actually reports an accurate return code to indicate success or error. This will make the setup rollback if it has to, or complete if everything is OK. Don't add custom actions that make changes to the system after InstallFinalize, you could cause the uninstall of the MSI to fail. – Stein Åsmul Aug 30 '12 at 15:58