Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

83 lines (63 sloc) 4.263 kB
@echo off
setlocal enabledelayedexpansion
set VERSIONTAG=
set VCVARSALL="%ProgramFiles(x86)%\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"
set DEVENV="devenv.exe"
set MAKENSIS="%ProgramFiles(x86)%\NSIS\Unicode\makensis.exe"
set RAR="%ProgramFiles%\WinRAR\WinRAR.exe"
set SIGNCMD=signtool.exe sign /n "Next Generation Software" /sha1 "c4ece717747eb7d0cac824f6c7431e5237138b02" /t http://timestamp.verisign.com/scripts/timstamp.dll
rem Windows Sysinternals Sigcheck from http://technet.microsoft.com/en-us/sysinternals/bb897441
set SIGCHECK="%ProgramFiles(x86)%\Sigcheck\sigcheck.exe"
call %VCVARSALL% x86
rmdir /s /q "%~dp0\mRemoteV1\bin" > nul 2>&1
rmdir /s /q "%~dp0\mRemoteV1\obj" > nul 2>&1
echo Building release version...
%DEVENV% "%~dp0\mRemoteV1.sln" /build "Release"
echo Building portable version...
%DEVENV% "%~dp0\mRemoteV1.sln" /build "Release Portable"
echo Signing binaries...
%SIGNCMD% "%~dp0\mRemoteV1\bin\Release\de\mRemoteNG.resources.dll" "%~dp0\mRemoteV1\bin\Release\en-US\mRemoteNG.resources.dll" "%~dp0\mRemoteV1\bin\Release\fr\mRemoteNG.resources.dll" "%~dp0\mRemoteV1\bin\Release\AxInterop.WFICALib.dll" "%~dp0\mRemoteV1\bin\Release\AxInterop.MSTSCLib.dll" "%~dp0\mRemoteV1\bin\Release\Interop.WFICALib.dll" "%~dp0\mRemoteV1\bin\Release\Interop.ShDocVw.dll" "%~dp0\mRemoteV1\bin\Release\Interop.MSTSCLib.dll" "%~dp0\mRemoteV1\bin\Release\Interop.EOLWTSCOM.dll" "%~dp0\mRemoteV1\bin\Release\Interop.EOLWTSCOM.dll" "%~dp0\mRemoteV1\bin\Release\mRemoteNG.exe" "%~dp0\mRemoteV1\bin\Release Portable\de\mRemoteNG.resources.dll" "%~dp0\mRemoteV1\bin\Release Portable\en-US\mRemoteNG.resources.dll" "%~dp0\mRemoteV1\bin\Release Portable\fr\mRemoteNG.resources.dll" "%~dp0\mRemoteV1\bin\Release Portable\AxInterop.WFICALib.dll" "%~dp0\mRemoteV1\bin\Release Portable\AxInterop.MSTSCLib.dll" "%~dp0\mRemoteV1\bin\Release Portable\Interop.WFICALib.dll" "%~dp0\mRemoteV1\bin\Release Portable\Interop.ShDocVw.dll" "%~dp0\mRemoteV1\bin\Release Portable\Interop.MSTSCLib.dll" "%~dp0\mRemoteV1\bin\Release Portable\Interop.EOLWTSCOM.dll" "%~dp0\mRemoteV1\bin\Release Portable\Interop.EOLWTSCOM.dll" "%~dp0\mRemoteV1\bin\Release Portable\mRemoteNG.exe"
mkdir "%~dp0\Release" > nul 2>&1
echo Getting product version...
set VERSIONNSH="%~dp0\Release\Version.nsh"
set SIGCHECK=!SIGCHECK:"=^"!
set SIGCHECK=!SIGCHECK: =^^ !
set SIGCHECK=!SIGCHECK:(=^^(!
set SIGCHECK=!SIGCHECK:)=^^)!
for /F "usebackq delims=. tokens=1-4" %%i in (`!SIGCHECK! /accepteula -q -n "%~dp0\mRemoteV1\bin\Release\mRemoteNG.exe"`) do (
set PRODUCT_VERSION_SHORT=%%i.%%j
echo ^^!define PRODUCT_VERSION "%%i.%%j.%%k.%%l" > %VERSIONNSH%
echo ^^!define PRODUCT_VERSION_SHORT "%%i.%%j" >> %VERSIONNSH%
echo ^^!define PRODUCT_VERSION_MAJOR "%%i" >> %VERSIONNSH%
echo ^^!define PRODUCT_VERSION_MINOR "%%j" >> %VERSIONNSH%
)
echo Version is %PRODUCT_VERSION_SHORT%
echo Creating installer package...
if defined VERSIONTAG (
%MAKENSIS% /DPRODUCT_VERSION_TAG=%VERSIONTAG% "%~dp0\Installer\mRemote.nsi"
set INSTALLEREXE="%~dp0\Release\mRemoteNG-Installer-%PRODUCT_VERSION_SHORT%-%VERSIONTAG%.exe"
set BINARYZIP="%~dp0\Release\mRemoteNG-%PRODUCT_VERSION_SHORT%-%VERSIONTAG%.zip"
set PORTABLEZIP="%~dp0\Release\mRemoteNG-Portable-%PRODUCT_VERSION_SHORT%-%VERSIONTAG%.zip"
) else (
%MAKENSIS% "%~dp0\Installer\mRemote.nsi"
set INSTALLEREXE="%~dp0\Release\mRemoteNG-Installer-%PRODUCT_VERSION_SHORT%.exe"
set BINARYZIP="%~dp0\Release\mRemoteNG-%PRODUCT_VERSION_SHORT%.zip"
set PORTABLEZIP="%~dp0\Release\mRemoteNG-Portable-%PRODUCT_VERSION_SHORT%.zip"
)
del %VERSIONNSH%
echo Signing installer package...
%SIGNCMD% %INSTALLEREXE%
echo Creating release ZIP file...
del /f /q %BINARYZIP% > nul 2>&1
%RAR% a -m5 -r -ep1 -afzip -inul %BINARYZIP% "%~dp0\mRemoteV1\bin\Release\*.*"
%RAR% a -m5 -r -ep1 -afzip -inul %BINARYZIP% "%~dp0\Installer\Dependencies\*.*"
%RAR% a -m5 -ep -afzip -inul %BINARYZIP% "%~dp0\*.TXT"
echo Creating portable ZIP file...
del /f /q %PORTABLEZIP% > nul 2>&1
%RAR% a -m5 -r -ep1 -afzip -inul %PORTABLEZIP% "%~dp0\mRemoteV1\bin\Release Portable\*.*"
%RAR% a -m5 -r -ep1 -afzip -inul %PORTABLEZIP% "%~dp0\Installer\Dependencies\*.*"
%RAR% a -m5 -ep -afzip -inul %PORTABLEZIP% "%~dp0\*.TXT"
echo.
echo Build process complete.
echo.
pause
Jump to Line
Something went wrong with that request. Please try again.