2015-10-22 16:36:31 +02:00
|
|
|
rem script helps create installer
|
|
|
|
|
2016-02-16 19:55:52 +01:00
|
|
|
rem find target architecture
|
2016-12-29 20:41:39 +01:00
|
|
|
IF "%PROCESSOR_ARCHITECTURE%"=="x86" (set ARCHITECTURE=32BIT) else (set ARCHITECTURE=64BIT)
|
2016-02-16 19:55:52 +01:00
|
|
|
|
2016-06-13 10:47:22 +02:00
|
|
|
rem Path to Inno Setup according to architecture
|
|
|
|
if %ARCHITECTURE%==32BIT set nsis_path="C:/Program Files/Inno Setup 5/iscc.exe"
|
|
|
|
if %ARCHITECTURE%==64BIT set nsis_path="C:/Program Files (x86)/Inno Setup 5/iscc.exe"
|
2016-02-16 19:55:52 +01:00
|
|
|
|
2015-10-22 16:36:31 +02:00
|
|
|
if not exist %nsis_path% (
|
2016-12-19 11:05:39 +01:00
|
|
|
echo Coudn't find Inno Setup. Package will not be created.
|
2016-12-12 16:01:40 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
:CONTINUE
|
|
|
|
rem detect windows version
|
|
|
|
ver | find "6.1" > nul
|
|
|
|
|
|
|
|
IF ERRORLEVEL = 1 GOTO PREPARE
|
|
|
|
IF ERRORLEVEL = 0 GOTO WIN7
|
|
|
|
|
|
|
|
:WIN7
|
|
|
|
chcp 65001
|
2015-10-22 16:36:31 +02:00
|
|
|
|
|
|
|
:PREPARE
|
|
|
|
cd ..
|
|
|
|
cd
|
2015-10-24 09:38:11 +02:00
|
|
|
rem force qmake create new qm files
|
|
|
|
del /Q share\translations\*.qm
|
2016-09-05 18:16:17 +02:00
|
|
|
IF exist build (
|
|
|
|
echo Build exists. Clearing.
|
2016-11-07 15:58:39 +01:00
|
|
|
rd /s /q build\package
|
|
|
|
del /s /q /f build\Makefile
|
|
|
|
del /s /q /f build\*.exe
|
|
|
|
del /s /q /f build\*.dll
|
2016-11-21 19:36:48 +01:00
|
|
|
del /q /f build\src\app\tape\obj\dialogabouttape.o
|
|
|
|
del /q /f build\src\app\valentina\obj\dialogaboutapp.o
|
2016-09-05 18:16:17 +02:00
|
|
|
)
|
|
|
|
mkdir build && echo build created
|
2015-10-22 16:36:31 +02:00
|
|
|
cd build
|
|
|
|
cd
|
|
|
|
|
2016-06-13 14:06:09 +02:00
|
|
|
qmake -r CONFIG+=noTests ..\Valentina.pro
|
2015-10-22 16:36:31 +02:00
|
|
|
IF ERRORLEVEL 1 GOTO ERRORQMAKE1
|
|
|
|
IF ERRORLEVEL 0 GOTO MAKE
|
|
|
|
|
|
|
|
:MAKE
|
|
|
|
mingw32-make -j%NUMBER_OF_PROCESSORS%
|
|
|
|
IF ERRORLEVEL 1 GOTO ERRORMAKE
|
|
|
|
IF ERRORLEVEL 0 GOTO MAKEINSTALL
|
|
|
|
|
|
|
|
:MAKEINSTALL
|
|
|
|
mingw32-make install
|
|
|
|
IF ERRORLEVEL 1 GOTO ERRORMAKEINSTALL
|
|
|
|
IF ERRORLEVEL 0 GOTO ONEXIT
|
|
|
|
|
|
|
|
:ERRORMAKEINSTALL
|
|
|
|
echo Failed to create installer!
|
|
|
|
@pause
|
|
|
|
exit /b 1
|
|
|
|
:ERRORMAKE
|
|
|
|
echo Failed to build project!
|
|
|
|
@pause
|
|
|
|
exit /b 1
|
|
|
|
:ERRORQMAKE2
|
|
|
|
echo Failed to make the second run qmake!
|
|
|
|
@pause
|
|
|
|
exit /b 1
|
|
|
|
:ERRORQMAKE1
|
|
|
|
echo Failed to make the first run qmake!
|
|
|
|
@pause
|
|
|
|
exit /b 1
|
|
|
|
:ONEXIT
|
2016-12-19 11:05:39 +01:00
|
|
|
echo Done!
|
2016-02-16 19:55:52 +01:00
|
|
|
@pause
|
2016-09-05 18:16:17 +02:00
|
|
|
|