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 3: | Line 3: | ||
@echo off | @echo off | ||
:CheckAdminRights | |||
net session >nul 2>&1 | net session >nul 2>&1 | ||
if not % | if not %ErrorLevel% == 0 ( | ||
echo Please run as administator! | echo Please run as administator^^! | ||
pause | pause | ||
exit | exit /b 1 | ||
) | ) | ||
set | :SetVariables | ||
set "7zip=%ProgramFiles%\7-Zip\7zG.exe" | |||
set | set "Configuration=Release" | ||
set | set "Miranda=%ProgramFiles%\Miranda NG" | ||
set | set "Msbuild=%vs%\MSBuild\15.0\Bin\MSBuild.exe" | ||
set "Solution=bin15" | |||
set | set "Sources=D:\dev\miranda-ng" | ||
set "Vs=%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community" | |||
:CleanSources | |||
if exist "%sources%\%Solution%\%configuration%64" rd /s /q "%sources%\%Solution%\%configuration%64" | |||
if exist "%sources%\% | |||
cd /d "%sources%" | cd /d "%sources%" | ||
call cleaner.bat | call cleaner.bat | ||
:UpdateSources | |||
tortoisegitproc /command:pull /path:"%sources%" | |||
"% | :SetVsEnvironmentVariables | ||
call "%vs%\Common7\Tools\vsdevcmd.bat" -arch=amd64 -host_arch=amd64 -no_logo | |||
"%msbuild%" "%sources%\% | :BuildMiranda | ||
if not % | ::TODO платформу и конфигурацию задавать в vsdevcmd | ||
"%msbuild%" "%sources%\%Solution%\my.sln" /m /t:Rebuild /p:Configuration=Release /p:Platform=x64 | |||
if not %ErrorLevel% == 0 ( | |||
echo ********** Miranda build failed ********** | echo ********** Miranda build failed ********** | ||
pause | pause | ||
exit | exit /b 1 | ||
) | ) | ||
"%msbuild%" "%sources%\% | :BuildIcons | ||
if not % | ::TODO платформу и конфигурацию задавать в vsdevcmd | ||
"%msbuild%" "%sources%\%Solution%\my_icons.sln" /m /t:Rebuild /p:Configuration=Release /p:Platform=x64 | |||
if not %ErrorLevel% == 0 ( | |||
echo ********** Icons build failed ********** | echo ********** Icons build failed ********** | ||
pause | pause | ||
exit | exit /b 1 | ||
) | ) | ||
mkdir "%sources%\% | :BuildLangpack | ||
cscript /nologo "%sources%\tools\lpgen\translate.js" /sourcelang:"russian" /release:"%sources%\% | mkdir "%sources%\%Solution%\%configuration%64\Languages" | ||
cscript /nologo "%sources%\tools\lpgen\translate.js" /sourcelang:"russian" /release:"%sources%\%Solution%\%configuration%64\Languages\langpack_russian.txt" | |||
cd /d "%sources%\% | :SortCompiledFiles | ||
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 "%sources%\% | for /r %%k in (*.pdb) do move %%k "%sources%\%Solution%\%configuration%64" | ||
:KillMiranda | |||
Taskkill /f /im Miranda64.exe | Taskkill /f /im Miranda64.exe | ||
if exist "% | :BackupOldMiranda | ||
xcopy /i /s /y "% | if exist "%Temp%\Miranda_backup" rd /q /s "%Temp%\Miranda_backup" | ||
xcopy /i /s /y "%Miranda%" "%Temp%\Miranda_backup" | |||
xcopy /i /s /y "%sources%\% | :UpdateMiranda | ||
xcopy /i /s /y "%sources%\%Solution%\%configuration%64" "%Miranda%" | |||
cd % | :ObtainOpenssl | ||
cd %Temp% | |||
curl https://www.miranda-ng.org/distr/pdb_x64/miranda64.zip -o miranda64.zip | curl https://www.miranda-ng.org/distr/pdb_x64/miranda64.zip -o miranda64.zip | ||
"% | "%7zip%" e miranda64.zip libcrypto* libssl* -r -aoa | ||
for %%n in (libcrypto-1_1.mir,libssl-1_1.mir) do xcopy /y %%n "% | 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 "% | 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 | :: dirty hack to prevent the app from inheriting elevated permissions | ||
explorer "% | explorer "%Miranda%\Miranda64" | ||
exit | exit /b 0 | ||
</pre> | </pre> | ||
my.sln and my_icons.sln are my custom solutions. | my.sln and my_icons.sln are my custom solutions. |
Revision as of 19:12, 3 August 2023
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 "7zip=%ProgramFiles%\7-Zip\7zG.exe" set "Configuration=Release" set "Miranda=%ProgramFiles%\Miranda NG" set "Msbuild=%vs%\MSBuild\15.0\Bin\MSBuild.exe" set "Solution=bin15" set "Sources=D:\dev\miranda-ng" set "Vs=%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community" :CleanSources if exist "%sources%\%Solution%\%configuration%64" rd /s /q "%sources%\%Solution%\%configuration%64" cd /d "%sources%" call cleaner.bat :UpdateSources tortoisegitproc /command:pull /path:"%sources%" :SetVsEnvironmentVariables call "%vs%\Common7\Tools\vsdevcmd.bat" -arch=amd64 -host_arch=amd64 -no_logo :BuildMiranda ::TODO платформу и конфигурацию задавать в vsdevcmd "%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 ::TODO платформу и конфигурацию задавать в vsdevcmd "%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%" :ObtainOpenssl cd %Temp% curl https://www.miranda-ng.org/distr/pdb_x64/miranda64.zip -o miranda64.zip "%7zip%" e miranda64.zip libcrypto* libssl* -r -aoa 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" exit /b 0
my.sln and my_icons.sln are my custom solutions.