-
-
Notifications
You must be signed in to change notification settings - Fork 198
Expand file tree
/
Copy pathMake-Installer.bat
More file actions
51 lines (43 loc) · 1.55 KB
/
Make-Installer.bat
File metadata and controls
51 lines (43 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
@echo off
rem SoundSwitch Installer Make file
rem
rem Compiles the installer.
rem
rem Requires installed Inno Setup:
rem http://www.jrsoftware.org/isdl.php
setlocal
cd /d "%~dp0"
if "%PROCESSOR_ARCHITECTURE%"=="x86" (
set innoSetupRegistryNode=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Inno Setup 6_is1
) else (
set innoSetupRegistryNode=HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Inno Setup 6_is1
)
rem Retrieve registry key of Inno Setup installation
set innoSetupExe=
for /f "eol=; tokens=1,2*" %%a in ('REG QUERY "%innoSetupRegistryNode%" /v InstallLocation') do (
set innoSetupExe=%%c
)
set innoSetupExe="%innoSetupExe%ISCC.exe"
if not exist %innoSetupExe% (set errorMessage=Inno Setup not found in %innoSetupExe% & goto ERROR_QUIT)
if not exist "..\Final\Installer" (
echo Creating installer output directory: ..\Final\Installer
mkdir ..\Final\Installer
)
echo Cleaning previous installer files: ..\Final\Installer\*Installer.exe
del ..\Final\Installer\*Installer.exe
echo Building installer...
echo Running Inno Setup: %innoSetupExe% setup.iss /DReleaseState=%1
%innoSetupExe% setup.iss /DReleaseState=%1
if not %ERRORLEVEL%==0 (set errorMessage=Installer script setup.iss failed & goto ERROR_QUIT)
echo Moving installer to final location: ..\Final\*Installer.exe -^> ..\Final\Installer\
move ..\Final\*Installer.exe ..\Final\Installer\
echo Installer created successfully.
exit /b 0
:ERROR_QUIT
echo.
if defined errorMessage (
echo Error: %errorMessage%!
) else (
echo An unknown error occurred.
)
exit /b 1