简体   繁体   中英

SFX with 7-zip : Is it possible to run a included .bat file *before* extracting the files?

I'm creating a SFX executable with 7-zip (command line version) and the 7zsd.sfx module. My current config file looks like this :

;!@Install@!UTF-8!
Title="Test"
BeginPrompt="Test"
CancelPrompt="Do you want to cancel the extraction?"
ExtractDialogText="Please, wait..."
ExtractPathText="Please, enter the extraction path:"
ExtractTitle="Extracting..."
GUIFlags="8+32+64+256+4096"
GUIMode="1"
InstallPath="%%S"
RunProgram="test2.bat"
;!@InstallEnd@!

Is it possible to run a program before extracting the files? Currently, test2.bat is ran once the files are extracted. I'd like :

  • The user click "OK"

  • test1.bat is executed

  • Files are extracted

  • test2.bat is executed

Using WinRAR's SFX, there is a presetup option. Is there something similar using 7-zip and 7zsd.sfx?

我发现的一种解决方法是将文件提取到临时文件夹中,而不是最终目标中,运行第一个.bat文件,将temp文件夹xcopy到实际目标中,最后运行最后一个.bat

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