Archive: Including and running other installers in NSIS


Including and running other installers in NSIS
Hey guys,

I'm fairly new at NSIS and want to use it to create an installer for some software. I was wondering how it would be possible to add another installer inside of mine so when the user starts my installer, they will be prompted to install another piece of software first.

My example: I want to automate an install of some PHP software and wish to automate the install of Apache,PHP, and MySQL for the user as well.

How can I add these installers inside mine and call them?
Thanks for your help.

Will


One way this can be done is using the .oninit function. I can't explain it so I will write the code out here. See attachment. I suggest saving the attachment before opening it.


Seems to work great. However, I could not get the other installer to start up at first because I had to remove $INSTDIR from ExecWait

It didn't work like this:

File "C:\path\to\apachesetup.exe"
ExecWait "$INSTDIR\apachesetup.exe"
MessageBox MB_YESNO|MB_ICONQUESTION "Do you want to install PHP?" IDNO +3 ;comment this line out to automate

But did like this:

File "C:\path\to\apachesetup.exe"
ExecWait "apachesetup.exe" ; notice $INSTDIR is gone
MessageBox MB_YESNO|MB_ICONQUESTION "Do you want to install PHP?" IDNO +3 ;comment this line out to automate

I hope that's okay.
Thanks for your help.


You could try changing $INSTDIR to $TEMP so that it installs into the temp directory and it runs from there.

You could try this example:

file /oname=$TEMP\name_of_apache_setup.exe "C:\path\to\apachesetup.exe"
ExecWait "$TEMP\name_of_apache_setup.exe"
Delete "$TEMP\name_of_apache_setup.exe" ;this makes sure you don't waste space on the users computer.

This makes sure the files are extracted to a temporary dir, runs the file and is deleted to recover space.