mirror of
https://github.com/babalae/better-genshin-impact.git
synced 2026-03-28 09:59:49 +08:00
28 lines
750 B
C#
28 lines
750 B
C#
using System;
|
|
|
|
namespace MicaSetup.Helper;
|
|
|
|
public static class PrepareInstallPathHelper
|
|
{
|
|
public static string GetPrepareInstallPath(string keyName, bool preferX86 = false)
|
|
{
|
|
try
|
|
{
|
|
UninstallInfo info = RegistyUninstallHelper.Read(keyName);
|
|
|
|
if (!string.IsNullOrWhiteSpace(info.InstallLocation))
|
|
{
|
|
return info.InstallLocation;
|
|
}
|
|
}
|
|
catch
|
|
{
|
|
}
|
|
if (preferX86)
|
|
{
|
|
return Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86) + @"\" + Option.Current.KeyName;
|
|
}
|
|
return Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles) + @"\" + Option.Current.KeyName;
|
|
}
|
|
}
|