views:

952

answers:

2

I have an InstallShield 12 installscript. I want to uninstall the old version before installing the new version. I will keep the name of the package unchanged. How can I do this?

+1  A: 

With an MSI-based project, this would be accomplished by configuring a Major Upgrade for your project. Upgrades don't exist for InstallScript projects, but there are no Windows Installer restrictions to keep you from running multiple installations simultaneously. You should be able to simply run the uninstallation of the previous version manually in your InstallScript code (maybe in the OnFirstUIBefore function).

CodeSavvyGeek
Actually, there are restrictions on running multiple installations simultaneously nowadays. (You can't launch one installer from another, for instance.) That's why you need to make a bootstrap application if you want your installer to install all of the prerequisites that your .MSI needs. I don't know, exactly, which version of Windows installer implemented those restrictions (2.0?), but it's documented somewhere.
RobH
I thought the original question was about InstallScipt installations, not MSI installations. InstallScript-only installation don't have the restrictions of Windows Installer since they don't use an MSI, so you can run multiple of them simultaneously. This is why an InstallScript installation can be used as a "bootstrapper" for other installations (including MSI installations).
CodeSavvyGeek
A: 

Assuming this is not an MSI project and youve kept the same Project GUID, you could simply call ComponentUninstall() in the OnMaintUIBefore function. If the Project GUID is not the same you can look at the uninstall string in the registry under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{PROJECT_GUID} and then do a LaunchApp with that.

Hope it helps.

Alonso

related questions