User:Dart Raiden/Build Miranda: Difference between revisions
Jump to navigation
Jump to search
Dart Raiden (talk | contribs) No edit summary |
Dart Raiden (talk | contribs) No edit summary |
||
Line 25: | Line 25: | ||
:CleanSources | :CleanSources | ||
if exist "% | if exist "%Sources%\%Solution%\%Configuration%64" rd /s /q "%Sources%\%Solution%\%Configuration%64" | ||
cd /d "% | cd /d "%Sources%" | ||
call cleaner.bat | call cleaner.bat | ||
:UpdateSources | :UpdateSources | ||
git --work-tree="%Sources%" --git-dir="%Sources%/.git" pull | git --work-tree="%Sources%" --git-dir="%Sources%/.git" pull | ||
:: or you can use something like tortoisegitproc /command:pull /path:"% | :: or you can use something like tortoisegitproc /command:pull /path:"%Sources%" | ||
:SetVsEnvironmentVariables | :SetVsEnvironmentVariables | ||
call "% | call "%Vs%\Common7\Tools\vsdevcmd.bat" -arch=amd64 -host_arch=amd64 -no_logo | ||
:BuildTdlib | :BuildTdlib | ||
"% | "%Msbuild%" "%Sources%\%Solution%\tdlib.sln" /m /t:Rebuild /p:Configuration=Release /p:Platform=x64 | ||
if not %ErrorLevel% == 0 ( | if not %ErrorLevel% == 0 ( | ||
echo ********** TDLib build failed ********** | echo ********** TDLib build failed ********** | ||
Line 45: | Line 45: | ||
:BuildMiranda | :BuildMiranda | ||
"% | "%Msbuild%" "%Sources%\%Solution%\my.sln" /m /t:Rebuild /p:Configuration=Release /p:Platform=x64 | ||
if not %ErrorLevel% == 0 ( | if not %ErrorLevel% == 0 ( | ||
echo ********** Miranda build failed ********** | echo ********** Miranda build failed ********** | ||
Line 53: | Line 53: | ||
:BuildIcons | :BuildIcons | ||
"% | "%Msbuild%" "%Sources%\%Solution%\my_icons.sln" /m /t:Rebuild /p:Configuration=Release /p:Platform=x64 | ||
if not %ErrorLevel% == 0 ( | if not %ErrorLevel% == 0 ( | ||
echo ********** Icons build failed ********** | echo ********** Icons build failed ********** | ||
Line 61: | Line 61: | ||
:BuildLangpack | :BuildLangpack | ||
mkdir "% | mkdir "%Sources%\%Solution%\%Configuration%64\Languages" | ||
cscript /nologo "% | cscript /nologo "%Sources%\tools\lpgen\translate.js" /sourcelang:"russian" /release:"%Sources%\%Solution%\%Configuration%64\Languages\langpack_russian.txt" | ||
:SortCompiledFiles | :SortCompiledFiles | ||
cd /d "% | cd /d "%Sources%\%Solution%\%Configuration%64" | ||
rd /q /s Obj | rd /q /s Obj | ||
for /r %%i in (*.ilk,*.iobj,*.ipdb) do del /q /s %%i | for /r %%i in (*.ilk,*.iobj,*.ipdb) do del /q /s %%i | ||
for /r Icons %%j in (*.pdb) do del /q /s %%j | for /r Icons %%j in (*.pdb) do del /q /s %%j | ||
for /r %%k in (*.pdb) do move %%k "% | for /r %%k in (*.pdb) do move %%k "%Sources%\%Solution%\%Configuration%64" | ||
:KillMiranda | :KillMiranda | ||
Line 79: | Line 79: | ||
:UpdateMiranda | :UpdateMiranda | ||
xcopy /i /s /y "% | xcopy /i /s /y "%Sources%\%Solution%\%Configuration%64" "%Miranda%" | ||
:BuildOpenssl | :BuildOpenssl |
Revision as of 21:42, 7 August 2023
It is assumed that you have 7-Zip, NASM, Strawberry Perl, and Visual Studion 2017 installed.
build.bat:
@echo off :CheckAdminRights net session >nul 2>&1 if not %ErrorLevel% == 0 ( echo Please run as administator^^! pause exit /b 1 ) :SetVariables set "unpacker=%ProgramFiles%\7-Zip\7zG.exe" set "Configuration=Release" set "Miranda=%ProgramFiles%\Miranda NG" set "Vs=%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community" set "Msbuild=%Vs%\MSBuild\15.0\Bin\MSBuild.exe" set "Openssl=D:\dev\openssl" set "Path=%ProgramFiles%\NASM;%Path%" set "Solution=bin15" set "Sources=D:\dev\miranda-ng" :CleanSources if exist "%Sources%\%Solution%\%Configuration%64" rd /s /q "%Sources%\%Solution%\%Configuration%64" cd /d "%Sources%" call cleaner.bat :UpdateSources git --work-tree="%Sources%" --git-dir="%Sources%/.git" pull :: or you can use something like tortoisegitproc /command:pull /path:"%Sources%" :SetVsEnvironmentVariables call "%Vs%\Common7\Tools\vsdevcmd.bat" -arch=amd64 -host_arch=amd64 -no_logo :BuildTdlib "%Msbuild%" "%Sources%\%Solution%\tdlib.sln" /m /t:Rebuild /p:Configuration=Release /p:Platform=x64 if not %ErrorLevel% == 0 ( echo ********** TDLib build failed ********** pause exit /b 1 ) :BuildMiranda "%Msbuild%" "%Sources%\%Solution%\my.sln" /m /t:Rebuild /p:Configuration=Release /p:Platform=x64 if not %ErrorLevel% == 0 ( echo ********** Miranda build failed ********** pause exit /b 1 ) :BuildIcons "%Msbuild%" "%Sources%\%Solution%\my_icons.sln" /m /t:Rebuild /p:Configuration=Release /p:Platform=x64 if not %ErrorLevel% == 0 ( echo ********** Icons build failed ********** pause exit /b 1 ) :BuildLangpack mkdir "%Sources%\%Solution%\%Configuration%64\Languages" cscript /nologo "%Sources%\tools\lpgen\translate.js" /sourcelang:"russian" /release:"%Sources%\%Solution%\%Configuration%64\Languages\langpack_russian.txt" :SortCompiledFiles cd /d "%Sources%\%Solution%\%Configuration%64" rd /q /s Obj for /r %%i in (*.ilk,*.iobj,*.ipdb) do del /q /s %%i for /r Icons %%j in (*.pdb) do del /q /s %%j for /r %%k in (*.pdb) do move %%k "%Sources%\%Solution%\%Configuration%64" :KillMiranda Taskkill /f /im Miranda64.exe :BackupOldMiranda if exist "%Temp%\Miranda_backup" rd /q /s "%Temp%\Miranda_backup" xcopy /i /s /y "%Miranda%" "%Temp%\Miranda_backup" :UpdateMiranda xcopy /i /s /y "%Sources%\%Solution%\%Configuration%64" "%Miranda%" :BuildOpenssl cd /d "%Openssl%" git apply "%Sources%\tools\openssl\openssl-mir-changes.patch" perl "%Openssl%\Configure" shared VC-WIN64A nmake for %%n in (libcrypto-1_1.mir,libssl-1_1.mir) do xcopy /y %%n "%Miranda%\Libs" for %%n in (libcrypto-1_1.pdb,libssl-1_1.pdb) do xcopy /y %%n "%Miranda%" :RunMiranda :: dirty hack to prevent the app from inheriting elevated permissions explorer "%Miranda%\Miranda64.exe" exit /b 0
my.sln and my_icons.sln are my custom solutions.