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()
{
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);
}
}
}

View File

@ -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"; });
}