diff --git a/installer/win/WixSharpInstaller/CloseDialog.designer.cs b/installer/win/WixSharpInstaller/CloseDialog.designer.cs index 152e4166..c999c727 100644 --- a/installer/win/WixSharpInstaller/CloseDialog.designer.cs +++ b/installer/win/WixSharpInstaller/CloseDialog.designer.cs @@ -101,13 +101,13 @@ namespace Symphony // backgroundPanel // this.backgroundPanel.BackColor = System.Drawing.Color.White; - this.backgroundPanel.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; + this.backgroundPanel.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; this.backgroundPanel.Controls.Add(this.closeButton); this.backgroundPanel.Controls.Add(this.labelBody); this.backgroundPanel.Controls.Add(this.labelHeader); this.backgroundPanel.Location = new System.Drawing.Point(-3, -1); this.backgroundPanel.Name = "backgroundPanel"; - this.backgroundPanel.Size = new System.Drawing.Size(502, 309); + this.backgroundPanel.Size = new System.Drawing.Size(494, 270); this.backgroundPanel.TabIndex = 10; // // labelBody @@ -144,6 +144,7 @@ namespace Symphony // // CloseDialog // + this.BackColor = System.Drawing.Color.White; this.ControlBox = false; this.ClientSize = new System.Drawing.Size(494, 361); this.Controls.Add(this.backgroundPanel); @@ -158,9 +159,26 @@ namespace Symphony this.backgroundPanel.PerformLayout(); this.ResumeLayout(false); + ScaleForDPI(this.backgroundPanel); + foreach (System.Windows.Forms.Control control in this.backgroundPanel.Controls) + { + ScaleForDPI(control); + } + foreach (System.Windows.Forms.Control control in this.tableLayoutbackgroundPanel.Controls) + { + ScaleForDPI(control); + } } #endregion + + void ScaleForDPI(System.Windows.Forms.Control control) + { + double factor = (System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width / System.Windows.SystemParameters.PrimaryScreenWidth); + control.Location = new System.Drawing.Point((int)(control.Location.X * factor), (int)(control.Location.Y * factor)); + control.Size = new System.Drawing.Size((int)(control.Size.Width * factor), (int)(control.Size.Height * factor)); + } + private System.Windows.Forms.Panel bottomPanel; private System.Windows.Forms.TableLayoutPanel tableLayoutbackgroundPanel; private System.Windows.Forms.Button next; diff --git a/installer/win/WixSharpInstaller/ProgressDialog.Designer.cs b/installer/win/WixSharpInstaller/ProgressDialog.Designer.cs index 0295f7c3..39ba0b98 100644 --- a/installer/win/WixSharpInstaller/ProgressDialog.Designer.cs +++ b/installer/win/WixSharpInstaller/ProgressDialog.Designer.cs @@ -107,6 +107,7 @@ namespace Symphony this.banner.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); + this.banner.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; this.banner.BackColor = System.Drawing.Color.White; this.banner.Location = new System.Drawing.Point(0, 0); this.banner.Name = "banner"; @@ -239,11 +240,33 @@ namespace Symphony this.tableLayoutPanel1.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); + foreach (System.Windows.Forms.Control control in this.Controls) + { + if (control != this.bottomPanel && control != this.topPanel && control != this.progress) + { + ScaleForDPI(control); + } + } + ScaleForDPIHeight(this.progress); } #endregion + void ScaleForDPI(System.Windows.Forms.Control control) + { + double factor = (System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width / System.Windows.SystemParameters.PrimaryScreenWidth); + control.Location = new System.Drawing.Point((int)(control.Location.X * factor), (int)(control.Location.Y * factor)); + control.Size = new System.Drawing.Size((int)(control.Size.Width * factor), (int)(control.Size.Height * factor)); + } + + void ScaleForDPIHeight(System.Windows.Forms.Control control) + { + double factor = (System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width / System.Windows.SystemParameters.PrimaryScreenWidth); + control.Location = new System.Drawing.Point(control.Location.X, (int)(control.Location.Y * factor)); + control.Size = new System.Drawing.Size(control.Size.Width, (int)(control.Size.Height * factor)); + } + private System.Windows.Forms.PictureBox banner; private System.Windows.Forms.Panel topPanel; private System.Windows.Forms.Label dialogText; diff --git a/installer/win/WixSharpInstaller/Symphony.cs b/installer/win/WixSharpInstaller/Symphony.cs index 384b10ef..a6be27f7 100644 --- a/installer/win/WixSharpInstaller/Symphony.cs +++ b/installer/win/WixSharpInstaller/Symphony.cs @@ -1,6 +1,7 @@ //css_dir ..\WixSharpToolset\; //css_ref System.Core.dll; //css_ref System.Windows.Forms.dll; +//css_ref PresentationFramework.dll; //css_ref Wix_bin\SDK\Microsoft.Deployment.WindowsInstaller.dll; //css_ref WixSharp.UI.dll; //css_imp WelcomeDialog.cs; @@ -269,6 +270,7 @@ class Script // Use our own Symphony branded bitmap for installation dialogs project.BannerImage = "Banner.jpg"; project.BackgroundImage = "Tabloid.jpg"; + project.ValidateBackgroundImage = false; // Define our own installation flow, using a mix of custom dialogs (defined in their own files) and built-in dialogs project.ManagedUI = new ManagedUI(); diff --git a/installer/win/WixSharpInstaller/Tabloid.jpg b/installer/win/WixSharpInstaller/Tabloid.jpg index 662f9516..6d1e1f9e 100644 Binary files a/installer/win/WixSharpInstaller/Tabloid.jpg and b/installer/win/WixSharpInstaller/Tabloid.jpg differ diff --git a/installer/win/WixSharpInstaller/WelcomeDialog.designer.cs b/installer/win/WixSharpInstaller/WelcomeDialog.designer.cs index 4d65023d..9ec3f3cd 100644 --- a/installer/win/WixSharpInstaller/WelcomeDialog.designer.cs +++ b/installer/win/WixSharpInstaller/WelcomeDialog.designer.cs @@ -105,14 +105,14 @@ namespace Symphony // backgroundPanel // this.backgroundPanel.BackColor = System.Drawing.Color.White; - this.backgroundPanel.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; + this.backgroundPanel.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; this.backgroundPanel.Controls.Add(this.panelInstallType); this.backgroundPanel.Controls.Add(this.labelInstallType); this.backgroundPanel.Controls.Add(this.labelBody); this.backgroundPanel.Controls.Add(this.labelHeader); this.backgroundPanel.Location = new System.Drawing.Point(-3, -1); this.backgroundPanel.Name = "backgroundPanel"; - this.backgroundPanel.Size = new System.Drawing.Size(502, 309); + this.backgroundPanel.Size = new System.Drawing.Size(494, 270); this.backgroundPanel.TabIndex = 10; // // panelInstallType @@ -179,6 +179,7 @@ namespace Symphony // // WelcomeDialog // + this.BackColor = System.Drawing.Color.White; this.ControlBox = false; this.ClientSize = new System.Drawing.Size(494, 361); this.Controls.Add(this.backgroundPanel); @@ -195,9 +196,30 @@ namespace Symphony this.panelInstallType.PerformLayout(); this.ResumeLayout(false); + ScaleForDPI( this.backgroundPanel ); + foreach (System.Windows.Forms.Control control in this.backgroundPanel.Controls) + { + ScaleForDPI(control); + } + foreach (System.Windows.Forms.Control control in this.panelInstallType.Controls) + { + ScaleForDPI(control); + } + foreach (System.Windows.Forms.Control control in this.tableLayoutbackgroundPanel.Controls) + { + ScaleForDPI(control); + } } #endregion + + void ScaleForDPI(System.Windows.Forms.Control control) + { + double factor = (System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width / System.Windows.SystemParameters.PrimaryScreenWidth); + control.Location = new System.Drawing.Point((int)(control.Location.X * factor), (int)(control.Location.Y * factor)); + control.Size = new System.Drawing.Size((int)(control.Size.Width * factor), (int)(control.Size.Height * factor)); + } + private System.Windows.Forms.Panel bottomPanel; private System.Windows.Forms.TableLayoutPanel tableLayoutbackgroundPanel; private System.Windows.Forms.Button next;