Search code examples
inno-setupinstallshield

Stop InstallShield installation when Inno Setup is detected


I am trying to migrate from InstallShield to Inno Setup. I have all setup but I got stuck on a single case when the user might downgrade from Inno Setup back to the InstallShield. I need InstallShield to fail the installation or at least warn the user to uninstall Inno Setup version first manually (otherwise I get two versions installed and things get messed up).

I CAN´T of course change the existing InstallShield installers in any way since they have already been released. Solution must come from Inno Setup. Any ideas how this could be done? I understand this might me impossible.


Solution

  • OK I solved it. (kind of)

    There is a simple trick what you can do to trick the InstallShield to think it is already installed even if it is not.

    First you need to locate all the registry entries with your UpgradeCode and ProductCode (it should be 3 entries for the UC and 5 for the PC) normally created by the InstallShield. Also note that both GUIDS are stored in the registry in reversed form (first 8 chars are backwards!!! - rest I am not sure of but it can be googled).

    Now you need to make the InnoSetup recreate this registry entries. When InstallShield starts it looks for existing version in the registry, if it finds one it tries to uninstall it using the copy of the original installer - path to the copy is stored in the registry at

    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products{reversed guid of product code}\InstallProperties]

    "LocalPackage"="C:\Windows\Installer\[random string].msi"

    If InstallShield wont find this file it will fail. You can also create your own MSI file which will call the uninstall.exe file from InnoSetup.