-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstaller.iss
More file actions
96 lines (80 loc) · 3.16 KB
/
Copy pathinstaller.iss
File metadata and controls
96 lines (80 loc) · 3.16 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
; Inno Setup Script for PiPCrunchy
; Download Inno Setup from: https://jrsoftware.org/isinfo.php
#define MyAppName "PiPCrunchy"
#define MyAppVersion "1.0.0"
#define MyAppPublisher "PiPCrunchy"
#define MyAppURL "https://github.com/yourusername/PiPCrunchy"
#define MyAppExeName "PiPCrunchy.exe"
[Setup]
; Basic Information
AppId={{A1B2C3D4-E5F6-7890-ABCD-EF1234567890}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
; Installation Settings
DefaultDirName={autopf}\{#MyAppName}
DefaultGroupName={#MyAppName}
AllowNoIcons=yes
DisableProgramGroupPage=yes
; Output Settings
OutputDir=Output
OutputBaseFilename=PiPCrunchy-Setup
Compression=lzma2/max
SolidCompression=yes
; Modern UI
SetupIconFile=Assets\icon.ico
WizardStyle=modern
; System Requirements
PrivilegesRequired=lowest
ArchitecturesAllowed=x64compatible
ArchitecturesInstallIn64BitMode=x64compatible
MinVersion=10.0.17763
; Uninstall
UninstallDisplayIcon={app}\{#MyAppExeName}
UninstallDisplayName={#MyAppName}
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
[Files]
; Main application files
Source: "bin\Release\net8.0-windows\win-x64\publish\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
Source: "bin\Release\net8.0-windows\win-x64\publish\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "README.md"; DestDir: "{app}"; Flags: ignoreversion
[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
[Run]
; Check for WebView2 Runtime and offer to download if not present
Filename: "https://go.microsoft.com/fwlink/p/?LinkId=2124703"; Description: "Download WebView2 Runtime (Required)"; Flags: shellexec postinstall skipifsilent nowait; Check: not IsWebView2RuntimeInstalled
; Launch application after installation
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
[Code]
// Function to check if WebView2 Runtime is installed
function IsWebView2RuntimeInstalled: Boolean;
var
RegKey: String;
begin
RegKey := 'SOFTWARE\WOW6432Node\Microsoft\EdgeUpdate\Clients\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}';
Result := RegKeyExists(HKLM, RegKey) or RegKeyExists(HKCU, RegKey);
if not Result then
begin
RegKey := 'SOFTWARE\Microsoft\EdgeUpdate\Clients\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}';
Result := RegKeyExists(HKLM, RegKey) or RegKeyExists(HKCU, RegKey);
end;
end;
procedure InitializeWizard();
begin
// Show message if WebView2 is not installed
if not IsWebView2RuntimeInstalled then
begin
MsgBox('WebView2 Runtime is not detected on your system.' + #13#10 + #13#10 +
'After installation, you will be prompted to download it.' + #13#10 +
'PiPCrunchy requires WebView2 Runtime to function.',
mbInformation, MB_OK);
end;
end;