From c1c4314e527d0e22fe9d2516d0b5b115f28a2eb6 Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 20 Jul 2021 17:37:09 +0300 Subject: [PATCH] Pack compiler to portable / store version. --- Telegram/CMakeLists.txt | 2 +- Telegram/build/build.bat | 33 ++++++++------------------------- Telegram/build/setup.iss | 4 ++-- 3 files changed, 11 insertions(+), 28 deletions(-) diff --git a/Telegram/CMakeLists.txt b/Telegram/CMakeLists.txt index 22034b21e..a0894fe1d 100644 --- a/Telegram/CMakeLists.txt +++ b/Telegram/CMakeLists.txt @@ -1443,7 +1443,7 @@ if ((NOT DESKTOP_APP_DISABLE_AUTOUPDATE OR APPLE) AND NOT build_macstore AND NOT endif() if (DESKTOP_APP_SPECIAL_TARGET) - add_executable(Packer WIN32) + add_executable(Packer) init_target(Packer) add_dependencies(Telegram Packer) diff --git a/Telegram/build/build.bat b/Telegram/build/build.bat index 6826f3b85..97683e436 100644 --- a/Telegram/build/build.bat +++ b/Telegram/build/build.bat @@ -206,13 +206,7 @@ if %BuildUWP% equ 0 ( ) ) - if %Build64% neq 0 ( - set "ModulesFolder=x64" - ) else ( - set "ModulesFolder=x86" - ) - - call Packer.exe -version %VersionForPacker% -path %BinaryName%.exe -path Updater.exe -path "modules\!ModulesFolder!\d3d\d3dcompiler_47.dll" -target %BuildTarget% %AlphaBetaParam% + call Packer.exe -version %VersionForPacker% -path %BinaryName%.exe -path Updater.exe -path "modules\%Platform%\d3d\d3dcompiler_47.dll" -target %BuildTarget% %AlphaBetaParam% if %errorlevel% neq 0 goto error if %AlphaVersion% neq 0 ( @@ -249,24 +243,17 @@ echo Done! if %BuildUWP% neq 0 ( cd "%HomePath%" - mkdir "%ReleasePath%\AppX" + mkdir "%ReleasePath%\AppX\modules\%Platform%\d3d" xcopy "Resources\uwp\AppX\*" "%ReleasePath%\AppX\" /E set "ResourcePath=%ReleasePath%\AppX\AppxManifest.xml" - if %Build64% equ 0 ( - call :repl "Argument= (ProcessorArchitecture=)"ARCHITECTURE"/ $1"x86"" "Filename=!ResourcePath!" || goto error - ) else ( - call :repl "Argument= (ProcessorArchitecture=)"ARCHITECTURE"/ $1"x64"" "Filename=!ResourcePath!" || goto error - ) + call :repl "Argument= (ProcessorArchitecture=)"ARCHITECTURE"/ $1"%Platform%"" "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\" + xcopy "%ReleasePath%\modules\%Platform%\d3d\d3dcompiler_47.dll" "%ReleasePath%\AppX\modules\%Platform%\d3d\" - if %Build64% equ 0 ( - MakeAppx.exe pack /d "%ReleasePath%\AppX" /l /p ..\out\Release\%BinaryName%.x86.appx - ) else ( - MakeAppx.exe pack /d "%ReleasePath%\AppX" /l /p ..\out\Release\%BinaryName%.x64.appx - ) + MakeAppx.exe pack /d "%ReleasePath%\AppX" /l /p ..\out\Release\%BinaryName%.%Platform%.appx if %errorlevel% neq 0 goto error if not exist "%ReleasePath%\deploy" mkdir "%ReleasePath%\deploy" @@ -274,11 +261,7 @@ if %BuildUWP% neq 0 ( mkdir "%DeployPath%" move "%ReleasePath%\%BinaryName%.pdb" "%DeployPath%\" - if %Build64% equ 0 ( - move "%ReleasePath%\%BinaryName%.x86.appx" "%DeployPath%\" - ) else ( - move "%ReleasePath%\%BinaryName%.x64.appx" "%DeployPath%\" - ) + move "%ReleasePath%\%BinaryName%.%Platform%.appx" "%DeployPath%\" move "%ReleasePath%\%BinaryName%.exe" "%DeployPath%\" if "%AlphaBetaParam%" equ "" ( @@ -289,11 +272,11 @@ if %BuildUWP% neq 0 ( ) else ( if not exist "%ReleasePath%\deploy" mkdir "%ReleasePath%\deploy" if not exist "%ReleasePath%\deploy\%AppVersionStrMajor%" mkdir "%ReleasePath%\deploy\%AppVersionStrMajor%" - mkdir "%DeployPath%" - mkdir "%DeployPath%\%BinaryName%" + mkdir "%DeployPath%\%BinaryName%\modules\%Platform%\d3d" if %errorlevel% neq 0 goto error move "%ReleasePath%\%BinaryName%.exe" "%DeployPath%\%BinaryName%\" + xcopy "%ReleasePath%\modules\%Platform%\d3d\d3dcompiler_47.dll" "%DeployPath%\%BinaryName%\modules\%Platform%\d3d\" move "%ReleasePath%\Updater.exe" "%DeployPath%\" move "%ReleasePath%\%BinaryName%.pdb" "%DeployPath%\" move "%ReleasePath%\Updater.pdb" "%DeployPath%\" diff --git a/Telegram/build/setup.iss b/Telegram/build/setup.iss index 1c7d7fd33..b0d352bf3 100644 --- a/Telegram/build/setup.iss +++ b/Telegram/build/setup.iss @@ -42,7 +42,7 @@ OutputBaseFilename=tsetup.{#MyAppVersionFull} #define ArchModulesFolder "x86" #endif -#define ModulesFolder "modules\{#ArchModulesFolder}" +#define ModulesFolder "modules\" + ArchModulesFolder [Languages] Name: "english"; MessagesFile: "compiler:Default.isl" @@ -62,7 +62,7 @@ Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescrip [Files] Source: "{#ReleasePath}\Telegram.exe"; DestDir: "{app}"; Flags: ignoreversion Source: "{#ReleasePath}\Updater.exe"; DestDir: "{app}"; Flags: ignoreversion -Source: "{#ReleasePath}\{#ModulesFolder}\d3d\d3dcompiler_47.dll; DestDir: "{app}\{#ModulesFolder}\d3d"; Flags: ignoreversion +Source: "{#ReleasePath}\{#ModulesFolder}\d3d\d3dcompiler_47.dll"; DestDir: "{app}\{#ModulesFolder}\d3d"; Flags: ignoreversion ; NOTE: Don't use "Flags: ignoreversion" on any shared system files [Icons]