diff options
author | XhmikosR <xhmikosr@users.sourceforge.net> | 2013-02-07 12:15:16 +0400 |
---|---|---|
committer | XhmikosR <xhmikosr@users.sourceforge.net> | 2013-02-08 21:37:30 +0400 |
commit | 3aaaa7ec319735e691375023e78ede0a0b5b34e3 (patch) | |
tree | 0621bf489e89115210b906837f4e1a5f6524e798 /build.bat | |
parent | b676384bf1abaee5596de21dbf7ca2df3dfcc0ca (diff) |
Add sign support for the binaries
Diffstat (limited to 'build.bat')
-rw-r--r-- | build.bat | 67 |
1 files changed, 52 insertions, 15 deletions
@@ -56,8 +56,8 @@ IF /I "%ARG%" == "?" GOTO ShowHelp FOR %%G IN (%ARG%) DO (
IF /I "%%G" == "help" GOTO ShowHelp
IF /I "%%G" == "GetVersion" ENDLOCAL & CALL :SubGetVersion & EXIT /B
- IF /I "%%G" == "CopyDXDll" ENDLOCAL & CALL :SubCopyDXDll x86 & CALL :SubCopyDXDll x64 & EXIT /B
- IF /I "%%G" == "CopyDX" ENDLOCAL & CALL :SubCopyDXDll x86 & CALL :SubCopyDXDll x64 & EXIT /B
+ IF /I "%%G" == "CopyDXDll" ENDLOCAL & CALL :SubPrePackage MPC-HC x86 & CALL :SubPrePackage MPC-HC x64 & EXIT /B
+ IF /I "%%G" == "CopyDX" ENDLOCAL & CALL :SubPrePackage MPC-HC x86 & CALL :SubPrePackage MPC-HC x64 & EXIT /B
IF /I "%%G" == "Build" SET "BUILDTYPE=Build" & SET /A ARGB+=1
IF /I "%%G" == "Clean" SET "BUILDTYPE=Clean" & SET /A ARGB+=1 & SET /A ARGCL+=1 & SET /A ARGFF+=1
IF /I "%%G" == "Rebuild" SET "BUILDTYPE=Rebuild" & SET /A ARGB+=1 & SET /A ARGRE+=1
@@ -284,22 +284,16 @@ FOR %%G IN ("Armenian" "Basque" "Belarusian" "Catalan" "Chinese Simplified" EXIT /B
-:SubCopyDXDll
-PUSHD "%BIN_DIR%"
-EXPAND "%DXSDK_DIR%\Redist\Jun2010_D3DCompiler_43_%~1.cab" -F:D3DCompiler_43.dll mpc-hc_%~1 >NUL
-EXPAND "%DXSDK_DIR%\Redist\Jun2010_d3dx9_43_%~1.cab" -F:d3dx9_43.dll mpc-hc_%~1 >NUL
-POPD
-EXIT /B
-
-
:SubCreateInstaller
IF %ERRORLEVEL% NEQ 0 EXIT /B
IF DEFINED MPCHC_LITE SET MPCHC_INNO_DEF=%MPCHC_INNO_DEF% /DMPCHC_LITE
IF /I "%~1" == "x64" (
SET MPCHC_INNO_DEF=%MPCHC_INNO_DEF% /Dx64Build
- CALL :SubCopyDXDll x64
-) ELSE CALL :SubCopyDXDll x86
+ CALL :SubPrePackage MPC-HC x64
+) ELSE CALL :SubPrePackage MPC-HC x86
+IF %ERRORLEVEL% NEQ 0 EXIT /B 1
+
IF /I "%COMPILER%" == "VS2012" (SET MPCHC_INNO_DEF=%MPCHC_INNO_DEF% /DVS2012)
CALL :SubDetectInnoSetup
@@ -310,7 +304,8 @@ IF NOT DEFINED InnoSetupPath ( )
TITLE Compiling %1 %COMPILER% installer...
-"%InnoSetupPath%" /Q /O"%BIN_DIR%" "distrib\mpc-hc_setup.iss" %MPCHC_INNO_DEF%
+"%InnoSetupPath%" /SMySignTool="cmd /c "%~dp0contrib\sign.bat" $f" /Q /O"%BIN_DIR%"^
+ "distrib\mpc-hc_setup.iss" %MPCHC_INNO_DEF%
IF %ERRORLEVEL% NEQ 0 CALL :SubMsg "ERROR" "Compilation failed!" & EXIT /B
CALL :SubMsg "INFO" "%1 installer successfully built"
@@ -331,11 +326,11 @@ IF NOT DEFINED SEVENZIP ( IF /I "%~1" == "Filters" (SET "NAME=MPC-HC_standalone_filters") ELSE (SET "NAME=MPC-HC")
IF /I "%~2" == "Win32" (
SET ARCH=x86
- CALL :SubCopyDXDll x86
) ELSE (
SET ARCH=x64
- CALL :SubCopyDXDll x64
)
+CALL :SubPrePackage %~1 %ARCH%
+IF %ERRORLEVEL% NEQ 0 EXIT /B 1
PUSHD "%BIN_DIR%"
@@ -398,6 +393,48 @@ POPD EXIT /B
+:SubPrePackage
+IF %ERRORLEVEL% NEQ 0 EXIT /B 1
+REM %1 is Filters or MPC-HC
+REM %2 is %ARCH%; x86 or x64
+
+PUSHD "%BIN_DIR%"
+EXPAND "%DXSDK_DIR%\Redist\Jun2010_D3DCompiler_43_%~2.cab" -F:D3DCompiler_43.dll mpc-hc_%~2 >NUL
+EXPAND "%DXSDK_DIR%\Redist\Jun2010_d3dx9_43_%~2.cab" -F:d3dx9_43.dll mpc-hc_%~2 >NUL
+
+IF EXIST "%~dp0signinfo.txt" (
+ IF /I NOT "%SIGNED_BINARIES%" == "true" (
+ PUSHD "%~1_%~2"
+
+ IF /I "%~1" == "MPC-HC" (
+ IF NOT DEFINED MPCHC_LITE (
+ CALL "..\..\contrib\sign.bat" Lang\mpcresources.??.dll
+ IF %ERRORLEVEL% NEQ 0 CALL :SubMsg "ERROR" "Problem signing Lang\mpcresources.??.dll" & SET SIGNED_BINARIES=false & EXIT /B 1
+ )
+ IF /I "%~2" == "x64" (
+ CALL "..\..\contrib\sign.bat" mpc-hc64.exe
+ IF %ERRORLEVEL% NEQ 0 CALL :SubMsg "ERROR" "Problem signing mpc-hc64.exe" & SET SIGNED_BINARIES=false & EXIT /B 1
+ ) ELSE (
+ CALL "..\..\contrib\sign.bat" mpc-hc.exe
+ IF %ERRORLEVEL% NEQ 0 CALL :SubMsg "ERROR" "Problem signing mpc-hc.exe" & SET SIGNED_BINARIES=false & EXIT /B 1
+ )
+ CALL "..\..\contrib\sign.bat" mpciconlib.dll
+ IF %ERRORLEVEL% NEQ 0 CALL :SubMsg "ERROR" "Problem signing mpciconlib.dll" & SET SIGNED_BINARIES=false & EXIT /B 1
+ ) ELSE (
+ CALL "..\..\contrib\sign.bat" "*.ax"
+ IF %ERRORLEVEL% NEQ 0 CALL :SubMsg "ERROR" "Problem signing *.ax" & SET SIGNED_BINARIES=false & EXIT /B 1
+ CALL "..\..\contrib\sign.bat" "VSFilter.dll"
+ IF %ERRORLEVEL% NEQ 0 CALL :SubMsg "ERROR" "Problem signing VSFilter.dll" & SET SIGNED_BINARIES=false & EXIT /B 1
+ )
+ )
+ SET SIGNED_BINARIES=true
+ POPD
+)
+
+POPD
+EXIT /B 0
+
+
:SubGetVersion
REM Get the version
FOR /F "tokens=3,4 delims= " %%G IN (
|