编译指南
<h2>官方编译指南:</h2>
<p><a href="https://github.com/telegramdesktop/tdesktop/blob/dev/docs/building-win.md">https://github.com/telegramdesktop/tdesktop/blob/dev/docs/building-win.md</a></p>
<h2>系统环境:</h2>
<p>Windows10/11</p>
<h2>开发环境:</h2>
<p>VisualStudio2022 <a href="https://c2rsetup.officeapps.live.com/c2r/downloadVS.aspx?sku=enterprise&channel=Release&version=VS2022&source=VSLandingPage&includeRecommended=true&cid=2030:9c6225ab-e52d-4fcb-9e53-54db54e4f001" title="[点此下载]">[点此下载]</a>
Python3.9.13 <a href="https://www.python.org/ftp/python/3.9.13/python-3.9.13.exe" title="[点此下载]">[点此下载]</a>
注意:安装Python3.9以后,选择自定义安装,并将环境变量添加到系统中。
安装完以后,可以通过where python查看安装目录,以及python --version查看版本。</p>
<p>以下库可均可以通过集成包打包下载
Strawberry Perl - <a href="http://strawberryperl.com/">http://strawberryperl.com/</a>
NASM - <a href="http://www.nasm.us">http://www.nasm.us</a>
Yasm - <a href="http://yasm.tortall.net/Download.html">http://yasm.tortall.net/Download.html</a>
MSYS2 - <a href="http://www.msys2.org/">http://www.msys2.org/</a>
jom - <a href="http://download.qt.io/official_releases/jom/jom.zip">http://download.qt.io/official_releases/jom/jom.zip</a>
CMake 3.21 or later - <a href="https://cmake.org/download/">https://cmake.org/download/</a>
Ninja - <a href="https://github.com/ninja-build/ninja/releases/download/v1.7.2/ninja-win.zip">https://github.com/ninja-build/ninja/releases/download/v1.7.2/ninja-win.zip</a>
Git - <a href="https://git-scm.com/download/win">https://git-scm.com/download/win</a>
NuGet - <a href="https://dist.nuget.org/win-x86-commandline/latest/nuget.exe">https://dist.nuget.org/win-x86-commandline/latest/nuget.exe</a>
以上打包库的下载地址:
链接:<a href="https://pan.baidu.com/s/1HVVSFKnRmlOTHRNmQrWFmQ">https://pan.baidu.com/s/1HVVSFKnRmlOTHRNmQrWFmQ</a>
提取码:lmbg </p>
<h2>编译准备:</h2>
<ol>
<li>
<p>需要在系统时区中设置Unicode编码。
<img src="https://www.showdoc.com.cn/server/api/attachment/visitFile?sign=9c5df2102f6f24710dfd8223cd424f74" alt="" /></p>
</li>
<li>打开x86 Native Tools Command Prompt VS2022<br />
命令如下:
cd D:\Project\Black\client-secret-app\secret\
set Path=%Path%;D:\Project\Black\client-secret-app\secret\ThirdParty\Strawberry\perl\bin;^
C:\Users\sgw\AppData\Local\Programs\Python\Python39-32;^
D:\Project\Black\client-secret-app\secret\ThirdParty\NASM;^
D:\Project\Black\client-secret-app\secret\ThirdParty\jom;^
D:\Project\Black\client-secret-app\secret\ThirdParty\cmake\bin;^
D:\Project\Black\client-secret-app\secret\ThirdParty\yasm;^
D:\Project\Black\client-secret-app\secret\ThirdParty\Strawberry\c\bin;^
D:\Project\Black\client-secret-app\secret\ThirdParty\Strawberry\perl\site\bin;^
D:\Project\Black\client-secret-app\secret\ThirdParty\Strawberry\perl\bin;^
D:\Project\Black\client-secret-app\secret\ThirdParty\CMake\bin;^
D:\Project\Black\client-secret-app\secret\ThirdParty\gyp;^
D:\Project\Black\client-secret-app\secret\ThirdParty\Ninja;^
D:\Project\Black\client-secret-app\secret\ThirdParty\nuget;^</li>
</ol>
<p>Win下的指令为:</p>
<pre><code>python -m pip install pywin32
tdesktop\Telegram\build\prepare\win.bat
cd tdesktop/Telegram
configure.bat -D TDESKTOP_API_ID=17349 -D TDESKTOP_API_HASH=344583e45741c457fe1862106095a5eb -D DESKTOP_APP_USE_PACKAGED=OFF -D DESKTOP_APP_DISABLE_CRASH_REPORTS=OFF -D DESKTOP_APP_SPECIAL_TARGET=win</code></pre>
<p>MAC下的指令为:</p>
<pre><code>configure.sh -D TDESKTOP_API_ID=17349 -D TDESKTOP_API_HASH=344583e45741c457fe1862106095a5eb -D DESKTOP_APP_USE_PACKAGED=OFF -D DESKTOP_APP_MAC_ARCH=x86_64</code></pre>
<p>然后便可以在目录中找到解决方案了:
D:\Project\Black\client-secret-app\secret\tdesktop\out</p>