Last active
January 17, 2017 15:29
-
-
Save libraplanet/0227237ae38ef3793111782e246adbb7 to your computer and use it in GitHub Desktop.
create sfx droplet.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@SETLOCAL | |
@SET _7ZIP_HOME=C:\Program Files\7-Zip | |
@REM ---------------------------------------------------------------------------------------------- | |
@REM param init | |
@REM ---------------------------------------------------------------------------------------------- | |
@SET IN_FILE=%~1 | |
@SET OUT_FILE=%~dpn1.exe | |
@REM ---------------------------------------------------------------------------------------------- | |
@REM execute | |
@REM ---------------------------------------------------------------------------------------------- | |
@pushd "%~dp0" | |
@copy /b "%_7ZIP_HOME%\7z.sfx" + "%IN_FILE%" "%OUT_FILE%" | |
@popd | |
@REM ---------------------------------------------------------------------------------------------- | |
@REM wait | |
@REM ---------------------------------------------------------------------------------------------- | |
@ping -n 3 localhost > nul | |
@ENDLOCAL |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@SETLOCAL | |
@SET WINRAR_HOME=C:\Program Files\WinRAR | |
@REM @SET SFX=Default.SFX | |
@REM @SET SFX=Default64.SFX | |
@REM @SET SFX=WinCon.sfx | |
@REM @SET SFX=WinCon64.SFX | |
@REM @SET SFX=Zip.SFX | |
@REM @SET SFX=Zip64.SFX | |
@REM ---------------------------------------------------------------------------------------------- | |
@REM param init | |
@REM ---------------------------------------------------------------------------------------------- | |
@SET PATH=%WINRAR_HOME%;%PATH% | |
@SET IN_FILE=%~1 | |
@SET OUT_FILE=%~dpn1.exe | |
@REM ---------------------------------------------------------------------------------------------- | |
@REM execute | |
@REM ---------------------------------------------------------------------------------------------- | |
@pushd "%~dp0" | |
@IF EXIST "%OUT_FILE%" ( | |
@DEL "%OUT_FILE%" | |
@ECHO deleted output file. | |
@ECHO %OUT_FILE% | |
@ECHO. | |
) | |
@IF /I "%SFX%" NEQ "" ( | |
@COPY /b /y "%WINRAR_HOME%\%SFX%" .\ > nul | |
@ECHO copy sfx file. | |
@ECHO %SFX% | |
@ECHO. | |
) | |
@WinRAR.exe s%SFX% "%IN_FILE%" | |
@IF NOT "%ERRORLEVEL%" EQU "0" ( | |
@ECHO convert faild... | |
) ELSE ( | |
@ECHO converted. | |
@ECHO %OUT_FILE% | |
) | |
@ECHO. | |
@IF /I "%SFX%" NEQ "" ( | |
@del %SFX%" | |
@ECHO delete sfx file. | |
@ECHO. | |
) | |
@popd | |
@REM ---------------------------------------------------------------------------------------------- | |
@REM eait | |
@REM ---------------------------------------------------------------------------------------------- | |
@ping -n 3 localhost > nul | |
@ENDLOCAL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment