private static InstallCommands GetInstallCommands([NotNull] RegistryKey clientKey, [NotNull] string installationDir)
{
#region Sanity checks
if (clientKey == null) throw new ArgumentNullException(nameof(clientKey));
if (string.IsNullOrEmpty(installationDir)) throw new ArgumentNullException(nameof(installationDir));
#endregion
using (var installInfoKey = clientKey.OpenSubKey(DesktopIntegration.Windows.DefaultProgram.RegSubKeyInstallInfo))
{
if (installInfoKey == null) return default(InstallCommands);
string reinstallArgs;
string reinstall = IsolateCommand(installInfoKey.GetValue(DesktopIntegration.Windows.DefaultProgram.RegValueReinstallCommand, "").ToString(), installationDir, out reinstallArgs);
string showIconsArgs;
string showIcons = IsolateCommand(installInfoKey.GetValue(DesktopIntegration.Windows.DefaultProgram.RegValueShowIconsCommand, "").ToString(), installationDir, out showIconsArgs);
string hideIconsArgs;
string hideIcons = IsolateCommand(installInfoKey.GetValue(DesktopIntegration.Windows.DefaultProgram.RegValueHideIconsCommand, "").ToString(), installationDir, out hideIconsArgs);
return new InstallCommands
{
Reinstall = reinstall, ReinstallArgs = reinstallArgs,
ShowIcons = showIcons, ShowIconsArgs = showIconsArgs,
HideIcons = hideIcons, HideIconsArgs = hideIconsArgs
};
}
}