NSIS

NSIS 압축 파일 풀기

코딩세상 2023. 3. 23. 08:30

NSIS에 각가 파일을 첨부해서 넣는 것 보다 압축파일을 추가하고, 푸는 방식으로 설치 하는 것이 선호한다.

NSIS에서 제공하는 압축 Plug-in은 두가지이다. 아래 링크를 NSIS설치 폴더의 Plugins에 복사하여 사용하면 된다.

 

https://nsis.sourceforge.io/Nsisunz_plug-in

 

Nsisunz plug-in - NSIS

NxS Unzip plug-in Download Updated February 15th 2012: Fixed list of mirrors. Previous mirror on darklogic.org is no longer available as "darklogic.org" is no longer in use. Overview nsisunz is a NSIS plugin which allows you to extract files from ZIP archi

nsis.sourceforge.io

https://nsis.sourceforge.io/ZipDLL_plug-in

 

ZipDLL plug-in - NSIS

Links ZipDLL.zip (370 KB) ZipDLL.zip (370 KB) [original version with syntax error in ZipDLL.nsh:357] To use ZipDLL: Extract ZipDLL.dll to directory Plugins in your NSIS installation Extract ZipDLL.nsh to directory Include in your NSIS installation Descript

nsis.sourceforge.io

 

!define APP_ZIP_NAME            "sample.zip"                   ; 언인스톨러 이름
   
 
    ; 파일 복사
    SetOutPath $INSTDIR
    SetOverwrite on                             ; 덮어쓰기 허용
    File "${APP_ZIP_NAME}"

    ; plug-in ZipDLL.dll
    ZipDLL::extractall "$INSTDIR\${APP_ZIP_NAME}" "$INSTDIR"
    Pop $0
    StrCmp $0 "success" +7
    Push $0
    nsisunz::UnzipToLog "$INSTDIR\${APP_ZIP_NAME}" "$INSTDIR"
    Pop $0
    StrCmp $0 "success" +3
    MessageBox MB_OK $0
    Quit

    Delete "$INSTDIR\${APP_ZIP_NAME}"