public static SettingsFile DefaultValues() {
SettingsFile Result = new SettingsFile();
string Root = Path.GetPathRoot(Environment.GetFolderPath(Environment.SpecialFolder.System));
Result.NaturalGroundingFolder = Root + "Natural Grounding\\";
// Auto-detect SVP path.
string[] DefaultPaths = {
@"SVP 4\SVPManager.exe",
@"SVP 4 Free\SVPManager.exe",
@"SVP 4 Dev\SVPManager.exe",
@"SVP\SVPMgr.exe"
};
string ProgramFiles = Environment.GetFolderPath(Environment.Is64BitOperatingSystem ? Environment.SpecialFolder.ProgramFilesX86 : Environment.SpecialFolder.ProgramFiles);
string ItemPath;
foreach (string item in DefaultPaths) {
ItemPath = Path.Combine(ProgramFiles, item);
if (File.Exists(ItemPath)) {
Result.SvpPath = ItemPath;
break;
}
}
if (string.IsNullOrEmpty(Result.SvpPath))
Result.SvpPath = Path.Combine(ProgramFiles, DefaultPaths[0]);
// Auto-detect MPC-HC path.
Result.MpcPath = Registry.GetValue(@"HKEY_CURRENT_USER\Software\MPC-HC\MPC-HC\", "ExePath", "") as string;
if ((string.IsNullOrEmpty(Result.MpcPath) || !File.Exists(Result.MpcPath)))
Result.MpcPath = Path.Combine(ProgramFiles, @"MPC-HC\mpc-hc.exe");
return Result;
}