Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run another installer in an Inno Setup installation

My company is developing an application that has a dependency on another of our applications. That second application already has an Inno Setup installer.

So I think I'd like to bundle the second application's installer within the Inno Setup installer for the first application. But I'm not sure how to go about that properly. Does anyone know the "right way" to do this?

I found this: Inno Setup Knowledge Base—HOWTO: Install .MSI files. I assume the technique could be used for a nested Inno Setup installer. But I have a couple of questions about the fine details:

  1. How could I make it so if the first application is uninstalled, the second is also uninstalled?
  2. Is that a sensible thing to do (automatically uninstall the second application), or should I leave it to the user to do that manually?
  3. If the user tries to uninstall the second application while the first is uninstalled, should I somehow detect that and give a warning? How could I do that?
like image 869
Craig McQueen Avatar asked Jun 27 '09 11:06

Craig McQueen


People also ask

Can Inno Setup create MSI?

Create MSI with Inno Setup. The MSI Wrapper was produced to create MSI packages from executable files built with Inno Setup. It puts the setup.exe inside an MSI file and runs it with the specified command line switches when the MSI package is installed.

How do I make an inno file executable?

Go to Menu, Project, then Compile to compile and create the setup file. This will create a complete installer. Run the Setup and your application will be installed correctly. Innosetup offers an awesome alternative to create great looking Installers for free.

Who invented Inno?

Kevin Gundersen - Founder - Inno Supps | LinkedIn.

Is Inno Setup open source?

Inno Setup grew popular due to being free and open source; free for both commercial and non-commercial use, many software companies switched to the tool.


1 Answers

For the level of uninstaller functionality you are talking about, I suggest you get familiar with pascal scripting in Inno Setup (if you are not already). It offers incredible customisation, but has the caveat of making your projects a lot more complex.

To answer your third question first:

Yes, you should do this. In order to do it properly, you need to add this functionality to the uninstaller of the second application (i.e. the one your app is dependent on). See Uninstall event functions in the Inno Setup help. You need to check in that uninstaller if your app is installed (by checking if HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\SecondAppName exists, for example) and in that case show an additional warning.

As for your second question:

If it is remotely possible that your customer wants to continue using the second app, even if he decides that he wants to uninstall the first one, you should offer him the choice. I would do this with a seperate wizard page in the uninstaller for your app, after your app is uninstalled.

And finally, your first question:

You need to determine the name (full path) of the other app's uninstaller exe. You can retrieve it from the registry key HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\SecondAppName\UninstallString. For executing it from a script in the [CODE] section, see Exec in the Inno Setup help.

like image 103
Treb Avatar answered Nov 15 '22 10:11

Treb