Cosmos/source/Cosmos.Build.Builder/Services/InnoSetupService.cs
José Pedro f969601a53
Builder improvements.
- Added check for dependencies, which can be installed from the builder.
- Replaced CosmosTask with CosmosBuildDefinition, which is much simpler.
- The builder can be opened without any command line arguments.
- If the VS path is not specified as a command line argument, it can be selected in a dialog.
2018-03-30 19:44:19 +01:00

29 lines
946 B
C#

using System.IO;
using Microsoft.Win32;
namespace Cosmos.Build.Builder.Services
{
internal class InnoSetupService : IInnoSetupService
{
private const string InnoSetupRegistryKey = @"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Inno Setup 5_is1";
public string GetInnoSetupInstallationPath()
{
using (var localMachineKey32 = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry32))
{
using (var key = localMachineKey32.OpenSubKey(InnoSetupRegistryKey, false))
{
if (key?.GetValue("InstallLocation") is string innoSetupPath)
{
if (Directory.Exists(innoSetupPath))
{
return innoSetupPath;
}
}
}
}
return null;
}
}
}