diff --git a/Branding/Images/000_ManagementInterface_h32bit_16.png b/Branding/Images/000_ManagementInterface_h32bit_16.png index f460c2d3f..484cb45f7 100755 Binary files a/Branding/Images/000_ManagementInterface_h32bit_16.png and b/Branding/Images/000_ManagementInterface_h32bit_16.png differ diff --git a/Branding/Images/000_XenCenterAlerts_h32bit_24.png b/Branding/Images/000_XenCenterAlerts_h32bit_24.png index c5b524fc0..b90cffb81 100755 Binary files a/Branding/Images/000_XenCenterAlerts_h32bit_24.png and b/Branding/Images/000_XenCenterAlerts_h32bit_24.png differ diff --git a/Branding/Images/AppIcon.ico b/Branding/Images/AppIcon.ico index 844c993ba..e95e7e68f 100755 Binary files a/Branding/Images/AppIcon.ico and b/Branding/Images/AppIcon.ico differ diff --git a/Branding/Images/DlgBmp.bmp b/Branding/Images/DlgBmp.bmp index 24d4d6e45..6329358ea 100644 Binary files a/Branding/Images/DlgBmp.bmp and b/Branding/Images/DlgBmp.bmp differ diff --git a/Branding/Images/Logo.png b/Branding/Images/Logo.png index a43a7ed67..02437950b 100755 Binary files a/Branding/Images/Logo.png and b/Branding/Images/Logo.png differ diff --git a/Branding/Images/XS.png b/Branding/Images/XS.png index b86f0d2de..d1c74735c 100755 Binary files a/Branding/Images/XS.png and b/Branding/Images/XS.png differ diff --git a/Branding/Images/about_box_graphic_423x79.png b/Branding/Images/about_box_graphic_423x79.png index 25a242f14..0642f3deb 100755 Binary files a/Branding/Images/about_box_graphic_423x79.png and b/Branding/Images/about_box_graphic_423x79.png differ diff --git a/Branding/Images/alerts_32.png b/Branding/Images/alerts_32.png index 57eb4bbce..d7835bcfb 100755 Binary files a/Branding/Images/alerts_32.png and b/Branding/Images/alerts_32.png differ diff --git a/Branding/Images/splash.bmp b/Branding/Images/splash.bmp index f9039ad89..557a9e095 100755 Binary files a/Branding/Images/splash.bmp and b/Branding/Images/splash.bmp differ diff --git a/Branding/Images/upsell_16.png b/Branding/Images/upsell_16.png index 3d004649e..a7c72e0b8 100755 Binary files a/Branding/Images/upsell_16.png and b/Branding/Images/upsell_16.png differ diff --git a/Branding/Images/wizard_background.png b/Branding/Images/wizard_background.png index a77465337..2a58e55f8 100755 Binary files a/Branding/Images/wizard_background.png and b/Branding/Images/wizard_background.png differ diff --git a/XenAdmin.sln b/XenAdmin.sln index 1df15e272..7a71fe8f8 100644 --- a/XenAdmin.sln +++ b/XenAdmin.sln @@ -32,7 +32,7 @@ Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "installer-xcp-ng", "install EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xe", "xe\Xe.csproj", "{727E885D-14BE-40F0-9D0B-3853D44D3984}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "splash-xcp-ng", "..\xcpng.splash\splash-xcp-ng\splash-xcp-ng.csproj", "{CD563857-6159-4415-B7B2-A21991F572E3}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "splash-xcp-ng", "splash-xcp-ng\splash-xcp-ng.csproj", "{CD563857-6159-4415-B7B2-A21991F572E3}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/installer-xcp-ng/installer-xcp-ng.wixproj b/installer-xcp-ng/installer-xcp-ng.wixproj index 4e5b63bd4..2502cf5b7 100644 --- a/installer-xcp-ng/installer-xcp-ng.wixproj +++ b/installer-xcp-ng/installer-xcp-ng.wixproj @@ -43,7 +43,7 @@ - + splash-xcp-ng {cd563857-6159-4415-b7b2-a21991f572e3} True @@ -51,6 +51,14 @@ Binaries;Content;Satellites INSTALLFOLDER + + Xe + {727e885d-14be-40f0-9d0b-3853d44d3984} + True + True + Binaries;Content;Satellites + INSTALLFOLDER + diff --git a/splash-xcp-ng/App.config b/splash-xcp-ng/App.config new file mode 100644 index 000000000..bbb531477 --- /dev/null +++ b/splash-xcp-ng/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/splash-xcp-ng/Form1.Designer.cs b/splash-xcp-ng/Form1.Designer.cs new file mode 100644 index 000000000..0dbfa8d21 --- /dev/null +++ b/splash-xcp-ng/Form1.Designer.cs @@ -0,0 +1,69 @@ +namespace splash_xcp_ng +{ + partial class Form1 + { + private System.ComponentModel.IContainer components = null; + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + private void InitializeComponent() + { + this.labelVersion = new System.Windows.Forms.Label(); + this.panelMain = new System.Windows.Forms.Panel(); + this.panelMain.SuspendLayout(); + this.SuspendLayout(); + // + // labelVersion + // + this.labelVersion.AutoSize = true; + this.labelVersion.BackColor = System.Drawing.Color.Transparent; + this.labelVersion.Dock = System.Windows.Forms.DockStyle.Bottom; + this.labelVersion.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.labelVersion.Location = new System.Drawing.Point(10, 531); + this.labelVersion.Margin = new System.Windows.Forms.Padding(0); + this.labelVersion.Name = "labelVersion"; + this.labelVersion.Size = new System.Drawing.Size(0, 13); + this.labelVersion.TabIndex = 0; + // + // panelMain + // + this.panelMain.AutoSize = true; + this.panelMain.BackColor = System.Drawing.Color.Transparent; + this.panelMain.Controls.Add(this.labelVersion); + this.panelMain.Dock = System.Windows.Forms.DockStyle.Fill; + this.panelMain.Location = new System.Drawing.Point(0, 0); + this.panelMain.Margin = new System.Windows.Forms.Padding(0); + this.panelMain.Name = "panelMain"; + this.panelMain.Padding = new System.Windows.Forms.Padding(10, 0, 0, 10); + this.panelMain.Size = new System.Drawing.Size(800, 554); + this.panelMain.TabIndex = 1; + // + // Form1 + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 16F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(800, 554); + this.Controls.Add(this.panelMain); + this.Font = new System.Drawing.Font("Arial Narrow", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); + this.Name = "Form1"; + this.Text = "XCP-ng Center Launcher"; + this.Shown += new System.EventHandler(this.Form1_Shown); + this.panelMain.ResumeLayout(false); + this.panelMain.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + private System.Windows.Forms.Label labelVersion; + private System.Windows.Forms.Panel panelMain; + } +} + diff --git a/splash-xcp-ng/Form1.cs b/splash-xcp-ng/Form1.cs new file mode 100644 index 000000000..09abd32c0 --- /dev/null +++ b/splash-xcp-ng/Form1.cs @@ -0,0 +1,101 @@ +using System; +using System.ComponentModel; +using System.Diagnostics; +using System.Drawing; +using System.IO; +using System.Windows.Forms; + +namespace splash_xcp_ng +{ + public partial class Form1 : Form + { + private System.IO.Stream stream; + private System.Reflection.Assembly assembly; + const string exe = "XenCenterMain.exe"; + Version AssemblyVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version; + string ProductVersion = System.Windows.Forms.Application.ProductVersion; + + private BackgroundWorker bworker = new BackgroundWorker(); + private ProcessStartInfo startInfo = new ProcessStartInfo(); + private Process proc; + + public Form1() + { + InitializeComponent(); + Style(); + } + + private void Form1_Shown(object sender, EventArgs e) + { + Application.DoEvents(); + Launch(); + } + + private void Style() + { + labelVersion.Text = ProductVersion + " (" + AssemblyVersion + ")"; + + Image bitmap; + assembly = System.Reflection.Assembly.LoadFrom(Application.ExecutablePath); + stream = assembly.GetManifestResourceStream("splash_xcp_ng.Resources.splash.bmp"); + bitmap = Image.FromStream(stream); + + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; + this.SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.DoubleBuffer, true); + this.BackgroundImage = bitmap; + this.BackgroundImageLayout = ImageLayout.Stretch; + this.Width = bitmap.Width; + this.Height = bitmap.Height; + this.CenterToScreen(); + } + + private void Launch() + { + if (!File.Exists(exe)) + { + MessageBox.Show("[ERROR] Application not found: " + exe); + Exit(); + return; + } + + + startInfo.CreateNoWindow = false; + startInfo.UseShellExecute = false; + startInfo.FileName = exe; + startInfo.WindowStyle = ProcessWindowStyle.Hidden; + startInfo.Arguments = String.Empty; + + bworker.WorkerSupportsCancellation = true; + bworker.DoWork += new DoWorkEventHandler(Start); + bworker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bworkerCompleted); + bworker.RunWorkerAsync(); + + //FixMe: Add some safty counter to exit if something goes wrong + while (proc == null || string.IsNullOrEmpty(proc.MainWindowTitle)) + { + System.Threading.Thread.Sleep(100); + if(proc != null) proc.Refresh(); + } + + Exit(); + + } + + private void Start(object sender, DoWorkEventArgs e) + { + proc = Process.Start(startInfo); + } + + private void bworkerCompleted(object sender, RunWorkerCompletedEventArgs e) + { + } + + private void Exit() + { + if (bworker != null && bworker.WorkerSupportsCancellation) bworker.CancelAsync(); + System.Environment.Exit(1); + } + + + } +} diff --git a/splash-xcp-ng/Form1.resx b/splash-xcp-ng/Form1.resx new file mode 100644 index 000000000..29dcb1b3a --- /dev/null +++ b/splash-xcp-ng/Form1.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/splash-xcp-ng/Program.cs b/splash-xcp-ng/Program.cs new file mode 100644 index 000000000..53a824093 --- /dev/null +++ b/splash-xcp-ng/Program.cs @@ -0,0 +1,16 @@ +using System; +using System.Windows.Forms; + +namespace splash_xcp_ng +{ + static class Program + { + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new SplashForm()); + } + } +} diff --git a/splash-xcp-ng/Properties/AssemblyInfo.cs b/splash-xcp-ng/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..564989ad4 --- /dev/null +++ b/splash-xcp-ng/Properties/AssemblyInfo.cs @@ -0,0 +1,19 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +//FixMe: insert Branding +[assembly: AssemblyTitle("[XenCenter] Splash")] +[assembly: AssemblyDescription("XCP-ng Center Launcher")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("[Citrix]")] +[assembly: AssemblyProduct("[XenCenter]")] +[assembly: AssemblyCopyright("[BRANDING_COPYRIGHT]")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +[assembly: ComVisible(false)] +[assembly: Guid("cd563857-6159-4415-b7b2-a21991f572e3")] +[assembly: AssemblyVersion("0.0.0.0")] +[assembly: AssemblyFileVersion("0000")] +[assembly: AssemblyInformationalVersion("[BRANDING_PRODUCT_VERSION]")] diff --git a/splash-xcp-ng/Properties/Resources.Designer.cs b/splash-xcp-ng/Properties/Resources.Designer.cs new file mode 100644 index 000000000..a4232fc9c --- /dev/null +++ b/splash-xcp-ng/Properties/Resources.Designer.cs @@ -0,0 +1,37 @@ +namespace splash_xcp_ng.Properties { + using System; + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("splash_xcp_ng.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + } +} diff --git a/splash-xcp-ng/Properties/Resources.resx b/splash-xcp-ng/Properties/Resources.resx new file mode 100644 index 000000000..29dcb1b3a --- /dev/null +++ b/splash-xcp-ng/Properties/Resources.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/splash-xcp-ng/Properties/Settings.Designer.cs b/splash-xcp-ng/Properties/Settings.Designer.cs new file mode 100644 index 000000000..682084356 --- /dev/null +++ b/splash-xcp-ng/Properties/Settings.Designer.cs @@ -0,0 +1,18 @@ +namespace splash_xcp_ng.Properties +{ + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff --git a/splash-xcp-ng/Properties/Settings.settings b/splash-xcp-ng/Properties/Settings.settings new file mode 100644 index 000000000..abf36c5d3 --- /dev/null +++ b/splash-xcp-ng/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/splash-xcp-ng/Resources/AppIcon.ico b/splash-xcp-ng/Resources/AppIcon.ico new file mode 100644 index 000000000..e95e7e68f Binary files /dev/null and b/splash-xcp-ng/Resources/AppIcon.ico differ diff --git a/splash-xcp-ng/Resources/splash.bmp b/splash-xcp-ng/Resources/splash.bmp new file mode 100644 index 000000000..557a9e095 Binary files /dev/null and b/splash-xcp-ng/Resources/splash.bmp differ diff --git a/splash-xcp-ng/SplashForm.Designer.cs b/splash-xcp-ng/SplashForm.Designer.cs new file mode 100644 index 000000000..0d59ccd22 --- /dev/null +++ b/splash-xcp-ng/SplashForm.Designer.cs @@ -0,0 +1,69 @@ +namespace splash_xcp_ng +{ + partial class SplashForm + { + private System.ComponentModel.IContainer components = null; + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + private void InitializeComponent() + { + this.labelVersion = new System.Windows.Forms.Label(); + this.panelMain = new System.Windows.Forms.Panel(); + this.panelMain.SuspendLayout(); + this.SuspendLayout(); + // + // labelVersion + // + this.labelVersion.AutoSize = true; + this.labelVersion.BackColor = System.Drawing.Color.Transparent; + this.labelVersion.Dock = System.Windows.Forms.DockStyle.Bottom; + this.labelVersion.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.labelVersion.Location = new System.Drawing.Point(10, 531); + this.labelVersion.Margin = new System.Windows.Forms.Padding(0); + this.labelVersion.Name = "labelVersion"; + this.labelVersion.Size = new System.Drawing.Size(0, 13); + this.labelVersion.TabIndex = 0; + // + // panelMain + // + this.panelMain.AutoSize = true; + this.panelMain.BackColor = System.Drawing.Color.Transparent; + this.panelMain.Controls.Add(this.labelVersion); + this.panelMain.Dock = System.Windows.Forms.DockStyle.Fill; + this.panelMain.Location = new System.Drawing.Point(0, 0); + this.panelMain.Margin = new System.Windows.Forms.Padding(0); + this.panelMain.Name = "panelMain"; + this.panelMain.Padding = new System.Windows.Forms.Padding(10, 0, 0, 10); + this.panelMain.Size = new System.Drawing.Size(800, 554); + this.panelMain.TabIndex = 1; + // + // SplashForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 16F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(800, 554); + this.Controls.Add(this.panelMain); + this.Font = new System.Drawing.Font("Arial Narrow", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); + this.Name = "SplashForm"; + this.Text = "XCP-ng Center Launcher"; + this.Shown += new System.EventHandler(this.Form1_Shown); + this.panelMain.ResumeLayout(false); + this.panelMain.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + private System.Windows.Forms.Label labelVersion; + private System.Windows.Forms.Panel panelMain; + } +} + diff --git a/splash-xcp-ng/SplashForm.cs b/splash-xcp-ng/SplashForm.cs new file mode 100644 index 000000000..e689d0966 --- /dev/null +++ b/splash-xcp-ng/SplashForm.cs @@ -0,0 +1,137 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Diagnostics; +using System.Drawing; +using System.IO; +using System.Windows.Forms; + +namespace splash_xcp_ng +{ + public partial class SplashForm : Form + { + private System.IO.Stream stream; + private System.Reflection.Assembly assembly; + const string exe = "XenCenterMain.exe"; + private string exeFullPath = string.Empty; + private string appdir = string.Empty; + + Version AssemblyVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version; + string ProductVersion = System.Windows.Forms.Application.ProductVersion; + + private BackgroundWorker bworker = new BackgroundWorker(); + private ProcessStartInfo startInfo = new ProcessStartInfo(); + private Process proc; + + public SplashForm() + { + InitializeComponent(); + Style(); + } + + private void Form1_Shown(object sender, EventArgs e) + { + Application.DoEvents(); + Launch(); + } + + private void Style() + { + labelVersion.Text = ProductVersion + " (" + AssemblyVersion + ")"; + + Image bitmap; + assembly = System.Reflection.Assembly.LoadFrom(Application.ExecutablePath); + stream = assembly.GetManifestResourceStream("splash_xcp_ng.Resources.splash.bmp"); + bitmap = Image.FromStream(stream); + + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; + this.SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.DoubleBuffer, true); + this.BackgroundImage = bitmap; + this.BackgroundImageLayout = ImageLayout.Stretch; + this.Width = bitmap.Width; + this.Height = bitmap.Height; + this.CenterToScreen(); + } + + private void Launch() + { + appdir = System.IO.Path.GetDirectoryName(Application.ExecutablePath); + exeFullPath = Path.Combine(appdir, exe); + + if (!File.Exists(exeFullPath)) + { + MessageBox.Show("[ERROR] Application not found: " + Environment.NewLine + exeFullPath); + Exit(); + return; + } + + #region Arguments + + // test for agruments: "XCP-ng Center.exe" messageboxtest + + string arguments = String.Empty; + string[] args = Environment.GetCommandLineArgs(); + + if (args != null && args.Length > 0) + { + //remove first argument that always is the current + List temp = new List(args); + temp.RemoveAt(0); + string[] argsonly = temp.ToArray(); + + arguments = string.Join(" ", argsonly); + } + + #endregion + + startInfo.CreateNoWindow = false; + startInfo.UseShellExecute = false; + startInfo.FileName = exeFullPath; + startInfo.WindowStyle = ProcessWindowStyle.Hidden; + startInfo.Arguments = arguments; + startInfo.WorkingDirectory = appdir; + + + + bworker.WorkerSupportsCancellation = true; + bworker.DoWork += new DoWorkEventHandler(Start); + bworker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bworkerCompleted); + bworker.RunWorkerAsync(); + + //safty counter to exit if something goes wrong + int timeoutSeconds = 60; + int sleepMilliseconds = 100; + int max = timeoutSeconds * 1000; + + int counter = 0; + + while (proc == null || string.IsNullOrEmpty(proc.MainWindowTitle)) + { + System.Threading.Thread.Sleep(sleepMilliseconds); + if(proc != null) proc.Refresh(); + + counter++; + if ((counter * sleepMilliseconds) >= max) break; + } + + Exit(); + } + + private void Start(object sender, DoWorkEventArgs e) + { + proc = Process.Start(startInfo); + } + + private void bworkerCompleted(object sender, RunWorkerCompletedEventArgs e) + { + } + + private void Exit() + { + if (bworker != null && bworker.WorkerSupportsCancellation) bworker.CancelAsync(); + System.Environment.Exit(1); + } + + + } +} diff --git a/splash-xcp-ng/SplashForm.resx b/splash-xcp-ng/SplashForm.resx new file mode 100644 index 000000000..29dcb1b3a --- /dev/null +++ b/splash-xcp-ng/SplashForm.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/splash-xcp-ng/splash-xcp-ng.csproj b/splash-xcp-ng/splash-xcp-ng.csproj new file mode 100644 index 000000000..89f86e6cb --- /dev/null +++ b/splash-xcp-ng/splash-xcp-ng.csproj @@ -0,0 +1,98 @@ + + + + + Debug + AnyCPU + {CD563857-6159-4415-B7B2-A21991F572E3} + WinExe + splash_xcp_ng + XCP-ng Center + v4.6 + 512 + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + Resources\AppIcon.ico + + + + + + + + + + + + + + + + + Form + + + SplashForm.cs + + + + + SplashForm.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + True + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + + + + + + + + + + {70bda4bc-f062-4302-8acd-a15d8bf31d65} + XenAdmin + + + + \ No newline at end of file diff --git a/splash/main.cpp b/splash/main.cpp deleted file mode 100644 index 7963e5051..000000000 --- a/splash/main.cpp +++ /dev/null @@ -1,473 +0,0 @@ -/* Copyright (c) Citrix Systems, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, - * with or without modification, are permitted provided - * that the following conditions are met: - * - * * Redistributions of source code must retain the above - * copyright notice, this list of conditions and the - * following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the - * following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND - * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -/* - * main.cpp - * - * Loads a splash screen bitmap from the resources built into the - * executable. Writes the current XenCenter version numbers onto - * the bitmap, and displays it on screen. Waits for a message - * from XenCenter, and then quits. Also monitors the XenCenter - * process, and quits if it dies (in case XenCenter crashes - * before sending the message). - * - * Parts of code taken from msdn. - */ - -// Disable deprecation warnings in the CRT -#define _CRT_SECURE_NO_DEPRECATE -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "resource.h" -#include "util.h" - -using namespace std; - -// Our own made-up IDs for timers -const int ShortTimerId = 1; -const int LongTimerId = 2; - -const int ShortTimerInterval = 100; -// How long to wait for XenCenterMain to start -const int LongTimerInterval = 30000; - -const int PipeTimeout = 60 * 1000; - -// How long the splash should try to acquire the splashscreen lock for -const int SplashLockMaxWait = 60000; -// How many ms the splash screen should wait between attempts -const int SplashLockSleepInterval = 250; - -// Size of the splash bitmap -const int ImageSizeX = 415; -const int ImageSizeY = 217; - -const TCHAR SplashClassName[] = TEXT("XenCenterSplash0001"); -const TCHAR PipeStub[] = TEXT("\\\\.\\pipe\\XenCenter-"); -const TCHAR SplashPipeStub[] = TEXT("\\\\.\\pipe\\XenCenterSplash-"); -// The path to the main C# XenCenter exe, relative to the location of the splash exe. -const TCHAR XenCenterPath[] = TEXT("XenCenterMain.exe"); -const size_t PathLen = 17; - -#ifdef _DEBUG -const TCHAR ProductVersion[] = TEXT("0.0"); -const TCHAR ProductBuild[] = TEXT("0000"); -#else -const TCHAR ProductVersion[] = TEXT("[BRANDING_PRODUCT_VERSION]"); -const TCHAR ProductBuild[] = TEXT("@BUILD_NUMBER@"); -#endif - -// The in-memory Device Context -HDC memdc; - -PROCESS_INFORMATION pi; - -static wstring PipeName(const TCHAR * stub, wstring mainExePath) -{ - // Replace '\' with '-' in mainExePath - wstring sanitizedMainExePath(mainExePath); - { - size_t index = sanitizedMainExePath.npos; - while ((index = sanitizedMainExePath.find('\\', 0)) != sanitizedMainExePath.npos) - { - sanitizedMainExePath.replace(index, 1, 1, '-'); - } - } - - DWORD tmp = UNLEN + 1; - TCHAR UserName[UNLEN + 1]; - GetUserName(UserName, &tmp); - - DWORD pid = GetCurrentProcessId(); - DWORD sid = 0; - if (0 == ProcessIdToSessionId(pid, &sid)) - { - // Ignore error and force sid to 0. - sid = 0; - } - - wostringstream SplashPipePath; - SplashPipePath << stub << sid << '-' << UserName << '-' << sanitizedMainExePath; - - wstring s = SplashPipePath.str(); - // Max length of named pipe name string is 256 chars - if (s.length() > 256) - { - s.resize(256); - } - - return s; -} - -LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) -{ - switch(msg) - { - case WM_CLOSE: - DestroyWindow(hwnd); - break; - case WM_DESTROY: - // Hide the window - will happen anyway if we exit, but not until - // after XenCenterMain exits if --wait was specified. - ShowWindow(hwnd, SW_HIDE); - // Line below sends a WM_QUIT message to this thread - PostQuitMessage(0); - break; - case WM_LBUTTONDOWN: - ShowWindow(hwnd, SW_HIDE); - break; - case WM_PAINT: - { - PAINTSTRUCT ps; - HDC screendc = BeginPaint(hwnd, &ps); - BitBlt(screendc, ps.rcPaint.left, ps.rcPaint.top, ps.rcPaint.right, ps.rcPaint.bottom, - memdc, ps.rcPaint.left, ps.rcPaint.top, SRCCOPY); - EndPaint(hwnd, &ps); - } - break; - case WM_TIMER: - { - switch (wParam) - { - case ShortTimerId: - if (WaitForSingleObject(pi.hProcess, 0) != WAIT_TIMEOUT) - { - // XenCenter has closed (e.g. crashed) without killing the splash screen: exit. - KillTimer(hwnd, ShortTimerId); - DestroyWindow(hwnd); - } - else - { - // Poll again later - SetTimer(hwnd, ShortTimerId, ShortTimerInterval, NULL); - } - break; - case LongTimerId: - // We've been open too long: close even though we haven't heard from XenCenter - DestroyWindow(hwnd); - break; - default: - return DefWindowProc(hwnd, msg, wParam, lParam); - } - } - default: - return DefWindowProc(hwnd, msg, wParam, lParam); - } - return 0; -} - -int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow) -{ - UNREFERENCED_PARAMETER(hPrevInstance); - - // Record if an error that doesn't prevent us launching XenCenterMain has occurred. - // If set to true, we write the splash log to file and launch XenCenterMain, even - // if the splash screen locking or named pipe argument passing have failed. - bool nonCriticalError = false; - - // Open logging output stream. The accumulated contents of this stream are written - // to a log file only in the event of an ErrorExit. - wostringstream logStream; - time_t rawtime = time(NULL); - if (rawtime > -1) - { - logStream << TEXT("splash .exe started at ") << ctime(&rawtime) << endl; - } - else - { - logStream << TEXT("WARNING: time() returned -1") << endl; - } - - // Get the full path to the splash exe - const size_t pathBufSize = 128 * 1024; - wchar_t splashExePath[pathBufSize]; - DWORD pathLen = GetModuleFileName(NULL, splashExePath, pathBufSize); - if (pathLen == 0 || pathLen == pathBufSize) - { - ErrorExit(logStream, TEXT("GetModuleFileName"), true); - } - logStream << TEXT("splashExePath: ") << splashExePath << endl; - - // Now work out the path to the main exe - wstring mainExePath(splashExePath); - { - size_t index = mainExePath.find_last_of('\\', pathLen); - if (index != mainExePath.npos) - { - mainExePath.resize(index); - mainExePath.push_back('\\'); - } - mainExePath.append(XenCenterPath); - } - logStream << TEXT("mainExePath: ") << mainExePath << endl; - - // Acquire splash screen lock - HANDLE splashPipeHandle = INVALID_HANDLE_VALUE; - { - wstring s = PipeName(SplashPipeStub, mainExePath); - logStream << "Attempting to acquire splash screen lock: " << s.c_str() << endl; - - for (int numTries = 0; numTries * SplashLockSleepInterval < SplashLockMaxWait; numTries++) - { - splashPipeHandle = CreateNamedPipe(s.c_str(), - PIPE_ACCESS_DUPLEX | FILE_FLAG_FIRST_PIPE_INSTANCE, - PIPE_WAIT, PIPE_UNLIMITED_INSTANCES, 0, 0, 0, NULL); - - if (splashPipeHandle == INVALID_HANDLE_VALUE) - { - DWORD lastError = GetLastError(); - if (lastError == ERROR_ACCESS_DENIED) - { - // Pipe in use. Sleep and retry. - Sleep(SplashLockSleepInterval); - } - else - { - // Unexpected error code - logStream << "WARNING: CreateNamedPipe failed with unexpected error. Error code: " << GetLastError() << endl; - nonCriticalError = true; - } - } - else - { - // We have acquired the lock - logStream << "Acquired splash screen lock" << endl; - break; - } - } - - if (splashPipeHandle == INVALID_HANDLE_VALUE) - { - // Maximum attempts reached without success. Exit. - logStream << "WARNING: Couldn't acquire splash screen lock before timeout." << endl; - nonCriticalError = true; - } - } - - // First try to pass the cmd line arguments into the named pipe - { - wstring s = PipeName(PipeStub, mainExePath); - logStream << TEXT("Pipe path 's': ") << s << endl; - - // Allocate a buffer for data sent to us through the pipe. - // (Should never actually be any, but the command needs a buffer param anyway) - const int dataOutLength = 64 * 1024; - LPVOID dataOut = malloc(dataOutLength); - if (dataOut == NULL) - { - logStream << TEXT("WARNING: malloc dataOut failed. Error code: ") << GetLastError() << endl; - nonCriticalError = true; - } - - DWORD bytesRead; - if (!CallNamedPipe(s.c_str(), lpCmdLine, (DWORD)_tcslen(lpCmdLine) * sizeof(TCHAR), dataOut, dataOutLength, &bytesRead, PipeTimeout)) - { - DWORD lastError = GetLastError(); - if (lastError == ERROR_FILE_NOT_FOUND) - { - logStream << TEXT("CallNamedPipe gave ERROR_FILE_NOT_FOUND: proceeding to launch XenCenter") << endl; - } - else if (lastError == ERROR_BROKEN_PIPE) - { - logStream << TEXT("CallNamedPipe gave ERROR_BROKEN_PIPE: proceeding to launch XenCenter") << endl; - } - else - { - logStream << "WARNING: CallNamedPipe failed with unexpected error. Error code: " << GetLastError() << endl; - nonCriticalError = true; - } - } - else - { - // Success: we passed the args into the pipe. Exit. - logStream << "Success: command line arguments were passed into pipe. Exiting." << endl; - exit(0); - } - free(dataOut); - } - - // If we get here, sending into the pipe failed. Start XenCenter. - STARTUPINFO si; - ZeroMemory(&si, sizeof(si)); - si.cb = sizeof(si); - - logStream << TEXT("Running CreateProcess with GetCommandLine(): ") << GetCommandLine() << endl; - if (!CreateProcess(mainExePath.c_str(), // module name - GetCommandLine(), // Command line - NULL, // Process handle not inheritable - NULL, // Thread handle not inheritable - FALSE, // Set handle inheritance to FALSE - NORMAL_PRIORITY_CLASS, - NULL, // Use parent's environment block - NULL, // Use parent's starting directory - &si, // Pointer to STARTUPINFO structure - &pi) // Pointer to PROCESS_INFORMATION structure - ) - { - ErrorExit(logStream, TEXT("CreateProcess"), true); - } - CloseHandle(pi.hThread); - - if (nonCriticalError) - { - // At least we managed to launch XenCenterMain. - // Probably not appropriate to show the splash screen. Exit now. - ErrorExit(logStream, TEXT("nonCriticalError"), false); - } - - // Show the splash screen. First register the window class. - WNDCLASSEX wc; - wc.cbSize = sizeof(WNDCLASSEX); - wc.style = 0; - wc.lpfnWndProc = WndProc; - wc.cbClsExtra = 0; - wc.cbWndExtra = 0; - wc.hInstance = hInstance; - wc.hIcon = NULL; - wc.hCursor = LoadCursor(NULL, IDC_ARROW); - wc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1); - wc.lpszMenuName = NULL; - wc.lpszClassName = SplashClassName; - wc.hIconSm = NULL; - - if (RegisterClassEx(&wc) == NULL) - { - ErrorExit(logStream, TEXT("RegisterClassEx"), false); - } - - // Get the screen (desktop) DC - HDC screendc = CreateIC(TEXT("DISPLAY"), NULL, NULL, NULL); - if (screendc == NULL) - { - ErrorExit(logStream, TEXT("CreateIC"), false); - } - - // Get the primary monitor desktop size - const int screenwidth = GetSystemMetrics(SM_CXSCREEN); - const int screenheight = GetSystemMetrics(SM_CYSCREEN); - - logStream << TEXT("Creating splash window") << endl; - // Create the splash window - int x = (screenwidth-ImageSizeX)/2; - int y = (screenheight-ImageSizeY)/2; - HWND hwnd = CreateWindowEx(WS_EX_TOPMOST | WS_EX_TOOLWINDOW, SplashClassName, NULL, WS_POPUP, x, y, ImageSizeX, ImageSizeY, NULL, NULL, hInstance, NULL); - if (hwnd == NULL) - { - ErrorExit(logStream, TEXT("CreateWindowEx"), false); - } - - // Load the splash bitmap from the embedded resource file - HBITMAP image = (HBITMAP)LoadImage(hInstance, MAKEINTRESOURCE(IDB_BITMAP1), IMAGE_BITMAP, 0, 0, LR_DEFAULTCOLOR); - if (image == NULL) - { - ErrorExit(logStream, TEXT("LoadImage"), false); - } - - // Create the in-memory Device Context - memdc = CreateCompatibleDC(screendc); - if (memdc == NULL) - { - ErrorExit(logStream, TEXT("CreateCompatibleDC(screendc)"), false); - } - - // Create a DC for the splash image - HDC filedc = CreateCompatibleDC(screendc); - if (filedc == NULL) - { - ErrorExit(logStream, TEXT("CreateCompatibleDC(filedc)"), false); - } - - // Blit the splash image into the memory DC - SelectObject(filedc, image); - HBITMAP bmp = CreateCompatibleBitmap(screendc, ImageSizeX, ImageSizeY); - ReleaseDC(hwnd, screendc); - SelectObject(memdc, bmp); - BitBlt(memdc, 0, 0, ImageSizeX, ImageSizeY, filedc, 0, 0, SRCCOPY); - DeleteObject(image); - DeleteDC(filedc); - - logStream << TEXT("Showing splash window") << endl; - // Show the splash window - ShowWindow(hwnd, nCmdShow); - UpdateWindow(hwnd); - - // Start timer to poll for XenCenter having started - SetTimer(hwnd, ShortTimerId, ShortTimerInterval, NULL); - - // Start timeout timer after which splash window closes anyway - SetTimer(hwnd, LongTimerId, LongTimerInterval, NULL); - - MSG msg; - // Start message loop - while(GetMessage(&msg, NULL, 0, 0) > 0) - { - TranslateMessage(&msg); - DispatchMessage(&msg); - } - - if (!DisconnectNamedPipe(splashPipeHandle)) - { - // Irritating but non-fatal - logStream << "DisconnectNamedPipe failed with error " << GetLastError() << endl; - } - if (!CloseHandle(splashPipeHandle)) - { - // Likewise - logStream << "CloseHandle failed with error " << GetLastError() << endl; - } - - // Check to see if args contain '--wait': if so, wait for XenCenterMain process to exit - { - wstring args(lpCmdLine); - logStream << TEXT("args: ") << args.c_str() << endl; - if (args.find(TEXT("--wait"), 0) != args.npos) - { - logStream << TEXT("--wait detected: waiting for main XenCenter process to exit") << endl; - WaitForSingleObject(pi.hProcess, INFINITE); - logStream << TEXT("XenCenter process exited") << endl; - } - else - { - CloseHandle(pi.hProcess); - } - } - - logStream << TEXT("Exiting normally") << endl; - - return (int)msg.wParam; -} diff --git a/splash/resource.h b/splash/resource.h deleted file mode 100644 index 5e64b6d94..000000000 --- a/splash/resource.h +++ /dev/null @@ -1,48 +0,0 @@ -/* Copyright (c) Citrix Systems, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, - * with or without modification, are permitted provided - * that the following conditions are met: - * - * * Redistributions of source code must retain the above - * copyright notice, this list of conditions and the - * following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the - * following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND - * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by splash.rc -// -#define IDB_BITMAP1 101 -#define IDI_ICON1 102 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 103 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1001 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif diff --git a/splash/splash.manifest b/splash/splash.manifest deleted file mode 100644 index 2c837a3f9..000000000 --- a/splash/splash.manifest +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/splash/splash.rc b/splash/splash.rc deleted file mode 100644 index afb4bc993..000000000 --- a/splash/splash.rc +++ /dev/null @@ -1,130 +0,0 @@ -// Microsoft Visual C++ generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "windows.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE -BEGIN - "#include ""windows.h""\r\n" - "\0" -END - -3 TEXTINCLUDE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - -///////////////////////////////////////////////////////////////////////////// -// English (U.K.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK -#pragma code_page(1252) -#endif //_WIN32 - -///////////////////////////////////////////////////////////////////////////// -// -// Bitmap -// - -IDB_BITMAP1 BITMAP "../Branding/Images/splash.bmp" - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDI_ICON1 ICON "../Branding/Images/AppIcon.ico" - -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,0,0,1 - PRODUCTVERSION 1,0,0,1 - FILEFLAGSMASK 0x17L -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x4L - FILETYPE 0x1L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "080904b0" - BEGIN - VALUE "CompanyName", "[Citrix]" - VALUE "FileDescription", "[XenCenter]" - VALUE "FileVersion", "1, 0, 0, 1" - VALUE "InternalName", "[XenCenter]" - VALUE "LegalCopyright", "[BRANDING_COPYRIGHT_2]" - VALUE "OriginalFilename", "[XenCenter].exe" - VALUE "ProductName", "[Citrix] [XenCenter]" - VALUE "ProductVersion", "1, 0, 0, 1" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x809, 1200 - END -END - -#endif // English (U.K.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff --git a/splash/splash.vcproj b/splash/splash.vcproj deleted file mode 100644 index 886ac38de..000000000 --- a/splash/splash.vcproj +++ /dev/null @@ -1,227 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/splash/splash.vcxproj b/splash/splash.vcxproj deleted file mode 100644 index e1d4ee706..000000000 --- a/splash/splash.vcxproj +++ /dev/null @@ -1,129 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - {AFB19C9D-DD63-478B-A4A3-8452CBD0B9AB} - test - Win32Proj - 10.0.17134.0 - - - - Application - Unicode - true - v141 - - - Application - Unicode - v141 - - - - - - - - - - - - - <_ProjectFileVersion>10.0.40219.1 - $(SolutionDir)XenAdmin\bin\Debug\ - $(ProjectDir)$(Configuration)\ - true - $(SolutionDir)XenAdmin\bin\Release\ - $(ProjectDir)$(Configuration)\ - false - - - ~~XenCenter~~ - - - XCP-ng Center - - - - Disabled - %(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - - - Level4 - EditAndContinue - - - $(OutDir)$(TargetName).exe - true - Windows - false - - - MachineX86 - - - $(ProjectDir)\splash.manifest;%(AdditionalManifestFiles) - - - - - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreaded - - - Level4 - true - ProgramDatabase - 4995;%(DisableSpecificWarnings) - - - $(OutDir)$(TargetName).exe - %(AdditionalLibraryDirectories) - true - Windows - true - true - false - - - MachineX86 - - - $(ProjectDir)\splash.manifest;%(AdditionalManifestFiles) - - - - - - - - - - - - - - - - {70bda4bc-f062-4302-8acd-a15d8bf31d65} - false - - - - - - \ No newline at end of file diff --git a/splash/splash.vcxproj.filters b/splash/splash.vcxproj.filters deleted file mode 100644 index 862eab3a4..000000000 --- a/splash/splash.vcxproj.filters +++ /dev/null @@ -1,40 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav - - - - - Source Files - - - Source Files - - - - - Header Files - - - - - Resource Files - - - - - Header Files - - - \ No newline at end of file diff --git a/splash/util.cpp b/splash/util.cpp deleted file mode 100644 index a611dca36..000000000 --- a/splash/util.cpp +++ /dev/null @@ -1,79 +0,0 @@ -/* Copyright (c) Citrix Systems, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, - * with or without modification, are permitted provided - * that the following conditions are met: - * - * * Redistributions of source code must retain the above - * copyright notice, this list of conditions and the - * following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the - * following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND - * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include -#include -#include -#include -#include -#include -#include "util.h" - -using namespace std; - -void ErrorExit(wostringstream& logStream, const LPTSTR lpszFunction, bool showDialog) -{ - // Retrieve the system error message for the last-error code - LPVOID lpMsgBuf; - LPVOID lpDisplayBuf; - DWORD dw = GetLastError(); - - FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, - NULL, dw, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &lpMsgBuf, 0, NULL); - - // Display the error message and exit the process - lpDisplayBuf = (LPVOID)LocalAlloc(LMEM_ZEROINIT, (lstrlen((LPCTSTR)lpMsgBuf) + lstrlen((LPCTSTR)lpszFunction) + 100) * sizeof(TCHAR)); - StringCchPrintf((LPTSTR)lpDisplayBuf, LocalSize(lpDisplayBuf) / sizeof(TCHAR), - TEXT("%s failed with error %d: %s Please contact your support representative."), lpszFunction, dw, lpMsgBuf); - - logStream << TEXT("ErrorExit called: ") << (LPTSTR)lpDisplayBuf << endl; - - // Now write logStream to file - TCHAR destBuf[MAX_PATH]; - wostringstream DebugFilePath; - // Get %APPDATA% path - if (SHGetSpecialFolderPath(NULL, destBuf, CSIDL_APPDATA, 1) == TRUE) - { - DebugFilePath << destBuf << "\\[Citrix]\\[XenCenter]\\logs\\splash.log"; - wofstream fileStream(DebugFilePath.str().c_str(), ios_base::out | ios_base::trunc); - fileStream << logStream.str() << endl; - } - - if (showDialog) - { - // Show error to user - MessageBox(NULL, (LPCTSTR)lpDisplayBuf, TEXT("Error"), MB_OK); - } - - LocalFree(lpMsgBuf); - LocalFree(lpDisplayBuf); - ExitProcess(dw); -} diff --git a/splash/util.h b/splash/util.h deleted file mode 100644 index 0ff1bceca..000000000 --- a/splash/util.h +++ /dev/null @@ -1,42 +0,0 @@ -/* Copyright (c) Citrix Systems, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, - * with or without modification, are permitted provided - * that the following conditions are met: - * - * * Redistributions of source code must retain the above - * copyright notice, this list of conditions and the - * following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the - * following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND - * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef UTIL_H -#define UTIL_H - -#include -#include - -using namespace std; - -void ErrorExit(wostringstream& logStream, const LPTSTR lpszFunction, bool showDialog); - -#endif