简体   繁体   中英

Nsis script: Trying to write a script which extracts specific directory from a zip file and adds it as a part of installer(executable)

I have zip file say Texas.zip . It contains 2 directories Newyork and Manhattan. Newyork has two files A.txt and B.txt , while Manhattan has C.txt and D.txt. I want to extract only Newyork and 2 files associated inside it. The below script helps me extract a specific file inside Newyork but not the entire directory. Please do tell me how to extract a specific directory and its contents from the zip. SCRIPT:

Section "TEST1"
  InitPluginsDir
    #SetOutpath "$INSTDIR"
      
      nsisunz::UnzipToStack /file  "Texas\Newyork\A.txt" "D:\Files\Texas.zip" "D:\Output folder"
      
      Pop $0
    DetailPrint "$0" ;print message to log
  SectionEnd* 

DESIRED OUTPUT : Inside D:\\Output folder\\ post installation of the exe i must see D:\\Output folder\\Newyork * where '*' denotes both files A.txt and B.txt .

This plug-in does not support advanced options like this, you must use nsUnzip instead.

CabX and some of the 7z plug-ins also supports this if you are willing to change archive format.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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