2010-11-20 21:16:03 +01:00
|
|
|
@ECHO OFF
|
|
|
|
SETLOCAL
|
|
|
|
TITLE Compiling Subtitle Edit...
|
|
|
|
|
2011-02-03 11:43:13 +01:00
|
|
|
CD /D %~dp0
|
2010-11-29 17:27:13 +01:00
|
|
|
|
2011-02-03 11:43:13 +01:00
|
|
|
IF NOT DEFINED VS100COMNTOOLS (
|
|
|
|
ECHO Visual Studio 2010 wasn't found
|
|
|
|
GOTO EndWithError
|
2010-11-20 21:16:03 +01:00
|
|
|
)
|
|
|
|
|
2011-02-03 11:43:13 +01:00
|
|
|
IF "%~1" == "" (
|
|
|
|
SET "BUILDTYPE=Build"
|
|
|
|
) ELSE (
|
|
|
|
IF /I "%~1" == "Build" SET "BUILDTYPE=Build" & GOTO START
|
|
|
|
IF /I "%~1" == "/Build" SET "BUILDTYPE=Build" & GOTO START
|
|
|
|
IF /I "%~1" == "-Build" SET "BUILDTYPE=Build" & GOTO START
|
|
|
|
IF /I "%~1" == "--Build" SET "BUILDTYPE=Build" & GOTO START
|
|
|
|
IF /I "%~1" == "Clean" SET "BUILDTYPE=Clean" & GOTO START
|
|
|
|
IF /I "%~1" == "/Clean" SET "BUILDTYPE=Clean" & GOTO START
|
|
|
|
IF /I "%~1" == "-Clean" SET "BUILDTYPE=Clean" & GOTO START
|
|
|
|
IF /I "%~1" == "--Clean" SET "BUILDTYPE=Clean" & GOTO START
|
|
|
|
IF /I "%~1" == "Rebuild" SET "BUILDTYPE=Rebuild" & GOTO START
|
|
|
|
IF /I "%~1" == "/Rebuild" SET "BUILDTYPE=Rebuild" & GOTO START
|
|
|
|
IF /I "%~1" == "-Rebuild" SET "BUILDTYPE=Rebuild" & GOTO START
|
|
|
|
IF /I "%~1" == "--Rebuild" SET "BUILDTYPE=Rebuild" & GOTO START
|
|
|
|
|
|
|
|
ECHO. & ECHO Unsupported commandline switch!
|
|
|
|
GOTO EndWithError
|
|
|
|
)
|
2010-11-20 21:16:03 +01:00
|
|
|
|
|
|
|
|
2011-02-03 11:43:13 +01:00
|
|
|
:START
|
2010-11-20 21:16:03 +01:00
|
|
|
PUSHD "src"
|
|
|
|
|
2011-02-03 11:43:13 +01:00
|
|
|
CALL "%VS100COMNTOOLS%vsvars32.bat"
|
|
|
|
|
|
|
|
devenv SubtitleEdit.sln /%BUILDTYPE% "Release|Any CPU"
|
|
|
|
IF %ERRORLEVEL% NEQ 0 GOTO EndWithError
|
|
|
|
|
2010-11-20 21:16:03 +01:00
|
|
|
ECHO.
|
|
|
|
POPD
|
|
|
|
|
2011-02-03 11:43:13 +01:00
|
|
|
IF /I "%BUILDTYPE%" == "Clean" GOTO END
|
|
|
|
|
|
|
|
CALL :SubDetectInno
|
|
|
|
|
2010-11-29 17:27:13 +01:00
|
|
|
IF DEFINED InnoSetupPath (
|
2011-02-03 11:43:13 +01:00
|
|
|
PUSHD "InnoSetupScript"
|
|
|
|
|
|
|
|
"%InnoSetupPath%\iscc.exe" /Q "Subtitle_Edit_installer.iss"
|
|
|
|
IF %ERRORLEVEL% NEQ 0 GOTO EndWithError
|
|
|
|
|
|
|
|
ECHO. & ECHO Installer compiled successfully!
|
|
|
|
MOVE /Y "SubtitleEdit-*-setup.exe" ".." >NUL 2>&1
|
|
|
|
POPD
|
2010-11-29 17:27:13 +01:00
|
|
|
) ELSE (
|
2011-02-03 11:43:13 +01:00
|
|
|
ECHO Inno Setup wasn't found; the installer wasn't built
|
2010-11-29 17:27:13 +01:00
|
|
|
)
|
2010-11-20 21:16:03 +01:00
|
|
|
|
|
|
|
|
|
|
|
:END
|
|
|
|
ECHO.
|
2011-02-03 11:43:13 +01:00
|
|
|
ENDLOCAL
|
|
|
|
PAUSE
|
2010-11-20 21:16:03 +01:00
|
|
|
EXIT /B
|
|
|
|
|
2011-02-03 11:43:13 +01:00
|
|
|
|
2010-11-20 21:16:03 +01:00
|
|
|
:EndWithError
|
|
|
|
Title Compiling Subtitle Edit [ERROR]
|
2011-02-03 11:43:13 +01:00
|
|
|
ECHO. & ECHO.
|
|
|
|
ECHO **ERROR: Build failed and aborted!**
|
2010-11-20 21:16:03 +01:00
|
|
|
PAUSE
|
|
|
|
ENDLOCAL
|
|
|
|
EXIT
|
|
|
|
|
2011-02-03 11:43:13 +01:00
|
|
|
|
|
|
|
:SubDetectInno
|
|
|
|
REM Detect if we are running on 64bit WIN and use Wow6432Node, and set the path
|
|
|
|
REM of Inno Setup accordingly
|
|
|
|
IF "%PROGRAMFILES(x86)%zzz"=="zzz" (
|
|
|
|
SET "U_=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
|
|
|
|
) ELSE (
|
|
|
|
SET "U_=HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall"
|
|
|
|
)
|
|
|
|
|
|
|
|
SET "I_=Inno Setup"
|
|
|
|
SET "A_=%I_% 5"
|
|
|
|
FOR /f "delims=" %%a IN (
|
|
|
|
'REG QUERY "%U_%\%A_%_is1" /v "%I_%: App Path"2^>Nul^|FIND "REG_"') DO (
|
|
|
|
SET "InnoSetupPath=%%a" & CALL :SubIS %%InnoSetupPath:*Z=%%)
|
|
|
|
EXIT /B
|
|
|
|
|
|
|
|
|
2010-11-20 21:16:03 +01:00
|
|
|
:SubIS
|
|
|
|
SET InnoSetupPath=%*
|
2011-02-03 11:43:13 +01:00
|
|
|
EXIT /B
|