From 069333b24da8a3e17aab8cf2bd558bd39d161503 Mon Sep 17 00:00:00 2001
From: John Preston <johnprestonmail@gmail.com>
Date: Thu, 24 Sep 2015 17:17:53 +0300
Subject: [PATCH] deply scripts improved, crash fixed in dropdown

---
 .gitignore                        |   1 +
 Telegram/Build.sh                 | 185 ++++++++++++++++++++++++++++++
 Telegram/BuildWin.bat             |  56 ++++-----
 Telegram/Deploy.sh                | 128 +++++++++++++++++++++
 Telegram/DeployLinux.sh           |  16 +--
 Telegram/DeployLinux32.sh         |  16 +--
 Telegram/DeployMacWin.sh          |  56 ++++-----
 Telegram/PrepareLinux.sh          |  22 ++--
 Telegram/PrepareLinux32.sh        |  22 ++--
 Telegram/PrepareMac.sh            |  22 ++--
 Telegram/Setup.iss                |   4 +-
 Telegram/SourceFiles/dropdown.cpp |   2 +-
 Telegram/Version                  |   1 -
 13 files changed, 425 insertions(+), 106 deletions(-)
 create mode 100644 Telegram/Build.sh
 create mode 100644 Telegram/Deploy.sh

diff --git a/.gitignore b/.gitignore
index b1c55d7e0..19c18e0cf 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
+/Telegram/Target
 /Telegram/GeneratedFiles/
 /Telegram/SourceFiles/art/grid.png
 /Telegram/SourceFiles/art/grid_125x.png
diff --git a/Telegram/Build.sh b/Telegram/Build.sh
new file mode 100644
index 000000000..13cc5145a
--- /dev/null
+++ b/Telegram/Build.sh
@@ -0,0 +1,185 @@
+while IFS='' read -r line || [[ -n "$line" ]]; do
+  set $line
+  eval $1="$2"
+done < Version
+
+AppVersionStrFull="$AppVersionStr"
+DevParam=''
+if [ "$DevChannel" != "0" ]; then
+  AppVersionStrFull="$AppVersionStr.dev"
+  DevParam='-dev'
+fi
+
+if [ ! -f "Target" ]; then
+  echo "Build target not found!"
+  exit 1
+fi
+
+while IFS='' read -r line || [[ -n "$line" ]]; do
+  BuildTarget="$line"
+done < Target
+
+echo ""
+if [ "$BuildTarget" == "linux" ]; then
+  echo "Building version $AppVersionStrFull for Linux 64bit.."
+  UpdateFile="tlinuxupd$AppVersion"
+  SetupFile="tsetup.$AppVersionStrFull.tar.xz"
+  ReleasePath="./../Linux/Release"
+elif [ "$BuildTarget" == "linux32" ]; then
+  echo "Building version $AppVersionStrFull for Linux 32bit.."
+  UpdateFile="tlinux32upd$AppVersion"
+  SetupFile="tsetup32.$AppVersionStrFull.tar.xz"
+  ReleasePath="./../Linux/Release"
+elif [ "$BuildTarget" == "mac" ]; then
+  echo "Building version $AppVersionStrFull for OS X 10.8+.."
+  UpdateFile="tmacupd$AppVersion"
+  SetupFile="tsetup.$AppVersionStrFull.dmg"
+  ReleasePath="./../Mac/Release"
+elif [ "$BuildTarget" == "mac32" ]; then
+  echo "Building version $AppVersionStrFull for OS X 10.6 and 10.7.."
+  UpdateFile="tmac32upd$AppVersion"
+  SetupFile="tsetup32.$AppVersionStrFull.dmg"
+  ReleasePath="./../Mac/Release"
+elif [ "$BuildTarget" == "macstore" ]; then
+  echo "Building version $AppVersionStrFull for Mac App Store.."
+  ReleasePath="./../Mac/Release"
+else
+  echo "Invalid target!"
+  exit 1
+fi
+
+#if [ "$BuildTarget" == "linux" ] || [ "$BuildTarget" == "linux32" ] || [ "$BuildTarget" == "mac" ] || [ "$BuildTarget" == "mac32" ] || [ "$BuildTarget" == "macstore" ]; then
+  if [ -d "$ReleasePath/deploy/$AppVersionStrMajor/$AppVersionStr.dev" ]; then
+    echo "Deploy folder for version $AppVersionStr.dev already exists!"
+    exit 1
+  fi
+
+  if [ -d "$ReleasePath/deploy/$AppVersionStrMajor/$AppVersionStr" ]; then
+    echo "Deploy folder for version $AppVersionStr already exists!"
+    exit 1
+  fi
+
+  if [ -f "$ReleasePath/$UpdateFile" ]; then
+    echo "Update file for version $AppVersion already exists!"
+    exit 1
+  fi
+
+  DeployPath="$ReleasePath/deploy/$AppVersionStrMajor/$AppVersionStrFull"
+#fi
+
+if [ "$BuildTarget" == "linux" ] || [ "$BuildTarget" == "linux32" ]; then
+  if [ ! -f "$ReleasePath/Telegram" ]; then
+    echo "Telegram not found!"
+    exit 1
+  fi
+
+  if [ ! -f "$ReleasePath/Updater" ]; then
+    echo "Updater not found!"
+    exit 1
+  fi
+
+  echo "Preparing version $AppVersionStrFull, executing Packer.."
+  cd $ReleasePath && ./Packer -path Telegram -path Updater -version $AppVersion $DevParam && cd ./../../Telegram
+  echo "Packer done!"
+
+  if [ ! -d "$ReleasePath/deploy" ]; then
+    mkdir "$ReleasePath/deploy"
+  fi
+
+  if [ ! -d "$ReleasePath/deploy/$AppVersionStrMajor" ]; then
+    mkdir "$ReleasePath/deploy/$AppVersionStrMajor"
+  fi
+
+  echo "Copying Telegram, Updater and $UpdateFile to deploy/$AppVersionStrMajor/$AppVersionStrFull..";
+  mkdir "$DeployPath"
+  mkdir "$DeployPath/Telegram"
+  mv $ReleasePath/Telegram $DeployPath/Telegram/
+  mv $ReleasePath/Updater $DeployPath/Telegram/
+  mv $ReleasePath/$UpdateFile $DeployPath/
+  cd $DeployPath && tar -cJvf $SetupFile Telegram/ && cd ./../../../../../Telegram
+fi
+
+if [ "$BuildTarget" == "mac" ] || [ "$BuildTarget" == "mac32" ]; then
+  if [ ! -d "$ReleasePath/Telegram.app" ]; then
+    echo "Telegram.app not found!"
+    exit 1
+  fi
+
+  if [ ! -d "$ReleasePath/Telegram.app.dSYM" ]; then
+    echo "Telegram.app.dSYM not found!"
+    exit 1
+  fi
+
+  AppUUID=`dwarfdump -u "$ReleasePath/Telegram.app/Contents/MacOS/Telegram" | awk -F " " '{print $2}'`
+  DsymUUID=`dwarfdump -u "$ReleasePath/Telegram.app.dSYM" | awk -F " " '{print $2}'`
+  if [ "$AppUUID" != "$DsymUUID" ]; then
+    echo "UUID of binary '$AppUUID' and dSYM '$DsymUUID' differ!"
+    exit 1
+  fi
+
+  if [ ! -f "$ReleasePath/Telegram.app/Contents/Resources/Icon.icns" ]; then
+    echo "Icon.icns not found in Resources!"
+    exit 1
+  fi
+
+  if [ ! -f "$ReleasePath/Telegram.app/Contents/MacOS/Telegram" ]; then
+    echo "Telegram not found in MacOS!"
+    exit 1
+  fi
+
+  if [ ! -f "$ReleasePath/Telegram.app/Contents/Frameworks/Updater" ]; then
+    echo "Updater not found in Frameworks!"
+    exit 1
+  fi
+
+  if [ ! -d "$ReleasePath/Telegram.app/Contents/_CodeSignature" ]; then
+    echo "Telegram signature not found!"
+    exit 1
+  fi
+
+  cd $ReleasePath
+  temppath=`hdiutil attach -readwrite tsetup.dmg | awk -F "\t" 'END {print $3}'`
+  cp -R ./Telegram.app "$temppath/"
+  bless --folder "$temppath/" --openfolder "$temppath/"
+  hdiutil detach "$temppath"
+  hdiutil convert tsetup.dmg -format UDZO -imagekey zlib-level=9 -ov -o $SetupFile
+  cd ./../../Telegram
+  cd $ReleasePath && ./Packer.app/Contents/MacOS/Packer -path Telegram.app -version $AppVersion $DevParam && cd ./../../Telegram
+
+  if [ ! -d "$ReleasePath/deploy" ]; then
+    mkdir "$ReleasePath/deploy"
+  fi
+
+  if [ ! -d "$ReleasePath/deploy/$AppVersionStrMajor" ]; then
+    mkdir "$ReleasePath/deploy/$AppVersionStrMajor"
+  fi
+
+  echo "Copying Telegram.app and $UpdateFile to deploy/$AppVersionStrMajor/$AppVersionStr..";
+  mkdir "$DeployPath"
+  mkdir "$DeployPath/Telegram"
+  cp -r $ReleasePath/Telegram.app $DeployPath/Telegram/
+  mv $ReleasePath/Telegram.app.dSYM $DeployPath/
+  rm $ReleasePath/Telegram.app/Contents/MacOS/Telegram
+  rm $ReleasePath/Telegram.app/Contents/Frameworks/Updater
+  rm -rf $ReleasePath/Telegram.app/Contents/_CodeSignature
+  mv $ReleasePath/$UpdateFile $DeployPath/
+  mv $ReleasePath/$SetupFile $DeployPath/
+
+  if [ "$BuildTarget" == "mac32" ]; then
+    ReleaseToPath="./../../../TBuild/tother/tmac32"
+    DeployToPath="$ReleaseToPath/$AppVersionStrMajor/$AppVersionStrFull"
+    if [ ! -d "$ReleaseToPath/$AppVersionStrMajor" ]; then
+      mkdir "$ReleaseToPath/$AppVersionStrMajor"
+    fi
+
+    if [ ! -d "$DeployToPath" ]; then
+      mkdir "$DeployToPath"
+    fi
+
+    cp -v $DeployPath/$UpdateFile $DeployToPath/
+    cp -v $DeployPath/$SetupFile $DeployToPath/
+    cp -rv $DeployPath/Telegram.app.dSYM $DeployToPath/
+  fi
+fi
+
+echo "Version $AppVersionStrFull is ready!";
diff --git a/Telegram/BuildWin.bat b/Telegram/BuildWin.bat
index 0db10e258..ad5865dc3 100644
--- a/Telegram/BuildWin.bat
+++ b/Telegram/BuildWin.bat
@@ -4,19 +4,19 @@ FOR /F "tokens=1,2* delims= " %i in (Version) do set "%i=%j"
 
 if %DevChannel% neq 0 goto preparedev
 
-set "DevPostfix="
 set "DevParam="
+set "AppVersionStrFull=%AppVersionStr%"
 goto devprepared
 
 :preparedev
 
-set "DevPostfix=.dev"
 set "DevParam=-dev"
+set "AppVersionStrFull=%AppVersionStr%.dev"
 
 :devprepared
 
 echo.
-echo Building version %AppVersionStr%%DevPostfix%..
+echo Building version %AppVersionStrFull%..
 echo.
 
 if exist ..\Win32\Deploy\deploy\%AppVersionStrMajor%\%AppVersionStr%\ goto error_exist1
@@ -33,7 +33,7 @@ MSBuild Telegram.sln /property:Configuration=Deploy
 if %errorlevel% neq 0 goto error0
 
 echo .
-echo Version %AppVersionStr%%DevPostfix% build successfull! Preparing..
+echo Version %AppVersionStrFull% build successfull! Preparing..
 echo .
 
 set "PATH=%PATH%;C:\Program Files\7-Zip;C:\Program Files (x86)\Inno Setup 5"
@@ -45,10 +45,10 @@ if %errorlevel% neq 0 goto error1
 call ..\..\..\TelegramPrivate\Sign.bat Updater.exe
 if %errorlevel% neq 0 goto error1
 
-iscc /dMyAppVersion=%AppVersionStrSmall% /dMyAppVersionZero=%AppVersionStr% /dMyAppFullVersion=%AppVersionStrFull% /dMyAppVersionForExe=%AppVersionStr%%DevPostfix% ..\..\Telegram\Setup.iss
+iscc /dMyAppVersion=%AppVersionStrSmall% /dMyAppVersionZero=%AppVersionStr% /dMyAppVersionFull=%AppVersionStrFull% ..\..\Telegram\Setup.iss
 if %errorlevel% neq 0 goto error1
 
-call ..\..\..\TelegramPrivate\Sign.bat tsetup.%AppVersionStr%%DevPostfix%.exe
+call ..\..\..\TelegramPrivate\Sign.bat tsetup.%AppVersionStrFull%.exe
 if %errorlevel% neq 0 goto error1
 
 call Packer.exe -version %AppVersion% -path Telegram.exe -path Updater.exe %DevParam%
@@ -56,43 +56,43 @@ if %errorlevel% neq 0 goto error1
 
 if not exist deploy mkdir deploy
 if not exist deploy\%AppVersionStrMajor% mkdir deploy\%AppVersionStrMajor%
-mkdir deploy\%AppVersionStrMajor%\%AppVersionStr%%DevPostfix%
-mkdir deploy\%AppVersionStrMajor%\%AppVersionStr%%DevPostfix%\Telegram
+mkdir deploy\%AppVersionStrMajor%\%AppVersionStrFull%
+mkdir deploy\%AppVersionStrMajor%\%AppVersionStrFull%\Telegram
 if %errorlevel% neq 0 goto error1
 
-move Telegram.exe deploy\%AppVersionStrMajor%\%AppVersionStr%%DevPostfix%\Telegram\
-move Updater.exe deploy\%AppVersionStrMajor%\%AppVersionStr%%DevPostfix%\
-move Telegram.pdb deploy\%AppVersionStrMajor%\%AppVersionStr%%DevPostfix%\
-move Updater.pdb deploy\%AppVersionStrMajor%\%AppVersionStr%%DevPostfix%\
-move tsetup.%AppVersionStr%%DevPostfix%.exe deploy\%AppVersionStrMajor%\%AppVersionStr%%DevPostfix%\
-move tupdate%AppVersion% deploy\%AppVersionStrMajor%\%AppVersionStr%%DevPostfix%\
+move Telegram.exe deploy\%AppVersionStrMajor%\%AppVersionStrFull%\Telegram\
+move Updater.exe deploy\%AppVersionStrMajor%\%AppVersionStrFull%\
+move Telegram.pdb deploy\%AppVersionStrMajor%\%AppVersionStrFull%\
+move Updater.pdb deploy\%AppVersionStrMajor%\%AppVersionStrFull%\
+move tsetup.%AppVersionStrFull%.exe deploy\%AppVersionStrMajor%\%AppVersionStrFull%\
+move tupdate%AppVersion% deploy\%AppVersionStrMajor%\%AppVersionStrFull%\
 if %errorlevel% neq 0 goto error1
 
-cd deploy\%AppVersionStrMajor%\%AppVersionStr%%DevPostfix%\
-7z a -mx9 tportable.%AppVersionStr%%DevPostfix%.zip Telegram\
+cd deploy\%AppVersionStrMajor%\%AppVersionStrFull%\
+7z a -mx9 tportable.%AppVersionStrFull%.zip Telegram\
 if %errorlevel% neq 0 goto error2
 
 echo .
-echo Version %AppVersionStr%%DevPostfix% is ready for deploy!
+echo Version %AppVersionStrFull% is ready for deploy!
 echo .
 
 if not exist tupdate%AppVersion% goto error2
-if not exist tportable.%AppVersionStr%%DevPostfix%.zip goto error2
-if not exist tsetup.%AppVersionStr%%DevPostfix%.exe goto error2
+if not exist tportable.%AppVersionStrFull%.zip goto error2
+if not exist tsetup.%AppVersionStrFull%.exe goto error2
 if not exist Telegram.pdb goto error2
 if not exist Updater.exe goto error2
 if not exist Updater.pdb goto error2
 if not exist Z:\TBuild\tother\tsetup\%AppVersionStrMajor% mkdir Z:\TBuild\tother\tsetup\%AppVersionStrMajor%
-if not exist Z:\TBuild\tother\tsetup\%AppVersionStrMajor%\%AppVersionStr%%DevPostfix% mkdir Z:\TBuild\tother\tsetup\%AppVersionStrMajor%\%AppVersionStr%%DevPostfix%
+if not exist Z:\TBuild\tother\tsetup\%AppVersionStrMajor%\%AppVersionStrFull% mkdir Z:\TBuild\tother\tsetup\%AppVersionStrMajor%\%AppVersionStrFull%
 
-xcopy tupdate%AppVersion% Z:\TBuild\tother\tsetup\%AppVersionStrMajor%\%AppVersionStr%%DevPostfix%\
-xcopy tportable.%AppVersionStr%%DevPostfix%.zip Z:\TBuild\tother\tsetup\%AppVersionStrMajor%\%AppVersionStr%%DevPostfix%\
-xcopy tsetup.%AppVersionStr%%DevPostfix%.exe Z:\TBuild\tother\tsetup\%AppVersionStrMajor%\%AppVersionStr%%DevPostfix%\
-xcopy Telegram.pdb Z:\TBuild\tother\tsetup\%AppVersionStrMajor%\%AppVersionStr%%DevPostfix%\
-xcopy Updater.exe Z:\TBuild\tother\tsetup\%AppVersionStrMajor%\%AppVersionStr%%DevPostfix%\
-xcopy Updater.pdb Z:\TBuild\tother\tsetup\%AppVersionStrMajor%\%AppVersionStr%%DevPostfix%\
+xcopy tupdate%AppVersion% Z:\TBuild\tother\tsetup\%AppVersionStrMajor%\%AppVersionStrFull%\
+xcopy tportable.%AppVersionStrFull%.zip Z:\TBuild\tother\tsetup\%AppVersionStrMajor%\%AppVersionStrFull%\
+xcopy tsetup.%AppVersionStrFull%.exe Z:\TBuild\tother\tsetup\%AppVersionStrMajor%\%AppVersionStrFull%\
+xcopy Telegram.pdb Z:\TBuild\tother\tsetup\%AppVersionStrMajor%\%AppVersionStrFull%\
+xcopy Updater.exe Z:\TBuild\tother\tsetup\%AppVersionStrMajor%\%AppVersionStrFull%\
+xcopy Updater.pdb Z:\TBuild\tother\tsetup\%AppVersionStrMajor%\%AppVersionStrFull%\
 
-echo Version %AppVersionStr%%DevPostfix% deployed successfully!
+echo Version %AppVersionStrFull% is ready!
 
 cd ..\..\..\..\..\Telegram\
 goto eof
@@ -118,7 +118,7 @@ echo Update file for version %AppVersion% already exists!
 exit /b 1
 
 :error
-echo ERROR occured! 
+echo ERROR occured!
 exit /b %errorlevel%
 
 :eof
diff --git a/Telegram/Deploy.sh b/Telegram/Deploy.sh
new file mode 100644
index 000000000..b53e7fd61
--- /dev/null
+++ b/Telegram/Deploy.sh
@@ -0,0 +1,128 @@
+while IFS='' read -r line || [[ -n "$line" ]]; do
+  set $line
+  eval $1="$2"
+done < Version
+
+AppVersionStrFull="$AppVersionStr"
+DevParam=''
+if [ "$DevChannel" != "0" ]; then
+  AppVersionStrFull="$AppVersionStr.dev"
+  DevParam='-dev'
+fi
+
+if [ ! -f "Target" ]; then
+  echo "Build target not found!"
+  exit 1
+fi
+
+while IFS='' read -r line || [[ -n "$line" ]]; do
+  BuildTarget="$line"
+done < Target
+
+echo ""
+if [ "$BuildTarget" == "linux" ]; then
+  echo "Deploying version $AppVersionStrFull for Linux 64bit.."
+  UpdateFile="tlinuxupd$AppVersion"
+  SetupFile="tsetup.$AppVersionStrFull.tar.xz"
+  ReleasePath="./../Linux/Release"
+  RemoteFolder="tlinux"
+elif [ "$BuildTarget" == "linux32" ]; then
+  echo "Deploying version $AppVersionStrFull for Linux 32bit.."
+  UpdateFile="tlinux32upd$AppVersion"
+  SetupFile="tsetup32.$AppVersionStrFull.tar.xz"
+  ReleasePath="./../Linux/Release"
+  RemoteFolder="tlinux32"
+elif [ "$BuildTarget" == "mac" ]; then
+  echo "Deploying three versions of $AppVersionStrFull: for Windows, OS X 10.6 and 10.7 and OS X 10.8+.."
+  UpdateFile="tmacupd$AppVersion"
+  SetupFile="tsetup.$AppVersionStrFull.dmg"
+  ReleasePath="./../Mac/Release"
+  RemoteFolder="tmac"
+  Mac32DeployPath="./../../tother/tmac32/$AppVersionStrMajor/$AppVersionStrFull"
+  Mac32UpdateFile="tmac32upd$AppVersion"
+  Mac32SetupFile="tsetup32.$AppVersionStrFull.dmg"
+  Mac32RemoteFolder="tmac32"
+  WinDeployPath="./../../tother/tsetup/$AppVersionStrMajor/$AppVersionStrFull"
+  WinUpdateFile="tupdate$AppVersion"
+  WinSetupFile="tsetup.$AppVersionStrFull.exe"
+  WinPortableFile="tportable.$AppVersionStr.zip"
+  WinRemoteFolder="tsetup"
+  DropboxPath="./../../../Dropbox/Telegram/deploy/$AppVersionStrMajor"
+  DropboxDeployPath="$DropboxPath/$AppVersionStrFull"
+elif [ "$BuildTarget" == "mac32" ] || [ "$BuildTarget" = "macstore" ]; then
+  echo "No need to deploy this target."
+  exit
+else
+  echo "Invalid target!"
+  exit 1
+fi
+
+DeployPath="$ReleasePath/deploy/$AppVersionStrMajor/$AppVersionStrFull"
+
+#if [ "$BuildTarget" == "linux" ] || [ "$BuildTarget" == "linux32" ] || [ "$BuildTarget" == "mac" ] || [ "$BuildTarget" == "mac32" ] || [ "$BuildTarget" == "macstore" ]; then
+
+  if [ ! -f "$DeployPath/$UpdateFile" ]; then
+      echo "$UpdateFile not found!";
+      exit 1
+  fi
+
+  if [ ! -f "$DeployPath/$SetupFile" ]; then
+      echo "$SetupFile not found!"
+      exit 1
+  fi
+
+  if [ "$BuildTarget" == "mac" ]; then
+    if [ ! -f "$Mac32DeployPath/$Mac32UpdateFile" ]; then
+      echo "$Mac32UpdateFile not found!"
+      exit 1
+    fi
+
+    if [ ! -f "$Mac32DeployPath/$Mac32SetupFile" ]; then
+      echo "$Mac32SetupFile not found!"
+      exit 1
+    fi
+
+    if [ ! -f "$WinDeployPath/$WinUpdateFile" ]; then
+      echo "$WinUpdateFile not found!"
+      exit 1
+    fi
+
+    if [ ! -f "$WinDeployPath/$WinSetupFile" ]; then
+      echo "$WinSetupFile not found!"
+      exit 1
+    fi
+
+    if [ ! -f "$WinDeployPath/$WinPortableFile" ]; then
+      echo "$WinPortableFile not found!"
+      exit 1
+    fi
+
+    if [ ! -d "./../../../Dropbox/Telegram/deploy/$AppVersionStrMajor" ]; then
+      mkdir "./../../../Dropbox/Telegram/deploy/$AppVersionStrMajor"
+    fi
+  fi
+#fi
+
+if [ "$BuildTarget" == "linux" ] || [ "$BuildTarget" == "linux32" ] || [ "$BuildTarget" == "mac" ]; then
+  scp "$DeployPath/$UpdateFile" "tmaster:tdesktop/www/$RemoteFolder/"
+  scp "$DeployPath/$SetupFile" "tmaster:tdesktop/www/$RemoteFolder/"
+
+  if [ "$BuildTarget" == "mac" ]; then
+    scp "$Mac32DeployPath/$Mac32UpdateFile" "tmaster:tdesktop/www/$Mac32RemoteFolder/"
+    scp "$Mac32DeployPath/$Mac32SetupFile" "tmaster:tdesktop/www/$Mac32RemoteFolder/"
+    scp "$WinDeployPath/$WinUpdateFile" "tmaster:tdesktop/www/$WinRemoteFolder/"
+    scp "$WinDeployPath/$WinSetupFile" "tmaster:tdesktop/www/$WinRemoteFolder/"
+    scp "$WinDeployPath/$WinPortableFile" "tmaster:tdesktop/www/$WinRemoteFolder/"
+
+    mv -v "$WinDeployPath" "$DropboxPath/"
+
+    cp -v "$DeployPath/$UpdateFile" "$DropboxDeployPath"
+    cp -v "$DeployPath/$SetupFile" "$DropboxDeployPath"
+    cp -rv "$DeployPath/Telegram.app.dSYM" "$DropboxDeployPath"
+    cp -v "$Mac32DeployPath/$Mac32UpdateFile" "$DropboxDeployPath"
+    cp -v "$Mac32DeployPath/$Mac32SetupFile" "$DropboxDeployPath"
+    cp -rv "$DeployPath/Telegram.app.dSYM" "$DropboxDeployPath/Telegram32.app.dSYM"
+  fi
+fi
+
+echo "Version $AppVersionStrFull was deployed!";
diff --git a/Telegram/DeployLinux.sh b/Telegram/DeployLinux.sh
index f01726374..32de84189 100755
--- a/Telegram/DeployLinux.sh
+++ b/Telegram/DeployLinux.sh
@@ -3,20 +3,22 @@ while IFS='' read -r line || [[ -n "$line" ]]; do
     eval $1="$2"
 done < Version
 
-DevPostfix=''
+AppVersionStrFull="$AppVersionStr"
+DevParam=''
 if [ "$DevChannel" != "0" ]; then
-  DevPostfix='.dev'
+  AppVersionStrFull="$AppVersionStr.dev"
+  DevParam='-dev'
 fi
 
-if [ ! -f "./../Linux/Release/deploy/$AppVersionStrMajor/$AppVersionStr$DevPostfix/tlinuxupd$AppVersion" ]; then
+if [ ! -f "./../Linux/Release/deploy/$AppVersionStrMajor/$AppVersionStrFull/tlinuxupd$AppVersion" ]; then
     echo "tlinuxupd$AppVersion not found!";
     exit 1
 fi
 
-if [ ! -f "./../Linux/Release/deploy/$AppVersionStrMajor/$AppVersionStr$DevPostfix/tsetup.$AppVersionStr$DevPostfix.tar.xz" ]; then
-    echo "tsetup.$AppVersionStr$DevPostfix.tar.xz not found!"
+if [ ! -f "./../Linux/Release/deploy/$AppVersionStrMajor/$AppVersionStrFull/tsetup.$AppVersionStrFull.tar.xz" ]; then
+    echo "tsetup.$AppVersionStrFull.tar.xz not found!"
     exit 1
 fi
 
-scp ./../Linux/Release/deploy/$AppVersionStrMajor/$AppVersionStr$DevPostfix/tlinuxupd$AppVersion tmaster:tdesktop/www/tlinux/
-scp ./../Linux/Release/deploy/$AppVersionStrMajor/$AppVersionStr$DevPostfix/tsetup.$AppVersionStr$DevPostfix.tar.xz tmaster:tdesktop/www/tlinux/
+scp ./../Linux/Release/deploy/$AppVersionStrMajor/$AppVersionStrFull/tlinuxupd$AppVersion tmaster:tdesktop/www/tlinux/
+scp ./../Linux/Release/deploy/$AppVersionStrMajor/$AppVersionStrFull/tsetup.$AppVersionStrFull.tar.xz tmaster:tdesktop/www/tlinux/
diff --git a/Telegram/DeployLinux32.sh b/Telegram/DeployLinux32.sh
index 1362ceac3..398074bbe 100755
--- a/Telegram/DeployLinux32.sh
+++ b/Telegram/DeployLinux32.sh
@@ -3,21 +3,23 @@ while IFS='' read -r line || [[ -n "$line" ]]; do
     eval $1="$2"
 done < Version
 
-DevPostfix=''
+AppVersionStrFull="$AppVersionStr"
+DevParam=''
 if [ "$DevChannel" != "0" ]; then
-  DevPostfix='.dev'
+  AppVersionStrFull="$AppVersionStr.dev"
+  DevParam='-dev'
 fi
 
-if [ ! -f "./../Linux/Release/deploy/$AppVersionStrMajor/$AppVersionStr$DevPostfix/tlinux32upd$AppVersion" ]; then
+if [ ! -f "./../Linux/Release/deploy/$AppVersionStrMajor/$AppVersionStrFull/tlinux32upd$AppVersion" ]; then
     echo "tlinux32upd$AppVersion not found!"
     exit 1
 fi
 
-if [ ! -f "./../Linux/Release/deploy/$AppVersionStrMajor/$AppVersionStr$DevPostfix/tsetup32.$AppVersionStr$DevPostfix.tar.xz" ]; then
-    echo "tsetup32.$AppVersionStr$DevPostfix.zip not found!"
+if [ ! -f "./../Linux/Release/deploy/$AppVersionStrMajor/$AppVersionStrFull/tsetup32.$AppVersionStrFull.tar.xz" ]; then
+    echo "tsetup32.$AppVersionStrFull.zip not found!"
     exit 1
 fi
 
-scp ./../Linux/Release/deploy/$AppVersionStrMajor/$AppVersionStr$DevPostfix/tlinux32upd$AppVersion tmaster:tdesktop/www/tlinux32/
-scp ./../Linux/Release/deploy/$AppVersionStrMajor/$AppVersionStr$DevPostfix/tsetup32.$AppVersionStr$DevPostfix.tar.xz tmaster:tdesktop/www/tlinux32/
+scp ./../Linux/Release/deploy/$AppVersionStrMajor/$AppVersionStrFull/tlinux32upd$AppVersion tmaster:tdesktop/www/tlinux32/
+scp ./../Linux/Release/deploy/$AppVersionStrMajor/$AppVersionStrFull/tsetup32.$AppVersionStrFull.tar.xz tmaster:tdesktop/www/tlinux32/
 
diff --git a/Telegram/DeployMacWin.sh b/Telegram/DeployMacWin.sh
index 05394fe97..3e7b32c87 100755
--- a/Telegram/DeployMacWin.sh
+++ b/Telegram/DeployMacWin.sh
@@ -3,43 +3,45 @@ while IFS='' read -r line || [[ -n "$line" ]]; do
     eval $1="$2"
 done < Version
 
-DevPostfix=''
+AppVersionStrFull="$AppVersionStr"
+DevParam=''
 if [ "$DevChannel" != "0" ]; then
-  DevPostfix='.dev'
+  AppVersionStrFull="$AppVersionStr.dev"
+  DevParam='-dev'
 fi
 
-if [ ! -f "./../Mac/Release/deploy/$AppVersionStrMajor/$AppVersionStr$DevPostfix/tmacupd$AppVersion" ]; then
+if [ ! -f "./../Mac/Release/deploy/$AppVersionStrMajor/$AppVersionStrFull/tmacupd$AppVersion" ]; then
   echo "tmacupd$AppVersion not found!"
   exit 1
 fi
 
-if [ ! -f "./../Mac/Release/deploy/$AppVersionStrMajor/$AppVersionStr$DevPostfix/tsetup.$AppVersionStr$DevPostfix.dmg" ]; then
-  echo "tsetup.$AppVersionStr$DevPostfix.dmg not found!"
+if [ ! -f "./../Mac/Release/deploy/$AppVersionStrMajor/$AppVersionStrFull/tsetup.$AppVersionStrFull.dmg" ]; then
+  echo "tsetup.$AppVersionStrFull.dmg not found!"
   exit 1
 fi
 
-if [ ! -f "./../../tother/tmac32/$AppVersionStrMajor/$AppVersionStr$DevPostfix/tmac32upd$AppVersion" ]; then
+if [ ! -f "./../../tother/tmac32/$AppVersionStrMajor/$AppVersionStrFull/tmac32upd$AppVersion" ]; then
   echo "tmac32upd$AppVersion not found!"
   exit 1
 fi
 
-if [ ! -f "./../../tother/tmac32/$AppVersionStrMajor/$AppVersionStr$DevPostfix/tsetup32.$AppVersionStr$DevPostfix.dmg" ]; then
-  echo "tsetup32.$AppVersionStr$DevPostfix.dmg not found!"
+if [ ! -f "./../../tother/tmac32/$AppVersionStrMajor/$AppVersionStrFull/tsetup32.$AppVersionStrFull.dmg" ]; then
+  echo "tsetup32.$AppVersionStrFull.dmg not found!"
   exit 1
 fi
 
-if [ ! -f "./../../tother/tsetup/$AppVersionStrMajor/$AppVersionStr$DevPostfix/tupdate$AppVersion" ]; then
+if [ ! -f "./../../tother/tsetup/$AppVersionStrMajor/$AppVersionStrFull/tupdate$AppVersion" ]; then
   echo "tupdate$AppVersion not found!"
   exit 1
 fi
 
-if [ ! -f "./../../tother/tsetup/$AppVersionStrMajor/$AppVersionStr$DevPostfix/tportable.$AppVersionStr$DevPostfix.zip" ]; then
-  echo "tportable.$AppVersionStr$DevPostfix.zip not found!"
+if [ ! -f "./../../tother/tsetup/$AppVersionStrMajor/$AppVersionStrFull/tportable.$AppVersionStrFull.zip" ]; then
+  echo "tportable.$AppVersionStrFull.zip not found!"
   exit 1
 fi
 
-if [ ! -f "./../../tother/tsetup/$AppVersionStrMajor/$AppVersionStr$DevPostfix/tsetup.$AppVersionStr$DevPostfix.exe" ]; then
-  echo "tsetup.$AppVersionStr$DevPostfix.exe not found!"
+if [ ! -f "./../../tother/tsetup/$AppVersionStrMajor/$AppVersionStrFull/tsetup.$AppVersionStrFull.exe" ]; then
+  echo "tsetup.$AppVersionStrFull.exe not found!"
   exit 1
 fi
 
@@ -47,20 +49,20 @@ if [ ! -d "./../../../Dropbox/Telegram/deploy/$AppVersionStrMajor" ]; then
   mkdir "./../../../Dropbox/Telegram/deploy/$AppVersionStrMajor"
 fi
 
-scp ./../Mac/Release/deploy/$AppVersionStrMajor/$AppVersionStr$DevPostfix/tmacupd$AppVersion tmaster:tdesktop/www/tmac/
-scp ./../Mac/Release/deploy/$AppVersionStrMajor/$AppVersionStr$DevPostfix/tsetup.$AppVersionStr$DevPostfix.dmg tmaster:tdesktop/www/tmac/
-scp ./../../tother/tmac32/$AppVersionStrMajor/$AppVersionStr$DevPostfix/tmac32upd$AppVersion tmaster:tdesktop/www/tmac32/
-scp ./../../tother/tmac32/$AppVersionStrMajor/$AppVersionStr$DevPostfix/tsetup32.$AppVersionStr$DevPostfix.dmg tmaster:tdesktop/www/tmac32/
-scp ./../../tother/tsetup/$AppVersionStrMajor/$AppVersionStr$DevPostfix/tupdate$AppVersion tmaster:tdesktop/www/tsetup/
-scp ./../../tother/tsetup/$AppVersionStrMajor/$AppVersionStr$DevPostfix/tportable.$AppVersionStr$DevPostfix.zip tmaster:tdesktop/www/tsetup/
-scp ./../../tother/tsetup/$AppVersionStrMajor/$AppVersionStr$DevPostfix/tsetup.$AppVersionStr$DevPostfix.exe tmaster:tdesktop/www/tsetup/
+scp ./../Mac/Release/deploy/$AppVersionStrMajor/$AppVersionStrFull/tmacupd$AppVersion tmaster:tdesktop/www/tmac/
+scp ./../Mac/Release/deploy/$AppVersionStrMajor/$AppVersionStrFull/tsetup.$AppVersionStrFull.dmg tmaster:tdesktop/www/tmac/
+scp ./../../tother/tmac32/$AppVersionStrMajor/$AppVersionStrFull/tmac32upd$AppVersion tmaster:tdesktop/www/tmac32/
+scp ./../../tother/tmac32/$AppVersionStrMajor/$AppVersionStrFull/tsetup32.$AppVersionStrFull.dmg tmaster:tdesktop/www/tmac32/
+scp ./../../tother/tsetup/$AppVersionStrMajor/$AppVersionStrFull/tupdate$AppVersion tmaster:tdesktop/www/tsetup/
+scp ./../../tother/tsetup/$AppVersionStrMajor/$AppVersionStrFull/tportable.$AppVersionStrFull.zip tmaster:tdesktop/www/tsetup/
+scp ./../../tother/tsetup/$AppVersionStrMajor/$AppVersionStrFull/tsetup.$AppVersionStrFull.exe tmaster:tdesktop/www/tsetup/
 
-mv -v ./../../tother/tsetup/$AppVersionStrMajor/$AppVersionStr$DevPostfix ./../../../Dropbox/Telegram/deploy/$AppVersionStrMajor/
+mv -v ./../../tother/tsetup/$AppVersionStrMajor/$AppVersionStrFull ./../../../Dropbox/Telegram/deploy/$AppVersionStrMajor/
 
-cp -v ./../Mac/Release/deploy/$AppVersionStrMajor/$AppVersionStr$DevPostfix/tmacupd$AppVersion ./../../../Dropbox/Telegram/deploy/$AppVersionStrMajor/$AppVersionStr$DevPostfix/
-cp -v ./../Mac/Release/deploy/$AppVersionStrMajor/$AppVersionStr$DevPostfix/tsetup.$AppVersionStr$DevPostfix.dmg ./../../../Dropbox/Telegram/deploy/$AppVersionStrMajor/$AppVersionStr$DevPostfix/
-cp -rv ./../Mac/Release/deploy/$AppVersionStrMajor/$AppVersionStr$DevPostfix/Telegram.app.dSYM ./../../../Dropbox/Telegram/deploy/$AppVersionStrMajor/$AppVersionStr$DevPostfix/
-cp -v ./../../tother/tmac32/$AppVersionStrMajor/$AppVersionStr$DevPostfix/tmac32upd$AppVersion ./../../../Dropbox/Telegram/deploy/$AppVersionStrMajor/$AppVersionStr$DevPostfix/
-cp -v ./../../tother/tmac32/$AppVersionStrMajor/$AppVersionStr$DevPostfix/tsetup32.$AppVersionStr$DevPostfix.dmg ./../../../Dropbox/Telegram/deploy/$AppVersionStrMajor/$AppVersionStr$DevPostfix/
-cp -rv ./../../tother/tmac32/$AppVersionStrMajor/$AppVersionStr$DevPostfix/Telegram.app.dSYM ./../../../Dropbox/Telegram/deploy/$AppVersionStrMajor/$AppVersionStr$DevPostfix/Telegram32.app.dSYM
+cp -v ./../Mac/Release/deploy/$AppVersionStrMajor/$AppVersionStrFull/tmacupd$AppVersion ./../../../Dropbox/Telegram/deploy/$AppVersionStrMajor/$AppVersionStrFull/
+cp -v ./../Mac/Release/deploy/$AppVersionStrMajor/$AppVersionStrFull/tsetup.$AppVersionStrFull.dmg ./../../../Dropbox/Telegram/deploy/$AppVersionStrMajor/$AppVersionStrFull/
+cp -rv ./../Mac/Release/deploy/$AppVersionStrMajor/$AppVersionStrFull/Telegram.app.dSYM ./../../../Dropbox/Telegram/deploy/$AppVersionStrMajor/$AppVersionStrFull/
+cp -v ./../../tother/tmac32/$AppVersionStrMajor/$AppVersionStrFull/tmac32upd$AppVersion ./../../../Dropbox/Telegram/deploy/$AppVersionStrMajor/$AppVersionStrFull/
+cp -v ./../../tother/tmac32/$AppVersionStrMajor/$AppVersionStrFull/tsetup32.$AppVersionStrFull.dmg ./../../../Dropbox/Telegram/deploy/$AppVersionStrMajor/$AppVersionStrFull/
+cp -rv ./../../tother/tmac32/$AppVersionStrMajor/$AppVersionStrFull/Telegram.app.dSYM ./../../../Dropbox/Telegram/deploy/$AppVersionStrMajor/$AppVersionStrFull/Telegram32.app.dSYM
 
diff --git a/Telegram/PrepareLinux.sh b/Telegram/PrepareLinux.sh
index b4db1ffad..4cef1bdae 100755
--- a/Telegram/PrepareLinux.sh
+++ b/Telegram/PrepareLinux.sh
@@ -3,10 +3,10 @@ while IFS='' read -r line || [[ -n "$line" ]]; do
     eval $1="$2"
 done < Version
 
-DevPostfix=''
+AppVersionStrFull="$AppVersionStr"
 DevParam=''
 if [ "$DevChannel" != "0" ]; then
-  DevPostfix='.dev'
+  AppVersionStrFull="$AppVersionStr.dev"
   DevParam='-dev'
 fi
 
@@ -35,7 +35,7 @@ if [ ! -f "./../Linux/Release/Updater" ]; then
   exit 1
 fi
 
-echo "Preparing version $AppVersionStr$DevPostfix, executing Packer.."
+echo "Preparing version $AppVersionStrFull, executing Packer.."
 cd ./../Linux/Release && ./Packer -path Telegram -path Updater -version $AppVersion $DevParam && cd ./../../Telegram
 echo "Packer done!"
 
@@ -47,12 +47,12 @@ if [ ! -d "./../Linux/Release/deploy/$AppVersionStrMajor" ]; then
   mkdir "./../Linux/Release/deploy/$AppVersionStrMajor"
 fi
 
-echo "Copying Telegram, Updater and tlinuxupd$AppVersion to deploy/$AppVersionStrMajor/$AppVersionStr$DevPostfix..";
-mkdir "./../Linux/Release/deploy/$AppVersionStrMajor/$AppVersionStr$DevPostfix"
-mkdir "./../Linux/Release/deploy/$AppVersionStrMajor/$AppVersionStr$DevPostfix/Telegram"
-mv ./../Linux/Release/Telegram ./../Linux/Release/deploy/$AppVersionStrMajor/$AppVersionStr$DevPostfix/Telegram/
-mv ./../Linux/Release/Updater ./../Linux/Release/deploy/$AppVersionStrMajor/$AppVersionStr$DevPostfix/Telegram/
-mv ./../Linux/Release/tlinuxupd$AppVersion ./../Linux/Release/deploy/$AppVersionStrMajor/$AppVersionStr$DevPostfix/
-cd ./../Linux/Release/deploy/$AppVersionStrMajor/$AppVersionStr$DevPostfix && tar -cJvf tsetup.$AppVersionStr$DevPostfix.tar.xz Telegram/ && cd ./../../../../../Telegram
-echo "Version $AppVersionStr$DevPostfix prepared!";
+echo "Copying Telegram, Updater and tlinuxupd$AppVersion to deploy/$AppVersionStrMajor/$AppVersionStrFull..";
+mkdir "./../Linux/Release/deploy/$AppVersionStrMajor/$AppVersionStrFull"
+mkdir "./../Linux/Release/deploy/$AppVersionStrMajor/$AppVersionStrFull/Telegram"
+mv ./../Linux/Release/Telegram ./../Linux/Release/deploy/$AppVersionStrMajor/$AppVersionStrFull/Telegram/
+mv ./../Linux/Release/Updater ./../Linux/Release/deploy/$AppVersionStrMajor/$AppVersionStrFull/Telegram/
+mv ./../Linux/Release/tlinuxupd$AppVersion ./../Linux/Release/deploy/$AppVersionStrMajor/$AppVersionStrFull/
+cd ./../Linux/Release/deploy/$AppVersionStrMajor/$AppVersionStrFull && tar -cJvf tsetup.$AppVersionStrFull.tar.xz Telegram/ && cd ./../../../../../Telegram
+echo "Version $AppVersionStrFull prepared!";
 
diff --git a/Telegram/PrepareLinux32.sh b/Telegram/PrepareLinux32.sh
index 312e8112d..c088d449f 100755
--- a/Telegram/PrepareLinux32.sh
+++ b/Telegram/PrepareLinux32.sh
@@ -3,10 +3,10 @@ while IFS='' read -r line || [[ -n "$line" ]]; do
     eval $1="$2"
 done < Version
 
-DevPostfix=''
+AppVersionStrFull="$AppVersionStr"
 DevParam=''
 if [ "$DevChannel" != "0" ]; then
-  DevPostfix='.dev'
+  AppVersionStrFull="$AppVersionStr.dev"
   DevParam='-dev'
 fi
 
@@ -35,7 +35,7 @@ if [ ! -f "./../Linux/Release/Updater" ]; then
   exit 1
 fi
 
-echo "Preparing version $AppVersionStr$DevPostfix, executing Packer.."
+echo "Preparing version $AppVersionStrFull, executing Packer.."
 cd ./../Linux/Release && ./Packer -path Telegram -path Updater -version $AppVersion $DevParam && cd ./../../Telegram
 echo "Packer done!"
 
@@ -47,12 +47,12 @@ if [ ! -d "./../Linux/Release/deploy/$AppVersionStrMajor" ]; then
   mkdir "./../Linux/Release/deploy/$AppVersionStrMajor"
 fi
 
-echo "Copying Telegram, Updater and tlinux32upd$AppVersion to deploy/$AppVersionStrMajor/$AppVersionStr$DevPostfix..";
-mkdir "./../Linux/Release/deploy/$AppVersionStrMajor/$AppVersionStr$DevPostfix"
-mkdir "./../Linux/Release/deploy/$AppVersionStrMajor/$AppVersionStr$DevPostfix/Telegram"
-mv ./../Linux/Release/Telegram ./../Linux/Release/deploy/$AppVersionStrMajor/$AppVersionStr$DevPostfix/Telegram/
-mv ./../Linux/Release/Updater ./../Linux/Release/deploy/$AppVersionStrMajor/$AppVersionStr$DevPostfix/Telegram/
-mv ./../Linux/Release/tlinux32upd$AppVersion ./../Linux/Release/deploy/$AppVersionStrMajor/$AppVersionStr$DevPostfix/
-cd ./../Linux/Release/deploy/$AppVersionStrMajor/$AppVersionStr$DevPostfix && tar -cJvf tsetup32.$AppVersionStr$DevPostfix.tar.xz Telegram/ && cd ./../../../../../Telegram
-echo "Version $AppVersionStr$DevPostfix prepared!";
+echo "Copying Telegram, Updater and tlinux32upd$AppVersion to deploy/$AppVersionStrMajor/$AppVersionStrFull..";
+mkdir "./../Linux/Release/deploy/$AppVersionStrMajor/$AppVersionStrFull"
+mkdir "./../Linux/Release/deploy/$AppVersionStrMajor/$AppVersionStrFull/Telegram"
+mv ./../Linux/Release/Telegram ./../Linux/Release/deploy/$AppVersionStrMajor/$AppVersionStrFull/Telegram/
+mv ./../Linux/Release/Updater ./../Linux/Release/deploy/$AppVersionStrMajor/$AppVersionStrFull/Telegram/
+mv ./../Linux/Release/tlinux32upd$AppVersion ./../Linux/Release/deploy/$AppVersionStrMajor/$AppVersionStrFull/
+cd ./../Linux/Release/deploy/$AppVersionStrMajor/$AppVersionStrFull && tar -cJvf tsetup32.$AppVersionStrFull.tar.xz Telegram/ && cd ./../../../../../Telegram
+echo "Version $AppVersionStrFull prepared!";
 
diff --git a/Telegram/PrepareMac.sh b/Telegram/PrepareMac.sh
index 5e7e34a2e..e69d04904 100755
--- a/Telegram/PrepareMac.sh
+++ b/Telegram/PrepareMac.sh
@@ -3,15 +3,15 @@ while IFS='' read -r line || [[ -n "$line" ]]; do
     eval $1="$2"
 done < Version
 
-DevPostfix=''
+AppVersionStrFull="$AppVersionStr"
 DevParam=''
 if [ "$DevChannel" != "0" ]; then
-  DevPostfix='.dev'
+  AppVersionStrFull="$AppVersionStr.dev"
   DevParam='-dev'
 fi
 
 echo ""
-echo "Preparing version $AppVersionStr$DevPostfix.."
+echo "Preparing version $AppVersionStrFull.."
 echo ""
 
 if [ -d "./../Mac/Release/deploy/$AppVersionStrMajor/$AppVersionStr.dev" ]; then
@@ -71,7 +71,7 @@ temppath=`hdiutil attach -readwrite tsetup.dmg | awk -F "\t" 'END {print $3}'`
 cp -R ./Telegram.app "$temppath/"
 bless --folder "$temppath/" --openfolder "$temppath/"
 hdiutil detach "$temppath"
-hdiutil convert tsetup.dmg -format UDZO -imagekey zlib-level=9 -ov -o tsetup.$AppVersionStr$DevPostfix.dmg
+hdiutil convert tsetup.dmg -format UDZO -imagekey zlib-level=9 -ov -o tsetup.$AppVersionStrFull.dmg
 cd ./../../Telegram
 cd ./../Mac/Release && ./Packer.app/Contents/MacOS/Packer -path Telegram.app -version $AppVersion $DevParam && cd ./../../Telegram
 
@@ -84,15 +84,15 @@ if [ ! -d "./../Mac/Release/deploy/$AppVersionStrMajor" ]; then
 fi
 
 echo "Copying Telegram.app and tmacupd$AppVersion to deploy/$AppVersionStrMajor/$AppVersionStr..";
-mkdir "./../Mac/Release/deploy/$AppVersionStrMajor/$AppVersionStr$DevPostfix"
-mkdir "./../Mac/Release/deploy/$AppVersionStrMajor/$AppVersionStr$DevPostfix/Telegram"
-cp -r ./../Mac/Release/Telegram.app ./../Mac/Release/deploy/$AppVersionStrMajor/$AppVersionStr$DevPostfix/Telegram/
-mv ./../Mac/Release/Telegram.app.dSYM ./../Mac/Release/deploy/$AppVersionStrMajor/$AppVersionStr$DevPostfix/
+mkdir "./../Mac/Release/deploy/$AppVersionStrMajor/$AppVersionStrFull"
+mkdir "./../Mac/Release/deploy/$AppVersionStrMajor/$AppVersionStrFull/Telegram"
+cp -r ./../Mac/Release/Telegram.app ./../Mac/Release/deploy/$AppVersionStrMajor/$AppVersionStrFull/Telegram/
+mv ./../Mac/Release/Telegram.app.dSYM ./../Mac/Release/deploy/$AppVersionStrMajor/$AppVersionStrFull/
 rm ./../Mac/Release/Telegram.app/Contents/MacOS/Telegram
 rm ./../Mac/Release/Telegram.app/Contents/Frameworks/Updater
 rm -rf ./../Mac/Release/Telegram.app/Contents/_CodeSignature
-mv ./../Mac/Release/tmacupd$AppVersion ./../Mac/Release/deploy/$AppVersionStrMajor/$AppVersionStr$DevPostfix/
-mv ./../Mac/Release/tsetup.$AppVersionStr$DevPostfix.dmg ./../Mac/Release/deploy/$AppVersionStrMajor/$AppVersionStr$DevPostfix/tsetup.$AppVersionStr$DevPostfix.dmg
+mv ./../Mac/Release/tmacupd$AppVersion ./../Mac/Release/deploy/$AppVersionStrMajor/$AppVersionStrFull/
+mv ./../Mac/Release/tsetup.$AppVersionStrFull.dmg ./../Mac/Release/deploy/$AppVersionStrMajor/$AppVersionStrFull/tsetup.$AppVersionStrFull.dmg
 
-echo "Version $AppVersionStr$DevPostfix prepared!";
+echo "Version $AppVersionStrFull prepared!";
 
diff --git a/Telegram/Setup.iss b/Telegram/Setup.iss
index 78ade6152..c3773c30c 100644
--- a/Telegram/Setup.iss
+++ b/Telegram/Setup.iss
@@ -24,14 +24,14 @@ DefaultDirName={userappdata}\{#MyAppName}
 DefaultGroupName={#MyAppName}
 AllowNoIcons=yes
 OutputDir=.\..\Win32\Deploy
-OutputBaseFilename=tsetup.{#MyAppVersionForExe}
+OutputBaseFilename=tsetup.{#MyAppVersionFull}
 SetupIconFile=.\SourceFiles\art\icon256.ico
 UninstallDisplayIcon={app}\Telegram.exe
 Compression=lzma
 SolidCompression=yes         
 DisableStartupPrompt=yes
 PrivilegesRequired=lowest
-VersionInfoVersion={#MyAppFullVersion}
+VersionInfoVersion={#MyAppVersion}.0
 
 [Languages]
 Name: "english"; MessagesFile: "compiler:Default.isl"
diff --git a/Telegram/SourceFiles/dropdown.cpp b/Telegram/SourceFiles/dropdown.cpp
index 8e0d01eb1..ba9e07789 100644
--- a/Telegram/SourceFiles/dropdown.cpp
+++ b/Telegram/SourceFiles/dropdown.cpp
@@ -2826,7 +2826,7 @@ void MentionsDropdown::updateFiltered(bool toDown) {
 					cnt += user->botInfo->commands.size();
 				}
 			}
-		} else if (_user->botInfo) {
+		} else if (_user && _user->botInfo) {
 			if (!_user->botInfo->inited) App::api()->requestFullPeer(_user);
 			cnt = _user->botInfo->commands.size();
 			bots.insert(_user, true);
diff --git a/Telegram/Version b/Telegram/Version
index f93fcf5a6..3446cfef2 100644
--- a/Telegram/Version
+++ b/Telegram/Version
@@ -2,5 +2,4 @@ AppVersion         9000
 AppVersionStrMajor 0.9
 AppVersionStrSmall 0.9
 AppVersionStr      0.9.0
-AppVersionStrFull  0.9.0.0
 DevChannel         0