From ff3b0fe2d92f83a069096ac78eaa7d1551ed28b2 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Fri, 27 Feb 2026 08:38:58 +0300 Subject: [PATCH] Updated Windows build docs for VS 2026. --- .github/workflows/win.yml | 1 - README.md | 5 ++-- docs/building-win-x64.md | 52 --------------------------------------- docs/building-win.md | 32 ++++++++++++++++++++---- 4 files changed, 29 insertions(+), 61 deletions(-) delete mode 100644 docs/building-win-x64.md diff --git a/.github/workflows/win.yml b/.github/workflows/win.yml index 2e12fde5ee..cbdff19e04 100644 --- a/.github/workflows/win.yml +++ b/.github/workflows/win.yml @@ -86,7 +86,6 @@ jobs: shell: bash run: | DOCPATH=$TBUILD/$REPO_NAME/docs/building-win.md - [ "${{ matrix.arch }}" = x64 ] && DOCPATH=$TBUILD/$REPO_NAME/docs/building-win-x64.md SDK="$(grep "SDK version" $DOCPATH | sed -r 's/.*\*\*(.*)\*\* SDK version.*/\1/')" echo "SDK=$SDK" >> $GITHUB_ENV diff --git a/README.md b/README.md index 02fd87697d..b5cabb358e 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,7 @@ Version **1.8.15** was the last that supports older systems ## Build instructions -* Windows [(32-bit)][win32] [(64-bit)][win64] +* [Windows (32-bit and 64-bit)][win] * [macOS][mac] * [GNU/Linux using Docker][linux] @@ -78,8 +78,7 @@ Version **1.8.15** was the last that supports older systems [telegram_api]: https://core.telegram.org [telegram_proto]: https://core.telegram.org/mtproto [license]: LICENSE -[win32]: docs/building-win.md -[win64]: docs/building-win-x64.md +[win]: docs/building-win.md [mac]: docs/building-mac.md [linux]: docs/building-linux.md [preview_image]: https://github.com/telegramdesktop/tdesktop/blob/dev/docs/assets/preview.png "Preview of Telegram Desktop" diff --git a/docs/building-win-x64.md b/docs/building-win-x64.md deleted file mode 100644 index 403c346b80..0000000000 --- a/docs/building-win-x64.md +++ /dev/null @@ -1,52 +0,0 @@ -# Build instructions for Windows 64-bit - -- [Prepare folder](#prepare-folder) -- [Install third party software](#install-third-party-software) -- [Clone source code and prepare libraries](#clone-source-code-and-prepare-libraries) -- [Build the project](#build-the-project) -- [Qt Visual Studio Tools](#qt-visual-studio-tools) - -## Prepare folder - -The build is done in **Visual Studio 2022** with **10.0.26100.0** SDK version. - -Choose an empty folder for the future build, for example **D:\\TBuild**. It will be named ***BuildPath*** in the rest of this document. Create two folders there, ***BuildPath*\\ThirdParty** and ***BuildPath*\\Libraries**. - -All commands (if not stated otherwise) will be launched from **x64 Native Tools Command Prompt for VS 2022.bat** (should be in **Start Menu > Visual Studio 2022** menu folder). Pay attention not to use any other Command Prompt. - -### Obtain your API credentials - -You will require **api_id** and **api_hash** to access the Telegram API servers. To learn how to obtain them [click here][api_credentials]. - -## Install third party software - -* Download **Python 3.10** installer from [https://www.python.org/downloads/](https://www.python.org/downloads/) and install it with adding to PATH. -* Download **Git** installer from [https://git-scm.com/download/win](https://git-scm.com/download/win) and install it. - -## Clone source code and prepare libraries - -Open **x64 Native Tools Command Prompt for VS 2022.bat**, go to ***BuildPath*** and run - - git clone --recursive https://github.com/telegramdesktop/tdesktop.git - tdesktop\Telegram\build\prepare\win.bat - -## Build the project - -Go to ***BuildPath*\\tdesktop\\Telegram** and run (using [your **api_id** and **api_hash**](#obtain-your-api-credentials)) - - configure.bat x64 -D TDESKTOP_API_ID=YOUR_API_ID -D TDESKTOP_API_HASH=YOUR_API_HASH - -* Open ***BuildPath*\\tdesktop\\out\\Telegram.sln** in Visual Studio 2022 -* Select Telegram project and press Build > Build Telegram (Debug and Release configurations) -* The result Telegram.exe will be located in **D:\TBuild\tdesktop\out\Debug** (and **Release**) - -### Qt Visual Studio Tools - -For better debugging you may want to install Qt Visual Studio Tools: - -* Open **Extensions** -> **Manage Extensions** -* Go to **Online** tab -* Search for **Qt** -* Install **Qt Visual Studio Tools** extension - -[api_credentials]: api_credentials.md diff --git a/docs/building-win.md b/docs/building-win.md index be79bfcfc5..1e9f7df47b 100644 --- a/docs/building-win.md +++ b/docs/building-win.md @@ -2,17 +2,18 @@ - [Prepare folder](#prepare-folder) - [Install third party software](#install-third-party-software) +- [Choose architecture and initialize terminal](#choose-architecture-and-initialize-terminal) - [Clone source code and prepare libraries](#clone-source-code-and-prepare-libraries) - [Build the project](#build-the-project) - [Qt Visual Studio Tools](#qt-visual-studio-tools) ## Prepare folder -The build is done in **Visual Studio 2022** with **10.0.26100.0** SDK version. +The build is done in **Visual Studio 2026** with **10.0.26100.0** SDK version. Choose an empty folder for the future build, for example **D:\\TBuild**. It will be named ***BuildPath*** in the rest of this document. Create two folders there, ***BuildPath*\\ThirdParty** and ***BuildPath*\\Libraries**. -All commands (if not stated otherwise) will be launched from **x86 Native Tools Command Prompt for VS 2022.bat** (should be in **Start Menu > Visual Studio 2022** menu folder). Pay attention not to use any other Command Prompt. +The default modern toolset from Visual Studio 2026 (`v145`) does not support Windows 7, so for Telegram Desktop you must use `-vcvars_ver=14.44` (`v144.4`, based on `v143` with Windows 7 support). ### Obtain your API credentials @@ -23,20 +24,41 @@ You will require **api_id** and **api_hash** to access the Telegram API servers. * Download **Python 3.10** installer from [https://www.python.org/downloads/](https://www.python.org/downloads/) and install it with adding to PATH. * Download **Git** installer from [https://git-scm.com/download/win](https://git-scm.com/download/win) and install it. +## Choose architecture and initialize terminal + +Before preparing libraries and running build commands, initialize the Visual Studio environment for your target architecture. +The default modern toolset from Visual Studio 2026 (`v145`) does not support Windows 7, so for Telegram Desktop you must use `-vcvars_ver=14.44` (`v144.4`, based on `v143` with Windows 7 support). + +For `win` (32-bit): + + %comspec% /k "C:\Program Files\Microsoft Visual Studio\18\Community\VC\Auxiliary\Build\vcvars32.bat" -vcvars_ver=14.44 + +For `win64` (64-bit): + + %comspec% /k "C:\Program Files\Microsoft Visual Studio\18\Community\VC\Auxiliary\Build\vcvars64.bat" -vcvars_ver=14.44 + +Run both `Clone source code and prepare libraries` and `Build the project` sections in the terminal initialized with one of the commands above. + ## Clone source code and prepare libraries -Open **x86 Native Tools Command Prompt for VS 2022.bat**, go to ***BuildPath*** and run +In the initialized terminal, go to ***BuildPath*** and run git clone --recursive https://github.com/telegramdesktop/tdesktop.git tdesktop\Telegram\build\prepare\win.bat ## Build the project -Go to ***BuildPath*\\tdesktop\\Telegram** and run (using [your **api_id** and **api_hash**](#obtain-your-api-credentials)) +Go to ***BuildPath*\\tdesktop\\Telegram** and run (using [your **api_id** and **api_hash**](#obtain-your-api-credentials)): + +For `win` (32-bit): configure.bat -D TDESKTOP_API_ID=YOUR_API_ID -D TDESKTOP_API_HASH=YOUR_API_HASH -* Open ***BuildPath*\\tdesktop\\out\\Telegram.sln** in Visual Studio 2022 +For `win64` (64-bit): + + configure.bat x64 -D TDESKTOP_API_ID=YOUR_API_ID -D TDESKTOP_API_HASH=YOUR_API_HASH + +* Open ***BuildPath*\\tdesktop\\out\\Telegram.sln** in Visual Studio 2026 * Select Telegram project and press Build > Build Telegram (Debug and Release configurations) * The result Telegram.exe will be located in **D:\TBuild\tdesktop\out\Debug** (and **Release**)