Version 1.0.6: fixing some critical issues in audio handling.

OnPropertyValueChanged() is called sometimes couple times a second
and sometimes when AudioMutex is locked already causing a deadlock.

Also some code added to support Desktop Bridge converter to UWP app.
This commit is contained in:
John Preston 2017-02-01 13:12:52 +03:00
parent da2191e9d5
commit 686abd63b5
21 changed files with 268 additions and 108 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

View file

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<Package
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities">
<Identity Name="TelegramDesktop"
ProcessorArchitecture="x64"
Publisher="CN=Telegram Messenger LLP, O=Telegram Messenger LLP, L=London, C=GB"
Version="1.0.6.0" />
<Properties>
<DisplayName>Telegram Desktop</DisplayName>
<PublisherDisplayName>Reserved</PublisherDisplayName>
<Description>No description entered</Description>
<Logo>Assets\logo.png</Logo>
</Properties>
<Resources>
<Resource Language="en-us" />
</Resources>
<Dependencies>
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="1.0.6.0" MaxVersionTested="10.0.14316.0" />
</Dependencies>
<Capabilities>
<rescap:Capability Name="runFullTrust"/>
</Capabilities>
<Applications>
<Application Id="Telegram.TelegramDesktop.Store" Executable="Telegram.exe" EntryPoint="Windows.FullTrustApplication">
<uap:VisualElements
BackgroundColor="#0e6b99"
DisplayName="Telegram Desktop"
Square150x150Logo="Assets\logo150.png"
Square44x44Logo="Assets\logo44.png"
Description="Telegram Desktop official messenger" />
</Application>
</Applications>
</Package>

View file

@ -0,0 +1,6 @@
[Files]
"..\out\Release\Telegram.exe" "Telegram.exe"
"Resources\uwp\appxmanifest.xml" "AppxManifest.xml"
"Resources\art\uwp\logo.png" "Assets\logo.png"
"Resources\art\uwp\logo44.png" "Assets\logo44.png"
"Resources\art\uwp\logo150.png" "Assets\logo150.png"

View file

@ -34,8 +34,8 @@ IDI_ICON1 ICON "..\\art\\icon256.ico"
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,5,0
PRODUCTVERSION 1,0,5,0
FILEVERSION 1,0,6,0
PRODUCTVERSION 1,0,6,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@ -51,10 +51,10 @@ BEGIN
BLOCK "040904b0"
BEGIN
VALUE "CompanyName", "Telegram Messenger LLP"
VALUE "FileVersion", "1.0.5.0"
VALUE "FileVersion", "1.0.6.0"
VALUE "LegalCopyright", "Copyright (C) 2014-2017"
VALUE "ProductName", "Telegram Desktop"
VALUE "ProductVersion", "1.0.5.0"
VALUE "ProductVersion", "1.0.6.0"
END
END
BLOCK "VarFileInfo"

View file

@ -25,8 +25,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,5,0
PRODUCTVERSION 1,0,5,0
FILEVERSION 1,0,6,0
PRODUCTVERSION 1,0,6,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@ -43,10 +43,10 @@ BEGIN
BEGIN
VALUE "CompanyName", "Telegram Messenger LLP"
VALUE "FileDescription", "Telegram Updater"
VALUE "FileVersion", "1.0.5.0"
VALUE "FileVersion", "1.0.6.0"
VALUE "LegalCopyright", "Copyright (C) 2014-2017"
VALUE "ProductName", "Telegram Desktop"
VALUE "ProductVersion", "1.0.5.0"
VALUE "ProductVersion", "1.0.6.0"
END
END
BLOCK "VarFileInfo"

View file

@ -24,7 +24,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#define BETA_VERSION_MACRO (0ULL)
constexpr int AppVersion = 1000005;
constexpr str_const AppVersionStr = "1.0.5";
constexpr int AppVersion = 1000006;
constexpr str_const AppVersionStr = "1.0.6";
constexpr bool AppAlphaVersion = false;
constexpr uint64 AppBetaVersion = BETA_VERSION_MACRO;

View file

@ -331,7 +331,9 @@ namespace Logs {
} else {
cForceWorkingDir(psAppDataPath());
workingDirChosen = true;
#endif // Q_OS_WINRT
#elif defined OS_WIN_STORE
cForceWorkingDir(psAppDataPath());
#endif // OS_WIN_STORE
}
LogsData = new LogsDataFields();

View file

@ -21,6 +21,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "stdafx.h"
#include "platform/win/audio_win.h"
#include "platform/win/windows_dlls.h"
#include "media/media_audio.h"
#include <mmdeviceapi.h>
@ -73,13 +74,42 @@ STDMETHODIMP DeviceListener::QueryInterface(REFIID iid, void** object) {
}
STDMETHODIMP DeviceListener::OnPropertyValueChanged(LPCWSTR device_id, const PROPERTYKEY key) {
LOG(("Audio Info: OnPropertyValueChanged() scheduling detach from audio device."));
Media::Player::DetachFromDeviceByTimer();
auto deviceName = device_id ? '"' + QString::fromWCharArray(device_id) + '"' : QString("nullptr");
constexpr auto kKeyBufferSize = 1024;
WCHAR keyBuffer[kKeyBufferSize] = { 0 };
auto hr = Dlls::PSStringFromPropertyKey(key, keyBuffer, kKeyBufferSize);
auto keyName = Dlls::PSStringFromPropertyKey ? (SUCCEEDED(hr) ? '"' + QString::fromWCharArray(keyBuffer) + '"' : QString("unknown")) : QString("unsupported");
// BAD GUID { 0xD4EF3098, 0xC967, 0x4A4E, { 0xB2, 0x19, 0xAC, 0xB6, 0xDA, 0x1D, 0xC3, 0x73 } };
// BAD GUID { 0x3DE556E2, 0xE087, 0x4721, { 0xBE, 0x97, 0xEC, 0x16, 0x2D, 0x54, 0x81, 0xF8 } };
// VERY BAD GUID { 0x91F1336D, 0xC37C, 0x4C48, { 0xAD, 0xEB, 0x92, 0x17, 0x2F, 0xA8, 0x7E, 0xEB } };
// It is fired somewhere from CloseAudioPlaybackDevice() causing deadlock on AudioMutex.
// Sometimes unknown value change events come very frequently, like each 0.5 seconds.
// So we will handle only special value change events from mmdeviceapi.h
constexpr GUID pkey_AudioEndpoint = { 0x1da5d803, 0xd492, 0x4edd, { 0x8c, 0x23, 0xe0, 0xc0, 0xff, 0xee, 0x7f, 0x0e } };
constexpr GUID pkey_AudioEngine_Device = { 0xf19f064d, 0x82c, 0x4e27, { 0xbc, 0x73, 0x68, 0x82, 0xa1, 0xbb, 0x8e, 0x4c } };
constexpr GUID pkey_AudioEngine_OEM = { 0xe4870e26, 0x3cc5, 0x4cd2, { 0xba, 0x46, 0xca, 0xa, 0x9a, 0x70, 0xed, 0x4 } };
constexpr GUID pkey_AudioUnknown1 = { 0x3d6e1656, 0x2e50, 0x4c4c, { 0x8d, 0x85, 0xd0, 0xac, 0xae, 0x3c, 0x6c, 0x68 } };
constexpr GUID pkey_AudioUnknown2 = { 0x624f56de, 0xfd24, 0x473e, { 0x81, 0x4a, 0xde, 0x40, 0xaa, 0xca, 0xed, 0x16 } };
if (key.fmtid == pkey_AudioEndpoint
|| key.fmtid == pkey_AudioEngine_Device
|| key.fmtid == pkey_AudioEngine_OEM
|| key.fmtid == pkey_AudioUnknown1
|| key.fmtid == pkey_AudioUnknown2) {
LOG(("Audio Info: OnPropertyValueChanged(%1, %2) scheduling detach from audio device.").arg(deviceName).arg(keyName));
Media::Player::DetachFromDeviceByTimer();
} else {
DEBUG_LOG(("Audio Info: OnPropertyValueChanged(%1, %2) unknown, skipping.").arg(deviceName).arg(keyName));
}
return S_OK;
}
STDMETHODIMP DeviceListener::OnDeviceStateChanged(LPCWSTR device_id, DWORD new_state) {
LOG(("Audio Info: OnDeviceStateChanged() scheduling detach from audio device."));
auto deviceName = device_id ? '"' + QString::fromWCharArray(device_id) + '"' : QString("nullptr");
LOG(("Audio Info: OnDeviceStateChanged(%1, %2) scheduling detach from audio device.").arg(deviceName).arg(new_state));
Media::Player::DetachFromDeviceByTimer();
return S_OK;
}

View file

@ -39,7 +39,11 @@ namespace {
const PROPERTYKEY pkey_AppUserModel_ID = { { 0x9F4C2855, 0x9F79, 0x4B39, { 0xA8, 0xD0, 0xE1, 0xD4, 0x2D, 0xE1, 0xD5, 0xF3 } }, 5 };
const PROPERTYKEY pkey_AppUserModel_StartPinOption = { { 0x9F4C2855, 0x9F79, 0x4B39, { 0xA8, 0xD0, 0xE1, 0xD4, 0x2D, 0xE1, 0xD5, 0xF3 } }, 12 };
#ifdef OS_WIN_STORE
const WCHAR AppUserModelIdRelease[] = L"Telegram.TelegramDesktop.Store";
#else // OS_WIN_STORE
const WCHAR AppUserModelIdRelease[] = L"Telegram.TelegramDesktop";
#endif // OS_WIN_STORE
const WCHAR AppUserModelIdBeta[] = L"Telegram.TelegramDesktop.Beta";
} // namespace

View file

@ -55,6 +55,7 @@ f_RoGetActivationFactory RoGetActivationFactory;
f_WindowsCreateStringReference WindowsCreateStringReference;
f_WindowsDeleteString WindowsDeleteString;
f_PropVariantToString PropVariantToString;
f_PSStringFromPropertyKey PSStringFromPropertyKey;
HINSTANCE LibUxTheme;
HINSTANCE LibShell32;
@ -89,6 +90,7 @@ void start() {
LibPropSys = LoadLibrary(L"PROPSYS.DLL");
load(LibPropSys, "PropVariantToString", PropVariantToString);
load(LibPropSys, "PSStringFromPropertyKey", PSStringFromPropertyKey);
if (version >= QSysInfo::WV_WINDOWS8) {
LibComBase = LoadLibrary(L"COMBASE.DLL");

View file

@ -82,6 +82,9 @@ extern f_WTSUnRegisterSessionNotification WTSUnRegisterSessionNotification;
typedef HRESULT (FAR STDAPICALLTYPE *f_PropVariantToString)(_In_ REFPROPVARIANT propvar, _Out_writes_(cch) PWSTR psz, _In_ UINT cch);
extern f_PropVariantToString PropVariantToString;
typedef HRESULT (FAR STDAPICALLTYPE *f_PSStringFromPropertyKey)(_In_ REFPROPERTYKEY pkey, _Out_writes_(cch) LPWSTR psz, _In_ UINT cch);
extern f_PSStringFromPropertyKey PSStringFromPropertyKey;
// COMBASE.DLL
typedef HRESULT (FAR STDAPICALLTYPE *f_RoGetActivationFactory)(_In_ HSTRING activatableClassId, _In_ REFIID iid, _COM_Outptr_ void ** factory);
@ -93,5 +96,7 @@ extern f_WindowsCreateStringReference WindowsCreateStringReference;
typedef HRESULT (FAR STDAPICALLTYPE *f_WindowsDeleteString)(_In_opt_ HSTRING string);
extern f_WindowsDeleteString WindowsDeleteString;
} // namespace Dlls
} // namespace Platform

View file

@ -362,7 +362,11 @@ QString psAppDataPath() {
WCHAR wstrPath[maxFileLen];
if (GetEnvironmentVariable(L"APPDATA", wstrPath, maxFileLen)) {
QDir appData(QString::fromStdWString(std::wstring(wstrPath)));
#ifdef OS_WIN_STORE
return appData.absolutePath() + qsl("/Telegram Desktop UWP/");
#else // OS_WIN_STORE
return appData.absolutePath() + '/' + str_const_toString(AppName) + '/';
#endif // OS_WIN_STORE
}
return QString();
}

View file

@ -3,6 +3,14 @@ setlocal enabledelayedexpansion
set "FullScriptPath=%~dp0"
set "FullExecPath=%cd%"
set "BuildPlatform=%1"
if "%BuildPlatform%" neq "uwp" (
set "BuildUWP=0"
) else (
set "BuildUWP=1"
)
if not exist "%FullScriptPath%..\..\..\TelegramPrivate" (
echo.
echo This script is for building the production version of Telegram Desktop.
@ -31,7 +39,11 @@ if %BetaVersion% neq 0 (
)
echo.
echo Building version %AppVersionStrFull% for Windows..
if %BuildUWP% neq 0 (
echo Building version %AppVersionStrFull% for UWP..
) else (
echo Building version %AppVersionStrFull% for Windows..
)
echo.
set "HomePath=%FullScriptPath%.."
@ -43,6 +55,7 @@ set "PortableFile=tportable.%AppVersionStrFull%.zip"
set "ReleasePath=%HomePath%\..\out\Release"
set "DeployPath=%ReleasePath%\deploy\%AppVersionStrMajor%\%AppVersionStrFull%"
set "SignPath=%HomePath%\..\..\TelegramPrivate\Sign.bat"
set "SignAppxPath=%HomePath%\..\..\TelegramPrivate\AppxSign.bat"
set "BinaryName=Telegram"
set "DropboxSymbolsPath=X:\Telegram\symbols"
set "FinalReleasePath=Y:\TBuild\tother\tsetup"
@ -58,6 +71,10 @@ if not exist %FinalReleasePath% (
)
if %BetaVersion% neq 0 (
if %BuildUWP% neq 0 (
echo Can not build UWP version from a closed beta!
exit /b 1
)
if exist %DeployPath%\ (
echo Deploy folder for version %AppVersionStr% already exists!
exit /b 1
@ -67,25 +84,47 @@ if %BetaVersion% neq 0 (
exit /b 1
)
) else (
if exist %ReleasePath%\deploy\%AppVersionStrMajor%\%AppVersionStr%.alpha\ (
echo Deploy folder for version %AppVersionStr%.alpha already exists!
exit /b 1
)
if exist %ReleasePath%\deploy\%AppVersionStrMajor%\%AppVersionStr%.dev\ (
echo Deploy folder for version %AppVersionStr%.dev already exists!
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
if %BuildUWP% neq 0 (
if "%AlphaBetaParam%" neq "" (
echo Can not build UWP version from an alpha!
exit /b 1
)
if exist %ReleasePath%\deploy\%AppVersionStrMajor%\%AppVersionStr%\uwp\ (
echo UWP deploy folder for version %AppVersionStr% already exists!
exit /b 1
)
if not exist %ReleasePath%\deploy\%AppVersionStrMajor%\%AppVersionStr%\ (
echo Deploy folder for version %AppVersionStr% does not exist!
exit /b 1
)
) else (
if exist %ReleasePath%\deploy\%AppVersionStrMajor%\%AppVersionStr%.alpha\ (
echo Deploy folder for version %AppVersionStr%.alpha already exists!
exit /b 1
)
if exist %ReleasePath%\deploy\%AppVersionStrMajor%\%AppVersionStr%.dev\ (
echo Deploy folder for version %AppVersionStr%.dev already exists!
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
)
)
)
cd "%HomePath%"
if %BuildUWP% neq 0 (
echo uwp > build\target
) else (
echo win > build\target
)
call gyp\refresh.bat
if %errorlevel% neq 0 goto error
@ -93,9 +132,9 @@ cd "%SolutionPath%"
call ninja -C out/Release Telegram
if %errorlevel% neq 0 goto error
echo .
echo.
echo Version %AppVersionStrFull% build successfull. Preparing..
echo .
echo.
echo Dumping debug symbols..
xcopy "%ReleasePath%\%BinaryName%.exe" "%ReleasePath%\%BinaryName%.exe.exe*"
@ -109,43 +148,52 @@ cd "%ReleasePath%"
call "%SignPath%" "%BinaryName%.exe"
if %errorlevel% neq 0 goto error
call "%SignPath%" "Updater.exe"
if %errorlevel% neq 0 goto error
if %BuildUWP% neq 0 (
cd "%HomePath%"
if %BetaVersion% equ 0 (
iscc /dMyAppVersion=%AppVersionStrSmall% /dMyAppVersionZero=%AppVersionStr% /dMyAppVersionFull=%AppVersionStrFull% "/dReleasePath=%ReleasePath%" "%FullScriptPath%setup.iss"
MakeAppx.exe pack /f Resources\uwp\mapping /p ..\out\Release\%BinaryName%.appx
if %errorlevel% neq 0 goto error
if not exist "tsetup.%AppVersionStrFull%.exe" goto error
call "%SignPath%" "tsetup.%AppVersionStrFull%.exe"
call "%SignAppxPath%" "..\out\Release\%BinaryName%.appx"
) else (
call "%SignPath%" "Updater.exe"
if %errorlevel% neq 0 goto error
)
call Packer.exe -version %VersionForPacker% -path %BinaryName%.exe -path Updater.exe %AlphaBetaParam%
if %errorlevel% neq 0 goto error
if %BetaVersion% equ 0 (
iscc /dMyAppVersion=%AppVersionStrSmall% /dMyAppVersionZero=%AppVersionStr% /dMyAppVersionFull=%AppVersionStrFull% "/dReleasePath=%ReleasePath%" "%FullScriptPath%setup.iss"
if %errorlevel% neq 0 goto error
if not exist "tsetup.%AppVersionStrFull%.exe" goto error
if %BetaVersion% neq 0 (
if not exist "%ReleasePath%\%BetaKeyFile%" (
echo Beta version key file not found!
exit /b 1
call "%SignPath%" "tsetup.%AppVersionStrFull%.exe"
if %errorlevel% neq 0 goto error
)
FOR /F "tokens=1* delims= " %%i in (%ReleasePath%\%BetaKeyFile%) do set "BetaSignature=%%i"
)
if %errorlevel% neq 0 goto error
call Packer.exe -version %VersionForPacker% -path %BinaryName%.exe -path Updater.exe %AlphaBetaParam%
if %errorlevel% neq 0 goto error
if %BetaVersion% neq 0 (
set "UpdateFile=%UpdateFile%_%BetaSignature%"
set "PortableFile=tbeta%BetaVersion%_%BetaSignature%.zip"
if %BetaVersion% neq 0 (
if not exist "%ReleasePath%\%BetaKeyFile%" (
echo Beta version key file not found!
exit /b 1
)
FOR /F "tokens=1* delims= " %%i in (%ReleasePath%\%BetaKeyFile%) do set "BetaSignature=%%i"
)
if %errorlevel% neq 0 goto error
if %BetaVersion% neq 0 (
set "UpdateFile=%UpdateFile%_%BetaSignature%"
set "PortableFile=tbeta%BetaVersion%_%BetaSignature%.zip"
)
)
for /f ^"usebackq^ eol^=^
^ delims^=^" %%a in (%ReleasePath%\%BinaryName%.exe.sym) do (
set "SymbolsHashLine=%%a"
goto symbolslinedone
)
:symbolslinedone
set "SymbolsHashLine=%%a"
goto symbolslinedone
)
:symbolslinedone
FOR /F "tokens=1,2,3,4* delims= " %%i in ("%SymbolsHashLine%") do set "SymbolsHash=%%l"
echo Copying %BinaryName%.exe.sym to %DropboxSymbolsPath%\%BinaryName%.exe.pdb\%SymbolsHash%
@ -154,61 +202,71 @@ if not exist %DropboxSymbolsPath%\%BinaryName%.exe.pdb\%SymbolsHash% mkdir %Drop
move "%ReleasePath%\%BinaryName%.exe.sym" %DropboxSymbolsPath%\%BinaryName%.exe.pdb\%SymbolsHash%\
echo Done!
if not exist "%ReleasePath%\deploy" mkdir "%ReleasePath%\deploy"
if not exist "%ReleasePath%\deploy\%AppVersionStrMajor%" mkdir "%ReleasePath%\deploy\%AppVersionStrMajor%"
mkdir "%DeployPath%"
mkdir "%DeployPath%\%BinaryName%"
if %errorlevel% neq 0 goto error
move "%ReleasePath%\%BinaryName%.exe" "%DeployPath%\%BinaryName%\"
move "%ReleasePath%\Updater.exe" "%DeployPath%\"
xcopy "%ReleasePath%\%BinaryName%.pdb" "%DeployPath%\"
xcopy "%ReleasePath%\Updater.pdb" "%DeployPath%\"
move "%ReleasePath%\%BinaryName%.exe.pdb" "%DeployPath%\"
move "%ReleasePath%\Updater.exe.pdb" "%DeployPath%\"
if %BetaVersion% equ 0 (
move "%ReleasePath%\%SetupFile%" "%DeployPath%\"
if %BuildUWP% neq 0 (
mkdir "%DeployPath%\uwp"
move "%ReleasePath%\%BinaryName%.exe" "%DeployPath%\uwp\"
xcopy "%ReleasePath%\%BinaryName%.pdb" "%DeployPath%\uwp\"
move "%ReleasePath%\%BinaryName%.exe.pdb" "%DeployPath%\uwp\"
move "%ReleasePath%\Telegram.appx" "%DeployPath%\uwp\"
) else (
move "%ReleasePath%\%BetaKeyFile%" "%DeployPath%\"
if not exist "%ReleasePath%\deploy" mkdir "%ReleasePath%\deploy"
if not exist "%ReleasePath%\deploy\%AppVersionStrMajor%" mkdir "%ReleasePath%\deploy\%AppVersionStrMajor%"
mkdir "%DeployPath%"
mkdir "%DeployPath%\%BinaryName%"
if %errorlevel% neq 0 goto error
move "%ReleasePath%\%BinaryName%.exe" "%DeployPath%\%BinaryName%\"
move "%ReleasePath%\Updater.exe" "%DeployPath%\"
xcopy "%ReleasePath%\%BinaryName%.pdb" "%DeployPath%\"
xcopy "%ReleasePath%\Updater.pdb" "%DeployPath%\"
move "%ReleasePath%\%BinaryName%.exe.pdb" "%DeployPath%\"
move "%ReleasePath%\Updater.exe.pdb" "%DeployPath%\"
if %BetaVersion% equ 0 (
move "%ReleasePath%\%SetupFile%" "%DeployPath%\"
) else (
move "%ReleasePath%\%BetaKeyFile%" "%DeployPath%\"
)
move "%ReleasePath%\%UpdateFile%" "%DeployPath%\"
if %errorlevel% neq 0 goto error
cd "%DeployPath%"
7z a -mx9 %PortableFile% %BinaryName%\
if %errorlevel% neq 0 goto error
)
move "%ReleasePath%\%UpdateFile%" "%DeployPath%\"
if %errorlevel% neq 0 goto error
cd "%DeployPath%"
7z a -mx9 %PortableFile% %BinaryName%\
if %errorlevel% neq 0 goto error
if %BuildUWP% equ 0 (
echo.
echo Version %AppVersionStrFull% is ready for deploy!
echo.
echo .
echo Version %AppVersionStrFull% is ready for deploy!
echo .
set "FinalDeployPath=%FinalReleasePath%\%AppVersionStrMajor%\%AppVersionStrFull%"
set "FinalDeployPath=%FinalReleasePath%\%AppVersionStrMajor%\%AppVersionStrFull%"
if not exist "%DeployPath%\%UpdateFile%" goto error
if not exist "%DeployPath%\%PortableFile%" goto error
if %BetaVersion% equ 0 (
if not exist "%DeployPath%\%SetupFile%" goto error
)
if not exist "%DeployPath%\%BinaryName%.pdb" goto error
if not exist "%DeployPath%\%BinaryName%.exe.pdb" goto error
if not exist "%DeployPath%\Updater.exe" goto error
if not exist "%DeployPath%\Updater.pdb" goto error
if not exist "%DeployPath%\Updater.exe.pdb" goto error
if not exist "%FinalReleasePath%\%AppVersionStrMajor%" mkdir "%FinalReleasePath%\%AppVersionStrMajor%"
if not exist "%FinalDeployPath%" mkdir "%FinalDeployPath%"
if not exist "%DeployPath%\%UpdateFile%" goto error
if not exist "%DeployPath%\%PortableFile%" goto error
if %BetaVersion% equ 0 (
if not exist "%DeployPath%\%SetupFile%" goto error
xcopy "%DeployPath%\%UpdateFile%" "%FinalDeployPath%\"
xcopy "%DeployPath%\%PortableFile%" "%FinalDeployPath%\"
if %BetaVersion% equ 0 (
xcopy "%DeployPath%\%SetupFile%" "%FinalDeployPath%\"
) else (
xcopy "%DeployPath%\%BetaKeyFile%" "%FinalDeployPath%\" /Y
)
xcopy "%DeployPath%\%BinaryName%.pdb" "%FinalDeployPath%\"
xcopy "%DeployPath%\%BinaryName%.exe.pdb" "%FinalDeployPath%\"
xcopy "%DeployPath%\Updater.exe" "%FinalDeployPath%\"
xcopy "%DeployPath%\Updater.pdb" "%FinalDeployPath%\"
xcopy "%DeployPath%\Updater.exe.pdb" "%FinalDeployPath%\"
)
if not exist "%DeployPath%\%BinaryName%.pdb" goto error
if not exist "%DeployPath%\%BinaryName%.exe.pdb" goto error
if not exist "%DeployPath%\Updater.exe" goto error
if not exist "%DeployPath%\Updater.pdb" goto error
if not exist "%DeployPath%\Updater.exe.pdb" goto error
if not exist "%FinalReleasePath%\%AppVersionStrMajor%" mkdir "%FinalReleasePath%\%AppVersionStrMajor%"
if not exist "%FinalDeployPath%" mkdir "%FinalDeployPath%"
xcopy "%DeployPath%\%UpdateFile%" "%FinalDeployPath%\"
xcopy "%DeployPath%\%PortableFile%" "%FinalDeployPath%\"
if %BetaVersion% equ 0 (
xcopy "%DeployPath%\%SetupFile%" "%FinalDeployPath%\"
) else (
xcopy "%DeployPath%\%BetaKeyFile%" "%FinalDeployPath%\" /Y
)
xcopy "%DeployPath%\%BinaryName%.pdb" "%FinalDeployPath%\"
xcopy "%DeployPath%\%BinaryName%.exe.pdb" "%FinalDeployPath%\"
xcopy "%DeployPath%\Updater.exe" "%FinalDeployPath%\"
xcopy "%DeployPath%\Updater.pdb" "%FinalDeployPath%\"
xcopy "%DeployPath%\Updater.exe.pdb" "%FinalDeployPath%\"
echo Version %AppVersionStrFull% is ready!

View file

@ -103,6 +103,10 @@ call :repl "Replace=(PRODUCTVERSION) (\s*)\d+,\d+,\d+,\d+/$1$2 %VersionMajor%,%V
call :repl "Replace=(&quot;FileVersion&quot;,) (\s*)&quot;\d+.\d+.\d+.\d+&quot;/$1$2 &quot;%VersionMajor%.%VersionMinor%.%VersionPatch%.%VersionBeta%&quot;" "Filename=%ResourcePath%" || goto :error
call :repl "Replace=(&quot;ProductVersion&quot;,) (\s*)&quot;\d+.\d+.\d+.\d+&quot;/$1$2 &quot;%VersionMajor%.%VersionMinor%.%VersionPatch%.%VersionBeta%&quot;" "Filename=%ResourcePath%" || goto :error
echo Patching appxmanifest.xml...
set "ResourcePath=%FullScriptPath%..\Resources\uwp\appxmanifest.xml"
call :repl "Replace=(Version=)&quot;\d+.\d+.\d+.\d+&quot;/$1&quot;%VersionMajor%.%VersionMinor%.%VersionPatch%.%VersionBeta%&quot;" "Filename=%ResourcePath%" || goto :error
exit /b
:error

View file

@ -1,6 +1,6 @@
AppVersion 1000005
AppVersion 1000006
AppVersionStrMajor 1.0
AppVersionStrSmall 1.0.5
AppVersionStr 1.0.5
AppVersionStrSmall 1.0.6
AppVersionStr 1.0.6
AlphaChannel 0
BetaVersion 0

View file

@ -92,6 +92,11 @@
}, {
'build_macstore': 0,
}],
[ '"<(official_build_target)" == "uwp"', {
'build_uwp': 1,
}, {
'build_uwp': 0,
}],
],
'ld_lib_prefix': '<(ld_lib_prefix)',
'ld_lib_postfix': '<(ld_lib_postfix)',

View file

@ -44,7 +44,7 @@
],
'conditions': [
[ '"<(official_build_target)" != "" and "<(official_build_target)" != "linux"', {
'sources': [ '__Wrong_Official_Build_Target__' ],
'sources': [ '__Wrong_Official_Build_Target_<(official_build_target)_' ],
}],
],
}, {

View file

@ -109,7 +109,7 @@
},
},
'conditions': [
[ '"<(official_build_target)" != "" and "<(official_build_target)" != "win"', {
[ '"<(official_build_target)" != "" and "<(official_build_target)" != "win" and "<(official_build_target)" != "uwp"', {
'sources': [ '__Wrong_Official_Build_Target__' ],
}],
],

View file

@ -88,5 +88,10 @@
],
},
},
}], [ 'build_uwp', {
'defines': [
'TDESKTOP_DISABLE_AUTOUPDATE',
'OS_WIN_STORE',
]
}]],
}