Skip to content

Commit

Permalink
Expose product features
Browse files Browse the repository at this point in the history
  • Loading branch information
Nir Bar committed Feb 15, 2023
1 parent 51f6dd3 commit 831be10
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
15 changes: 15 additions & 0 deletions MsiZapEx/ProductInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public enum StatusFlags
public List<ComponentInfo> Components { get; private set; }
public List<PatchInfo> Patches { get; private set; }
public List<string> Dependants { get; private set; }
public List<string> Features { get; private set; }
public RegistryView View { get; private set; }
public StatusFlags Status { get; private set; } = StatusFlags.None;

Expand Down Expand Up @@ -207,11 +208,25 @@ private void Read(string obfuscatedGuid)
Status |= StatusFlags.HkcrProduct;
}
}

Features = new List<string>();
using (RegistryKey k = hkcr.OpenSubKey($@"Installer\Features\{obfuscatedGuid}", false))
{
if (k != null)
{
Status |= StatusFlags.HkcrFeatures;

string[] features = k.GetValueNames();
if (features != null)
{
foreach (string f in features)
{
if (!string.IsNullOrEmpty(f) && !f.Equals("@"))
{
Features.Add(f);
}
}
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion TidyBuild.custom.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<Import Project="$(SolutionDir)TidyBuild.user.props" Condition="Exists('$(SolutionDir)TidyBuild.user.props')" />
<PropertyGroup>
<FullVersion Condition="'$(FullVersion)'==''">0.0.11</FullVersion>
<FullVersion Condition="'$(FullVersion)'==''">0.0.12</FullVersion>
<DefineConstants Condition="'$(MSBuildProjectExtension)'=='.wixproj'">FullVersion=$(FullVersion);$(DefineConstants)</DefineConstants>
</PropertyGroup>
</Project>

0 comments on commit 831be10

Please sign in to comment.