|
9 | 9 | #define AppPublisher "OpenChartProject" |
10 | 10 | #define AppURL "https://openchart.io" |
11 | 11 | #define AppExeName "OpenChart.exe" |
12 | | -#define GtkDownloadURL "https://github.com/tschoonj/GTK-for-Windows-Runtime-Environment-Installer/releases/download/2020-05-19/gtk3-runtime-3.24.18-2020-05-19-ts-win64.exe" |
13 | | -#define GtkDownloadDest "{tmp}\gtk-3.24.18.exe" |
14 | 12 |
|
15 | 13 | [Setup] |
16 | 14 | ; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications. |
@@ -55,47 +53,3 @@ Name: "{autodesktop}\{#AppName}"; Filename: "{app}\{#AppExeName}"; IconFilename: |
55 | 53 |
|
56 | 54 | [Run] |
57 | 55 | Filename: "{app}\{#AppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(AppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent |
58 | | - |
59 | | -[Code] |
60 | | -
|
61 | | -var |
62 | | - InstallGtk: Boolean; |
63 | | - InstallGtkPage: TOutputMsgMemoWizardPage; |
64 | | -
|
65 | | -const |
66 | | - NewLine = #13#10; |
67 | | -
|
68 | | -procedure InitializeWizard(); |
69 | | -begin |
70 | | - InstallGtk := False; |
71 | | -
|
72 | | - if (not RegKeyExists(HKLM32, 'SOFTWARE\GTK\3.0')) and (not RegKeyExists(HKLM64, 'SOFTWARE\GTK\3.0')) then |
73 | | - begin |
74 | | - idpAddFile('{#GtkDownloadURL}', ExpandConstant('{#GtkDownloadDest}')); |
75 | | - idpDownloadAfter(wpReady); |
76 | | - InstallGtk := True; |
77 | | - InstallGtkPage := CreateOutputMsgMemoPage(wpInstalling, 'Installing Dependencies...', '', 'Some additional dependencies need to be installed.', ''); |
78 | | - end; |
79 | | -end; |
80 | | -
|
81 | | -procedure CurPageChanged(CurPageID: Integer); |
82 | | -var |
83 | | - ResultCode: Integer; |
84 | | - Text: String; |
85 | | -begin |
86 | | - if InstallGtk and (CurPageID = InstallGtkPage.ID) then |
87 | | - begin |
88 | | - Text := 'Installing Gtk. Please be patient, as this can take a minute...'; |
89 | | - InstallGtkPage.RichEditViewer.RTFText := Text; |
90 | | -
|
91 | | - if Exec(ExpandConstant('{#GtkDownloadDest}'), '/S', '', SW_HIDE, ewWaitUntilTerminated, ResultCode) then |
92 | | - begin |
93 | | - Text := Text + NewLine + 'Gtk was installed successfully.'; |
94 | | - InstallGtkPage.RichEditViewer.RTFText := Text; |
95 | | - end |
96 | | - else begin |
97 | | - Text := Text + NewLine + 'An error occurred while installing Gtk (code = ' + IntToStr(ResultCode) + ')'; |
98 | | - InstallGtkPage.RichEditViewer.RTFText := Text; |
99 | | - end; |
100 | | - end; |
101 | | -end; |
0 commit comments