SHOW:
|
|
- or go back to the newest paste.
| 1 | @echo off | |
| 2 | Set SFX_Name=TestSFX.exe | |
| 3 | Set SfxOptions=SfxOptions.txt | |
| 4 | Set AddFile=MyBatchFile.bat | |
| 5 | Set Icon=HackooIcon.ico | |
| 6 | Set Winrar="%ProgramFiles%\WinRAR\WinRar.exe" | |
| 7 | Set ExtractedPath=%tmp%\hackoo | |
| 8 | Set Setup=%ExtractedPath%\MyBatchFile.bat | |
| 9 | Set Password=hackoo123 | |
| 10 | ||
| 11 | ( | |
| 12 | echo ;The comment below contains SFX script commands | |
| 13 | echo Path="%ExtractedPath%" | |
| 14 | echo Silent=1 | |
| 15 | echo OverWrite=1 | |
| 16 | echo Setup="%Setup%" | |
| 17 | )> "%SfxOptions%" | |
| 18 | ||
| 19 | %Winrar% a -c -cfg- -ep1 -idq -m5 -mdg -r -s -sfx -y -iicon"%Icon%" -hp"%Password%" "-z%SfxOptions%" "%SFX_Name%" "%AddFile%" | |
| 20 | if errorlevel 1 goto Failure | |
| 21 | ::del "%~dp0SfxOptions.txt" | |
| 22 | goto :EOF | |
| 23 | ||
| 24 | :Failure | |
| 25 | ::del "%~dp0SfxOptions.txt" | |
| 26 | echo. | |
| 27 | echo Error on creation of "%~dp0%SFX_Name%" | |
| 28 | echo. | |
| 29 | pause |