-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathinstaller.iss
More file actions
84 lines (72 loc) · 2.41 KB
/
Copy pathinstaller.iss
File metadata and controls
84 lines (72 loc) · 2.41 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
#define AppName "BPTimer Desktop Companion"
#define AppPublisher "Wohee"
#define AppURL "https://github.com/woheedev/bptimer"
#define AppExeName "bptimer-desktop.exe"
#ifndef AppVersion
#define AppVersion "0.1.0"
#endif
[Setup]
AppId={{9dafa76e-277e-43fd-8958-38f44246bb09}
AppName={#AppName}
AppVersion={#AppVersion}
AppPublisher={#AppPublisher}
AppPublisherURL={#AppURL}
AppSupportURL={#AppURL}
AppUpdatesURL={#AppURL}
DefaultDirName={localappdata}\BPTimer
DefaultGroupName={#AppName}
AllowNoIcons=yes
LicenseFile=
OutputDir=Output
OutputBaseFilename=BPTimer-Desktop-Setup-{#AppVersion}
SetupIconFile=..\web\static\favicon.ico
Compression=lzma
SolidCompression=yes
WizardStyle=modern
PrivilegesRequired=admin
ArchitecturesInstallIn64BitMode=x64compatible
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
[Files]
Source: "target\release\{#AppExeName}"; DestDir: "{app}"; Flags: ignoreversion
Source: "npcap-installer.exe"; DestDir: "{tmp}"; Flags: deleteafterinstall; Check: not IsNpcapInstalled
[Icons]
Name: "{group}\{#AppName}"; Filename: "{app}\{#AppExeName}"; IconFilename: "{app}\{#AppExeName}"
Name: "{group}\{cm:UninstallProgram,{#AppName}}"; Filename: "{uninstallexe}"
Name: "{autodesktop}\{#AppName}"; Filename: "{app}\{#AppExeName}"; IconFilename: "{app}\{#AppExeName}"; Tasks: desktopicon
[Run]
Filename: "{tmp}\npcap-installer.exe"; StatusMsg: "Installing Npcap (user interaction required)..."; Check: not IsNpcapInstalled
Filename: "{app}\{#AppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(AppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
[UninstallDelete]
Type: files; Name: "{app}\settings.json"
[Code]
function IsNpcapInstalled(): Boolean;
var
NpcapPath: string;
RegistryKey: string;
begin
Result := False;
// Check registry for Npcap installation
RegistryKey := 'SYSTEM\CurrentControlSet\Services\npcap\Parameters';
if RegKeyExists(HKEY_LOCAL_MACHINE, RegistryKey) then
begin
Result := True;
Exit;
end;
// Check for Npcap files
NpcapPath := ExpandConstant('{pf}\Npcap\NPFInstall.exe');
if FileExists(NpcapPath) then
begin
Result := True;
Exit;
end;
// Alternative path check
NpcapPath := ExpandConstant('{pf32}\Npcap\NPFInstall.exe');
if FileExists(NpcapPath) then
begin
Result := True;
Exit;
end;
end;