Little improvements for make_install.bat.

1. Detect Windows version and set UTF-8 codepage if Windows 7 or higher.
2. Write error message if build finished successful, but a package was not
created.
3. Check if exists "build" directory and remove it before new build.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2016-09-05 19:16:17 +03:00
parent eb3fc4daa7
commit 4c8210afc2

View File

@ -1,5 +1,15 @@
rem script helps create installer
rem detect windows version
ver | find "6.1" > nul
IF ERRORLEVEL = 1 GOTO ARCHITECTURE
IF ERRORLEVEL = 0 GOTO WIN7
:WIN7
chcp 65001
:ARCHITECTURE
rem find target architecture
reg Query "HKLM\Hardware\Description\System\CentralProcessor\0" | find /i "x86" > NUL && set ARCHITECTURE=32BIT || set ARCHITECTURE=64BIT
@ -8,6 +18,7 @@ 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"
if not exist %nsis_path% (
SET package_error="Package was not created!"
SET /P promt="Coudn't find Inno Setup. Do you want to continue?[Y\N]"
IF "%promt%" == "Y" GOTO PREPARE
IF "%promt%" == "y" GOTO PREPARE
@ -19,7 +30,11 @@ cd ..
cd
rem force qmake create new qm files
del /Q share\translations\*.qm
mkdir build
IF exist build (
echo Build exists. Clearing.
rd /s /q build
)
mkdir build && echo build created
cd build
cd
@ -54,5 +69,6 @@ echo Failed to make the first run qmake!
@pause
exit /b 1
:ONEXIT
echo Done!
echo Done! %package_error%
@pause