Merge branch 'issue4424' of git://github.com/heaths/wix3 into develop
Conflicts: History.md
This commit is contained in:
Коммит
fc25b7dbae
|
@ -1,3 +1,5 @@
|
|||
* HeathS: WIXBUG:4424 - Allow user custom actions to be independently non-vital.
|
||||
|
||||
* HeathS: WIXBUG:4420 - Suppress patch sequence data to optimize patch performance
|
||||
|
||||
* HeathS: WIXBUG:4366 - Correctly enum all products for non-specific patches
|
||||
|
|
|
@ -41,6 +41,7 @@ namespace Microsoft.Tools.WindowsInstallerXml.Extensions
|
|||
|
||||
internal const int UserDontRemoveOnUninstall = 0x00000100;
|
||||
internal const int UserDontCreateUser = 0x00000200;
|
||||
internal const int UserNonVital = 0x00000400;
|
||||
|
||||
[Flags]
|
||||
internal enum WixFileSearchAttributes
|
||||
|
@ -3528,6 +3529,17 @@ namespace Microsoft.Tools.WindowsInstallerXml.Extensions
|
|||
attributes |= UserUpdateIfExists;
|
||||
}
|
||||
break;
|
||||
case "Vital":
|
||||
if (null == componentId)
|
||||
{
|
||||
this.Core.OnMessage(UtilErrors.IllegalAttributeWithoutComponent(sourceLineNumbers, node.Name, attrib.Name));
|
||||
}
|
||||
|
||||
if (YesNoType.No == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib))
|
||||
{
|
||||
attributes |= UserNonVital;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
this.Core.UnexpectedAttribute(sourceLineNumbers, attrib);
|
||||
break;
|
||||
|
|
|
@ -957,6 +957,11 @@ namespace Microsoft.Tools.WindowsInstallerXml.Extensions
|
|||
{
|
||||
user.CreateUser = Util.YesNoType.no;
|
||||
}
|
||||
|
||||
if (UtilCompiler.UserNonVital == (attributes & UtilCompiler.UserNonVital))
|
||||
{
|
||||
user.Vital = Util.YesNoType.no;
|
||||
}
|
||||
}
|
||||
|
||||
if (null != row[1])
|
||||
|
|
|
@ -1269,6 +1269,11 @@
|
|||
<xs:documentation>Indicates whether or not to create the user. User creation can be skipped if all that is desired is to join a user to groups.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="Vital" type="YesNoType" default="yes">
|
||||
<xs:annotation>
|
||||
<xs:documentation>Indicates whether failure to create the user or add the user to a group fails the installation. The default value is "yes".</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:attribute>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="XmlFile">
|
||||
|
|
|
@ -130,6 +130,7 @@ enum SCAU_ATTRIBUTES
|
|||
|
||||
SCAU_DONT_REMOVE_ON_UNINSTALL = 0x00000100,
|
||||
SCAU_DONT_CREATE_USER = 0x00000200,
|
||||
SCAU_NON_VITAL = 0x00000400,
|
||||
};
|
||||
|
||||
// sql database attributes definitions
|
||||
|
|
|
@ -1895,7 +1895,11 @@ LExit:
|
|||
::CoUninitialize();
|
||||
}
|
||||
|
||||
if (FAILED(hr))
|
||||
if (SCAU_NON_VITAL & iAttributes)
|
||||
{
|
||||
er = ERROR_SUCCESS;
|
||||
}
|
||||
else if (FAILED(hr))
|
||||
{
|
||||
er = ERROR_INSTALL_FAILURE;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,36 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!--
|
||||
<copyright file="NonVitalUserGroup.wxs" company="Outercurve Foundation">
|
||||
Copyright (c) 2004, Outercurve Foundation.
|
||||
This software is released under Microsoft Reciprocal License (MS-RL).
|
||||
The license and further copyright text can be found in the file
|
||||
LICENSE.TXT at the root directory of the distribution.
|
||||
</copyright>
|
||||
-->
|
||||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
|
||||
<Product Id="ECE4ABA2-1253-480C-A4A3-B0433A296756" Name="UserGroup" Language="1033" Version="1.0.0.0" UpgradeCode="0419D0E1-2467-4DCB-B45D-08F903F34A80" Manufacturer="Microsoft Corporation">
|
||||
<Package Description="Test from: User" Comments="Test from: User" InstallerVersion="200" Compressed="yes" />
|
||||
|
||||
<Media Id="1" Cabinet="product.cab" EmbedCab="yes" />
|
||||
|
||||
<?include $(env.WIX_ROOT)\test\data\SharedData\Authoring\directories.wxi ?>
|
||||
|
||||
<util:Group Id="ShouldNotExist" Name="Should Not Exist" />
|
||||
|
||||
<DirectoryRef Id="WixTestFolder">
|
||||
<Component Id="Component1" Guid="00030829-0000-0000-C000-000000000046" DiskId="1">
|
||||
<File Source="$(env.WIX_ROOT)\test\data\SharedData\Files\TextFile1.txt" KeyPath="yes"/>
|
||||
|
||||
<util:User Id="CurrentUser" Name="[LogonUser]" Domain="[%USERDOMAIN]" RemoveOnUninstall="no" Vital="no">
|
||||
<util:GroupRef Id="ShouldNotExist" />
|
||||
</util:User>
|
||||
|
||||
</Component>
|
||||
</DirectoryRef>
|
||||
|
||||
<Feature Id="Feature1" Level="1">
|
||||
<ComponentRef Id="Component1" />
|
||||
</Feature>
|
||||
|
||||
</Product>
|
||||
</Wix>
|
|
@ -159,6 +159,7 @@ namespace WixTest
|
|||
}
|
||||
|
||||
this.TestUninitialize();
|
||||
this.CleanUp();
|
||||
}
|
||||
|
||||
void IDisposable.Dispose()
|
||||
|
|
|
@ -243,5 +243,17 @@ namespace WixTest.Tests.Extensions.UtilExtension
|
|||
Assert.True(LogVerifier.MessageInLogFile(logFile, string.Format("ConfigureUsers: Error 0x80070035: Failed to check existence of domain: {0}, user: testName1",Environment.GetEnvironmentVariable("tempdomain"))) ||
|
||||
LogVerifier.MessageInLogFile(logFile, "CreateUser: Error 0x80070005: failed to create user: testName1"), String.Format("Could not find CreateUser error message in log file: '{0}'.", logFile));
|
||||
}
|
||||
|
||||
[NamedFact]
|
||||
[Description("Verify that adding a user to a non-existent group does not fail the install when non-vital.")]
|
||||
[Priority(2)]
|
||||
[RuntimeTest]
|
||||
public void User_NonVitalUserGroup()
|
||||
{
|
||||
string sourceFile = Path.Combine(UserTests.TestDataDirectory, @"NonVitalUserGroup.wxs");
|
||||
string msiFile = Builder.BuildPackage(sourceFile, "test.msi", "WixUtilExtension");
|
||||
|
||||
MSIExec.InstallProduct(msiFile, MSIExec.MSIExecReturnCode.SUCCESS);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче