-
Notifications
You must be signed in to change notification settings - Fork 28
/
setup_package.iss
129 lines (106 loc) · 4.08 KB
/
setup_package.iss
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "MBSeedKey"
#define MyAppNameUninstall "MBSeedKey"
#define MyAppFolderName "MBSeedKey"
#define MyAppVersion "1.0.003"
#define MyAppPublisher "Xplatforms"
#define MyAppURL "https://github.com/Xplatforms/mbseedkey/releases"
#define MyAppExeName "MBSeedKey.exe"
#define MyAppExeNameCLI "mbseedkey_cli.exe"
#define registrychars "%1"
[Setup]
; NOTE: The value of AppId uniquely identifies this application. 83x108
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{A06873B5-A929-488D-BBCF-C750F71766CF}}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL="https://github.com/Xplatforms/mbseedkey"
AppUpdatesURL={#MyAppURL}
UsePreviousAppDir=no
DefaultDirName={code:DefDirRoot}\Xplatforms\{#MyAppFolderName}
DefaultGroupName=Xplatforms\{#MyAppName}
LicenseFile=LICENSE
OutputDir=..\BUILDS\
OutputBaseFilename=MBSeedKey_x86_{#MyAppVersion}
SetupIconFile=Resources\icon.ico
Compression=lzma
SolidCompression=yes
AlwaysUsePersonalGroup=yes
PrivilegesRequired=lowest
;ArchitecturesInstallIn64BitMode=x64
;Check: not Is64BitInstallMode
;Check: Is64BitInstallMode
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"
Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked; OnlyBelowVersion: 0,6.1
[Files]
Source: "..\BUILDS\MBSeedKey\*"; DestDir: "{app}"; Flags: ignoreversion overwritereadonly replacesameversion recursesubdirs
Source: "LICENSE"; DestDir: "{app}"; Flags: ignoreversion overwritereadonly replacesameversion recursesubdirs
[Icons]
Name: "{userprograms}\Xplatforms\{#MyAppName}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}";
Name: "{userprograms}\Xplatforms\{#MyAppName}\{#MyAppExeNameCLI}"; Filename: "{app}\{#MyAppExeNameCLI}";
Name: "{userdesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: quicklaunchicon
[Code]
function InitializeSetup(): Boolean;
var
oldVersion: String;
uninstaller: String;
ErrorCode: Integer;
begin
if RegKeyExists(HKEY_CURRENT_USER,
'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{AppId}_is1') then
begin
RegQueryStringValue(HKEY_CURRENT_USER,
'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{AppId}_is1',
'UninstallString', uninstaller);
uninstaller := RemoveQuotes(uninstaller);
Exec(uninstaller, '/SILENT /NORESTART /SUPPRESSMSGBOXES', '', SW_HIDE, TRUE, ErrorCode);
end;
Result := True;
end;
function IsRegularUser(): Boolean;
begin
Result := not (IsAdminLoggedOn);
end;
function DefDirRoot(Param: String): String;
begin
if IsRegularUser then
Result := ExpandConstant('{localappdata}')
else
Result := ExpandConstant('{pf}')
end;
procedure RunOtherInstaller;
var
ResultCode: Integer;
begin
if not Exec(ExpandConstant('{app}\OtherInstaller.exe'), '', '', SW_SHOWNORMAL,
ewWaitUntilTerminated, ResultCode)
then
MsgBox('Other installer failed to run!' + #13#10 +
SysErrorMessage(ResultCode), mbError, MB_OK);
end;
function CmdLineParamExists(const Value: string): Boolean;
var
I: Integer;
begin
Result := False;
for I := 1 to ParamCount do
if CompareText(ParamStr(I), Value) = 0 then
begin
Result := True;
Exit;
end;
end;
function VerySilentRun: Boolean;
begin
Result := CmdLineParamExists('/VERYSILENT');;
end;
[Run]
Filename: "{app}\vc_redist.x86.exe"; Description: "{cm:LaunchProgram,{#StringChange("vc_redist.x86.exe installer", "&", "&&")}}"; Flags: postinstall
;Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange("MBSeedKey 1.0", "&", "&&")}}"; Flags: nowait postinstall; Check: not VerySilentRun