diff options
author | inat3k <infantini.francesco@gmail.com> | 2018-01-09 13:17:33 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-09 13:17:33 +0300 |
commit | 81ab40a6ae7bf46a804d5335b307709727d81c4a (patch) | |
tree | 371f2feb482b6a125e660f323f9b3cfc1e24c5fb /Duplicati/Library/Snapshots/MSSQLUtility.cs | |
parent | c05ad799686c75f2c4eabd246f5558d09906c86e (diff) |
Check MSSQL 32bit installation on 64bit system
Some programs install MSSQL 32bit version on 64bit system. In that case Duplicati can't find MSSQL instances because it checks only on 64bit registry. That change check also 32bit registry.
Diffstat (limited to 'Duplicati/Library/Snapshots/MSSQLUtility.cs')
-rw-r--r-- | Duplicati/Library/Snapshots/MSSQLUtility.cs | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/Duplicati/Library/Snapshots/MSSQLUtility.cs b/Duplicati/Library/Snapshots/MSSQLUtility.cs index 1b5e6fb88..3fcb11b32 100644 --- a/Duplicati/Library/Snapshots/MSSQLUtility.cs +++ b/Duplicati/Library/Snapshots/MSSQLUtility.cs @@ -94,13 +94,28 @@ namespace Duplicati.Library.Snapshots {
if (!string.IsNullOrWhiteSpace(installed as string))
arrInstalledInstances = new string[] { installed as string };
- }
+ }
else if (installed is string[])
arrInstalledInstances = (string[])installed;
else if (installed != null)
try { arrInstalledInstances = (string[])installed; }
catch { }
+ if(Environment.Is64BitOperatingSystem)
+ {
+ var installed32on64 = Microsoft.Win32.Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SQL Server", "InstalledInstances", "");
+ if (installed32on64 is string)
+ {
+ if (!string.IsNullOrWhiteSpace(installed32on64 as string))
+ arrInstalledInstances = new string[] { installed32on64 as string };
+ }
+ else if (installed32on64 is string[])
+ arrInstalledInstances = (string[])installed32on64;
+ else if (installed32on64 != null)
+ try { arrInstalledInstances = (string[])installed32on64; }
+ catch { }
+ }
+
IsMSSQLInstalled = arrInstalledInstances == null ? false : arrInstalledInstances.Length > 0;
if (!IsMSSQLInstalled)
@@ -164,4 +179,4 @@ namespace Duplicati.Library.Snapshots }
}
}
-}
\ No newline at end of file +}
|