OSDN Git Service

IniOptionsMgr.cpp: The value of the m_serializing variable was not initialized
[winmerge-jp/winmerge-jp.git] / BuildBin.vs2017.cmd
index 847f7c6..52f2c55 100644 (file)
@@ -1,34 +1,45 @@
 cd /d "%~dp0"
 
-del /s Build\*.exe
-del /s BuildTmp\*.res
-
 call SetVersion.cmd
 cscript /nologo ExpandEnvironmenStrings.vbs Version.in > Version.h
 
 setlocal
-set VisualStudioVersion=15.0
-call "%VS141COMNTOOLS%vsvars32.bat"
-MSBuild WinMerge.vs2017.sln /t:Rebuild /p:Configuration="Release Unicode" /p:Platform="Win32" || pause
-MSBuild WinMerge.vs2017.sln /t:Rebuild /p:Configuration="Release Unicode" /p:Platform="x64" || pause
-endlocal
+for /f "usebackq tokens=*" %%i in (`"%programfiles(x86)%\microsoft visual studio\installer\vswhere.exe" -version [15.0^,16.0^) -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath`) do (
+  set InstallDir=%%i
+)
+if exist "%InstallDir%\Common7\Tools\vsdevcmd.bat" (
+  call "%InstallDir%\Common7\Tools\vsdevcmd.bat
+)
 
-if exist "%SIGNBAT_PATH%" (
-  call "%SIGNBAT_PATH%" Build\MergeUnicodeRelease\WinMergeU.exe
-  call "%SIGNBAT_PATH%" Build\MergeUnicodeRelease\MergeLang.dll
-  call "%SIGNBAT_PATH%" Build\x64\MergeUnicodeRelease\WinMergeU.exe
-  call "%SIGNBAT_PATH%" Build\x64\MergeUnicodeRelease\MergeLang.dll
+if "%1" == "" (
+  call :BuildBin || goto :eof
+  call :BuildBin ARM64 || goto :eof
+  call :BuildBin x64 || goto :eof
+) else (
+  call :BuildBin %1 || goto :eof
 )
 
-mkdir Build\MergeUnicodeRelease\%APPVER% 2> NUL
-mkdir Build\x64\MergeUnicodeRelease\%APPVER% 2> NUL
-copy Build\MergeUnicodeRelease\*.pdb "Build\MergeUnicodeRelease\%APPVER%\"
-copy Build\x64\MergeUnicodeRelease\*.pdb "Build\x64\MergeUnicodeRelease\%APPVER%\"
+goto :eof
 
-for %%i in ("%ProgramFiles(x86)%" "%ProgramFiles%") do (
-  if exist "%%~i\Inno Setup 5\iscc.exe" (
-    "%%~i\Inno Setup 5\iscc.exe" "Installer\innosetup\WinMerge.iss" || pause
-    "%%~i\Inno Setup 5\iscc.exe" "Installer\innosetup\WinMergeX64.iss" || pause
-  )
+:BuildBin
+set PLATFORM=%1
+if "%1" == "" (
+  set PLATFORM_VS=Win32
+) else (
+  set PLATFORM_VS=%1
+)
+if "%PLATFORM_VS%" == "Win32" (
+  set PLATFORM_DIR=
+) else (
+  set PLATFORM_DIR=%PLATFORM_VS%
+)
+MSBuild WinMerge.vs2017.sln /t:Rebuild /p:Configuration="Release" /p:Platform="%PLATFORM_VS%" || goto :eof
+endlocal
+
+if exist "%SIGNBAT_PATH%" (
+  call "%SIGNBAT_PATH%" Build\%PLATFORM_DIR%\Release\WinMergeU.exe
 )
 
+mkdir Build\%PLATFORM_DIR%\Release\%APPVER% 2> NUL
+copy Build\%PlATFORM_DIR%\Release\*.pdb "Build\%PLATFORM_DIR%\Release\%APPVER%\"
+goto :eof