-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.iss
More file actions
68 lines (59 loc) · 1.44 KB
/
setup.iss
File metadata and controls
68 lines (59 loc) · 1.44 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
[Setup]
AppName=AutoLogout
VersionInfoVersion=0.9.1
AppVersion=0.9.1
DefaultDirName={autopf}\AutoLogout
DefaultGroupName=AutoLogout
OutputDir=.\bin\Installer
OutputBaseFilename=AutoLogoutSetup
PrivilegesRequired=admin
[Files]
Source: "bin\Release\net9.0-windows10.0.17763.0\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs
[Icons]
Name: "{group}\AutoLogout"; Filename: "{app}\AutoLogout.exe"
Name: "{group}\Uninstall AutoLogout"; Filename: "{uninstallexe}"
[Code]
procedure RemoveRegEntries();
var
Subkeys: TArrayOfString;
Subkey: string;
I, J, Dashes: Integer;
begin
// Remove HKLM Run key
Log('Deleting Run key');
if RegDeleteValue(HKLM64, 'Software\Microsoft\Windows\CurrentVersion\Run', 'AutoLogout') then
Log('true')
else
Log('false');
// Get all user AutoLogout entries
RegGetSubkeyNames(HKU, '', Subkeys);
for I := 0 to GetArrayLength(Subkeys) - 1 do
begin
Subkey := Subkeys[I];
Dashes := 0;
for J := 1 to Length(Subkey) do
begin
if Subkey[J] = '-' then
begin
Inc(Dashes);
end;
if Subkey[J] = '_' then
begin
Dashes := -1;
Break;
end;
end;
if Dashes = 7 then
begin
RegDeleteKeyIncludingSubkeys(
HKU, Subkey + '\Software\Yiays\AutoLogout');
end;
end;
end;
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin
if CurUninstallStep = usUninstall then
begin
RemoveRegEntries();
end;
end;