Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit 59f37d2
Author: Rob Mensching <rob@firegiant.com>
Date:   Mon Aug 7 15:43:10 2023 -0700

    Fix the use of ModuleSubstitution table

    Addresses two issues in the creation of configurable merge modules. First, the
    ModuleConfiguration table Id should not be modularized. Second, the
    ModuleSubstitution table was never created. Fixing both of those allows
    configurable merge modules to work again.

    Fixes 7559

commit 2b429e9
Author: Rob Mensching <rob@firegiant.com>
Date:   Mon Aug 7 12:31:20 2023 -0700

    Remove Esproj test

    The npm packages in esproj regularly encounter security issues that are not
    relevant to WiX. The test provides less value than the churn required to keep
    all the test project up to date, so deleting it.

commit 9607c3a
Author: Rob Mensching <rob@firegiant.com>
Date:   Mon Aug 7 12:07:39 2023 -0700

    Ensure the Font actions are scheduled for TrueType fonts

    TrueType fonts are denoted by the empty string in the FontTitle field of the
    FileSymbol. That means a non-null FontTitle field value means a font is being
    installed.

    Fixes 7593

commit 6d5c4be
Author: Bob Arnson <bob@firegiant.com>
Date:   Sat Jul 29 20:57:14 2023 -0400

    Remove legacy permissions support.

    In the long ago, a share could have one user/permissions pair. That's
    really limited, of course, so support for _n_ user/permissions pairs
    was added. In the move to WiX v4, support for that single, legacy user
    was removed from the extension side but not the custom action side.
    Remove that support.

    Fixes wixtoolset/issues#7632.

commit d8832db
Author: chris_bednarski <Chris.Bednarski@minfos.com.au>
Date:   Wed Aug 2 19:39:25 2023 +1000

    fix stack corruption around cbdata when adding a machine certificate

commit 5e9901d
Author: chris_bednarski <Chris.Bednarski@minfos.com.au>
Date:   Sat Jul 22 09:01:55 2023 +1000

    Multiple extension support in unit tests

commit 1c50eb8
Author: Bob Arnson <bob@firegiant.com>
Date:   Fri Jul 21 19:56:59 2023 -0400

    Fix mentions of dark.exe.

commit e0641f1
Author: Marco Stadler <marco.stadler@bruker.com>
Date:   Mon Apr 24 11:49:53 2023 +0200

    Allow custom package comments

    Fixes #7369

commit 42118ef
Author: Rob Mensching <rob@firegiant.com>
Date:   Wed Jul 19 10:20:19 2023 -0700

    Fix out of date references to Product in warnings

    Fixes 7631

commit 7a603e4
Author: Rob Mensching <rob@firegiant.com>
Date:   Wed Jul 19 10:19:35 2023 -0700

    Remove invalid references to ToolsVersion in ext wixlib projects

commit d20b6d4
Author: chris_bednarski <Chris.Bednarski@minfos.com.au>
Date:   Wed Jul 19 10:11:18 2023 +1000

    feat(build): update xunit to version 2.5.0, fix occasional test timeout

commit cef14c6
Author: Bob Arnson <bob@firegiant.com>
Date:   Thu Jun 15 15:40:37 2023 -0400

    Ensure extensions get the same decompiler helper.

    Fixes wixtoolset/issues#7548.

    THIS IS A BREAKING INTERFACE/EXTENSIBILITY CHANGE.

commit 164c29a
Author: Bob Arnson <bob@firegiant.com>
Date:   Tue Jul 11 21:19:08 2023 -0400

    Partial fix for the weirdly broken...

    IWindowsInstallerDecompileContext.TreatProductAsModule.

    wixtoolset/issues#7607

commit 713f286
Author: Rob Mensching <rob@firegiant.com>
Date:   Sat Jul 8 09:10:50 2023 -0700

    Fix typo where Level was used instead of Value in Level element error message

    Fixes 7603

commit e53c658
Author: Bob Arnson <bob@firegiant.com>
Date:   Thu Jun 29 21:16:35 2023 -0400

    Extract object fields with modularization GUIDs.

commit ddae99c
Author: Bob Arnson <bob@firegiant.com>
Date:   Tue Jun 20 20:09:19 2023 -0400

    Handle MergeModule.CABinet for extraction.

    Fixes wixtoolset/issues#7568,

commit 9a550ac
Author: Michael Stoll <michael.stoll@stolltec.com>
Date:   Wed May 3 18:04:48 2023 +0200

    Add more _NODOMAIN properties to WixQueryOsWellKnownSID

commit 35d30e0
Author: Bob Arnson <bob@firegiant.com>
Date:   Thu May 18 20:47:27 2023 -0400

    Improve logging to remove `(null)`.

    Add detached container runtime test.

    Inspired by wixtoolset/issues#7490.

commit f474066
Author: Jesper Hansen <jesper@staunhansen.dk>
Date:   Mon Jun 12 14:39:32 2023 +0200

    Update WindowsInstallerStandard.cs ordered sequence

    Ordered standard actions by sequence and group for more human readability

commit 2daf189
Author: Nir Bar <nir.bar@panel-sw.co.il>
Date:   Thu Apr 20 08:44:54 2023 +0300

    Allow customized AdditionalOptions for all HarvestX MSBuild ItemGroups

commit 783b829
Author: Rob Mensching <rob@firegiant.com>
Date:   Fri Jun 2 11:45:10 2023 -0700

    ProjectReferences to wixlibs should participate in DefineConstants creation

    Also fix documentation in ResolveWixLibraryReferences target.

    Fixes 7512

commit ed0a765
Author: Bob Arnson <bob@firegiant.com>
Date:   Wed May 31 16:04:27 2023 -0400

    Downgrade bad ProductVersion error to warning.

    Fixes wixtoolset/issues#7522.

commit bc9343a
Author: Rob Mensching <rob@firegiant.com>
Date:   Tue May 30 08:28:14 2023 -0700

    Obsolete removed PackageState.Cached value

    A package's cached status is no longer set via the PackageState. The value was
    removed in native code but the managed code was missed throwing off the enum
    mapping.

    Fixes 7399
  • Loading branch information
nirbar committed Aug 9, 2023
1 parent 55ee3fd commit a42df58
Show file tree
Hide file tree
Showing 76 changed files with 627 additions and 30,090 deletions.
33 changes: 22 additions & 11 deletions src/api/wix/WixToolset.Data/WarningMessages.cs
Expand Up @@ -57,9 +57,9 @@ public static Message CannotUpdateCabCache(SourceLineNumber sourceLineNumbers, s
return Message(sourceLineNumbers, Ids.CannotUpdateCabCache, "Cannot update the timestamp of cached cabinet: '{0}'. If the timestamp is not updated, the build may rebuild more than is necessary. To fix the issue, ensure that the cabinet file is writable, error: {1}", cabinetPath, detail);
}

public static Message ColumnsIncompatibleWithInstallerVersion(SourceLineNumber sourceLineNumbers, string tableName, int productInstallerVersion)
public static Message ColumnsIncompatibleWithInstallerVersion(SourceLineNumber sourceLineNumbers, string tableName, int packageInstallerVersion)
{
return Message(sourceLineNumbers, Ids.ColumnsIncompatibleWithInstallerVersion, "Table '{0}' uses columns that require a version of Windows Installer greater than specified in your package ('{1}').", tableName, productInstallerVersion);
return Message(sourceLineNumbers, Ids.ColumnsIncompatibleWithInstallerVersion, "Table '{0}' uses columns that require a version of Windows Installer greater than specified in your package ('{1}').", tableName, packageInstallerVersion);
}

public static Message CopyFileFileIdUseless(SourceLineNumber sourceLineNumbers)
Expand Down Expand Up @@ -199,7 +199,7 @@ public static Message DeprecatedTable(string tableName)

public static Message DeprecatedUpgradeProperty(SourceLineNumber sourceLineNumbers)
{
return Message(sourceLineNumbers, Ids.DeprecatedUpgradeProperty, "Specifying a Property element as a child of an Upgrade element has been deprecated. Please specify this Property element as a child of a different element such as Product or Fragment.");
return Message(sourceLineNumbers, Ids.DeprecatedUpgradeProperty, "Specifying a Property element as a child of an Upgrade element has been deprecated. Please specify this Property element as a child of a different element such as Package or Fragment.");
}

public static Message DirectoryInUse(SourceLineNumber sourceLineNumbers, string filePath)
Expand Down Expand Up @@ -367,9 +367,9 @@ public static Message InvalidAttributeCombination(SourceLineNumber sourceLineNum
return Message(sourceLineNumbers, Ids.InvalidAttributeCombination, "It is invalid to combine attributes {0} and {1}. The decompiled output will set attribute {2} to {3}.", attrib1, attrib2, name, value);
}

public static Message InvalidHigherInstallerVersionInModule(SourceLineNumber sourceLineNumbers, string moduleId, int moduleInstallerVersion, int productInstallerVersion)
public static Message InvalidHigherInstallerVersionInModule(SourceLineNumber sourceLineNumbers, string moduleId, int moduleInstallerVersion, int packageInstallerVersion)
{
return Message(sourceLineNumbers, Ids.InvalidHigherInstallerVersionInModule, "Merge module '{0}' has an installer version of {1} which is greater than the product's installer version of {2}. Merging a module with a higher installer version than the product it is being merged into can result in invalid values in the resulting msi. You must set the Package/@InstallerVersion attribute to {1} or greater to merge this merge module into your product.", moduleId, moduleInstallerVersion, productInstallerVersion);
return Message(sourceLineNumbers, Ids.InvalidHigherInstallerVersionInModule, "Merge module '{0}' has an installer version of {1} which is greater than the package's installer version of {2}. Merging a module with a higher installer version than the package it is being merged into can result in invalid values in the resulting msi. You must set the Package/@InstallerVersion attribute to {1} or greater to merge this merge module into your package.", moduleId, moduleInstallerVersion, packageInstallerVersion);
}

public static Message InvalidFourPartVersion(SourceLineNumber sourceLineNumbers, string elementName, string version)
Expand All @@ -384,7 +384,7 @@ public static Message InvalidRemoveFile(SourceLineNumber sourceLineNumbers, stri

public static Message MajorUpgradePatchNotRecommended()
{
return Message(null, Ids.MajorUpgradePatchNotRecommended, "Changing the ProductCode in a patch is not recommended because the patch cannot be uninstalled nor can it be sequenced along with other patches for the target product. See https://learn.microsoft.com/en-us/windows/win32/msi/applying-major-upgrades-by-patching-the-local-installation-of-the-product for more information.");
return Message(null, Ids.MajorUpgradePatchNotRecommended, "Changing the ProductCode in a patch is not recommended because the patch cannot be uninstalled nor can it be sequenced along with other patches for the target package. See https://learn.microsoft.com/en-us/windows/win32/msi/applying-major-upgrades-by-patching-the-local-installation-of-the-product for more information.");
}

public static Message MediaExternalCabinetFilenameIllegal(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string value)
Expand All @@ -404,7 +404,7 @@ public static Message MergeTableFailed(SourceLineNumber sourceLineNumbers, strin

public static Message MissingUpgradeCode(SourceLineNumber sourceLineNumbers)
{
return Message(sourceLineNumbers, Ids.MissingUpgradeCode, "The Product/@UpgradeCode attribute was not found; it is strongly recommended to ensure that this product can be upgraded.");
return Message(sourceLineNumbers, Ids.MissingUpgradeCode, "The Package/@UpgradeCode attribute was not found; it is strongly recommended to ensure that this package can be upgraded.");
}

public static Message MsiTransactionLimitations(SourceLineNumber sourceLineNumbers)
Expand Down Expand Up @@ -572,9 +572,9 @@ public static Message SuppressMergedAction(string action, string sequenceName)
return Message(null, Ids.SuppressMergedAction, "The merged action '{0}' in the {1} table is being suppressed.", action, sequenceName);
}

public static Message TableIncompatibleWithInstallerVersion(SourceLineNumber sourceLineNumbers, string tableName, int productInstallerVersion)
public static Message TableIncompatibleWithInstallerVersion(SourceLineNumber sourceLineNumbers, string tableName, int packageInstallerVersion)
{
return Message(sourceLineNumbers, Ids.TableIncompatibleWithInstallerVersion, "Using table '{0}' requires a version of Windows Installer greater than specified in your package ('{1}').", tableName, productInstallerVersion);
return Message(sourceLineNumbers, Ids.TableIncompatibleWithInstallerVersion, "Using table '{0}' requires a version of Windows Installer greater than specified in your package ('{1}').", tableName, packageInstallerVersion);
}

public static Message TargetDirCorrectedDefaultDir()
Expand Down Expand Up @@ -620,7 +620,7 @@ public static Message UnexpectedEntrySection(SourceLineNumber sourceLineNumbers,

public static Message UnexpectedTableInProduct(SourceLineNumber sourceLineNumbers, string tableName)
{
return Message(sourceLineNumbers, Ids.UnexpectedTableInProduct, "An unexpected row in the '{0}' table was found in this product. Products should not contain the '{0}' table.", tableName);
return Message(sourceLineNumbers, Ids.UnexpectedTableInProduct, "An unexpected row in the '{0}' table was found in this package. Packages should not contain the '{0}' table.", tableName);
}

public static Message UnknownAction(SourceLineNumber sourceLineNumbers, string sequenceTableName, string actionName)
Expand Down Expand Up @@ -675,7 +675,18 @@ public static Message VariableDeclarationCollision(SourceLineNumber sourceLineNu

public static Message InvalidMsiProductVersion(SourceLineNumber sourceLineNumbers, string version, string package)
{
return Message(sourceLineNumbers, Ids.InvalidMsiProductVersion, "Invalid product version '{0}' in MSI package '{1}'. Product version should have a major version less than 256, a minor version less than 256, and a build version less than 65536. The bundle may incorrectly detect upgrades of this package.", version, package);
return Message(sourceLineNumbers, Ids.InvalidMsiProductVersion, "Invalid package version '{0}' in MSI package '{1}'. Package version should have a major version less than 256, a minor version less than 256, and a build version less than 65536. The bundle may incorrectly detect upgrades of this package.", version, package);
}

public static Message InvalidMsiProductVersion(SourceLineNumber sourceLineNumbers, string version)
{
return Message(sourceLineNumbers, Ids.InvalidMsiProductVersion,
"Invalid MSI package version: '{0}'. " +
"The Windows Installer SDK says that MSI package versions must have a major version less than 256, a minor version less than 256, and a build version less than 65536. " +
"The revision value is ignored but version labels and metadata are not allowed. " +
"Violating the MSI rules sometimes works as expected but the behavior is unpredictable and undefined. "+
"Future versions of WiX might treat invalid package versions as an error.",
version);
}

public static Message InvalidMsiProductVersion(SourceLineNumber sourceLineNumbers, string version)
Expand Down
Expand Up @@ -1455,7 +1455,7 @@ public static class WindowsInstallerTableDefinitions
SymbolDefinitions.ModuleConfiguration,
new[]
{
new ColumnDefinition("Name", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, description: "Unique identifier for this row."),
new ColumnDefinition("Name", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, description: "Unique identifier for this row.", modularizeType: ColumnModularizeType.None),
new ColumnDefinition("Format", ColumnType.Number, 2, primaryKey: false, nullable: false, ColumnCategory.Unknown, minValue: 0, maxValue: 3, description: "Format of this item."),
new ColumnDefinition("Type", ColumnType.String, 72, primaryKey: false, nullable: true, ColumnCategory.Text, description: "Additional type information for this item."),
new ColumnDefinition("ContextData", ColumnType.Localized, 0, primaryKey: false, nullable: true, ColumnCategory.Text, description: "Additional context information about this item."),
Expand Down
Expand Up @@ -36,13 +36,13 @@ public abstract class BaseWindowsInstallerDecompilerExtension : IWindowsInstalle
/// <summary>
/// See <see cref="IWindowsInstallerDecompilerExtension.PostDecompile(IWindowsInstallerDecompileResult)"/>
/// </summary>
public virtual void PreDecompile(IWindowsInstallerDecompileContext context)
public virtual void PreDecompile(IWindowsInstallerDecompileContext context, IWindowsInstallerDecompilerHelper helper)
{
this.Context = context;

this.Messaging = context.ServiceProvider.GetService<IMessaging>();
this.DecompilerHelper = helper;

this.DecompilerHelper = context.ServiceProvider.GetService<IWindowsInstallerDecompilerHelper>();
this.Messaging = context.ServiceProvider.GetService<IMessaging>();
}

/// <summary>
Expand Down
Expand Up @@ -93,7 +93,8 @@ public interface IWindowsInstallerDecompileContext
bool SuppressUI { get; set; }

/// <summary>
/// Gets or sets whether the decompiler should use module logic on a product output.
/// Gets or sets whether the decompiler should keep modularization
/// GUIDs (true) or remove them (default/false).
/// </summary>
bool TreatProductAsModule { get; set; }
}
Expand Down
Expand Up @@ -5,6 +5,7 @@ namespace WixToolset.Extensibility
using System.Collections.Generic;
using WixToolset.Data.WindowsInstaller;
using WixToolset.Extensibility.Data;
using WixToolset.Extensibility.Services;

/// <summary>
/// Interface all windows installer decompiler extensions implement.
Expand All @@ -21,7 +22,8 @@ public interface IWindowsInstallerDecompilerExtension
/// Called before decompiling occurs.
/// </summary>
/// <param name="context">Decompile context.</param>
void PreDecompile(IWindowsInstallerDecompileContext context);
/// <param name="helper">Decompile helper.</param>
void PreDecompile(IWindowsInstallerDecompileContext context, IWindowsInstallerDecompilerHelper helper);

/// <summary>
/// Called before decompiling occurs.
Expand Down
2 changes: 1 addition & 1 deletion src/ext/DirectX/wixlib/directx.wixproj
@@ -1,5 +1,5 @@
<!-- 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. -->
<Project Sdk="PanelSwWix4.Sdk" ToolsVersion="4.0">
<Project Sdk="PanelSwWix4.Sdk">
<PropertyGroup>
<OutputType>Library</OutputType>
<BindFiles>true</BindFiles>
Expand Down
4 changes: 2 additions & 2 deletions src/ext/Firewall/wixlib/firewall.wixproj
@@ -1,5 +1,5 @@
<!-- 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. -->
<Project Sdk="PanelSwWix4.Sdk" ToolsVersion="4.0">
<Project Sdk="PanelSwWix4.Sdk">
<PropertyGroup>
<OutputType>Library</OutputType>
<BindFiles>true</BindFiles>
Expand All @@ -21,4 +21,4 @@
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" PrivateAssets="All" />
</ItemGroup>
</Project>
</Project>
6 changes: 3 additions & 3 deletions src/ext/Iis/ca/scacertexec.cpp
Expand Up @@ -154,7 +154,7 @@ static HRESULT ExecuteCertificateOperation(
LPWSTR pwzPFXPassword = NULL;
LPWSTR pwzFilePath = NULL;
BYTE* pbData = NULL;
DWORD cbData = 0;
DWORD_PTR cbData = 0;
DWORD_PTR cbPFXPassword = 0;

BOOL fUserStoreLocation = (CERT_SYSTEM_STORE_CURRENT_USER == dwStoreLocation);
Expand All @@ -174,7 +174,7 @@ static HRESULT ExecuteCertificateOperation(
ExitOnFailure(hr, "Failed to parse certificate attribute");
if (SCA_ACTION_INSTALL == saAction) // install operations need more data
{
hr = WcaReadStreamFromCaData(&pwz, &pbData, (DWORD_PTR*)&cbData);
hr = WcaReadStreamFromCaData(&pwz, &pbData, &cbData);
ExitOnFailure(hr, "Failed to parse certificate stream.");

hr = WcaReadStringFromCaData(&pwz, &pwzPFXPassword);
Expand All @@ -192,7 +192,7 @@ static HRESULT ExecuteCertificateOperation(
// CertAddCertificateContextToStore(CERT_STORE_ADD_REPLACE_EXISTING) does not remove the private key if the cert is replaced
UninstallCertificatePackage(hCertStore, fUserStoreLocation, pwzName);

hr = InstallCertificatePackage(hCertStore, fUserStoreLocation, pwzName, pbData, cbData, iAttributes & SCA_CERT_ATTRIBUTE_VITAL, pwzPFXPassword);
hr = InstallCertificatePackage(hCertStore, fUserStoreLocation, pwzName, pbData, (DWORD)cbData, iAttributes & SCA_CERT_ATTRIBUTE_VITAL, pwzPFXPassword);
ExitOnFailure(hr, "Failed to install certificate.");
}
else
Expand Down
3 changes: 0 additions & 3 deletions src/ext/Util/ca/scasmb.h
Expand Up @@ -23,14 +23,11 @@ struct SCA_SMB // hungarian ss
WCHAR wzDirectory[MAX_PATH + 1];

int nUserPermissionCount;
int nPermissions;
SCA_SMB_EX_USER_PERMS* pExUserPerms;

INSTALLSTATE isInstalled, isAction;

BOOL fUseIntegratedAuth;
BOOL fLegacyUserProvided;
struct SCA_USER scau;

struct SCA_SMB* pssNext;
};
Expand Down
50 changes: 4 additions & 46 deletions src/ext/Util/ca/scasmbsched.cpp
Expand Up @@ -92,17 +92,14 @@ void ScaExUserPermsSmbFreeList(SCA_SMB_EX_USER_PERMS* pExUserPermsList)
}

// sql query constants
LPCWSTR vcsSmbQuery = L"SELECT `FileShare`, `ShareName`, `Description`, `Directory_`, "
L"`Component_`, `User_`, `Permissions` FROM `Wix4FileShare`";
LPCWSTR vcsSmbQuery = L"SELECT `FileShare`, `ShareName`, `Component_`, `Description`, `Directory_` FROM `Wix4FileShare`";

enum eSmbQuery {
ssqFileShare = 1,
ssqShareName,
ssqComponent,
ssqDescription,
ssqDirectory,
ssqComponent,
ssqUser,
ssqPermissions
};


Expand Down Expand Up @@ -173,31 +170,11 @@ HRESULT ScaSmbRead(SCA_SMB** ppssList)
hr = ::StringCchCopyW(pss->wzDescription, countof(pss->wzDescription), pwzData);
ExitOnFailure(hr, "Failed to copy description string to smb object");

// get user info from the user table
hr = WcaGetRecordFormattedString(hRec, ssqUser, &pwzData);
ExitOnFailure(hr, "Failed to get Wix4User record for Wix4FileShare: '%ls'", pss->wzShareName);

// get component install state
er = ::MsiGetComponentStateW(WcaGetInstallHandle(), pss->wzComponent, &pss->isInstalled, &pss->isAction);
hr = HRESULT_FROM_WIN32(er);
ExitOnFailure(hr, "Failed to get Component state for Wix4FileShare");

// if a user was specified
if (*pwzData)
{
pss->fUseIntegratedAuth = FALSE;
pss->fLegacyUserProvided = TRUE;
hr = ScaGetUser(pwzData, &pss->scau);
ExitOnFailure(hr, "Failed to get user information for fileshare: '%ls'", pss->wzShareName);
}
else
{
pss->fLegacyUserProvided = FALSE;
// TODO: figure out whether this is useful still
//pss->fUseIntegratedAuth = TRUE;
// integrated authorization doesn't have a User record
}

// get the share's directory
hr = WcaGetRecordString(hRec, ssqDirectory, &pwzData);
ExitOnFailure(hr, "Failed to get directory for Wix4FileShare: '%ls'", pss->wzShareName);
Expand Down Expand Up @@ -235,9 +212,6 @@ HRESULT ScaSmbRead(SCA_SMB** ppssList)
hr = ::StringCchCopyW(pss->wzDirectory, countof(pss->wzDirectory), wzPath);
ExitOnFailure(hr, "Failed to copy directory string to smb object");

hr = WcaGetRecordInteger(hRec, ssqPermissions, &pss->nPermissions);
ExitOnFailure(hr, "Failed to get Wix4FileShare.Permissions");

// Check to see if additional user & permissions are specified for this share
if (bUserPermissionsTableExists)
{
Expand Down Expand Up @@ -378,24 +352,8 @@ HRESULT SchedCreateSmb(SCA_SMB* pss)
hr = WcaWriteStringToCaData(pss->fUseIntegratedAuth ? L"1" : L"0", &pwzCustomActionData);
ExitOnFailure(hr, "Failed to add server name to CustomActionData");

if (pss->fLegacyUserProvided)
{
hr = WcaWriteIntegerToCaData(pss->nUserPermissionCount + 1, &pwzCustomActionData);
ExitOnFailure(hr, "Failed to add additional user permission count to CustomActionData");

hr = UserBuildDomainUserName(wzDomainUser, countof(wzDomainUser), pss->scau.wzName, pss->scau.wzDomain);
ExitOnFailure(hr, "Failed to build user and domain name for CustomActionData");
hr = WcaWriteStringToCaData(wzDomainUser, &pwzCustomActionData);
ExitOnFailure(hr, "Failed to add server Domain\\UserName to CustomActionData");

hr = WcaWriteIntegerToCaData(pss->nPermissions, &pwzCustomActionData);
ExitOnFailure(hr, "Failed to add permissions to CustomActionData");
}
else
{
hr = WcaWriteIntegerToCaData(pss->nUserPermissionCount, &pwzCustomActionData);
ExitOnFailure(hr, "Failed to add additional user permission count to CustomActionData");
}
hr = WcaWriteIntegerToCaData(pss->nUserPermissionCount, &pwzCustomActionData);
ExitOnFailure(hr, "Failed to add additional user permission count to CustomActionData");

if (pss->nUserPermissionCount > 0)
{
Expand Down

0 comments on commit a42df58

Please sign in to comment.