Browse Source

Fixes issue 2457

tags/0.6.3m1rc1
Michael 15 years ago
parent
commit
0e558f25b1
1 changed files with 8 additions and 8 deletions
  1. 8
    8
      installer/windows/Setup.dpr

+ 8
- 8
installer/windows/Setup.dpr View File

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

Loading…
Cancel
Save