Skip to content

Commit

Permalink
Merge remote-tracking branch 'dni/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Crowther committed Jul 5, 2023
2 parents 07398a5 + b1f67f0 commit 5beb428
Show file tree
Hide file tree
Showing 104 changed files with 12,546 additions and 7,112 deletions.
18 changes: 17 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ env:

jobs:
build:
runs-on: windows-latest
runs-on: windows-2019

strategy:
matrix:
Expand All @@ -30,6 +30,22 @@ jobs:
- name: Add MSBuild to PATH
uses: microsoft/[email protected]

- name: Download Win8.1 SDK
shell: powershell
run: |
md C:\win81sdk
Invoke-WebRequest -Method Get -Uri https://go.microsoft.com/fwlink/p/?LinkId=323507 -OutFile C:\win81sdk\sdksetup.exe -UseBasicParsing
- name: Install Win8.1 SDK
shell: powershell
run: |
Start-Process -Wait C:\win81sdk\sdksetup.exe -ArgumentList "/q", "/norestart", "/features", "OptionId.WindowsDesktopSoftwareDevelopmentKit", "OptionId.NetFxSoftwareDevelopmentKit"
- name: Install Microsoft Visual C++ 2010 Runtime 10.0.40219
# This is required for the test method 'testGetRelatedInstalledProducts' in 'dotNetInstallerToolsLibUnitTests\MsiUtilUnitTests.cpp' to succeed.
# The windows-2016 virtual environment has an older version, Microsoft Visual C++ 2010 Runtime 10.0.30319.
run: choco install vcredist2010 --version=10.0.40219.32503

- name: Build
working-directory: ${{env.GITHUB_WORKSPACE}}
run: msbuild /t:all /m /p:Configuration=${{ matrix.Configuration }} .\dni.proj
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@ StyleCop.Cache
*.pdb
*.ipch
.vs
packages
packages
/temp
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
TBD
===

Features
--------

* [#114](https://github.com/dotnetinstaller/dotnetinstaller/issues/114) - Added support for operating system product type filters - [@icnocop](https://github.com/icnocop).
* [#153](https://github.com/dotnetinstaller/dotnetinstaller/issues/153) - Added support for sub-directory installed check comparison using semantic versioning - [@icnocop](https://github.com/icnocop).
* [#156](https://github.com/dotnetinstaller/dotnetinstaller/pull/156) - Building and distributing 64-bit version of CabLib.dll for reference by 64-bit processes - [@icnocop](https://github.com/icnocop).

3.2.115 (1/15/2022)
===================

Expand Down
2 changes: 1 addition & 1 deletion Documentation/Content/Checks.aml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
You can use <link topicType_id="1FE70836-AA7D-4515-B54B-E10C4B516E50" xlink:href="13ba8ef4-383f-4dd4-9588-b4ace3fcbf12" /> to
check whether a component is already installed. These can be combined with
<link topicType_id="1FE70836-AA7D-4515-B54B-E10C4B516E50" xlink:href="227b3deb-5fed-4c76-91fa-982e45338c97" />
which select components depending on the target operatng system and with
which select components depending on the target operating system and with
<link topicType_id="1FE70836-AA7D-4515-B54B-E10C4B516E50" xlink:href="40140223-7489-4377-b980-6204d9d21982" />
which check the machine's hardware architecture.
</para>
Expand Down
37 changes: 34 additions & 3 deletions Documentation/Content/InstalledChecks.aml
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,39 @@
<title>check_directory</title>
<content>
<para>
Check whether a specific directory exists.
</para>
Check whether a specific directory exists or if a sub directory exists with a specific version.
</para>
<para>
The following comparison types are available.
<definitionTable>
<definedTerm>exists</definedTerm>
<definition>Check whether the directory exists.</definition>
<definedTerm>version</definedTerm>
<definition>Check whether the name of a sub directory, parsed as a version number, is greater or equal to the check value.</definition>
<definedTerm>version_eq</definedTerm>
<definition>Check whether the name of a sub directory, parsed as a version number, is equal to the check value.</definition>
<definedTerm>version_lt</definedTerm>
<definition>Check whether the name of a sub directory, parsed as a version number, is lesser than the check value.</definition>
<definedTerm>version_le</definedTerm>
<definition>Check whether the name of a sub directory, parsed as a version number, is lesser or equal than the check value.</definition>
<definedTerm>version_gt</definedTerm>
<definition>Check whether the name of a sub directory, parsed as a version number, is greater than the check value.</definition>
<definedTerm>version_ge</definedTerm>
<definition>Check whether the name of a sub directory, parsed as a version number, is greater or equal than the check value.</definition>
<definedTerm>semver</definedTerm>
<definition>Check whether the name of a sub directory, parsed as a semantic version number, is greater or equal to the check value.</definition>
<definedTerm>semver_eq</definedTerm>
<definition>Check whether the name of a sub directory, parsed as a semantic version number, is equal to the check value.</definition>
<definedTerm>semver_lt</definedTerm>
<definition>Check whether the name of a sub directory, parsed as a semantic version number, is lesser than the check value.</definition>
<definedTerm>semver_le</definedTerm>
<definition>Check whether the name of a sub directory, parsed as a semantic version number, is lesser or equal than the check value.</definition>
<definedTerm>semver_gt</definedTerm>
<definition>Check whether the name of a sub directory, parsed as a semantic version number, is greater than the check value.</definition>
<definedTerm>semver_ge</definedTerm>
<definition>Check whether the name of a sub directory, parsed as a semantic version number, is greater or equal than the check value.</definition>
</definitionTable>
</para>
</content>
</section>
<section address="checktypesregistry">
Expand Down Expand Up @@ -175,7 +206,7 @@
<title>check_product</title>
<content>
<para>
Query the MSI database for a given product by product id or upgrade code. The following properties are availble
Query the MSI database for a given product by product id or upgrade code. The following properties are available
in the check.
<definitionTable>
<definedTerm>description</definedTerm>
Expand Down
31 changes: 30 additions & 1 deletion Documentation/Content/OsFilters.aml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<para>
A component may not be required for a specific operating system or may be required for a specific operating
system only. These behaviors can be achieved with <newTerm>operating system filters</newTerm>, specifically
<literal>os_filter</literal>, <literal>os_filter_min</literal> and <literal>os_filter_max</literal>.
<literal>os_filter</literal>, <literal>os_filter_min</literal>, <literal>os_filter_max</literal>, and <literal>os_type_filter</literal>.
</para>
</introduction>
<section address="operatingsystemfilters">
Expand Down Expand Up @@ -244,6 +244,35 @@
identifier. This is set if the OS is greater than the maximum known OS, currently Windows 10.
</para>
</alert>
<para>
The <literal>os_type_filter</literal> value specifies a filter to install a configuration or component on.
The operating system product type must be equal to any of the values specified. Separate multiple operating system product types
with commas. For example, <literal>workstation</literal> means only to install a configuration on Windows XP, Vista, 7, 8, 10, or 11.
</para>
<para>
The following operating system product type table values can be used for <literal>os_type_filter</literal>.
<table>
<title>Operating System Product Type Values</title>
<tableHeader>
<row>
<entry>Operating System Product Type Name</entry>
<entry>Enumerator</entry>
</row>
</tableHeader>
<row>
<entry>Workstation</entry>
<entry>workstation</entry>
</row>
<row>
<entry>Server</entry>
<entry>server</entry>
</row>
<row>
<entry>Domain Controller</entry>
<entry>domainController</entry>
</row>
</table>
</para>
</content>
</section>
</developerConceptualDocument>
Expand Down
13 changes: 13 additions & 0 deletions Documentation/Content/ThirdPartyLicenses.aml
Original file line number Diff line number Diff line change
Expand Up @@ -133,5 +133,18 @@
</para>
</content>
</section>
<section address="semver">
<title>semver</title>
<content>
<para>
C++ library to parse and compare strings with Semantic Versioning 2.0.0.
See <externalLink>
<linkText>https://github.com/zmarko/semver</linkText>
<linkUri>https://github.com/zmarko/semver</linkUri>
</externalLink> for more information.
<code language="text" source="..\ThirdParty\semver\LICENSE" />
</para>
</content>
</section>
</developerConceptualDocument>
</topic>
11 changes: 11 additions & 0 deletions InstallerLib/Component.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,15 @@ public OperatingSystem os_filter_max
set { m_os_filter_max = value; }
}

private string m_os_type_filter;
[Description("Filter to install this component only on all operating system product types equal or not equal to the value(s) specified. Separate multiple operating system types with a comma (',') and use the not symbol ('!') for NOT logic (ex. '!workstation,!server' ).")]
[Category("Operating System")]
public string os_type_filter
{
get { return m_os_type_filter; }
set { m_os_type_filter = value; }
}

private string m_os_filter_lcid;
[Description("Filter to install this component only on all operating system languages equal or not equal to the LCID specified. Separate multiple LCID with comma (',') and use not symbol ('!') for NOT logic (eg. '1044,1033,!1038' ).")]
[Category("Operating System")]
Expand Down Expand Up @@ -343,6 +352,7 @@ protected override void OnXmlWriteTag(XmlWriterEventArgs e)
? "" : Enum.GetName(typeof(OperatingSystem), m_os_filter_min)));
e.XmlWriter.WriteAttributeString("os_filter_max", (m_os_filter_max == OperatingSystem.winNone
? "" : Enum.GetName(typeof(OperatingSystem), m_os_filter_max)));
e.XmlWriter.WriteAttributeString("os_type_filter", m_os_type_filter);
e.XmlWriter.WriteAttributeString("os_filter_lcid", m_os_filter_lcid);
e.XmlWriter.WriteAttributeString("type", m_type);
e.XmlWriter.WriteAttributeString("installcompletemessage", m_installcompletemessage);
Expand Down Expand Up @@ -398,6 +408,7 @@ protected override void OnXmlReadTag(XmlElementEventArgs e)
m_selected_uninstall = m_selected_install;
// filters
ReadAttributeValue(e, "os_filter", ref m_os_filter);
ReadAttributeValue(e, "os_type_filter", ref m_os_type_filter);
ReadAttributeValue(e, "os_filter_lcid", ref m_os_filter_lcid);
string os_filter_greater = string.Empty;
if (ReadAttributeValue(e, "os_filter_greater", ref os_filter_greater) && !String.IsNullOrEmpty(os_filter_greater))
Expand Down
11 changes: 11 additions & 0 deletions InstallerLib/Configuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,15 @@ public OperatingSystem os_filter_max
set { m_os_filter_max = value; }
}

private string m_os_type_filter;
[Description("Filter to install this configuration only on all operating system product types equal or not equal to the value(s) specified. Separate multiple operating system types with a comma (',') and use the not symbol ('!') for NOT logic (ex. '!workstation,!server' ).")]
[Category("Operating System")]
public string os_type_filter
{
get { return m_os_type_filter; }
set { m_os_type_filter = value; }
}

// filter for processor architecture
private string m_processor_architecture_filter;
[Description("Type of processor architecture (x86, mips, alpha, ppc, shx, arm, ia64, alpha64, msil, x64, ia32onwin64). Separate by commas and use the NOT sign ('!') to exclude. (eg. 'x86,x64' or '!x86').")]
Expand Down Expand Up @@ -139,6 +148,7 @@ protected override void OnXmlReadTag(XmlElementEventArgs e)
ReadAttributeValue(e, "language", ref m_language);
ReadAttributeValue(e, "language_id", ref m_language_id);
ReadAttributeValue(e, "os_filter", ref m_os_filter);
ReadAttributeValue(e, "os_type_filter", ref m_os_type_filter);
string os_filter_greater = string.Empty;
if (ReadAttributeValue(e, "os_filter_greater", ref os_filter_greater) && !String.IsNullOrEmpty(os_filter_greater))
m_os_filter_min = (OperatingSystem)(int.Parse(os_filter_greater) + 1);
Expand All @@ -159,6 +169,7 @@ protected override void OnXmlWriteTag(XmlWriterEventArgs e)
e.XmlWriter.WriteAttributeString("language_id", m_language_id);
e.XmlWriter.WriteAttributeString("language", m_language);
e.XmlWriter.WriteAttributeString("os_filter", m_os_filter);
e.XmlWriter.WriteAttributeString("os_type_filter", m_os_type_filter);
e.XmlWriter.WriteAttributeString("os_filter_min", (m_os_filter_min == OperatingSystem.winNone
? "" : Enum.GetName(typeof(OperatingSystem), m_os_filter_min)));
e.XmlWriter.WriteAttributeString("os_filter_max", (m_os_filter_max == OperatingSystem.winNone
Expand Down
43 changes: 42 additions & 1 deletion InstallerLib/InstalledCheckDirectory.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,27 @@
using System;
using System.ComponentModel;

namespace InstallerLib
{
/// <summary>
/// Install check comparison types
/// </summary>
public enum installcheckdirectory_comparison
{
exists,
version,
version_eq,
version_lt,
version_le,
version_gt,
version_ge,
semver,
semver_eq,
semver_lt,
semver_le,
semver_gt,
semver_ge,
}

/// <summary>
/// InstalledCheck of type "check_directory".
/// </summary>
Expand All @@ -22,15 +41,37 @@ public string path
set { m_path = value; }
}

private installcheckdirectory_comparison m_comparison;
[Description("Comparison mode, can be 'exists', 'version', 'semver', etc.")]
[Required]
[DefaultValue(installcheckdirectory_comparison.exists)]
public installcheckdirectory_comparison comparison
{
get { return m_comparison; }
set { m_comparison = value; }
}

private string m_version;
[Description("Optional version used to perform a version check based on the comparison attribute.")]
public string version
{
get { return m_version; }
set { m_version = value; }
}

protected override void OnXmlWriteTag(XmlWriterEventArgs e)
{
e.XmlWriter.WriteAttributeString("path", m_path);
e.XmlWriter.WriteAttributeString("comparison", m_comparison.ToString());
e.XmlWriter.WriteAttributeString("version", m_version);
base.OnXmlWriteTag(e);
}

protected override void OnXmlReadTag(XmlElementEventArgs e)
{
ReadAttributeValue(e, "path", ref m_path);
ReadAttributeValue(e, "comparison", ref m_comparison);
ReadAttributeValue(e, "version", ref m_version);
base.OnXmlReadTag(e);
}
}
Expand Down
8 changes: 7 additions & 1 deletion InstallerMsi/InstallerMsi.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
</Component>
<Component Id="InstallerLib" Guid="5D5B5920-D2DF-48e0-BE89-DD1A77E705BB">
<File Id="InstallerLib.dll" Source="..\InstallerLib\bin\$(var.Configuration)\InstallerLib.dll" />
<File Id="CabLib.dll" Source="..\ThirdParty\CabLib\$(var.Configuration)\CabLib.dll" />
<File Id="CabLib.dll" Source="..\ThirdParty\CabLib\Win32\$(var.Configuration)\CabLib.dll" />
<File Id="Vestris.ResourceLib.dll" Source="..\packages\Vestris.ResourceLib.1.6.422\lib\Vestris.ResourceLib.dll" />
</Component>
<Component Id="InstallerEditor" Guid="B28C748A-5834-48f6-AC9D-6976B33EC922">
Expand All @@ -52,6 +52,11 @@
<File Id="htmlInstaller.exe" Source="..\htmlInstaller\$(var.Configuration)\htmlInstaller.exe" />
<File Id="htmlInstaller.pdb" Source="..\htmlInstaller\$(var.Configuration)\htmlInstaller.pdb" />
</Component>
<Directory Id="bin_x64" Name="x64">
<Component Id="CabLib.dll" Guid="565C3213-3489-4303-9677-23D65DFE5026">
<File Id="CabLib.dll_x64" Source="..\ThirdParty\CabLib\x64\$(var.Configuration)\CabLib.dll" />
</Component>
</Directory>
</Directory>
<Directory Id="doc" Name="doc">
<Component Id="Documentation" Guid="00A1CB0D-BCE4-43a4-8AAC-7563F90B3E7C">
Expand Down Expand Up @@ -81,6 +86,7 @@
<ComponentRef Id="InstallerLinker" />
<ComponentRef Id="dotNetInstaller" />
<ComponentRef Id="htmlInstaller" />
<ComponentRef Id="CabLib.dll" />
<ComponentRef Id="Documentation" />
<ComponentRef Id="DotNetInstallerMenuShortcuts" />
<Feature Id="SamplesFeature" Title="Samples" Level="1">
Expand Down
Loading

0 comments on commit 5beb428

Please sign in to comment.