This is complete source code and build instructions for alpha version of unofficial desktop client for [Telegram](https://telegram.org) messenger, based on [Telegram API](https://core.telegram.org/) and [MTProto](https://core.telegram.org/mtproto) secure protocol.
###Supported systems
Only Windows systems are supported at this moment, OS X and Linux builds are on their way.
* Windows XP
* Windows Vista
* Windows 7
* Windows 8 (**not** RT)
* Windows 8.1 (**not** RT)
###Third-party libraries
* Qt 5.3.0, slightly patched
* OpenSSL 1.0.1g
* zlib 1.2.8
* libexif 0.6.20
* LZMA SDK 9.20
##Build instructions for Visual Studio 2013
###Prepare folder
Choose a folder for the future build, for example **D:\TBuild\**. There you will have two folders, **Libraries** for third-party libs and **tdesktop** (or **tdesktop-master**) for the app.
###Clone source code
By git <20> in [Git Bash](http://git-scm.com/downloads) go to **/d/tbuild** and run
* Build Solution for Debug configuration <20> only **zlibstat** project builds successfully
* Build Solution for Release configuration <20> only **zlibstat** project builds successfully
####libexif 0.6.20
Get sources from https://github.com/telegramdesktop/libexif-0.6.20, by git <20> in [Git Bash](http://git-scm.com/downloads) go to **/d/tbuild/libraries** and run
or download in ZIP and extract to **D:\TBuild\Libraries\**, rename **libexif-0.6.20-master** to **libexif-0.6.20** to have **D:\TBuild\Libraries\libexif-0.6.20\win32\lib_exif.sln** solution
#####Building library
* Open in VS2013 **D:\TBuild\Libraries\libexif-0.6.20\win32\lib_exif.sln**
Extract to **D:\TBuild\Libraries\**, rename **qt-everywhere-opensource-src-5.3.0** to **QtStatic** to have **D:\TBuild\Libraries\QtStatic\qtbase\** folder
Apply patch <20> copy (with overwrite!) everything from **D:\TBuild\tdesktop\\\_qt\_5\_3\_0\_patch\** to **D:\TBuild\Libraries\QtStatic\**
#####Building library
* Install Python 3.3.2 from https://www.python.org/download/releases/3.3.2 > [**Windows x86 MSI Installer (3.3.2)**](https://www.python.org/ftp/python/3.3.2/python-3.3.2.msi)
* Open **VS2013 x86 Native Tools Command Prompt.bat** (should be in **\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\Shortcuts\** folder)
* File > Open > Project/Solution > **D:\TBuild\tdesktop\Telegram.sln**
* Build \ Build Solution (Debug and Release configurations)
##Projects in Telegram solution
####Telegram
tdesktop messenger
####Updater
little app, that is launched by Telegram when update is ready, replaces all files and launches it back
####Packer
compiles given files to single update file, compresses it with lzma and signs with a private key, it was not included to Telegram solution, because private key is inaccessible
####Prepare
prepares a release for deployment, puts all files to deploy/{version} folder
* current tsetup{version}exe installer
* current Telegram.exe
* current Telegram.pdb (debug info for crash minidumps view)
* current tupdate{updversion} binary lzma update archive
####MetaEmoji
from two folders
* SourceFiles/art/Emoji
* SourceFiles/art/Emoji_200x
and some inner config creates four sprites and text2emoji replace code
* SourceFiles/art/emoji.png
* SourceFiles/art/emoji_125x.png
* SourceFiles/art/emoji_150x.png
* SourceFiles/art/emoji_200x.png
* SourceFiles/gui/emoji_config.cpp
####MetaStyle
from two files and two sprites
* Resources/style_classes.txt
* Resources/style.txt
* SourceFiles/art/sprite.png
* SourceFiles/art/sprite_200x.png
creates two other sprites, four sprite grids and style constants code
* SourceFiles/art/sprite_125x.png
* SourceFiles/art/sprite_150x.png
* SourceFiles/art/grid.png
* SourceFiles/art/grid_125x.png
* SourceFiles/art/grid_150x.png
* SourceFiles/art/grid_200x.png
* GeneratedFiles/style_classes.h
* GeneratedFiles/style_auto.h
* GeneratedFiles/style_auto.cpp
####MetaLang
from langpack file
* Resources/lang.txt
creates lang constants code and lang file parse code