我使用nsis edit创建了一个软件包安装程序,但在安装软件包时,它只在安装目录中提取了几个文件夹。我在创建程序包时添加到程序包中的所有文件和文件夹都没有在安装目录中进行扩展。打包成功完成,编译也成功,因为在这些过程中没有错误。我添加到包中的文件和文件夹的总大小约为900 MB,我收到的包(.exe)为250 MB。
我在这里观察到一件事是,如果我包含高达150 MB的文件和文件夹,那么它不会给我任何问题。它提取我添加到包中的所有文件和文件夹。所以到目前为止,我的观察结果表明NSIS不支持更大尺寸的包装(我看到它可以正常工作150 MB)。 NSIS免费版有没有这样的限制。我目前正在使用HM NSI Edit 2.0.3和NSIS 3.03。
下面是我的包的.nsi脚本。
; Script generated by the HM NIS Edit Script Wizard.
; HM NIS Edit Wizard helper defines
!define PRODUCT_NAME "setup11"
!define PRODUCT_VERSION "1.0"
!define PRODUCT_PUBLISHER "My company, Inc."
!define PRODUCT_WEB_SITE "http://www.mycompany.com"
!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\jabswitch.exe"
SetCompressor lzma
; MUI 1.67 compatible ------
!include "MUI.nsh"
; MUI Settings
!define MUI_ABORTWARNING
!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install.ico"
; Welcome page
!insertmacro MUI_PAGE_WELCOME
; License page
!define MUI_LICENSEPAGE_CHECKBOX
!insertmacro MUI_PAGE_LICENSE "C:\Users\meenal.jain\Desktop\Package Installer\license.txt"
; Directory page
!insertmacro MUI_PAGE_DIRECTORY
; Instfiles page
!insertmacro MUI_PAGE_INSTFILES
; Finish page
!insertmacro MUI_PAGE_FINISH
; Language files
!insertmacro MUI_LANGUAGE "English"
; Reserve files
!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
; MUI end ------
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
OutFile "Setup11.exe"
InstallDir "$PROGRAMFILES\setup11"
InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
ShowInstDetails show
Section "MainSection" SEC01
SetOutPath "$INSTDIR\FetchLogs\jre7\bin"
SetOverwrite try
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\FetchLogs\jre7\bin\awt.dll"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\FetchLogs\jre7\bin\axbridge.dll"
SetOutPath "$INSTDIR\FetchLogs\jre7\bin\client"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\FetchLogs\jre7\bin\client\jvm.dll"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\FetchLogs\jre7\bin\client\Xusage.txt"
SetOutPath "$INSTDIR\FetchLogs\jre7\bin"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\FetchLogs\jre7\bin\dcpr.dll"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\FetchLogs\jre7\bin\decora-sse.dll"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\FetchLogs\jre7\bin\deploy.dll"
SetOutPath "$INSTDIR\FetchLogs\jre7\bin\dtplugin"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\FetchLogs\jre7\bin\dtplugin\deployJava1.dll"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\FetchLogs\jre7\bin\dtplugin\npdeployJava1.dll"
SetOutPath "$INSTDIR\FetchLogs\jre7\bin"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\FetchLogs\jre7\bin\dt_shmem.dll"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\FetchLogs\jre7\bin\dt_socket.dll"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\FetchLogs\jre7\bin\eula.dll"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\FetchLogs\jre7\bin\fontmanager.dll"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\FetchLogs\jre7\bin\fxplugins.dll"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\FetchLogs\jre7\bin\glass.dll"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\FetchLogs\jre7\bin\glib-lite.dll"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\FetchLogs\jre7\bin\gstreamer-lite.dll"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\FetchLogs\jre7\bin\hprof.dll"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\FetchLogs\jre7\bin\installer.dll"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\FetchLogs\jre7\bin\instrument.dll"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\FetchLogs\jre7\bin\j2pcsc.dll"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\FetchLogs\jre7\bin\j2pkcs11.dll"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\FetchLogs\jre7\bin\jaas_nt.dll"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\FetchLogs\jre7\bin\jabswitch.exe"
CreateDirectory "$SMPROGRAMS\setup11"
CreateShortCut "$SMPROGRAMS\setup11\setup11.lnk" "$INSTDIR\FetchLogs\jre7\bin\jabswitch.exe"
CreateShortCut "$DESKTOP\setup11.lnk" "$INSTDIR\FetchLogs\jre7\bin\jabswitch.exe"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\FetchLogs\jre7\bin\java-rmi.exe"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\FetchLogs\jre7\bin\java.dll"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\FetchLogs\jre7\bin\java.exe"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\FetchLogs\jre7\bin\JavaAccessBridge-32.dll"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\FetchLogs\jre7\bin\JavaAccessBridge.dll"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\FetchLogs\jre7\bin\javacpl.exe"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\FetchLogs\jre7\bin\javafx-font.dll"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\FetchLogs\jre7\bin\javafx-iio.dll"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\FetchLogs\jre7\bin\javaw.exe"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\FetchLogs\jre7\bin\javaws.exe"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\FetchLogs\jre7\bin\java_crw_demo.dll"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\FetchLogs\jre7\bin\jawt.dll"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\FetchLogs\jre7\bin\JAWTAccessBridge-32.dll"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\FetchLogs\jre7\bin\JAWTAccessBridge.dll"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\FetchLogs\jre7\bin\JdbcOdbc.dll"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\FetchLogs\jre7\bin\jdwp.dll"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\FetchLogs\jre7\bin\jfr.dll"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\FetchLogs\jre7\bin\jfxmedia.dll"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\FetchLogs\jre7\bin\jfxwebkit.dll"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\FetchLogs\jre7\bin\jli.dll"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\FetchLogs\jre7\bin\jp2iexp.dll"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\FetchLogs\jre7\bin\jp2launcher.exe"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\FetchLogs\jre7\bin\jp2native.dll"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\FetchLogs\jre7\bin\jp2ssv.dll"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\FetchLogs\jre7\bin\jpeg.dll"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\FetchLogs\jre7\bin\jpicom.dll"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\FetchLogs\jre7\bin\jpiexp.dll"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\FetchLogs\jre7\bin\jpinscp.dll"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\FetchLogs\jre7\bin\jpioji.dll"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\FetchLogs\jre7\bin\jpishare.dll"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\FetchLogs\jre7\bin\jqs.exe"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\FetchLogs\jre7\bin\jsdt.dll"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\FetchLogs\jre7\bin\jsound.dll"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\FetchLogs\jre7\bin\jsoundds.dll"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\FetchLogs\jre7\bin\kcms.dll"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\FetchLogs\jre7\bin\keytool.exe"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\FetchLogs\jre7\bin\kinit.exe"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\FetchLogs\jre7\bin\klist.exe"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\FetchLogs\jre7\bin\ktab.exe"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\FetchLogs\jre7\bin\libxml2.dll"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\FetchLogs\jre7\bin\libxslt.dll"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\FetchLogs\jre7\bin\management.dll"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\FetchLogs\jre7\bin\mlib_image.dll"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\FetchLogs\jre7\bin\msvcr100.dll"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\FetchLogs\jre7\bin\net.dll"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\FetchLogs\jre7\bin\nio.dll"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\FetchLogs\jre7\bin\npjpi170_80.dll"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\FetchLogs\jre7\bin\npoji610.dll"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\FetchLogs\jre7\bin\npt.dll"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\FetchLogs\jre7\bin\orbd.exe"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\FetchLogs\jre7\bin\pack200.exe"
SetOutPath "$INSTDIR\FetchLogs\lib"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\FetchLogs\lib\jsoup-1.9.2.jar"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\FetchLogs\lib\mysql-connector-java-5.1.38-bin.jar"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\FetchLogs\lib\ojdbc6.jar"
SetOutPath "$INSTDIR\FetchLogs"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\FetchLogs\LogsUtility.jar"
SetOutPath "$INSTDIR\lib"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\lib\AutomationFramework.jar"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\lib\ini4j-0.5.4.jar"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\lib\javafx-dialogs-0.0.4.jar"
SetOutPath "$INSTDIR"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\RFTjar.jar"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\SAPDriver.vbs"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\TestAutomationWizard.jar"
File "C:\Users\meenal.jain\Downloads\Workspace\ITAF\Scripts\WebserviceTPA.vbs"
SectionEnd
Section -AdditionalIcons
WriteIniStr "$INSTDIR\${PRODUCT_NAME}.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}"
CreateShortCut "$SMPROGRAMS\setup11\Website.lnk" "$INSTDIR\${PRODUCT_NAME}.url"
SectionEnd
Section -Post
WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\FetchLogs\jre7\bin\jabswitch.exe"
SectionEnd
RequestExecutionLevel user
编译此.nsi文件时没有任何错误,但仍未提取所有文件和文件夹。
答案 0 :(得分:0)
NSIS(所有v2和v3版本)仅限于2 GiB压缩数据。只要最终的压缩结果适合2 GiB,您的源文件就可以大于此文件。
没有任何示例代码,很难说明正在发生什么。
尝试简单的方法:
InstallDir "$Temp\InstallTest"
Section
SetOutPath $InstDir
File /r "c:\myFiles" ; Replace the path with the location of your real files
File /r "x:\stuff\myOtherFiles"
SectionEnd
如果您确实需要NSIS的第三方版本,它可以支持4个GiB安装程序。