2016-04-27 12:03:10 +00:00
|
|
|
@echo OFF
|
|
|
|
setlocal enabledelayedexpansion
|
|
|
|
set "FullScriptPath=%~dp0"
|
|
|
|
set "FullExecPath=%cd%"
|
|
|
|
|
2019-09-26 09:52:36 +00:00
|
|
|
if not exist "%FullScriptPath%..\..\..\DesktopPrivate" (
|
2016-04-27 12:03:10 +00:00
|
|
|
echo.
|
|
|
|
echo This script is for building the production version of Telegram Desktop.
|
|
|
|
echo.
|
|
|
|
echo For building custom versions please visit the build instructions page at:
|
|
|
|
echo https://github.com/telegramdesktop/tdesktop/#build-instructions
|
|
|
|
exit /b
|
|
|
|
)
|
|
|
|
|
2017-04-05 17:02:25 +00:00
|
|
|
FOR /F "tokens=1* delims= " %%i in (%FullScriptPath%target) do set "BuildTarget=%%i"
|
|
|
|
|
|
|
|
if "%BuildTarget%" equ "uwp" (
|
|
|
|
set "BuildUWP=1"
|
2021-01-28 10:07:35 +00:00
|
|
|
) else if "%BuildTarget%" equ "uwp64" (
|
|
|
|
set "BuildUWP=1"
|
2017-04-05 17:02:25 +00:00
|
|
|
) else (
|
|
|
|
set "BuildUWP=0"
|
|
|
|
)
|
|
|
|
|
2021-01-28 10:07:35 +00:00
|
|
|
if "%BuildTarget%" equ "win64" (
|
|
|
|
set "Build64=1"
|
|
|
|
) else if "%BuildTarget%" equ "uwp64" (
|
|
|
|
set "Build64=1"
|
|
|
|
) else (
|
|
|
|
set "Build64=0"
|
|
|
|
)
|
|
|
|
|
|
|
|
if %Build64% neq 0 (
|
|
|
|
if "%Platform%" neq "x64" (
|
|
|
|
echo Bad environment. Make sure to run from 'x64 Native Tools Command Prompt for VS 2019'.
|
|
|
|
exit /b
|
|
|
|
) else if "%VSCMD_ARG_HOST_ARCH%" neq "x64" (
|
|
|
|
echo Bad environment. Make sure to run from 'x64 Native Tools Command Prompt for VS 2019'.
|
|
|
|
exit /b
|
|
|
|
) else if "%VSCMD_ARG_TGT_ARCH%" neq "x64" (
|
|
|
|
echo Bad environment. Make sure to run from 'x64 Native Tools Command Prompt for VS 2019'.
|
|
|
|
exit /b
|
|
|
|
)
|
|
|
|
) else (
|
|
|
|
if "%Platform%" neq "x86" (
|
|
|
|
echo Bad environment. Make sure to run from 'x86 Native Tools Command Prompt for VS 2019'.
|
|
|
|
exit /b
|
|
|
|
) else if "%VSCMD_ARG_HOST_ARCH%" neq "x86" (
|
|
|
|
echo Bad environment. Make sure to run from 'x86 Native Tools Command Prompt for VS 2019'.
|
|
|
|
exit /b
|
|
|
|
) else if "%VSCMD_ARG_TGT_ARCH%" neq "x86" (
|
|
|
|
echo Bad environment. Make sure to run from 'x86 Native Tools Command Prompt for VS 2019'.
|
|
|
|
exit /b
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
2016-04-27 12:03:10 +00:00
|
|
|
FOR /F "tokens=1,2* delims= " %%i in (%FullScriptPath%version) do set "%%i=%%j"
|
|
|
|
|
|
|
|
set "VersionForPacker=%AppVersion%"
|
2018-09-26 14:58:09 +00:00
|
|
|
if %AlphaVersion% neq 0 (
|
|
|
|
set "AppVersion=%AlphaVersion%"
|
|
|
|
set "AppVersionStrFull=%AppVersionStr%_%AlphaVersion%"
|
|
|
|
set "AlphaBetaParam=-alpha %AlphaVersion%"
|
|
|
|
set "AlphaKeyFile=talpha_%AlphaVersion%_key"
|
2016-04-27 12:03:10 +00:00
|
|
|
) else (
|
2018-09-26 14:58:09 +00:00
|
|
|
if %BetaChannel% neq 0 (
|
|
|
|
set "AlphaBetaParam=-beta"
|
|
|
|
set "AppVersionStrFull=%AppVersionStr%.beta"
|
2016-04-27 12:03:10 +00:00
|
|
|
) else (
|
|
|
|
set "AlphaBetaParam="
|
|
|
|
set "AppVersionStrFull=%AppVersionStr%"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
echo.
|
2017-02-01 10:12:52 +00:00
|
|
|
if %BuildUWP% neq 0 (
|
2021-01-28 10:07:35 +00:00
|
|
|
if %Build64% neq 0 (
|
|
|
|
echo Building version %AppVersionStrFull% for UWP 64 bit..
|
|
|
|
) else (
|
|
|
|
echo Building version %AppVersionStrFull% for UWP..
|
|
|
|
)
|
2017-02-01 10:12:52 +00:00
|
|
|
) else (
|
2021-01-28 10:07:35 +00:00
|
|
|
if %Build64% neq 0 (
|
|
|
|
echo Building version %AppVersionStrFull% for Windows 64 bit..
|
|
|
|
) else (
|
|
|
|
echo Building version %AppVersionStrFull% for Windows..
|
|
|
|
)
|
2017-02-01 10:12:52 +00:00
|
|
|
)
|
2016-04-27 12:03:10 +00:00
|
|
|
echo.
|
|
|
|
|
|
|
|
set "HomePath=%FullScriptPath%.."
|
|
|
|
set "ResourcesPath=%HomePath%\Resources"
|
2019-12-06 10:17:40 +00:00
|
|
|
set "SolutionPath=%HomePath%\..\out"
|
2021-01-28 10:07:35 +00:00
|
|
|
if %Build64% neq 0 (
|
|
|
|
set "UpdateFile=tx64upd%AppVersion%"
|
|
|
|
set "SetupFile=tsetup-x64.%AppVersionStrFull%.exe"
|
|
|
|
set "PortableFile=tportable-x64.%AppVersionStrFull%.zip"
|
2023-02-09 05:40:27 +00:00
|
|
|
set "DumpSymsPath=%SolutionPath%\..\..\Libraries\win64\breakpad\src\tools\windows\dump_syms\Release\dump_syms.exe"
|
2021-01-28 10:07:35 +00:00
|
|
|
) else (
|
|
|
|
set "UpdateFile=tupdate%AppVersion%"
|
|
|
|
set "SetupFile=tsetup.%AppVersionStrFull%.exe"
|
|
|
|
set "PortableFile=tportable.%AppVersionStrFull%.zip"
|
2023-02-09 05:40:27 +00:00
|
|
|
set "DumpSymsPath=%SolutionPath%\..\..\Libraries\breakpad\src\tools\windows\dump_syms\Release\dump_syms.exe"
|
2021-01-28 10:07:35 +00:00
|
|
|
)
|
2019-12-06 10:17:40 +00:00
|
|
|
set "ReleasePath=%SolutionPath%\Release"
|
2016-04-27 12:03:10 +00:00
|
|
|
set "DeployPath=%ReleasePath%\deploy\%AppVersionStrMajor%\%AppVersionStrFull%"
|
2019-09-26 09:52:36 +00:00
|
|
|
set "SignPath=%HomePath%\..\..\DesktopPrivate\Sign.bat"
|
2016-04-27 12:03:10 +00:00
|
|
|
set "BinaryName=Telegram"
|
2017-10-13 19:23:19 +00:00
|
|
|
set "DropboxSymbolsPath=Y:\Telegram\symbols"
|
2022-03-11 11:43:52 +00:00
|
|
|
set "DropboxSymbolsPathFallback=%HomePath%\..\..\Dropbox\Telegram\symbols"
|
2019-11-05 21:27:20 +00:00
|
|
|
set "FinalReleasePath=Z:\Projects\backup\tdesktop"
|
2022-03-11 11:43:52 +00:00
|
|
|
set "FinalReleasePathFallback=%HomePath%\..\..\Projects\backup\tdesktop"
|
2016-04-27 12:03:10 +00:00
|
|
|
|
2016-08-05 19:31:19 +00:00
|
|
|
if not exist %DropboxSymbolsPath% (
|
2022-03-11 11:43:52 +00:00
|
|
|
if exist %DropboxSymbolsPathFallback% (
|
|
|
|
set "DropboxSymbolsPath=%DropboxSymbolsPathFallback%"
|
|
|
|
) else (
|
|
|
|
echo Dropbox path %DropboxSymbolsPath% not found!
|
|
|
|
exit /b 1
|
|
|
|
)
|
2016-12-20 13:03:51 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
if not exist %FinalReleasePath% (
|
2022-03-11 11:43:52 +00:00
|
|
|
if exist %FinalReleasePathFallback% (
|
|
|
|
set "FinalReleasePath=%FinalReleasePathFallback%"
|
|
|
|
) else (
|
|
|
|
echo Release path %FinalReleasePath% not found!
|
|
|
|
exit /b 1
|
|
|
|
)
|
2016-08-05 19:31:19 +00:00
|
|
|
)
|
|
|
|
|
2017-02-09 19:31:30 +00:00
|
|
|
if %BuildUWP% neq 0 (
|
|
|
|
if exist %ReleasePath%\AppX\ (
|
|
|
|
echo Result folder out\Release\AppX already exists!
|
2016-04-27 12:03:10 +00:00
|
|
|
exit /b 1
|
|
|
|
)
|
2017-04-05 17:02:25 +00:00
|
|
|
)
|
2018-09-26 14:58:09 +00:00
|
|
|
if %AlphaVersion% neq 0 (
|
2017-04-05 17:02:25 +00:00
|
|
|
if exist %DeployPath%\ (
|
|
|
|
echo Deploy folder for version %AppVersionStr% already exists!
|
|
|
|
exit /b 1
|
|
|
|
)
|
2018-09-26 14:58:09 +00:00
|
|
|
if exist %ReleasePath%\%AlphaKeyFile% (
|
|
|
|
echo Alpha version key file for version %AppVersion% already exists!
|
2017-04-05 17:02:25 +00:00
|
|
|
exit /b 1
|
2017-02-09 19:31:30 +00:00
|
|
|
)
|
|
|
|
) else (
|
2017-04-05 17:02:25 +00:00
|
|
|
if exist %ReleasePath%\deploy\%AppVersionStrMajor%\%AppVersionStr%.alpha\ (
|
|
|
|
echo Deploy folder for version %AppVersionStr%.alpha already exists!
|
|
|
|
exit /b 1
|
|
|
|
)
|
2018-09-26 14:58:09 +00:00
|
|
|
if exist %ReleasePath%\deploy\%AppVersionStrMajor%\%AppVersionStr%.beta\ (
|
|
|
|
echo Deploy folder for version %AppVersionStr%.beta already exists!
|
2017-04-05 17:02:25 +00:00
|
|
|
exit /b 1
|
|
|
|
)
|
|
|
|
if exist %ReleasePath%\deploy\%AppVersionStrMajor%\%AppVersionStr%\ (
|
|
|
|
echo Deploy folder for version %AppVersionStr% already exists!
|
|
|
|
exit /b 1
|
|
|
|
)
|
|
|
|
if exist %ReleasePath%\tupdate%AppVersion% (
|
|
|
|
echo Update file for version %AppVersion% already exists!
|
|
|
|
exit /b 1
|
2016-04-27 12:03:10 +00:00
|
|
|
)
|
|
|
|
)
|
2016-06-08 11:33:49 +00:00
|
|
|
|
|
|
|
cd "%HomePath%"
|
2017-02-01 10:12:52 +00:00
|
|
|
|
2019-12-06 10:17:40 +00:00
|
|
|
call configure.bat
|
2016-04-27 12:03:10 +00:00
|
|
|
if %errorlevel% neq 0 goto error
|
|
|
|
|
|
|
|
cd "%SolutionPath%"
|
2019-12-06 10:17:40 +00:00
|
|
|
call cmake --build . --config Release --target Telegram
|
2016-04-27 12:03:10 +00:00
|
|
|
if %errorlevel% neq 0 goto error
|
|
|
|
|
2017-02-01 10:12:52 +00:00
|
|
|
echo.
|
2016-04-27 12:03:10 +00:00
|
|
|
echo Version %AppVersionStrFull% build successfull. Preparing..
|
2017-02-01 10:12:52 +00:00
|
|
|
echo.
|
2016-04-27 12:03:10 +00:00
|
|
|
|
2021-01-29 20:05:49 +00:00
|
|
|
if not exist "%DumpSymsPath%" (
|
2018-08-27 15:08:16 +00:00
|
|
|
echo Utility dump_syms not found!
|
|
|
|
exit /b 1
|
|
|
|
)
|
|
|
|
|
2016-04-27 12:03:10 +00:00
|
|
|
echo Dumping debug symbols..
|
2021-01-29 20:05:49 +00:00
|
|
|
call "%DumpSymsPath%" "%ReleasePath%\%BinaryName%.pdb" > "%ReleasePath%\%BinaryName%.sym"
|
2016-04-27 12:03:10 +00:00
|
|
|
echo Done!
|
|
|
|
|
|
|
|
set "PATH=%PATH%;C:\Program Files\7-Zip;C:\Program Files (x86)\Inno Setup 5"
|
|
|
|
|
|
|
|
cd "%ReleasePath%"
|
2019-08-08 19:55:24 +00:00
|
|
|
|
|
|
|
:sign1
|
2016-04-27 12:03:10 +00:00
|
|
|
call "%SignPath%" "%BinaryName%.exe"
|
2019-08-08 19:55:24 +00:00
|
|
|
if %errorlevel% neq 0 (
|
|
|
|
timeout /t 3
|
|
|
|
goto sign1
|
|
|
|
)
|
2016-04-27 12:03:10 +00:00
|
|
|
|
2017-02-02 16:29:36 +00:00
|
|
|
if %BuildUWP% equ 0 (
|
2019-08-08 19:55:24 +00:00
|
|
|
:sign2
|
2017-02-01 10:12:52 +00:00
|
|
|
call "%SignPath%" "Updater.exe"
|
2019-08-08 19:55:24 +00:00
|
|
|
if %errorlevel% neq 0 (
|
|
|
|
timeout /t 3
|
|
|
|
goto sign2
|
|
|
|
)
|
2016-04-27 12:03:10 +00:00
|
|
|
|
2018-09-26 14:58:09 +00:00
|
|
|
if %AlphaVersion% equ 0 (
|
2021-01-28 10:07:35 +00:00
|
|
|
iscc /dMyAppVersion=%AppVersionStrSmall% /dMyAppVersionZero=%AppVersionStr% /dMyAppVersionFull=%AppVersionStrFull% "/dReleasePath=%ReleasePath%" "/dMyBuildTarget=%BuildTarget%" "%FullScriptPath%setup.iss"
|
2017-02-01 10:12:52 +00:00
|
|
|
if %errorlevel% neq 0 goto error
|
2019-11-02 17:06:47 +00:00
|
|
|
if not exist "%SetupFile%" goto error
|
2016-04-27 12:03:10 +00:00
|
|
|
)
|
|
|
|
|
2021-07-20 14:37:09 +00:00
|
|
|
call Packer.exe -version %VersionForPacker% -path %BinaryName%.exe -path Updater.exe -path "modules\%Platform%\d3d\d3dcompiler_47.dll" -target %BuildTarget% %AlphaBetaParam%
|
2017-02-01 10:12:52 +00:00
|
|
|
if %errorlevel% neq 0 goto error
|
2016-04-27 12:03:10 +00:00
|
|
|
|
2018-09-26 14:58:09 +00:00
|
|
|
if %AlphaVersion% neq 0 (
|
|
|
|
if not exist "%ReleasePath%\%AlphaKeyFile%" (
|
|
|
|
echo Alpha version key file not found!
|
2017-02-01 10:12:52 +00:00
|
|
|
exit /b 1
|
|
|
|
)
|
|
|
|
|
2018-09-26 14:58:09 +00:00
|
|
|
FOR /F "tokens=1* delims= " %%i in (%ReleasePath%\%AlphaKeyFile%) do set "AlphaSignature=%%i"
|
2017-02-01 10:12:52 +00:00
|
|
|
)
|
|
|
|
if %errorlevel% neq 0 goto error
|
|
|
|
|
2018-09-26 14:58:09 +00:00
|
|
|
if %AlphaVersion% neq 0 (
|
|
|
|
set "UpdateFile=!UpdateFile!_!AlphaSignature!"
|
|
|
|
set "PortableFile=talpha!AlphaVersion!_!AlphaSignature!.zip"
|
2017-02-01 10:12:52 +00:00
|
|
|
)
|
2021-11-04 08:35:34 +00:00
|
|
|
) else (
|
|
|
|
:sign2
|
|
|
|
call "%SignPath%" "StartupTask.exe"
|
|
|
|
if %errorlevel% neq 0 (
|
|
|
|
timeout /t 3
|
|
|
|
goto sign2
|
|
|
|
)
|
2016-04-27 12:03:10 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
for /f ^"usebackq^ eol^=^
|
|
|
|
|
2019-12-27 14:35:51 +00:00
|
|
|
^ delims^=^" %%a in (%ReleasePath%\%BinaryName%.sym) do (
|
2018-08-27 15:08:16 +00:00
|
|
|
set "SymbolsHashLine=%%a"
|
|
|
|
goto symbolslinedone
|
|
|
|
)
|
|
|
|
:symbolslinedone
|
2016-04-27 12:03:10 +00:00
|
|
|
FOR /F "tokens=1,2,3,4* delims= " %%i in ("%SymbolsHashLine%") do set "SymbolsHash=%%l"
|
|
|
|
|
2019-12-06 12:14:24 +00:00
|
|
|
echo Copying %BinaryName%.sym to %DropboxSymbolsPath%\%BinaryName%.pdb\%SymbolsHash%
|
|
|
|
if not exist %DropboxSymbolsPath%\%BinaryName%.pdb mkdir %DropboxSymbolsPath%\%BinaryName%.pdb
|
|
|
|
if not exist %DropboxSymbolsPath%\%BinaryName%.pdb\%SymbolsHash% mkdir %DropboxSymbolsPath%\%BinaryName%.pdb\%SymbolsHash%
|
|
|
|
move "%ReleasePath%\%BinaryName%.sym" %DropboxSymbolsPath%\%BinaryName%.pdb\%SymbolsHash%\
|
2016-04-27 12:03:10 +00:00
|
|
|
echo Done!
|
|
|
|
|
2017-02-01 10:12:52 +00:00
|
|
|
if %BuildUWP% neq 0 (
|
2017-02-02 16:29:36 +00:00
|
|
|
cd "%HomePath%"
|
|
|
|
|
2021-07-20 14:37:09 +00:00
|
|
|
mkdir "%ReleasePath%\AppX\modules\%Platform%\d3d"
|
2021-01-28 10:07:35 +00:00
|
|
|
xcopy "Resources\uwp\AppX\*" "%ReleasePath%\AppX\" /E
|
|
|
|
set "ResourcePath=%ReleasePath%\AppX\AppxManifest.xml"
|
2021-07-20 14:37:09 +00:00
|
|
|
call :repl "Argument= (ProcessorArchitecture=)"ARCHITECTURE"/ $1"%Platform%"" "Filename=!ResourcePath!" || goto error
|
2021-01-28 10:07:35 +00:00
|
|
|
makepri new /pr Resources\uwp\AppX\ /cf Resources\uwp\priconfig.xml /mn %ReleasePath%\AppX\AppxManifest.xml /of %ReleasePath%\AppX\resources.pri
|
2017-02-02 16:29:36 +00:00
|
|
|
if %errorlevel% neq 0 goto error
|
|
|
|
|
2021-01-28 10:07:35 +00:00
|
|
|
xcopy "%ReleasePath%\%BinaryName%.exe" "%ReleasePath%\AppX\"
|
2021-11-04 08:35:34 +00:00
|
|
|
xcopy "%ReleasePath%\StartupTask.exe" "%ReleasePath%\AppX\"
|
2021-07-20 14:37:09 +00:00
|
|
|
xcopy "%ReleasePath%\modules\%Platform%\d3d\d3dcompiler_47.dll" "%ReleasePath%\AppX\modules\%Platform%\d3d\"
|
2017-02-02 16:29:36 +00:00
|
|
|
|
2021-07-20 14:37:09 +00:00
|
|
|
MakeAppx.exe pack /d "%ReleasePath%\AppX" /l /p ..\out\Release\%BinaryName%.%Platform%.appx
|
2017-02-02 16:29:36 +00:00
|
|
|
if %errorlevel% neq 0 goto error
|
|
|
|
|
2017-04-05 17:02:25 +00:00
|
|
|
if not exist "%ReleasePath%\deploy" mkdir "%ReleasePath%\deploy"
|
|
|
|
if not exist "%ReleasePath%\deploy\%AppVersionStrMajor%" mkdir "%ReleasePath%\deploy\%AppVersionStrMajor%"
|
|
|
|
mkdir "%DeployPath%"
|
2017-02-02 16:29:36 +00:00
|
|
|
|
2019-12-06 12:14:24 +00:00
|
|
|
move "%ReleasePath%\%BinaryName%.pdb" "%DeployPath%\"
|
2021-07-20 14:37:09 +00:00
|
|
|
move "%ReleasePath%\%BinaryName%.%Platform%.appx" "%DeployPath%\"
|
2017-04-05 17:02:25 +00:00
|
|
|
move "%ReleasePath%\%BinaryName%.exe" "%DeployPath%\"
|
2017-02-09 19:31:30 +00:00
|
|
|
|
|
|
|
if "%AlphaBetaParam%" equ "" (
|
2021-01-28 10:07:35 +00:00
|
|
|
move "%ReleasePath%\AppX" "%DeployPath%\AppX"
|
2017-02-09 19:31:30 +00:00
|
|
|
) else (
|
2017-04-05 17:02:25 +00:00
|
|
|
echo Leaving result in out\Release\AppX_arch for now..
|
2017-02-09 19:31:30 +00:00
|
|
|
)
|
2016-04-27 12:03:10 +00:00
|
|
|
) else (
|
2017-02-01 10:12:52 +00:00
|
|
|
if not exist "%ReleasePath%\deploy" mkdir "%ReleasePath%\deploy"
|
|
|
|
if not exist "%ReleasePath%\deploy\%AppVersionStrMajor%" mkdir "%ReleasePath%\deploy\%AppVersionStrMajor%"
|
2021-07-20 14:37:09 +00:00
|
|
|
mkdir "%DeployPath%\%BinaryName%\modules\%Platform%\d3d"
|
2017-02-01 10:12:52 +00:00
|
|
|
if %errorlevel% neq 0 goto error
|
2016-04-27 12:03:10 +00:00
|
|
|
|
2017-02-01 10:12:52 +00:00
|
|
|
move "%ReleasePath%\%BinaryName%.exe" "%DeployPath%\%BinaryName%\"
|
2021-07-20 14:37:09 +00:00
|
|
|
xcopy "%ReleasePath%\modules\%Platform%\d3d\d3dcompiler_47.dll" "%DeployPath%\%BinaryName%\modules\%Platform%\d3d\"
|
2017-02-01 10:12:52 +00:00
|
|
|
move "%ReleasePath%\Updater.exe" "%DeployPath%\"
|
2019-12-06 12:14:24 +00:00
|
|
|
move "%ReleasePath%\%BinaryName%.pdb" "%DeployPath%\"
|
|
|
|
move "%ReleasePath%\Updater.pdb" "%DeployPath%\"
|
2018-09-26 14:58:09 +00:00
|
|
|
if %AlphaVersion% equ 0 (
|
2017-02-01 10:12:52 +00:00
|
|
|
move "%ReleasePath%\%SetupFile%" "%DeployPath%\"
|
|
|
|
) else (
|
2018-09-26 14:58:09 +00:00
|
|
|
move "%ReleasePath%\%AlphaKeyFile%" "%DeployPath%\"
|
2017-02-01 10:12:52 +00:00
|
|
|
)
|
|
|
|
move "%ReleasePath%\%UpdateFile%" "%DeployPath%\"
|
|
|
|
if %errorlevel% neq 0 goto error
|
|
|
|
|
|
|
|
cd "%DeployPath%"
|
|
|
|
7z a -mx9 %PortableFile% %BinaryName%\
|
|
|
|
if %errorlevel% neq 0 goto error
|
2018-08-27 11:35:58 +00:00
|
|
|
|
|
|
|
move "%DeployPath%\%BinaryName%\%BinaryName%.exe" "%DeployPath%\"
|
|
|
|
rmdir "%DeployPath%\%BinaryName%"
|
|
|
|
if %errorlevel% neq 0 goto error
|
2017-02-01 10:12:52 +00:00
|
|
|
)
|
2016-04-27 12:03:10 +00:00
|
|
|
|
2021-01-28 10:07:35 +00:00
|
|
|
if %Build64% equ 0 (
|
|
|
|
set "FinalDeployPath=%FinalReleasePath%\%AppVersionStrMajor%\%AppVersionStrFull%\tsetup"
|
|
|
|
) else (
|
|
|
|
set "FinalDeployPath=%FinalReleasePath%\%AppVersionStrMajor%\%AppVersionStrFull%\tx64"
|
|
|
|
)
|
2017-02-01 19:38:31 +00:00
|
|
|
|
2017-02-01 10:12:52 +00:00
|
|
|
if %BuildUWP% equ 0 (
|
|
|
|
echo.
|
|
|
|
echo Version %AppVersionStrFull% is ready for deploy!
|
|
|
|
echo.
|
2016-04-27 12:03:10 +00:00
|
|
|
|
2017-02-01 10:12:52 +00:00
|
|
|
if not exist "%DeployPath%\%UpdateFile%" goto error
|
|
|
|
if not exist "%DeployPath%\%PortableFile%" goto error
|
2018-09-26 14:58:09 +00:00
|
|
|
if %AlphaVersion% equ 0 (
|
2017-02-01 10:12:52 +00:00
|
|
|
if not exist "%DeployPath%\%SetupFile%" goto error
|
|
|
|
)
|
|
|
|
if not exist "%DeployPath%\%BinaryName%.pdb" goto error
|
|
|
|
if not exist "%DeployPath%\Updater.exe" goto error
|
|
|
|
if not exist "%DeployPath%\Updater.pdb" goto error
|
2018-04-08 13:17:56 +00:00
|
|
|
md "%FinalDeployPath%"
|
2017-02-01 10:12:52 +00:00
|
|
|
|
2017-04-05 17:02:25 +00:00
|
|
|
xcopy "%DeployPath%\%UpdateFile%" "%FinalDeployPath%\" /Y
|
|
|
|
xcopy "%DeployPath%\%PortableFile%" "%FinalDeployPath%\" /Y
|
2018-09-26 14:58:09 +00:00
|
|
|
if %AlphaVersion% equ 0 (
|
2017-04-05 17:02:25 +00:00
|
|
|
xcopy "%DeployPath%\%SetupFile%" "%FinalDeployPath%\" /Y
|
2017-02-01 10:12:52 +00:00
|
|
|
) else (
|
2018-09-26 14:58:09 +00:00
|
|
|
xcopy "%DeployPath%\%AlphaKeyFile%" "%FinalDeployPath%\" /Y
|
2017-02-01 10:12:52 +00:00
|
|
|
)
|
2016-04-27 12:03:10 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
echo Version %AppVersionStrFull% is ready!
|
|
|
|
|
|
|
|
cd "%FullExecPath%"
|
|
|
|
exit /b
|
|
|
|
|
|
|
|
:error
|
|
|
|
(
|
|
|
|
set ErrorCode=%errorlevel%
|
|
|
|
if !ErrorCode! neq 0 (
|
|
|
|
echo Error !ErrorCode!
|
|
|
|
) else (
|
|
|
|
echo Error 666
|
|
|
|
set ErrorCode=666
|
|
|
|
)
|
|
|
|
cd "%FullExecPath%"
|
|
|
|
exit /b !ErrorCode!
|
|
|
|
)
|
2017-04-05 17:02:25 +00:00
|
|
|
|
|
|
|
:repl
|
|
|
|
(
|
|
|
|
set %1
|
|
|
|
set %2
|
|
|
|
set "TempFilename=!Filename!__tmp__"
|
|
|
|
cscript //Nologo "%FullScriptPath%replace.vbs" "Replace" "!Argument!" < "!Filename!" > "!TempFilename!" || goto :repl_finish
|
|
|
|
xcopy /Y !TempFilename! !Filename! >NUL || goto :repl_finish
|
|
|
|
goto :repl_finish
|
|
|
|
)
|
|
|
|
|
|
|
|
:repl_finish
|
|
|
|
(
|
|
|
|
set ErrorCode=%errorlevel%
|
|
|
|
if !ErrorCode! neq 0 (
|
|
|
|
echo Replace error !ErrorCode!
|
|
|
|
echo While replacing "%Replace%"
|
|
|
|
echo In file "%Filename%"
|
|
|
|
)
|
|
|
|
del %TempFilename%
|
|
|
|
exit /b !ErrorCode!
|
|
|
|
)
|