2017-04-20 11:58:04 +00:00
|
|
|
@echo off
|
2018-10-26 13:05:43 +00:00
|
|
|
setlocal EnableExtensions DisableDelayedExpansion
|
2020-10-26 11:48:33 +00:00
|
|
|
set VERSION=3.13
|
2017-05-14 12:22:16 +00:00
|
|
|
|
|
|
|
del /q *.appx >NUL 2>&1
|
2018-10-26 13:05:43 +00:00
|
|
|
del /q *.appxbundle >NUL 2>&1
|
|
|
|
del /q *.map >NUL 2>&1
|
2017-05-14 12:22:16 +00:00
|
|
|
|
2019-08-22 15:41:12 +00:00
|
|
|
set WDK_PATH=C:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0\x64
|
|
|
|
set MSBUILD_PATH=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin
|
2018-10-26 13:05:43 +00:00
|
|
|
set MANIFEST=AppxManifest.xml
|
|
|
|
set ARCHS=x86 x64 arm arm64
|
|
|
|
|
2020-06-18 10:42:57 +00:00
|
|
|
rem if you don't set the temp/tmp you get:
|
|
|
|
rem error MSB6001: Invalid command line switch for "CL.exe". System.ArgumentExcep Key being added: 'TEMP'
|
|
|
|
set temp=
|
|
|
|
set tmp=
|
|
|
|
|
2018-10-26 13:05:43 +00:00
|
|
|
cd /d "%~dp0"
|
|
|
|
setlocal EnableDelayedExpansion
|
|
|
|
set FILES_TO_SIGN=
|
|
|
|
for %%a in (%ARCHS%) do (
|
2019-03-26 17:26:01 +00:00
|
|
|
echo [Building %%a]
|
|
|
|
"%MSBUILD_PATH%\MSBuild" ..\..\rufus.sln /m /nologo /verbosity:minimal /t:Clean,Build /p:Configuration=Release,Platform=%%a
|
|
|
|
if ERRORLEVEL 1 goto out
|
|
|
|
echo.
|
2018-10-26 13:05:43 +00:00
|
|
|
set FILES_TO_SIGN=!FILES_TO_SIGN! "..\..\%%a\Release\rufus.exe"
|
|
|
|
)
|
|
|
|
"%WDK_PATH%\SignTool" sign /v /sha1 9ce9a71ccab3b38a74781b975f1c228222cf7d3b /fd SHA256 /tr http://sha256timestamp.ws.symantec.com/sha256/timestamp %FILES_TO_SIGN%
|
2017-04-20 11:58:04 +00:00
|
|
|
if ERRORLEVEL 1 goto out
|
2018-10-26 13:05:43 +00:00
|
|
|
endlocal
|
|
|
|
|
|
|
|
echo [Files]> bundle.map
|
|
|
|
|
|
|
|
for %%a in (%ARCHS%) do (
|
|
|
|
echo Creating %%a appx...
|
|
|
|
cd /d "%~dp0"
|
|
|
|
echo "Rufus-%%a.appx" "Rufus-%%a.appx">> bundle.map
|
|
|
|
mkdir %%a >NUL 2>&1
|
|
|
|
copy %MANIFEST% %%a\%MANIFEST% >NUL 2>&1
|
|
|
|
cd %%a
|
|
|
|
for /f "delims=" %%i in ('type %MANIFEST% ^& break ^> %MANIFEST%') do (
|
|
|
|
set "line=%%i"
|
|
|
|
setlocal EnableDelayedExpansion
|
|
|
|
>>%MANIFEST% echo(!line:@ARCH@=%%a!
|
|
|
|
endlocal
|
|
|
|
)
|
|
|
|
mkdir Assets >NUL 2>&1
|
|
|
|
copy "..\..\icons\rufus-44.png" "Assets\Square44x44Logo.png" >NUL 2>&1
|
|
|
|
copy "..\..\icons\rufus-48.png" "Assets\Square44x44Logo.targetsize-48.png" >NUL 2>&1
|
|
|
|
copy "..\..\icons\rufus-48.png" "Assets\Square44x44Logo.targetsize-48_altform-unplated.png" >NUL 2>&1
|
|
|
|
copy "..\..\icons\rufus-150.png" "Assets\Square150x150Logo.png" >NUL 2>&1
|
|
|
|
copy "..\..\..\%%a\Release\rufus.exe" "rufus.exe" >NUL 2>&1
|
2019-03-26 17:26:01 +00:00
|
|
|
"%WDK_PATH%\MakePri" createconfig /o /dq en-US /cf priconfig.xml
|
2018-10-26 13:05:43 +00:00
|
|
|
"%WDK_PATH%\MakePri" new /o /pr . /cf priconfig.xml
|
|
|
|
"%WDK_PATH%\MakeAppx" pack /o /d . /p ../Rufus-%%a.appx
|
|
|
|
if ERRORLEVEL 1 goto out
|
|
|
|
)
|
|
|
|
|
|
|
|
cd /d "%~dp0"
|
|
|
|
"%WDK_PATH%\SignTool" sign /v /sha1 9ce9a71ccab3b38a74781b975f1c228222cf7d3b /fd SHA256 /tr http://sha256timestamp.ws.symantec.com/sha256/timestamp *.appx
|
|
|
|
if ERRORLEVEL 1 goto out
|
|
|
|
"%WDK_PATH%\MakeAppx" bundle /f bundle.map /p Rufus-%VERSION%.appxbundle
|
|
|
|
"%WDK_PATH%\SignTool" sign /v /sha1 9ce9a71ccab3b38a74781b975f1c228222cf7d3b /fd SHA256 /tr http://sha256timestamp.ws.symantec.com/sha256/timestamp Rufus-%VERSION%.appxbundle
|
|
|
|
|
2017-04-20 11:58:04 +00:00
|
|
|
:out
|
2018-10-26 13:05:43 +00:00
|
|
|
cd /d "%~dp0"
|
|
|
|
for %%a in (%ARCHS%) do (
|
|
|
|
rd /S /Q %%a >NUL 2>&1
|
|
|
|
)
|
|
|
|
del /q *.map >NUL 2>&1
|
|
|
|
del /q *.appx >NUL 2>&1
|
|
|
|
rename *.appxbundle *.appx >NUL 2>&1
|
2017-04-20 11:58:04 +00:00
|
|
|
pause
|
|
|
|
exit
|