Stable 0.10.6 (only for OS X): fixing Updater erasing.

This commit is contained in:
John Preston 2016-09-12 18:48:01 +03:00
parent a62a47098e
commit ffe75444d1
5 changed files with 28 additions and 13 deletions

View File

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

View File

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

View File

@ -160,6 +160,21 @@ int main(int argc, const char * argv[]) {
writeLog([@"Starting update files iteration, path: " stringByAppendingString: srcEnum]); writeLog([@"Starting update files iteration, path: " stringByAppendingString: srcEnum]);
// Take the Updater (this currently running binary) from the place where it was placed by Telegram
// and copy it to the folder with the new version of the app (ready),
// so it won't be deleted when we will clear the "Telegram.app/Contents" folder.
NSString *oldVersionUpdaterPath = [appDirFull stringByAppendingString: @"/Contents/Frameworks/Updater" ];
NSString *newVersionUpdaterPath = [srcEnum stringByAppendingString:[[NSArray arrayWithObjects:@"/", appName, @"/Contents/Frameworks/Updater", nil] componentsJoinedByString:@""]];
writeLog([[NSArray arrayWithObjects: @"Copying Updater from old path ", oldVersionUpdaterPath, @" to new path ", newVersionUpdaterPath, nil] componentsJoinedByString:@""]);
if (![fileManager fileExistsAtPath:newVersionUpdaterPath]) {
if (![fileManager copyItemAtPath:oldVersionUpdaterPath toPath:newVersionUpdaterPath error:nil]) {
writeLog([[NSArray arrayWithObjects: @"Failed to copy file from ", oldVersionUpdaterPath, @" to ", newVersionUpdaterPath, nil] componentsJoinedByString:@""]);
delFolder();
return -1;
}
}
NSString *contentsPath = [appDirFull stringByAppendingString: @"/Contents"]; NSString *contentsPath = [appDirFull stringByAppendingString: @"/Contents"];
writeLog([[NSArray arrayWithObjects: @"Clearing dir ", contentsPath, nil] componentsJoinedByString:@""]); writeLog([[NSArray arrayWithObjects: @"Clearing dir ", contentsPath, nil] componentsJoinedByString:@""]);
if (![fileManager removeItemAtPath:contentsPath error:nil]) { if (![fileManager removeItemAtPath:contentsPath error:nil]) {

View File

@ -24,7 +24,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
#define BETA_VERSION_MACRO (0ULL) #define BETA_VERSION_MACRO (0ULL)
constexpr int AppVersion = 10005; constexpr int AppVersion = 10006;
constexpr str_const AppVersionStr = "0.10.5"; constexpr str_const AppVersionStr = "0.10.6";
constexpr bool AppAlphaVersion = false; constexpr bool AppAlphaVersion = false;
constexpr uint64 AppBetaVersion = BETA_VERSION_MACRO; constexpr uint64 AppBetaVersion = BETA_VERSION_MACRO;

View File

@ -1,6 +1,6 @@
AppVersion 10005 AppVersion 10006
AppVersionStrMajor 0.10 AppVersionStrMajor 0.10
AppVersionStrSmall 0.10.5 AppVersionStrSmall 0.10.6
AppVersionStr 0.10.5 AppVersionStr 0.10.6
AlphaChannel 0 AlphaChannel 0
BetaVersion 0 BetaVersion 0