-
Notifications
You must be signed in to change notification settings - Fork 64
Expand file tree
/
Copy pathGrfEditor.iss
More file actions
109 lines (99 loc) · 4.34 KB
/
GrfEditor.iss
File metadata and controls
109 lines (99 loc) · 4.34 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
97
98
99
100
101
102
103
104
105
106
107
108
109
; -- GRF Editor --
[Setup]
AppName=GRF Editor
AppVersion={#VERSION_NAME}
DefaultDirName={pf}\GRF Editor
DefaultGroupName=GRF Editor
UninstallDisplayIcon={app}\GRF Editor.exe
Compression=lzma2
SolidCompression=yes
OutputDir=C:\Users\Tokei\Desktop\Releases\GRF Editor
OutputBaseFilename=GRF Editor Installer
WizardImageFile=setupBackground.bmp
DisableProgramGroupPage=yes
ChangesAssociations=yes
DisableDirPage=no
DisableWelcomePage=no
[Files]
Source: "GrfCL\bin\Release\GrfCL.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "GrfCL\bin\Release\GrfCL.exe.config"; DestDir: "{app}"; Flags: ignoreversion
Source: "GRFEditor\bin\Release\GRF Editor.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "GRFEditor\bin\Release\GRF Editor.exe.config"; DestDir: "{app}"; Flags: ignoreversion
Source: "GRFEditor\Resources\app.ico"; DestDir: "{app}"; Flags: ignoreversion
[UninstallDelete]
Type: files; Name: "{app}\gpf.ico"
Type: files; Name: "{app}\grf.ico"
Type: files; Name: "{app}\rgz.ico"
Type: files; Name: "{app}\grfkey.ico"
Type: files; Name: "{app}\crash.log"
Type: files; Name: "{app}\debug.log"
Type: filesandordirs; Name: "{app}\tmp"
Type: files; Name: "{userappdata}\GRF Editor\gpf.ico"
Type: files; Name: "{userappdata}\GRF Editor\grf.ico"
Type: files; Name: "{userappdata}\GRF Editor\rgz.ico"
Type: files; Name: "{userappdata}\GRF Editor\grfkey.ico"
Type: files; Name: "{userappdata}\GRF Editor\crash.log"
Type: files; Name: "{userappdata}\GRF Editor\debug.log"
Type: filesandordirs; Name: "{userappdata}\GRF Editor\~tmp"
[Icons]
Name: "{group}\GRF Editor"; Filename: "{app}\GRF Editor.exe"
Name: "{commondesktop}\GRF Editor"; Filename: "{app}\GRF Editor.exe"
[CustomMessages]
DotNetMissing=GRF Editor requires .NET Framework 3.5 Client Profile or higher (SP1). Do you want to download it? Setup will now exit!
[Code]
function IsDotNet48Installed: Boolean;
var
Release: Cardinal;
begin
Result := False;
if RegQueryDWordValue(HKLM, 'SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full', 'Release', Release) then
begin
// 528040 = .NET Framework 4.8
if Release >= 528040 then
Result := True;
end;
end;
function InitializeSetup(): Boolean;
var ErrorCode: Integer;
begin
if not IsDotNet48Installed then
begin
MsgBox('.NET Framework 4.8 is required. The installer will now open the download page.', mbInformation, MB_OK);
ShellExec('', 'https://dotnet.microsoft.com/en-us/download/dotnet-framework/net48', '', '', SW_SHOWNORMAL, ewNoWait, ErrorCode);
Result := False; // cancel setup
end
else
Result := True; // continue setup
end;
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin
case CurUninstallStep of
usPostUninstall:
begin
RegDeleteKeyIncludingSubkeys(HKCR, 'grfeditor.grf');
RegDeleteKeyIncludingSubkeys(HKCR, 'grfeditor.gpf');
RegDeleteKeyIncludingSubkeys(HKCR, 'grfeditor.rgz');
RegDeleteKeyIncludingSubkeys(HKCR, 'grfeditor.spr');
RegDeleteKeyIncludingSubkeys(HKCR, 'grfeditor.grfkey');
RegDeleteKeyIncludingSubkeys(HKCU, 'Software\Classes\.grf');
RegDeleteKeyIncludingSubkeys(HKCU, 'Software\Classes\.gpf');
RegDeleteKeyIncludingSubkeys(HKCU, 'Software\Classes\.rgz');
RegDeleteKeyIncludingSubkeys(HKCU, 'Software\Classes\.grfkey');
RegDeleteKeyIncludingSubkeys(HKCU, 'Software\Classes\.spr');
RegDeleteKeyIncludingSubkeys(HKCU, 'Software\Classes\Applications\GRF Editor.exe.grf');
RegDeleteKeyIncludingSubkeys(HKCU, 'Software\Classes\Applications\GRF Editor.exe.gpf');
RegDeleteKeyIncludingSubkeys(HKCU, 'Software\Classes\Applications\GRF Editor.exe.rgz');
RegDeleteKeyIncludingSubkeys(HKCU, 'Software\Classes\Applications\GRF Editor.exe.grfkey');
RegDeleteKeyIncludingSubkeys(HKCU, 'Software\Classes\Applications\GRF Editor.exe.spr');
RegDeleteKeyIncludingSubkeys(HKCU, 'Software\Classes\Applications\GRF Editor.exe');
if (FileExists(ExpandConstant('{app}\config.txt')) or FileExists(ExpandConstant('{userappdata}\GRF Editor\config.txt'))) then
begin
if (MsgBox('Program settings have been found, would you like to remove them?', mbConfirmation, MB_YESNO) = idYes) then
begin
DeleteFile(ExpandConstant('{app}\config.txt'));
DeleteFile(ExpandConstant('{userappdata}\GRF Editor\config.txt'));
end
end
end;
end;
end;