4

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 xyz@abc.com 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
msd_2
  • 1,117
  • 3
  • 16
  • 22

1 Answers1

4
  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'
Anders
  • 97,548
  • 12
  • 110
  • 164
  • I did the same but it's not working in my case. I've dependent DLL files with exe file too. how can I include those files while custom installing? – Harsh Makwana Mar 22 '22 at 06:47