-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathGameWikiAssistant_onedir.iss
More file actions
91 lines (82 loc) · 3.91 KB
/
Copy pathGameWikiAssistant_onedir.iss
File metadata and controls
91 lines (82 loc) · 3.91 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
#define MyAppName "GameWiki Assistant"
#define MyAppVersion "1.0.0"
#define MyAppPublisher "GameWiki Team"
#define MyAppURL "https://github.com/yourusername/gamewiki"
#define MyAppExeName "GameWikiAssistant.exe"
[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
AppId={{8F7A9E2C-4B3D-4E6A-9C1F-2A3B4C5D6E7F}}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={autopf}\{#MyAppName}
DefaultGroupName={#MyAppName}
AllowNoIcons=yes
; Remove the following line to run in administrative install mode
PrivilegesRequired=lowest
PrivilegesRequiredOverridesAllowed=dialog
OutputDir=installer
OutputBaseFilename=GameWikiAssistant_Setup_onedir
SetupIconFile=src\game_wiki_tooltip\assets\app.ico
Compression=lzma2/max
SolidCompression=yes
WizardStyle=modern
; Enable disk spanning for better performance with signed installers
DiskSpanning=yes
DiskSliceSize=max
; Uncomment the following lines if you have a code signing certificate
; SignTool=signtool
; SignedUninstaller=yes
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
Name: "chinesesimplified"; MessagesFile: "compiler:Languages\ChineseSimplified.isl"
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked; OnlyBelowVersion: 6.1; Check: not IsAdminInstallMode
[Files]
Source: "dist\GameWikiAssistant\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
; WebView2 Runtime installer
Source: "GameWikiAssistant_Portable_onedir\runtime\MicrosoftEdgeWebView2Setup.exe"; DestDir: "{tmp}"; Flags: deleteafterinstall
[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: quicklaunchicon
[Run]
; Check and install WebView2 Runtime if not present
Filename: "{tmp}\MicrosoftEdgeWebView2Setup.exe"; Parameters: "/silent /install"; StatusMsg: "Installing WebView2 Runtime..."; Check: not IsWebView2RuntimeInstalled
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
[Code]
function IsWebView2RuntimeInstalled: Boolean;
var
ResultCode: Integer;
begin
// Check if WebView2 Runtime is installed by looking for the registry key
Result := RegKeyExists(HKEY_LOCAL_MACHINE, 'SOFTWARE\WOW6432Node\Microsoft\EdgeUpdate\Clients\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}');
if not Result then
Result := RegKeyExists(HKEY_CURRENT_USER, 'SOFTWARE\Microsoft\EdgeUpdate\Clients\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}');
end;
procedure CurStepChanged(CurStep: TSetupStep);
begin
if CurStep = ssInstall then
begin
// Delete old temporary files if they exist (mainly for users upgrading from onefile version)
DelTree(ExpandConstant('{localappdata}\Temp\_MEI*'), False, True, False);
end;
end;
[UninstallDelete]
; Clean up all application data and temporary files during uninstall
; Main AppData folder containing all user settings and data
Type: filesandordirs; Name: "{userappdata}\GameWikiTooltip"
; Legacy folder name (if exists)
Type: filesandordirs; Name: "{userappdata}\game_wiki_tooltip"
; PyInstaller temporary files
Type: filesandordirs; Name: "{localappdata}\Temp\_MEI*"
; Desktop shortcut (in case it wasn't removed)
Type: files; Name: "{userdesktop}\{#MyAppName}.lnk"
; Quick Launch shortcut
Type: files; Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName}.lnk"