I am creating an installer through Inno Setup. I see a lot of code examples on how to detect a prerequisite's existence, but nothing on how to actually go about installing the prerequisite when I don't find it. I'm sure it's blindingly simple, but how do I go about installing a prerequisite? In particular, I'm looking to install mongodb as a service as a prerequisite to my application.
Have a look at the CodePrepareToInstall.iss example script (included with Inno) for the framework. Once you've detected that you need to do the install, at the appropriate point (shown in the script) you just ExtractTemporaryFile the installer for the prerequisite and then Exec it, checking for any errors and reboot-required-before-main-app-install conditions as needed.
For a more in-depth example for several common prerequisites (including download support), see this page.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With