diff --git a/build.bat b/build.bat index 27de47c0b..b7dc1af4f 100644 --- a/build.bat +++ b/build.bat @@ -1,5 +1,8 @@ @ECHO OFF SETLOCAL +SET "VERSION=3.2" +SET "SEVENZIP_PATH=%PROGRAMFILES%\7-Zip\7z.exe" + CD /D %~dp0 rem Check for the help switches @@ -51,17 +54,18 @@ POPD IF /I "%BUILDTYPE%" == "Clean" GOTO END +IF DEFINED SEVENZIP_PATH IF EXIST "%SEVENZIP_PATH%" CALL :SubZipFile + CALL :SubDetectInnoSetup IF DEFINED InnoSetupPath ( PUSHD "installer" TITLE Compiling installer... - "%InnoSetupPath%\iscc.exe" /Q "Subtitle_Edit_installer.iss" + "%InnoSetupPath%\iscc.exe" /O.. /Q "Subtitle_Edit_installer.iss" IF %ERRORLEVEL% NEQ 0 GOTO EndWithError ECHO. & ECHO Installer compiled successfully! - MOVE /Y "SubtitleEdit-*-setup.exe" ".." >NUL POPD ) ELSE ( ECHO Inno Setup wasn't found; the installer wasn't built @@ -69,12 +73,45 @@ IF DEFINED InnoSetupPath ( :END +TITLE Compiling Subtitle Edit finished! ECHO. ENDLOCAL PAUSE EXIT /B +:SubZipFile +TITLE Creating the ZIP file... +PUSHD "src\bin\Release" +IF EXIST "temp_zip" RD /S /Q "temp_zip" +IF NOT EXIST "temp_zip" MD "temp_zip" +IF NOT EXIST "temp_zip\Languages" MD "temp_zip\Languages" +IF NOT EXIST "temp_zip\Tesseract" MD "temp_zip\Tesseract" +IF NOT EXIST "temp_zip\Tesseract\tessdata" MD "temp_zip\Tesseract\tessdata" + +COPY /Y /V "..\..\gpl.txt" "temp_zip\" +COPY /Y /V "..\..\Changelog.txt" "temp_zip\" +COPY /Y /V "Interop.QuartzTypeLib.dll" "temp_zip\" +COPY /Y /V "Hunspellx86.dll" "temp_zip\" +COPY /Y /V "NHunspell.dll" "temp_zip\" +COPY /Y /V "SubtitleEdit.exe" "temp_zip\" +COPY /Y /V "Languages\*.xml" "temp_zip\Languages\" +COPY /Y /V "..\..\..\Tesseract\leptonlib.dll" "temp_zip\Tesseract\" +COPY /Y /V "..\..\..\Tesseract\tesseract.exe" "temp_zip\Tesseract\" +COPY /Y /V "..\..\..\Tesseract\tessdata\eng.traineddata" "temp_zip\Tesseract\tessdata\" + +PUSHD "temp_zip" +START "" /B /WAIT "%SEVENZIP_PATH%" a -tzip -mx=9 "SE%VERSION%.zip" * >NUL +IF %ERRORLEVEL% NEQ 0 GOTO EndWithError + + +MOVE /Y "SE%VERSION%.zip" "..\..\..\.." >NUL +POPD +IF EXIST "temp_zip" RD /S /Q "temp_zip" +POPD +EXIT /B + + :EndWithError Title Compiling Subtitle Edit [ERROR] ECHO. & ECHO. diff --git a/installer/Subtitle_Edit_installer.iss b/installer/Subtitle_Edit_installer.iss index c8903ce94..1520e0dbd 100644 --- a/installer/Subtitle_Edit_installer.iss +++ b/installer/Subtitle_Edit_installer.iss @@ -26,11 +26,6 @@ #error Update your Inno Setup version #endif -;#ifnexist "..\src\bin\Release\SubtitleEdit.exe" -; #error Compile Subtitle Edit first -;#endif - - #define installer_build_number "16" #define VerMajor @@ -40,6 +35,9 @@ #define bindir "..\src\Bin\Release" +;#ifnexist "..\src\bin\Release\SubtitleEdit.exe" +; #error Compile Subtitle Edit first +;#endif #expr ParseVersion(bindir + "\SubtitleEdit.exe", VerMajor, VerMinor, VerBuild, VerRevision) #define app_version str(VerMajor) + "." + str(VerMinor) + "." + str(VerBuild) + "." + str(VerRevision) @@ -191,6 +189,7 @@ Source: ..\Dictionaries\en_US_names_etc.xml; DestDir: {userappdata}\Subtit Source: ..\Dictionaries\en_US_user.xml; DestDir: {userappdata}\Subtitle Edit\Dictionaries; Flags: ignoreversion onlyifdoesntexist uninsneveruninstall; Components: main Source: ..\Dictionaries\eng_OCRFixReplaceList.xml; DestDir: {userappdata}\Subtitle Edit\Dictionaries; Flags: ignoreversion onlyifdoesntexist uninsneveruninstall; Components: main Source: ..\Dictionaries\names_etc.xml; DestDir: {userappdata}\Subtitle Edit\Dictionaries; Flags: ignoreversion onlyifdoesntexist uninsneveruninstall; Components: main +Source: ..\Dictionaries\swe_OCRFixReplaceList.xml; DestDir: {userappdata}\Subtitle Edit\Dictionaries; Flags: ignoreversion onlyifdoesntexist uninsneveruninstall; Components: main Source: ..\Tesseract\tessdata\eng.traineddata; DestDir: {app}\Tesseract\tessdata; Flags: ignoreversion; Components: main Source: ..\Tesseract\leptonlib.dll; DestDir: {app}\Tesseract; Flags: ignoreversion; Components: main Source: ..\Tesseract\tesseract.exe; DestDir: {app}\Tesseract; Flags: ignoreversion; Components: main @@ -318,6 +317,7 @@ begin DeleteFile(ExpandConstant('{userappdata}\Subtitle Edit\Dictionaries\en_US_user.xml')); DeleteFile(ExpandConstant('{userappdata}\Subtitle Edit\Dictionaries\eng_OCRFixReplaceList.xml')); DeleteFile(ExpandConstant('{userappdata}\Subtitle Edit\Dictionaries\names_etc.xml')); + DeleteFile(ExpandConstant('{userappdata}\Subtitle Edit\Dictionaries\swe_OCRFixReplaceList.xml')); DelTree(ExpandConstant('{userappdata}\Subtitle Edit\Dictionaries\*.dic'), False, True, False); DelTree(ExpandConstant('{userappdata}\Subtitle Edit\Dictionaries\*.aff'), False, True, False); RemoveDir(ExpandConstant('{userappdata}\Subtitle Edit\Dictionaries'));