init
Some checks failed
Docker. / Ubuntu (push) Has been cancelled
User-agent updater. / User-agent (push) Failing after 15s
Lock Threads / lock (push) Failing after 10s
Waiting for answer. / waiting-for-answer (push) Failing after 22s
Close stale issues and PRs / stale (push) Successful in 13s
Needs user action. / needs-user-action (push) Failing after 8s
Can't reproduce. / cant-reproduce (push) Failing after 8s
Some checks failed
Docker. / Ubuntu (push) Has been cancelled
User-agent updater. / User-agent (push) Failing after 15s
Lock Threads / lock (push) Failing after 10s
Waiting for answer. / waiting-for-answer (push) Failing after 22s
Close stale issues and PRs / stale (push) Successful in 13s
Needs user action. / needs-user-action (push) Failing after 8s
Can't reproduce. / cant-reproduce (push) Failing after 8s
This commit is contained in:
81
Telegram/build/test_package.bat
Normal file
81
Telegram/build/test_package.bat
Normal file
@@ -0,0 +1,81 @@
|
||||
@echo OFF
|
||||
setlocal enabledelayedexpansion
|
||||
set "FullScriptPath=%~dp0"
|
||||
set "FullExecPath=%cd%"
|
||||
|
||||
if not exist "%FullScriptPath%..\..\..\DesktopPrivate" (
|
||||
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
|
||||
)
|
||||
|
||||
set "HomePath=%FullScriptPath%.."
|
||||
set "SignAppxPath=%HomePath%\..\..\DesktopPrivate\AppxSign.bat"
|
||||
set "ResourcesPath=%HomePath%\Resources"
|
||||
set "SolutionPath=%HomePath%\.."
|
||||
set "ReleasePath=%HomePath%\..\out\Debug"
|
||||
set "BinaryName=Telegram"
|
||||
|
||||
if exist %ReleasePath%\AppX\ (
|
||||
echo Result folder out\Debug\AppX already exists!
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
cd "%HomePath%"
|
||||
|
||||
call gyp\refresh.bat
|
||||
if %errorlevel% neq 0 goto error
|
||||
|
||||
cd "%SolutionPath%"
|
||||
call ninja -C out/Debug Telegram
|
||||
if %errorlevel% neq 0 goto error
|
||||
|
||||
cd "%HomePath%"
|
||||
|
||||
mkdir "%ReleasePath%\AppX"
|
||||
xcopy "Resources\uwp\AppX\*" "%ReleasePath%\AppX\" /E
|
||||
|
||||
set "ResourcePath=%ReleasePath%\AppX\AppxManifest.xml"
|
||||
call :repl "Argument= (Publisher=)"CN=536BC709-8EE1-4478-AF22-F0F0F26FF64A"/ $1"CN=Telegram FZ-LLC, O=Telegram FZ-LLC, L=Dubai, C=AE"" "Filename=%ResourcePath%" || goto :error
|
||||
call :repl "Argument= (ProcessorArchitecture=)"ARCHITECTURE"/ $1"x64"" "Filename=%ResourcePath%" || goto :error
|
||||
|
||||
makepri new /pr Resources\uwp\AppX\ /cf Resources\uwp\priconfig.xml /mn %ReleasePath%\AppX\AppxManifest.xml /of %ReleasePath%\AppX\resources.pri
|
||||
if %errorlevel% neq 0 goto error
|
||||
|
||||
xcopy "%ReleasePath%\%BinaryName%.exe" "%ReleasePath%\AppX\"
|
||||
|
||||
MakeAppx.exe pack /d "%ReleasePath%\AppX" /l /p ..\out\Debug\%BinaryName%.appx
|
||||
if %errorlevel% neq 0 goto error
|
||||
|
||||
call "%SignAppxPath%" "..\out\Debug\%BinaryName%.appx"
|
||||
|
||||
move "%ReleasePath%\%BinaryName%.appx" "%ReleasePath%\AppX\"
|
||||
|
||||
echo Done.
|
||||
|
||||
exit /b
|
||||
|
||||
: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!
|
||||
)
|
||||
Reference in New Issue
Block a user