使用 NSIS 嵌入其他安装程序 [英] Embedding other installers using NSIS

查看:77
本文介绍了使用 NSIS 嵌入其他安装程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 NSIS 脚本的新手.我想创建一个自定义安装程序,它将环绕另一个安装程序(FEKO).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 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

推荐答案

  1. 如果子安装程序需要管理员权限,您需要将 RequestExecutionLevel admin 放入您的脚本中.如果 exe 具有请求提升的清单,则 ExecWait (CreateProcess) 将失败.
  2. ExecWait 的正确引用是:ExecWait '"c:\full\path\to\app.exe"/param1 "par am 2"/param3'
  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'

这篇关于使用 NSIS 嵌入其他安装程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆