|
@@ -72,7 +72,7 @@ program Setup;
|
72
|
72
|
|
73
|
73
|
// If defined the JRE will always be downloaded as if it didn't exist. Used for
|
74
|
74
|
// testing the JRE download dialog.
|
75
|
|
-//{$DEFINE FORCEJREDOWNLOAD}
|
|
75
|
+// {$DEFINE FORCEJREDOWNLOAD}
|
76
|
76
|
|
77
|
77
|
uses
|
78
|
78
|
kol, shared, Vista, Windows, SysUtils, classes, registry;
|
|
@@ -117,8 +117,6 @@ procedure setProgress(value: integer; msg: string);
|
117
|
117
|
begin
|
118
|
118
|
ProgressBar.progress := value;
|
119
|
119
|
labelprogress.Caption := msg;
|
120
|
|
- //self.Caption := pChar('DMDirc Setup - '+CaptionLabel.Caption);
|
121
|
|
- //Application.Title := self.Caption;
|
122
|
120
|
applet.processmessages;
|
123
|
121
|
end;
|
124
|
122
|
|
|
@@ -128,11 +126,15 @@ end;
|
128
|
126
|
procedure CreateMainWindow;
|
129
|
127
|
var
|
130
|
128
|
screenw, screenh: longint;
|
|
129
|
+ iconhandle: thandle;
|
131
|
130
|
begin
|
132
|
131
|
{ This call is required for common control 6 DLL to be correctly imported.
|
133
|
132
|
Without it strange things happen on windows XP }
|
134
|
133
|
InitCommonControls;
|
135
|
134
|
|
|
135
|
+ { Load the icon to assign to our window }
|
|
136
|
+ iconhandle := LoadIcon(hInstance, 'icon.ico');
|
|
137
|
+
|
136
|
138
|
{ We need the screen size to centre the window later }
|
137
|
139
|
screenw := GetSystemMetrics(SM_CXSCREEN);
|
138
|
140
|
screenh := GetSystemMetrics(SM_CYSCREEN);
|
|
@@ -141,8 +143,7 @@ begin
|
141
|
143
|
Applet := NewApplet('DMDirc Setup');
|
142
|
144
|
Applet.Visible := true;
|
143
|
145
|
|
144
|
|
- { Currently this icon does not work }
|
145
|
|
- Applet.Icon := THandle(-1);
|
|
146
|
+ Applet.Icon := iconhandle;
|
146
|
147
|
|
147
|
148
|
{ Create main form and set sane defaults. If we don't set the font here then
|
148
|
149
|
all child objects will have a rubbish font as a holdover from Windows 3.1! }
|
|
@@ -154,8 +155,7 @@ begin
|
154
|
155
|
frmmain.Font.FontHeight := 8;
|
155
|
156
|
frmmain.SetPosition((screenw div 2) - (frmmain.Width div 2), (screenh div 2) - (frmmain.height div 2));
|
156
|
157
|
|
157
|
|
- { Currently this icon does not work }
|
158
|
|
- frmmain.Icon := THandle(-1);
|
|
158
|
+ frmmain.Icon := iconhandle;
|
159
|
159
|
|
160
|
160
|
progressbar := NewProgressBar(frmmain).SetPosition(16, 114);
|
161
|
161
|
progressbar.SetSize(frmmain.clientWidth - (progressbar.Left * 2), 16);
|
|
@@ -164,7 +164,7 @@ begin
|
164
|
164
|
progressbar.Visible := true;
|
165
|
165
|
|
166
|
166
|
btncancel := NewButton(frmmain, 'Cancel').SetPosition(progressbar.Left +
|
167
|
|
- progressbar.width - 60, progressbar.Top + progressbar.Height + 14);
|
|
167
|
+ progressbar.width - 60, progressbar.Top + progressbar.Height + 14);
|
168
|
168
|
btncancel.SetSize(60, 24);
|
169
|
169
|
|
170
|
170
|
label1 := NewLabel(frmmain, 'Downloading Java Runtime Environment').SetPosition(16, 16);
|