From bb5152b6f53e9fd972482c989a0b3241ac979575 Mon Sep 17 00:00:00 2001 From: Thomas G <62822072+Thomasluigi07@users.noreply.github.com> Date: Fri, 29 Jul 2022 19:16:13 +1000 Subject: [PATCH] 1.0 --- ARCHBLOXLauncher_XP/ARCHBLOXLauncher_XP.csproj | 12 ++++++++++++ ARCHBLOXLauncher_XP/ARCHBLOXLauncher_XP.sln | 2 +- ARCHBLOXLauncher_XP/Form1.Designer.cs | 8 ++++---- ARCHBLOXLauncher_XP/Form1.cs | 17 +++++++++++++++-- ARCHBLOXLauncher_XP/Properties/AssemblyInfo.cs | 8 ++++---- ARCHBLOXLauncher_XP/URI_Maker.cs | 2 +- 6 files changed, 37 insertions(+), 12 deletions(-) diff --git a/ARCHBLOXLauncher_XP/ARCHBLOXLauncher_XP.csproj b/ARCHBLOXLauncher_XP/ARCHBLOXLauncher_XP.csproj index 1629c06..ab2a026 100644 --- a/ARCHBLOXLauncher_XP/ARCHBLOXLauncher_XP.csproj +++ b/ARCHBLOXLauncher_XP/ARCHBLOXLauncher_XP.csproj @@ -34,6 +34,9 @@ prompt 4 + + archblox.ico + @@ -92,6 +95,15 @@ + + {F935DC20-1CF0-11D0-ADB9-00C04FD58A0B} + 1 + 0 + 0 + tlbimp + False + True + {50A7E9B0-70EF-11D1-B75A-00A0C90564FE} 1 diff --git a/ARCHBLOXLauncher_XP/ARCHBLOXLauncher_XP.sln b/ARCHBLOXLauncher_XP/ARCHBLOXLauncher_XP.sln index 3469395..ab809ce 100644 --- a/ARCHBLOXLauncher_XP/ARCHBLOXLauncher_XP.sln +++ b/ARCHBLOXLauncher_XP/ARCHBLOXLauncher_XP.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 11.00 # Visual C# Express 2010 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ARCHBLOXLauncher_XP", "ARCHBLOXLauncher_XP\ARCHBLOXLauncher_XP.csproj", "{11134DDF-A25D-4EF8-89A6-1A1BF2310F07}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ARCHBLOXLauncher_XP", "ARCHBLOXLauncher_XP.csproj", "{11134DDF-A25D-4EF8-89A6-1A1BF2310F07}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/ARCHBLOXLauncher_XP/Form1.Designer.cs b/ARCHBLOXLauncher_XP/Form1.Designer.cs index e295c4d..f36c8a3 100644 --- a/ARCHBLOXLauncher_XP/Form1.Designer.cs +++ b/ARCHBLOXLauncher_XP/Form1.Designer.cs @@ -72,7 +72,7 @@ // serverip // this.serverip.CharacterCasing = System.Windows.Forms.CharacterCasing.Lower; - this.serverip.ForeColor = System.Drawing.SystemColors.ActiveCaptionText; + this.serverip.ForeColor = System.Drawing.SystemColors.MenuText; this.serverip.Location = new System.Drawing.Point(5, 34); this.serverip.MaxLength = 15; this.serverip.Name = "serverip"; @@ -91,7 +91,7 @@ // // serverport // - this.serverport.ForeColor = System.Drawing.SystemColors.ActiveCaptionText; + this.serverport.ForeColor = System.Drawing.SystemColors.MenuText; this.serverport.Location = new System.Drawing.Point(5, 72); this.serverport.MaxLength = 5; this.serverport.Name = "serverport"; @@ -152,7 +152,7 @@ // // textBox1 // - this.textBox1.ForeColor = System.Drawing.SystemColors.ActiveCaptionText; + this.textBox1.ForeColor = System.Drawing.SystemColors.MenuText; this.textBox1.Location = new System.Drawing.Point(5, 32); this.textBox1.MaxLength = 5; this.textBox1.Name = "textBox1"; @@ -185,7 +185,7 @@ // // textBox2 // - this.textBox2.ForeColor = System.Drawing.SystemColors.ActiveCaptionText; + this.textBox2.ForeColor = System.Drawing.SystemColors.MenuText; this.textBox2.Location = new System.Drawing.Point(5, 71); this.textBox2.Name = "textBox2"; this.textBox2.Size = new System.Drawing.Size(168, 21); diff --git a/ARCHBLOXLauncher_XP/Form1.cs b/ARCHBLOXLauncher_XP/Form1.cs index 514f311..cd37359 100644 --- a/ARCHBLOXLauncher_XP/Form1.cs +++ b/ARCHBLOXLauncher_XP/Form1.cs @@ -1,4 +1,5 @@ -using System; +using IWshRuntimeLibrary; +using System; using System.Text; using System.Diagnostics; using System.Windows.Forms; @@ -19,10 +20,22 @@ namespace ARCHBLOXLauncher_XP static string clientPath = Path.Combine(folderPath, version_string + @"\"); static string filePath = Path.Combine(clientPath, "ArchbloxPlayerBeta.exe"); // animations + private void CreateShortcut() + { + // create a shorcut on the user's desktop + object shDesktop = (object)"Desktop"; + WshShell shell = new WshShell(); + string shortcutAddress = (string)shell.SpecialFolders.Item(ref shDesktop) + @"\ARCHBLOX Launcher.lnk"; + IWshShortcut shortcut = (IWshShortcut)shell.CreateShortcut(shortcutAddress); + shortcut.Description = "ARCHBLOX Launcher"; + shortcut.TargetPath = Extensions.GetExecutablePath(); + shortcut.Save(); + } public Form1() { InitializeComponent(); ARCHBLOXProtocol.ARCHBLOXURIProtocol.Register(); + CreateShortcut(); var lastword = ""; var info1 = ""; var info2 = ""; @@ -220,7 +233,7 @@ namespace ARCHBLOXLauncher_XP { // it's supported, yay! string destFile = Path.Combine(clientPath, @"Content\", Path.GetFileName(dialog.FileName)); - System.IO.File.Copy(dialog.FileName, destFile, true); + if (!System.IO.File.Exists(destFile)) { System.IO.File.Copy(dialog.FileName, destFile, true); } textBox2.Text = Path.GetFileName(dialog.FileName); return; } diff --git a/ARCHBLOXLauncher_XP/Properties/AssemblyInfo.cs b/ARCHBLOXLauncher_XP/Properties/AssemblyInfo.cs index 6b66868..aebbeeb 100644 --- a/ARCHBLOXLauncher_XP/Properties/AssemblyInfo.cs +++ b/ARCHBLOXLauncher_XP/Properties/AssemblyInfo.cs @@ -5,12 +5,12 @@ using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. -[assembly: AssemblyTitle("WindowsFormsApplication1")] -[assembly: AssemblyDescription("")] +[assembly: AssemblyTitle("ARCHBLOX Launcher")] +[assembly: AssemblyDescription("ARCHBLOX Launcher for Windows XP and Vista")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("WindowsFormsApplication1")] -[assembly: AssemblyCopyright("Copyright © 2022")] +[assembly: AssemblyProduct("")] +[assembly: AssemblyCopyright("")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] diff --git a/ARCHBLOXLauncher_XP/URI_Maker.cs b/ARCHBLOXLauncher_XP/URI_Maker.cs index ca01f2c..ede6fff 100644 --- a/ARCHBLOXLauncher_XP/URI_Maker.cs +++ b/ARCHBLOXLauncher_XP/URI_Maker.cs @@ -7,7 +7,7 @@ namespace ARCHBLOXProtocol }; internal static class ARCHBLOXURIProtocol { - private static RegistryKey softwareClasses = Registry.CurrentUser.OpenSubKey("Software").OpenSubKey("Classes", true); + private static RegistryKey softwareClasses = Registry.CurrentUser.OpenSubKey("Software").OpenSubKey("Classes").OpenSubKey("Software",true); internal static void Register() {