OSDN Git Service

BuildBin*.cmd: Use vswhere.exe
[winmerge-jp/winmerge-jp.git] / BuildBin.vs2017.cmd
1 cd /d "%~dp0"
2
3 del /s Build\*.exe
4 del /s BuildTmp\*.res
5
6 call SetVersion.cmd
7 cscript /nologo ExpandEnvironmenStrings.vbs Version.in > Version.h
8
9 setlocal
10 for /f "usebackq tokens=*" %%i in (`"%programfiles(x86)%\microsoft visual studio\installer\vswhere.exe" -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath`) do (
11   set InstallDir=%%i
12 )
13 if exist "%InstallDir%\Common7\Tools\vsdevcmd.bat" (
14   call "%InstallDir%\Common7\Tools\vsdevcmd.bat %*
15 )
16 MSBuild WinMerge.vs2017.sln /t:Rebuild /p:Configuration="Release Unicode" /p:Platform="Win32" || pause
17 MSBuild WinMerge.vs2017.sln /t:Rebuild /p:Configuration="Release Unicode" /p:Platform="x64" || pause
18 endlocal
19
20 if exist "%SIGNBAT_PATH%" (
21   call "%SIGNBAT_PATH%" Build\MergeUnicodeRelease\WinMergeU.exe
22   call "%SIGNBAT_PATH%" Build\MergeUnicodeRelease\MergeLang.dll
23   call "%SIGNBAT_PATH%" Build\x64\MergeUnicodeRelease\WinMergeU.exe
24   call "%SIGNBAT_PATH%" Build\x64\MergeUnicodeRelease\MergeLang.dll
25 )
26
27 mkdir Build\MergeUnicodeRelease\%APPVER% 2> NUL
28 mkdir Build\x64\MergeUnicodeRelease\%APPVER% 2> NUL
29 copy Build\MergeUnicodeRelease\*.pdb "Build\MergeUnicodeRelease\%APPVER%\"
30 copy Build\x64\MergeUnicodeRelease\*.pdb "Build\x64\MergeUnicodeRelease\%APPVER%\"
31
32 for %%i in ("%ProgramFiles(x86)%" "%ProgramFiles%") do (
33   if exist "%%~i\Inno Setup 5\iscc.exe" (
34     "%%~i\Inno Setup 5\iscc.exe" "Installer\innosetup\WinMerge.iss" || pause
35     "%%~i\Inno Setup 5\iscc.exe" "Installer\innosetup\WinMergeX64.iss" || pause
36   )
37 )
38