2018-12-04 16:17:08 +00:00
|
|
|
@echo off
|
|
|
|
|
2018-12-02 09:38:54 +00:00
|
|
|
set "SCRIPTDIR=%~dp0"
|
|
|
|
set "SCRIPTDIR=%SCRIPTDIR:~0,-1%"
|
|
|
|
|
|
|
|
IF [%SRB2VERSIONNAME%] == [] set /p SRB2VERSIONNAME=<"%SCRIPTDIR%\VersionFileName.txt"
|
|
|
|
|
|
|
|
:: Find 7z
|
|
|
|
|
|
|
|
set SVZIP=
|
|
|
|
|
2018-12-04 16:17:08 +00:00
|
|
|
if NOT [%1] == [] (
|
2018-12-02 09:38:54 +00:00
|
|
|
echo.%~1 | findstr /C:"7z" 1>nul
|
2018-12-04 16:17:08 +00:00
|
|
|
if NOT errorlevel 1 (
|
2018-12-02 09:38:54 +00:00
|
|
|
if exist "%~1" set "SVZIP=%~1"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
if ["%SVZIP%"] == [""] (
|
|
|
|
if exist "%ProgramFiles(x86)%\7-Zip\7z.exe" set "SVZIP=%ProgramFiles(x86)%\7-Zip\7z.exe"
|
|
|
|
if exist "%ProgramFiles%\7-Zip\7z.exe" set "SVZIP=%ProgramFiles%\7-Zip\7z.exe"
|
|
|
|
if exist "%ProgramW6432%\7-Zip\7z.exe" set "SVZIP=%ProgramW6432%\7-Zip\7z.exe"
|
|
|
|
)
|
|
|
|
|
2018-12-04 16:17:08 +00:00
|
|
|
:: Is it in PATH?
|
|
|
|
|
|
|
|
if ["%SVZIP%"] == [""] (
|
|
|
|
"7z.exe" --help > NUL 2> NUL
|
|
|
|
if NOT errorlevel 1 (
|
|
|
|
set "SVZIP=7z.exe"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
:: Create the uninstaller
|
|
|
|
|
|
|
|
if NOT ["%SVZIP%"] == [""] (
|
|
|
|
del /f /q "%SCRIPTDIR%\Uninstaller.7z" 2> NUL
|
|
|
|
"%SVZIP%" a -t7z "%SCRIPTDIR%\Uninstaller.7z" "%SCRIPTDIR%\uninstaller\*" -m5=LZMA2
|
|
|
|
copy /y /b "%SCRIPTDIR%\sfx\7zsd_LZMA2.sfx" + "%SCRIPTDIR%\sfx\config-uninstaller.txt" + "%SCRIPTDIR%\Uninstaller.7z" "%SCRIPTDIR%\staging\new-install\uninstall.exe"
|
|
|
|
del /f /q "%SCRIPTDIR%\uninstaller.7z"
|
|
|
|
)
|
|
|
|
|
2018-12-02 09:38:54 +00:00
|
|
|
:: Operate on install archives
|
|
|
|
|
2018-12-04 03:12:13 +00:00
|
|
|
type NUL > "%SCRIPTDIR%\staging\new-install\staging.txt"
|
2018-12-03 06:06:25 +00:00
|
|
|
|
2018-12-02 09:38:54 +00:00
|
|
|
if exist "%SCRIPTDIR%\Installer.7z" (
|
2018-12-04 16:17:08 +00:00
|
|
|
if NOT ["%SVZIP%"] == [""] (
|
|
|
|
"%SVZIP%" a "%SCRIPTDIR%\Installer.7z" "%SCRIPTDIR%\staging\*"
|
2018-12-02 09:38:54 +00:00
|
|
|
)
|
2018-12-06 01:39:42 +00:00
|
|
|
copy /y /b "%SCRIPTDIR%\sfx\7zsd_LZMA2.sfx" + "%SCRIPTDIR%\sfx\config-installer.txt" + "%SCRIPTDIR%\Installer.7z" "%SCRIPTDIR%\SRB2Kart-%SRB2VERSIONNAME%-Installer.exe"
|
2018-12-02 09:38:54 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
if exist "%SCRIPTDIR%\Patch.7z" (
|
2018-12-04 16:17:08 +00:00
|
|
|
if NOT ["%SVZIP%"] == [""] (
|
|
|
|
"%SVZIP%" a "%SCRIPTDIR%\Patch.7z" "%SCRIPTDIR%\staging\*"
|
2018-12-02 09:38:54 +00:00
|
|
|
)
|
2018-12-06 01:39:42 +00:00
|
|
|
copy /y /b "%SCRIPTDIR%\sfx\7zsd_LZMA2.sfx" + "%SCRIPTDIR%\sfx\config-patch.txt" + "%SCRIPTDIR%\Patch.7z" "%SCRIPTDIR%\SRB2Kart-%SRB2VERSIONNAME%-Patch.exe"
|
2018-12-02 09:38:54 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
if exist "%SCRIPTDIR%\Installer_x64.7z" (
|
2018-12-04 16:17:08 +00:00
|
|
|
if NOT ["%SVZIP%"] == [""] (
|
|
|
|
"%SVZIP%" a "%SCRIPTDIR%\Installer_x64.7z" "%SCRIPTDIR%\staging\*"
|
2018-12-02 09:38:54 +00:00
|
|
|
)
|
2018-12-06 01:39:42 +00:00
|
|
|
copy /y /b "%SCRIPTDIR%\sfx\7zsd_LZMA2_x64.sfx" + "%SCRIPTDIR%\sfx\config-installer.txt" + "%SCRIPTDIR%\Installer_x64.7z" "%SCRIPTDIR%\SRB2Kart-%SRB2VERSIONNAME%-x64-Installer.exe"
|
2018-12-02 09:38:54 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
if exist "%SCRIPTDIR%\Patch_x64.7z" (
|
2018-12-04 16:17:08 +00:00
|
|
|
if NOT ["%SVZIP%"] == [""] (
|
|
|
|
"%SVZIP%" a "%SCRIPTDIR%\Patch_x64.7z" "%SCRIPTDIR%\staging\*"
|
2018-12-02 09:38:54 +00:00
|
|
|
)
|
2018-12-06 01:39:42 +00:00
|
|
|
copy /y /b "%SCRIPTDIR%\sfx\7zsd_LZMA2_x64.sfx" + "%SCRIPTDIR%\sfx\config-patch.txt" + "%SCRIPTDIR%\Patch_x64.7z" "%SCRIPTDIR%\SRB2Kart-%SRB2VERSIONNAME%-x64-Patch.exe"
|
2018-12-03 06:06:25 +00:00
|
|
|
)
|
|
|
|
|
2018-12-04 03:12:13 +00:00
|
|
|
del /f /q "%SCRIPTDIR%\staging\new-install\staging.txt"
|
2018-12-04 16:17:08 +00:00
|
|
|
del /f /q "%SCRIPTDIR%\staging\new-install\uninstall.exe"
|