I am creating an installer through innosetup
. 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.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
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.