Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Embedding other installers using NSIS

Tags:

nsis

I an new to NSIS scripting. I want to create a custom installer which would wrap around another installer(FEKO). This method Embedding other installers suggested on the NSIS website did not work for me

The script compiles correctly but the embedded application is not installed. Here is the script

!include "MUI2.nsh"
!include "logiclib.nsh"

!insertmacro MUI_PAGE_WELCOME 
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_LANGUAGE "English"


#Name of the application we are trying to install
Name "FEKO"

# update this section to add 'contact' info
BrandingText "Please contact support at [email protected] for any issues.   "


# define the name of installer
OutFile "Custom_FEKO_6.2_Installer.exe"

# define default installation directory
InstallDir "C:\FEKO\6.2\"

DirText "Choose a directory where you want to install FEKO"


# start default section
Section "FEKO Installation"

    # set the installation directory as the destination for the following actions
    SetOutPath $INSTDIR

    DetailPrint "Extracting FEKO Files into Installation Directory" 

    # specify files to go into the installation directory path
    File /r "C:\Feko_Installer\*"

    # set the current working directory
    SetOutPath "$INSTDIR"      
SectionEnd


Section "FEKO installation" FEKO
    DetailPrint "Installing Feko"

    # run the FEKO installer and wait for it to finish

    File "C:\Feko_Installer\feko_distrib_6.2_win64.exe"
    ExecWait "$INSTDIR\feko_distrib_6.2_win64.exe"

    DetailPrint "Finishing up Installation"
SectionEnd
like image 253
msd_2 Avatar asked Oct 12 '25 03:10

msd_2


1 Answers

  1. If the child installer needs admin privileges you need to put RequestExecutionLevel admin in your script. ExecWait (CreateProcess) fails if the exe has a manifest requesting elevation.
  2. Correct quoting for ExecWait is: ExecWait '"c:\full\path\to\app.exe" /param1 "par am 2" /param3'
like image 145
Anders Avatar answered Oct 16 '25 07:10

Anders