WinRar -sp<> flag not working with self-extractors -
i using winrar 3 create self extractors , using -sp flag pass arguments executable bundled inside. working fine. after updated winrar 5.1, stopped working. -sp<> flag no longer working me.
does else face similar issue? there other flags can utilize pass parameters executable called self extractor. read next documentation available flags. http://www.winrar-tr.com/winrar/help/eng/html/helpguisfxcmd.htm
the parameters executable can specified straight in comment file parameters sfx module.
here illustration batch file demonstrating technique:
@echo off cd /d "%temp%" rem create file sfx module sfx options. echo ;the comment below contains sfx script commands.>testsetup.txt echo.>>testsetup.txt echo setup=test.bat switch "one more parameter">>testsetup.txt echo overwrite=1>>testsetup.txt echo title=test installation>>testsetup.txt echo text>>testsetup.txt echo {>>testsetup.txt echo ^<font face='arial'^>an sfx test shows how sfx module runs installer.^<br^>^<br^>just click on button install or nail return.^</font^>>>testsetup.txt echo }>>testsetup.txt rem create batch file executed sfx archive. echo @echo %%0 %%*>test.bat echo @pause>>test.bat echo @del %%0 ^>nul>>test.bat rem create sfx archive. rar.exe -sfx -c -ztestsetup.txt testsetup.exe test.bat rem delete created batch , comment file. del test.bat del testsetup.txt rem run self-extracting archive. user has press return. start /wait testsetup.exe rem delete self-extracting archive. :deleteloop del testsetup.exe >nul if exist testsetup.exe goto deleteloop this batch file first creates in directory temporary files text file testsetup.txt content:
;the comment below contains sfx script commands. setup=test.bat switch "one more parameter" overwrite= title=test installation text { <font face='arial'>an sfx test shows how sfx module runs installer.<br><br>just click on button install or nail return.</font> } important line starting setup=.
test.bat file execute after extraction. switch alternative pass first parameter test.bat. "one more parameter" sec parameter spaces within pass test.bat must enclosed in double quotes because of spaces. next batch file continues creation of test.bat content:
@echo %0 %* @pause @del %0 >nul this little batch file outputs first line how called sfx archive, next waits key nail user , lastly deletes itself. not matter directory batch file extracted. default current directory directory of temporary files.
then batch file creates sfx archive testsetup.exe. details on used switches see rar.txt in programme files directory of winrar.
pleae note line rar.exe works without modification if programme files directory of winrar included in environment variable path, or windows fails find rar.exe console version of winrar. modify line finish path rar.exe in double quotes line of batch file working independent on included directories in path.
after sfx rar archive created, files test.bat , testsetup.txt deleted not needed anymore.
now created sfx archive testsetup.exe called , after hitting key homecoming , see test.bat called 2 parameters specified in testsetup.txt.
the batch file deletes created sfx archive.
winrar self-extracting sfx
No comments:
Post a Comment