Merge pull request #7134 from ivandrofly/feature/patch-2

Update method for retrieving installer path
This commit is contained in:
Nikolaj Olsson 2023-07-21 12:51:24 -04:00 committed by GitHub
commit 934364125c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -120,16 +120,18 @@ namespace Nikse.SubtitleEdit.Core.Common
private static string GetInstallerPath()
{
const string valueName = "InstallLocation";
var value = RegistryUtil.GetValue(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\SubtitleEdit_is1", valueName);
if (value != null && Directory.Exists(value))
{
return value;
}
string[] paths = {
@"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\SubtitleEdit_is1",
@"SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\SubtitleEdit_is1"
};
value = RegistryUtil.GetValue(@"SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\SubtitleEdit_is1", valueName);
if (value != null && Directory.Exists(value))
foreach (var path in paths)
{
return value;
var value = RegistryUtil.GetValue(path, valueName);
if (Directory.Exists(value))
{
return value;
}
}
return null;