-
Notifications
You must be signed in to change notification settings - Fork 0
/
.iss
49 lines (42 loc) · 1.67 KB
/
.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
; Define your application information
[Setup]
AppName=OGuard
AppVersion=1.0
DefaultDirName={pf}\OGuard
DefaultGroupName=OGuard
OutputDir=.
OutputBaseFilename=setup
Compression=lzma
SolidCompression=yes
; Specify the application files
[Files]
Source: ".\target\release\oguard.exe"; DestDir: "{app}"; Flags: ignoreversion
; Create the service
[Run]
Filename: "{app}\oguard.exe"; Parameters: "service create"; StatusMsg: "Installing service..."; Flags: runhidden waituntilterminated
; Start the service
[Run]
Filename: "{app}\oguard.exe"; Parameters: "service start"; StatusMsg: "Starting service..."; Flags: runhidden waituntilterminated
; Define the uninstall procedure
[UninstallRun]
Filename: "{app}\oguard.exe"; Parameters: "service stop"; StatusMsg: "Stopping service..."; Flags: runhidden waituntilterminated
Filename: "{app}\oguard.exe"; Parameters: "service delete"; StatusMsg: "Deleting service..."; Flags: runhidden waituntilterminated
; Optional: define the messages for the user
[Messages]
SetupMessage=OGuard service is being installed...
UninstallMessage=OGuard service is being uninstalled...
[Code]
procedure CurUninstallStepChanged (CurUninstallStep: TUninstallStep);
var
mres : integer;
begin
case CurUninstallStep of
usPostUninstall:
begin
mres := MsgBox('Do you want to delete the configuration file, data folder and its contents? This will delete any historical data, logging and configuration?', mbConfirmation, MB_YESNO or MB_DEFBUTTON2)
if mres = IDYES then
DelTree(ExpandConstant('{app}\data'), True, True, True);
DeleteFile(ExpandConstant('{app}\config.toml'));
end;
end;
end;