From 1521e587015e82c76ea3d89a5367991d610c36d3 Mon Sep 17 00:00:00 2001 From: Thomas G <62822072+Thomasluigi07@users.noreply.github.com> Date: Wed, 20 Jul 2022 21:42:59 +1000 Subject: [PATCH] Revert "2.5" This reverts commit a031e710aa7ea6c29683b96940d5ec360f1c5867. --- Extensions.cs | 24 ------------------------ Form2.cs | 4 ++-- 2 files changed, 2 insertions(+), 26 deletions(-) delete mode 100644 Extensions.cs diff --git a/Extensions.cs b/Extensions.cs deleted file mode 100644 index 5601604..0000000 --- a/Extensions.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; - -namespace ARCHBLOXBootstrapper -{ - public static class Extensions - { - [System.Runtime.InteropServices.DllImport("kernel32.dll")] - static extern uint GetModuleFileName(IntPtr hModule, System.Text.StringBuilder lpFilename, int nSize); - static readonly int MAX_PATH = 255; - public static string GetExecutablePath() - { - if (System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(System.Runtime.InteropServices.OSPlatform.Windows)) - { - var sb = new System.Text.StringBuilder(MAX_PATH); - GetModuleFileName(IntPtr.Zero, sb, MAX_PATH); - return sb.ToString(); - } - else - { - return System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName; - } - } - } -} \ No newline at end of file diff --git a/Form2.cs b/Form2.cs index cc4d527..b0447e9 100644 --- a/Form2.cs +++ b/Form2.cs @@ -24,7 +24,7 @@ namespace ARCHBLOXBootstrapper string shortcutAddress = (string)shell.SpecialFolders.Item(ref shDesktop) + @"\ARCHBLOX Studio.lnk"; IWshShortcut shortcut = (IWshShortcut)shell.CreateShortcut(shortcutAddress); shortcut.Description = "ARCHBLOX Studio"; - shortcut.TargetPath = Extensions.GetExecutablePath(); + shortcut.TargetPath = Path.GetFullPath(Application.ExecutablePath); shortcut.Save(); } @@ -69,7 +69,7 @@ namespace ARCHBLOXBootstrapper { Directory.CreateDirectory(clientPath); wc.DownloadFileAsync(new Uri(@"https://archblox.com/studio/" + version_string + ".zip"), filePath); - progressBar2.Style = ProgressBarStyle.Blocks; + progressBar2.Style = ProgressBarStyle.Blocks; handle.WaitOne(); } }