简体   繁体   English

NSIS ZipDLL插件无法正常工作

[英]NSIS ZipDLL plugin not working

I'm trying to do a simple installer, I want to copy a zip file to my install directory, and unzip it's contents there, but right now it only copies my zip, and doesn't unzip it. 我正在尝试做一个简单的安装程序,我想将一个zip文件复制到我的安装目录中,然后在其中解压缩它的内容,但是现在它仅复制我的zip,而没有将其解压缩。

Here is my code 这是我的代码

;--------------------------------
;Include Modern UI
        !include "MUI2.nsh"
;--------------------------------
;General
    Name "App"  ; Name of the app to install
    OutFile "setup.exe" ; Name of the app installer
    InstallDir "c:\app\"    ; App install directory (default C:)
    InstallDirRegKey HKCU "Software\App" "" ; Get installation folder from registry if available
    RequestExecutionLevel user ;Request application privileges for Windows Vista
    Caption "App"
;--------------------------------
;Interface Settings
  !define MUI_ABORTWARNING
;--------------------------------
;Language Selection Dialog Settings
    ;Remember the installer language
    !define MUI_LANGDLL_REGISTRY_ROOT "HKCU" 
    !define MUI_LANGDLL_REGISTRY_KEY "Software\App" 
    !define MUI_LANGDLL_REGISTRY_VALUENAME "Language"
;--------------------------------
;Pages
  !insertmacro MUI_PAGE_WELCOME
  !insertmacro MUI_PAGE_LICENSE "License.txt"
  !insertmacro MUI_PAGE_COMPONENTS
  !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
;--------------------------------
;Languages
  !insertmacro MUI_LANGUAGE "English"   ; Default English
    !insertmacro MUI_LANGUAGE "Spanish" ; Spanish
;--------------------------------
; ZIP Handling
    !include "ZipDLL.nsh"
;--------------------------------
;Installer Sections
Section "XAMPP" App
  SetOutPath "$INSTDIR"
    File App.zip
  WriteRegStr HKCU "Software\App" "" $INSTDIR   ; Store installation folder
  ; WriteUninstaller "$INSTDIR\Uninstall.exe"               ; Create uninstaller
    ; !insertmacro ZIPDLL_EXTRACT "$INSTDIR\App.zip" "$INSTDIR" "<ALL>"
    !insertmacro ZIPDLL_EXTRACT "C:\App\App.zip" "c:\App\" "<ALL>"
SectionEnd
;--------------------------------
;Descriptions
  ;Language strings
  LangString DESC_App ${LANG_ENGLISH} "The server modules necesary to install app."
    LangString DESC_App ${LANG_SPANISH} "Los modulos del servidor necesarios para instalar app"

  ;Assign language strings to sections
  !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
    !insertmacro MUI_DESCRIPTION_TEXT ${App} $(DESC_App)
  !insertmacro MUI_FUNCTION_DESCRIPTION_END
;--------------------------------
;Uninstaller Sections
;Section "Uninstall"
;  ;ADD YOUR OWN FILES HERE...
;  Delete "$INSTDIR\Uninstall.exe"
;  RMDir "$INSTDIR"
;  DeleteRegKey /ifempty HKCU "Software\App"
;SectionEnd
;--------------------------------
;Installer Functions
    Function .onInit
        !insertmacro MUI_LANGDLL_DISPLAY
    FunctionEnd
;--------------------------------
;Uninstaller Functions
;   Function un.onInit
;       !insertmacro MUI_UNGETLANGUAGE
;   FunctionEnd
;--------------------------------

Any suggestions? 有什么建议么?

it doesn't work either when setting RequestExecutionLevel to admin? 将RequestExecutionLevel设置为admin也不起作用? assuming you're installing to program files, you will have to do that (though it wouldn't extract the zip to that folder either). 假设要安装到程序文件中,则必须这样做(尽管它也不会将zip解压缩到该文件夹​​中)。 did you make sure the file is in place? 您确定文件到位了吗?

I was using the portable version of NSIS to compile my installer. 我正在使用NSIS的便携式版本来编译我的安装程序。 Then I installed the full version on my PC, and the same script now works flawlessly. 然后,我在PC上安装了完整版本,并且相同的脚本现在可以完美运行了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM