// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
namespace WixToolset.Dtf.WindowsInstaller
{
using System;
using System.Text;
using System.Globalization;
///
/// Subclasses of this abstract class represent a unique instance of a
/// registered product or patch installation.
///
public abstract class Installation
{
private string installationCode;
private string userSid;
private UserContexts context;
private SourceList sourceList;
internal Installation(string installationCode, string userSid, UserContexts context)
{
if (context == UserContexts.Machine)
{
userSid = null;
}
this.installationCode = installationCode;
this.userSid = userSid;
this.context = context;
}
///
/// Gets the user security identifier (SID) under which this product or patch
/// installation is available.
///
public string UserSid
{
get
{
return this.userSid;
}
}
///
/// Gets the user context of this product or patch installation.
///
public UserContexts Context
{
get
{
return this.context;
}
}
///
/// Gets the source list of this product or patch installation.
///
public virtual SourceList SourceList
{
get
{
if (this.sourceList == null)
{
this.sourceList = new SourceList(this);
}
return this.sourceList;
}
}
///
/// Gets a value indicating whether this product or patch is installed on the current system.
///
public abstract bool IsInstalled
{
get;
}
internal string InstallationCode
{
get
{
return this.installationCode;
}
}
internal abstract int InstallationType
{
get;
}
///
/// Gets a property about the product or patch installation.
///
/// Name of the property being retrieved.
///
public abstract string this[string propertyName]
{
get;
}
}
}