如何将文件(.exe .txt 等)嵌入到 NSIS 安装程序中以创建一个大型 .EXE 安装程序包?
How do you embed files (.exe .txt etc) into an NSIS installer to create one large .EXE installer package?
我有一些文件需要我的 NSIS 安装程序提取和安装。
这些是 .exe 文件(我的主要应用程序)、.txt 自述文件、许可证文件、.ICO 图形文件。
我想将这些嵌入到已编译的 NSIS 安装程序中,为用户提供一个大的安装文件。
将文件嵌入安装程序的命令和告诉 NSIS 提取嵌入文件的命令是什么?
我查看了一些文档,但我能找到的只是提到压缩它们,- 我认为 NSIS 里面有一个 7unzipper (?)
我想将嵌入的文件全部提取到我的 $INSTDIR
这是我的页面在 NSIS 中的顺序
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE "${NSISDIR}\Docs\Modern UI\License.txt"
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_WELCOME
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_UNPAGE_FINISH
Example1.nsi 向您展示如何使用 File
指令。
一个非常简单的安装程序如下所示:
Name "Test"
OutFile "TestInstaller.exe"
InstallDir "$Desktop\Test" ; Default install directory
Page Directory ; Let the user choose the $InstDir
Page InstFiles ; Sections are executed on this page
Section
SetOutPath $InstDir ; Create and set output path
File "c:\myinstallerfiles\MyFile.txt" ; Extract MyFile.txt to $InstDir
SectionEnd
File
指令将文件从您的本地计算机压缩到安装程序中,当用户运行安装程序时,文件将被提取到 SetOutPath
设置的目录中。
我有一些文件需要我的 NSIS 安装程序提取和安装。 这些是 .exe 文件(我的主要应用程序)、.txt 自述文件、许可证文件、.ICO 图形文件。
我想将这些嵌入到已编译的 NSIS 安装程序中,为用户提供一个大的安装文件。 将文件嵌入安装程序的命令和告诉 NSIS 提取嵌入文件的命令是什么? 我查看了一些文档,但我能找到的只是提到压缩它们,- 我认为 NSIS 里面有一个 7unzipper (?)
我想将嵌入的文件全部提取到我的 $INSTDIR
这是我的页面在 NSIS 中的顺序
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE "${NSISDIR}\Docs\Modern UI\License.txt"
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_WELCOME
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_UNPAGE_FINISH
Example1.nsi 向您展示如何使用 File
指令。
一个非常简单的安装程序如下所示:
Name "Test"
OutFile "TestInstaller.exe"
InstallDir "$Desktop\Test" ; Default install directory
Page Directory ; Let the user choose the $InstDir
Page InstFiles ; Sections are executed on this page
Section
SetOutPath $InstDir ; Create and set output path
File "c:\myinstallerfiles\MyFile.txt" ; Extract MyFile.txt to $InstDir
SectionEnd
File
指令将文件从您的本地计算机压缩到安装程序中,当用户运行安装程序时,文件将被提取到 SetOutPath
设置的目录中。