mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-10-28 15:02:35 +01:00
Update method for retrieving installer path
The method 'GetInstallerPath' in 'Configuration.cs' has been updated to check both 32-bit and 64-bit registry paths for the 'SubtitleEdit_is1' uninstall key. This was changed to enhance compatibility with different system architectures, ensuring that the correct path is found in both scenarios. Changes involve replacing separate read commands with an array of paths and a loop to sift through them.
This commit is contained in:
parent
96b8794b82
commit
e7c7c300cf
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user