-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWinhtop-installer.iss
More file actions
117 lines (95 loc) · 2.57 KB
/
Winhtop-installer.iss
File metadata and controls
117 lines (95 loc) · 2.57 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
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
; =========================================================
; WinHtop Installer
; =========================================================
#define MyAppName "WinHtop"
#define MyAppVersion "1.2.0"
#define MyAppPublisher "Iza Carlos"
#define MyAppExeName "winhtop.exe"
#define MyAppId "C6E2A3B4-D1F2-4EBA-BD3F-6A7C10B7B7C2"
[Setup]
AppId={{{#MyAppId}}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
AppPublisher={#MyAppPublisher}
DefaultDirName={localappdata}\Programs\{#MyAppName}
DefaultGroupName={#MyAppName}
UsePreviousAppDir=yes
ArchitecturesAllowed=x64
ArchitecturesInstallIn64BitMode=x64
PrivilegesRequired=none
CloseApplications=force
Compression=lzma2/ultra64
SolidCompression=yes
WizardStyle=modern
SetupIconFile=assets\winhtop.ico
UninstallDisplayIcon={app}\{#MyAppExeName}
ChangesEnvironment=yes
OutputBaseFilename=WinHtopInstaller
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
[Tasks]
Name: "addpath"; Description: "Add to PATH (Recommended)"; Flags: checkedonce
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; Flags: unchecked
[Files]
Source: "dist\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{userdesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
[UninstallDelete]
Type: files; Name: "{app}\*.conf"
Type: files; Name: "{app}\*.log"
Type: dirifempty; Name: "{app}"
[Code]
function GetInstalledUninstaller(): string;
var
Key: string;
begin
Key := 'Software\Microsoft\Windows\CurrentVersion\Uninstall\' +
'{C6E2A3B4-D1F2-4EBA-BD3F-6A7C10B7B7C2}_is1';
if RegQueryStringValue(
HKLM,
Key,
'UninstallString',
Result
) then
exit;
Result := '';
end;
function InitializeSetup(): Boolean;
var
Uninstaller: string;
Choice: Integer;
ResultCode: Integer;
begin
Result := True;
Uninstaller := GetInstalledUninstaller();
if Uninstaller <> '' then
begin
Choice := MsgBox(
'WinHtop is already installed.'#13#13 +
'Yes = uninstall current version'#13 +
'No = open maintenance mode',
mbConfirmation,
MB_YESNO
);
if Choice = IDYES then
begin
Exec(
RemoveQuotes(Uninstaller),
'',
'',
SW_SHOWNORMAL,
ewWaitUntilTerminated,
ResultCode
);
MsgBox(
'Uninstall complete. Please run the installer again to reinstall.',
mbInformation,
MB_OK
);
Result := False;
exit;
end;
{ NO means maintenance mode, let Inno continue naturally }
end;
end;