Stop InstallShield installation when Inno Setup is detected - inno-setup

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.

A stock InstallShield template automatically authors a prevent downgrade rule into the MSI. Assuming your InnoSetup project was created using the same UpgradeCode as the InstallShield project this should work automatically.
If you gave your new InnoSetup project a new UpgradeCode GUID and authored a remove legacy product type rule using the old GUI in the Upgrade table there really isn't much InstallShield could possibly do. That's the nature of installers... once it's shipped it's shipped.

I do not think this can be done. The Inno Setup does not use the Windows Installer, so the InstallShield won't even know that your product is already installed. And Inno Setup uninstaller cannot know that the InstallShield installer is starting.
The best what you can do is to have your Inno Setup installer remove the InstallShield installation and install itself to another folder. So when you re-install the InstallShield installation, it at least won't conflict/break the Inno Setup installation. And user will be able to correctly uninstall the new Inno Setup installation, if needed.

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.

Related

Silent installation msi

0x80070652 - when installing VS 2012 C++ redistributables.
Hi All,
I have a weird issue for the last few days now, i've been looking for a solution in the forums, google etc.
So far, couldn't find a similar problem:
Scenario:
I have an "Basic MSI" project that deploy our company product.
everything worked OK till i needed to add installation of VS 2012 C++ redistributables.
i'm using the installscript to initiate a command line for installing it quietly - 'vcredist_x64.exe /q'.
if the custom action is being added to the execute sequance, the following error is coming from the "VS 2012 C++ redistributables. -
ERROR 0X80070652: ERROR_INSTALL_ALREADY_RUNNING.This error is due to Another installation is already in progress. Complete that installation before proceeding with this install.
if running it manually, regardless to the IS installation, everything is working perfectly.
Also, when the custom action is on the UI sequance - works great. - i cannot leave it on the UI sequance, since our product is being deployed quietly along with our product client.
I've been trying to change into a different project type - "installscript MSI"... Same error.
Please advise, thanks for any inputs.
Short Answer: You can't run this executable from inside your MSI for technical reasons, you should run them in sequence instead. First the executable, then your MSI (batch file or manually). Or you should make an executable that runs them in sequence (WiX Bundle for example).
VCRedist: The VS 2012 C++ redistributable vcredist_x64.exe is a WiX Bundle with a couple of MSI files inside. You are not allowed to run embedded / nested MSI files concurrently with the main MSI installation. Simple explanation here. Inline explanation: This is because MSI files install as a transaction that is supposed to be possible to roll back. Hence the file installation sequence locks the system to prevent other MSI files installing when one is already in progress.
Extract: You can extract a WiX bundle using the WiX toolkit's dark.exe: dark.exe /x D:\VCRedist vcredist_x64.exe. WiX toolkit must be installed and dark.exe must be in the path or you must specify its full path.
Setup.exe: The solution is to run the MSI files in sequence inside a setup.exe bundle created with WiX, Installshield (see link for sample screenshot - more on suite projects here), Advanced Installer or a similar setup creation tool. Another approach is to simply deliver the runtime next to your installer and install them in sequence with a batch file or even by instructing the user to do so.
Merge Modules: Most VCRedist versions have merge modules that you can use to install the runtime (as opposed to setup executables). WiX sample. These are merged into your own MSI at build time and hence feature no nested MSI processes. There are some issues with merge modules and recent VCRedist versions.
Links:
The latest supported Visual C++ downloads
Detect VC runtime presence
Similar answer

How can i get Setup.rul file of an old InstallShield Installer from its exe file?

I have an old InstallShield installer which i believe was made using InstallShield 2012. I don't have the install script code for the same. I only have exe of the installer with me.
I need to create a new installer containing some of the same features from old installer, so is there any way by which i can get the setup.rul file of the installer from its exe?
I did some googling but got no help.
Setup.exe Extraction: If you run an extraction of your setup.exe, do you get an *.ins file?
Programmatically extract contents of InstallShield setup.exe
Extract MSI from EXE
Decompiler: I believe there are some hacky solutions to decompile *.ins to *.rul. I do not have such a tool, nor have I ever tried one and I can't recall seeing any trace of them for a whole decade. Perhaps Installshield support can help?
Alternatives: Off the top of my head: Contact Installshield support, they might have better advice? Check with Installshield community? Check with Stefan Kruger - Installshield consultant? Check any source repositories you can find based on setup.exe timestamp? (search for *.rul, *.ism, or similar as relevant). Check backups? Check backups of setup developer PC? Check github.com even? (for samples of similar tasks). Check external media, email attachments, network shares, etc...

Installshield: Upgrade Windows Installer do not update anything?

I have created an MSI installscript project in Installshield. I went to Project Assistant>Application Files, then added the application files(package) and built Setup.exe to install.
After installed these files, I went back to Project Assistant and added some application files, then i changed the product version for updating. Finally, i built the Setup.exe again. When i run the Setup.exe, the automatic update (Upgrade Window Installer Setup) asked me to update a new version. After finishing, I checked Program Files(x86) and the updating didn't do anything, the old package was still here.
How can i update my new package? Is there any way to disable the Upgrade Window Installer Setup?
Thanks for the help.
In my humble opinion, most likely, you added new files to existing Component with keypath, which didn't change. Also you should check "Add\Remove Programs" snap-in in Control Panel to see if upgrade was applied - there should change version of your product.
So, I recommend you check Components, and re-allocate files to new Components if I had right. Also please read more about Components and Files. Could start from here.
Two words about InstallScript MSI project. From InstallShield documentation: Because this project type uses two different engines, it is more complex than pure InstallScript or Basic MSI installation projects. It is recommended only for advanced users.
So, if possible, use Basic MSI project - it's a bit simpler than InstallScript MSI for begginers.

Registry in inno setup

I am new to creating installers. Before used the Microsoft visual studio deployment package. Now trying inno setup, pretty awesome.
I saw that Visual studio one wrote some registries when installed.
Do I have to create Registries for my package too? I have a visual c# application and need to create a installer for my company. Main intention is to create a installer that will easily update the old one, but this is a first version of software we are going to release to customers. Much appreciated. I saw tutorials of Registry in internet, but the point of creating is the one that I don't understand.
I'm not sure what you are asking exactly. If you mean how do I write to the Windows Registry, you create a [Registry] section in your inno-setup file and add what you need. Here is a link to the documentation.
You don't HAVE to write any registry entries unless your app requires them.
Inno automatically creates the usual entries to allow uninstall from the Add/Remove programs applet.
Inno will also automatically handle upgrades with no special effort.
If you have previously distributed the app using an MSI package, then you will either need to allow side by side installs (different folders, etc) or uninstall the previous version first. The article above has a sample of how to get the uninstall path.

Use Inno Setup to delete another application not installed with Inno Setup during installation

I have an old VB6 application that is deployed using a very old 16 bit version of InstallShield. I have created a new installer with Inno Setup to be 64 bit friendly for my VB6 application with updates.
All of my users already have the existing InstallShield version installed. Currently, I have Inno Setup working. The problem is, I do not want to overwrite the old InstallShield installation files, so my Inno Setup installs to another directory. This causes problems because now I have two versions installed, with two separate icons.
I need a way to invoke the uninstaller of the old InstallShield application when I install the new Inno Setup version. How do I call the uninstaller from the Windows Add/remove programs through Inno Setup? If i reuse the app id for the InstallShield version to be the same as the Inno Setup, and then manually delete the old files, would that work?
You would have to locate the InstallShield uninstall registry key which will reside under either HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\ or HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\ and then execute its UninstallString value. Once that is done, delete the registry key: it is not possible to reuse the same key with Inno Setup since it will always append _is1 to your AppId to generate the uninstall registry key name. Additionally on older Windows versions it may also truncate this key name and append a checksum, because of length limitations.
Do all this from a PrepareToInstall event function.

Resources