3

我是 NSIS 脚本的新手。我想创建一个自定义安装程序,它将包裹另一个安装程序(FEKO)。这种嵌入NSIS 网站上建议的其他安装程序的方法对我不起作用

脚本编译正确,但未安装嵌入式应用程序。这是脚本

!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
4

1 回答 1

4
  1. 如果子安装程序需要管理员权限,则需要放入RequestExecutionLevel admin脚本。如果 exe 具有请求提升的清单,则 ExecWait (CreateProcess) 将失败。
  2. ExecWait 的正确引用是:ExecWait '"c:\full\path\to\app.exe" /param1 "par am 2" /param3'
于 2013-10-01T02:30:34.890 回答