-
-
Notifications
You must be signed in to change notification settings - Fork 45
/
Copy pathiss.iss
234 lines (210 loc) · 9.59 KB
/
iss.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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
#include <idp.iss>
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "Adb File Manager"
#define MyAppVersion "1.9"
#define MyAppPublisher "Tobiksoft"
#define MyAppURL "https://github.com/T0biasCZe/AdbFileManager/"
#define MyAppExeName "AdbFileManager.exe"
[Setup]
; NOTE: The value of AppId uniquely identifies this application. 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={{A4B0411F-BF82-4D3B-8DD5-91D974EB30E5}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={autopf}\{#MyAppName}
DefaultGroupName={#MyAppName}
AllowNoIcons=yes
; Uncomment the following line to run in non administrative install mode (install for current user only.)
;PrivilegesRequired=lowest
PrivilegesRequiredOverridesAllowed=dialog
OutputDir=C:\Users\user\source\repos\AdbFileManager\installer_create
OutputBaseFilename=afm_install
SetupIconFile=C:\Users\user\source\repos\AdbFileManager\AdbFileManager\w7 transferr.ico
Compression=lzma
SolidCompression=yes
WizardStyle=modern
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
[Files]
Source: "C:\Users\user\source\repos\AdbFileManager\AdbFileManager\bin\Release\net8.0-windows10.0.17763.0\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\user\source\repos\AdbFileManager\AdbFileManager\bin\Release\net8.0-windows10.0.17763.0\adb.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\user\source\repos\AdbFileManager\AdbFileManager\bin\Release\net8.0-windows10.0.17763.0\AdbFileManager.deps.json"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\user\source\repos\AdbFileManager\AdbFileManager\bin\Release\net8.0-windows10.0.17763.0\AdbFileManager.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\user\source\repos\AdbFileManager\AdbFileManager\bin\Release\net8.0-windows10.0.17763.0\AdbFileManager.dll.config"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\user\source\repos\AdbFileManager\AdbFileManager\bin\Release\net8.0-windows10.0.17763.0\AdbFileManager.runtimeconfig.json"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\user\source\repos\AdbFileManager\AdbFileManager\bin\Release\net8.0-windows10.0.17763.0\AdbWinApi.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\user\source\repos\AdbFileManager\AdbFileManager\bin\Release\net8.0-windows10.0.17763.0\AdbWinUsbApi.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\user\source\repos\AdbFileManager\AdbFileManager\bin\Release\net8.0-windows10.0.17763.0\Microsoft.Windows.SDK.NET.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\user\source\repos\AdbFileManager\AdbFileManager\bin\Release\net8.0-windows10.0.17763.0\Microsoft.WindowsAPICodePack.Core.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\user\source\repos\AdbFileManager\AdbFileManager\bin\Release\net8.0-windows10.0.17763.0\Microsoft.WindowsAPICodePack.ExtendedLinguisticServices.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\user\source\repos\AdbFileManager\AdbFileManager\bin\Release\net8.0-windows10.0.17763.0\Microsoft.WindowsAPICodePack.Sensors.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\user\source\repos\AdbFileManager\AdbFileManager\bin\Release\net8.0-windows10.0.17763.0\Microsoft.WindowsAPICodePack.Shell.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\user\source\repos\AdbFileManager\AdbFileManager\bin\Release\net8.0-windows10.0.17763.0\Microsoft.WindowsAPICodePack.ShellExtensions.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\user\source\repos\AdbFileManager\AdbFileManager\bin\Release\net8.0-windows10.0.17763.0\WinRT.Runtime.dll"; DestDir: "{app}"; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
[CustomMessages]
IDP_DownloadFailed=Download of .NET 5 failed. .NET 5 Desktop runtime is required to run VidCoder.
IDP_RetryCancel=Click 'Retry' to try downloading the files again, or click 'Cancel' to terminate setup.
InstallingDotNetRuntime=Installing .NET 5 Desktop Runtime. This might take a few minutes...
DotNetRuntimeFailedToLaunch=Failed to launch .NET Runtime Installer with error "%1". Please fix the error then run this installer again.
DotNetRuntimeFailed1602=.NET Runtime installation was cancelled. This installation can continue, but be aware that this application may not run unless the .NET Runtime installation is completed successfully.
DotNetRuntimeFailed1603=A fatal error occurred while installing the .NET Runtime. Please fix the error, then run the installer again.
DotNetRuntimeFailed5100=Your computer does not meet the requirements of the .NET Runtime. Please consult the documentation.
DotNetRuntimeFailedOther=The .NET Runtime installer exited with an unexpected status code "%1". Please review any other messages shown by the installer to determine whether the installation completed successfully, and abort this installation and fix the problem if it did not.
[Code]
var
requiresRestart: boolean;
function CompareVersion(V1, V2: string): Integer;
var
P, N1, N2: Integer;
begin
Result := 0;
while (Result = 0) and ((V1 <> '') or (V2 <> '')) do
begin
P := Pos('.', V1);
if P > 0 then
begin
N1 := StrToInt(Copy(V1, 1, P - 1));
Delete(V1, 1, P);
end
else
if V1 <> '' then
begin
N1 := StrToInt(V1);
V1 := '';
end
else
begin
N1 := 0;
end;
P := Pos('.', V2);
if P > 0 then
begin
N2 := StrToInt(Copy(V2, 1, P - 1));
Delete(V2, 1, P);
end
else
if V2 <> '' then
begin
N2 := StrToInt(V2);
V2 := '';
end
else
begin
N2 := 0;
end;
if N1 < N2 then Result := -1
else
if N1 > N2 then Result := 1;
end;
end;
function NetRuntimeIsMissing(): Boolean;
var
runtimes: TArrayOfString;
registryKey: string;
I: Integer;
meetsMinimumVersion: Boolean;
meetsMaximumVersion: Boolean;
minimumVersion: string;
maximumExclusiveVersion: string;
begin
Result := True;
minimumVersion := '8.0.0';
maximumExclusiveVersion := '8.9.9';
registryKey := 'SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x64\sharedfx\Microsoft.WindowsDesktop.App';
if RegGetValueNames(HKLM, registryKey, runtimes) then
begin
for I := 0 to GetArrayLength(runtimes)-1 do
begin
meetsMinimumVersion := not (CompareVersion(runtimes[I], minimumVersion) = -1);
meetsMaximumVersion := CompareVersion(runtimes[I], maximumExclusiveVersion) = -1;
if meetsMinimumVersion and meetsMaximumVersion then
begin
Log(Format('[.NET] Selecting %s', [runtimes[I]]));
Result := False;
Exit;
end;
end;
end;
end;
procedure InitializeWizard;
begin
if NetRuntimeIsMissing() then
begin
idpAddFile('http://go.microsoft.com/fwlink/?linkid=2155258', ExpandConstant('{tmp}\NetRuntimeInstaller.exe'));
idpDownloadAfter(wpReady);
end;
end;
function InstallDotNetRuntime(): String;
var
StatusText: string;
ResultCode: Integer;
begin
StatusText := WizardForm.StatusLabel.Caption;
WizardForm.StatusLabel.Caption := CustomMessage('InstallingDotNetRuntime');
WizardForm.ProgressGauge.Style := npbstMarquee;
try
if not Exec(ExpandConstant('{tmp}\NetRuntimeInstaller.exe'), '/passive /norestart /showrmui /showfinalerror', '', SW_SHOW, ewWaitUntilTerminated, ResultCode) then
begin
Result := FmtMessage(CustomMessage('DotNetRuntimeFailedToLaunch'), [SysErrorMessage(resultCode)]);
end
else
begin
// See https://msdn.microsoft.com/en-us/library/ee942965(v=vs.110).aspx#return_codes
case resultCode of
0: begin
// Successful
end;
1602 : begin
MsgBox(CustomMessage('DotNetRuntimeFailed1602'), mbInformation, MB_OK);
end;
1603: begin
Result := CustomMessage('DotNetRuntimeFailed1603');
end;
1641: begin
requiresRestart := True;
end;
3010: begin
requiresRestart := True;
end;
5100: begin
Result := CustomMessage('DotNetRuntimeFailed5100');
end;
else begin
MsgBox(FmtMessage(CustomMessage('DotNetRuntimeFailedOther'), [IntToStr(resultCode)]), mbError, MB_OK);
end;
end;
end;
finally
WizardForm.StatusLabel.Caption := StatusText;
WizardForm.ProgressGauge.Style := npbstNormal;
DeleteFile(ExpandConstant('{tmp}\NetRuntimeInstaller.exe'));
end;
end;
function PrepareToInstall(var NeedsRestart: Boolean): String;
begin
// 'NeedsRestart' only has an effect if we return a non-empty string, thus aborting the installation.
// If the installers indicate that they want a restart, this should be done at the end of installation.
// Therefore we set the global 'restartRequired' if a restart is needed, and return this from NeedRestart()
if NetRuntimeIsMissing() then
begin
Result := InstallDotNetRuntime();
end;
end;
function NeedRestart(): Boolean;
begin
Result := requiresRestart;
end;