I'm using the following NSIS script:
Name "My app wrapper"
Outfile "MyAppSetup.exe"
InstallDir $TEMP\MyApp\Install
Function .onInit
SetSilent silent
FunctionEnd
Section ""
SetOutPath $TEMP\MyApp\Install
File installer.msi
File setup.exe
Exec setup.exe
SectionEnd
The intention is that the installer will wrap up those two files, installer.msi and setup.exe (which is a bootstrapper to install prereqs and then call installer.msi) into the MyApp Setup.exe file. When MyAppSetup.exe is run, it should extract installer.msi and setup.exe to the $Temp\MyApp\Install directory, and it should run setup.exe from that directory.
However, when I run MyAppSetup from the desktop, it executes a setup.exe file that it finds on the desktop, and I don't even see a MyApp\Install directory in C:\Temp.
What do I need to do to get this script to install the files to the right location and to execute the right file?
NSIS installers are generated by using the 'MakeNSIS' program to compile a NSIS script (. NSI) into an installer executable. The NSIS development kit installer sets up your computer so that you can compile a . nsi file by simply right-clicking on it in Explorer and selecting 'compile'.
NSIS Setup You can use the NSIS Menu and under the Compiler section click Compile NSI scripts to start MakeNSISW. The makensisw.exe in the NSIS installation folder is the actual compiler. It has a graphical front end that explains three ways to load scripts, so it's very easy to use.
Text file written using NSIS (Nullsoft Scriptable Install System) script, a language used for declaring the logic and tasks for software installers; often references files and folders to install as well as Windows registry actions.
Section
InitPluginsDir
SetOutPath "$pluginsdir\MyApp\Install" ;It is better to put stuff in $pluginsdir, $temp is shared
File installer.msi
File setup.exe
ExecWait '"$pluginsdir\MyApp\Install\setup.exe"' ;You should always use full paths and proper quotes
SetOutPath $exedir ;Change current dir so $temp and $pluginsdir is not locked by our open handle
SectionEnd
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