wixtoolset / issues

WiX Toolset Issues Tracker
http://wixtoolset.org/
129 stars 36 forks source link

Lux unit test fails when checking property values set using a type 51 custom action #4012

Open wixbot opened 11 years ago

wixbot commented 11 years ago

Hi.

Lux unit test fails when checking property values set using a type 51 custom action.

Windows 7 Enterprise 64-bit SP1

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:lux="http://schemas.microsoft.com/wix/2009/Lux">
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir" />
<CustomAction Id="SetProperty" Property="PropertyName" Value="PropertyValue" Execute="immediate" />
<lux:UnitTest CustomAction="SetProperty" Property="PropertyName" Value="PropertyValue" Operator="equal" />
</Fragment>
</Wix>

Running with 3.5.2430.0 and 3.6.3303.0:

nit.exe : error NIT8103 : Test luxFE00466110E1E8399A3E9EFEE8EC845E failed: Property 'PropertyName' expected value 'PropertyValue' but actual value was ''. nit.exe : error NIT8102 : 1 tests failed. 0 tests passed.

Running with 3.8.520.0:

nit.exe : error NIT8104 : Package failed: Fatal error during installation. nit.exe : error NIT8102 : 1 tests failed. 0 tests passed.

In all instances, nit.exe exited with return code 8102.

I tried explicitly defining the property as follows:

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:lux="http://schemas.microsoft.com/wix/2009/Lux">
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir" />
<Property Id="PropertyName" Value="PropertyValueToReplace" />
<CustomAction Id="SetProperty" Property="PropertyName" Value="PropertyValue" Execute="immediate" />
<lux:UnitTest CustomAction="SetProperty" Property="PropertyName" Value="PropertyValue" Operator="equal" />
</Fragment>
</Wix>

Running with 3.5.2430.0 and 3.6.3303.0:

nit.exe : error NIT8103 : Test luxFE00466110E1E8399A3E9EFEE8EC845E failed: Property 'PropertyName' expected value 'PropertyValue' but actual value was 'PropertyValueToReplace'. nit.exe : error NIT8102 : 1 tests failed. 0 tests passed.

Running with 3.8.520.0:

nit.exe : error NIT8104 : Package failed: Fatal error during installation. nit.exe : error NIT8102 : 1 tests failed. 0 tests passed.

Originally opened by icnocop from http://sourceforge.net/p/wix/bugs/3303/

wixbot commented 11 years ago

Sorry, I had a little misunderstanding on using the Lux unit test framework.

I didn't schedule the custom action in the InstallExecuteSequence and so that's why the property was not set.

However, I got confused from this requirement because of some other (now realized unexpected) behavior.

Here is some example code that illustrates the unexpected behavior:

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:lux="http://schemas.microsoft.com/wix/2009/Lux">
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir" />
<CustomAction Id="CustomAction1" Property="Property1" Value="Value1" Execute="immediate" />
<CustomAction Id="CustomAction2" Property="Property2" Value="Value2" Execute="immediate" />
<Property Id="Property1" Value="[Property2]" />
<Property Id="Property2" Value="_Value2" />
<lux:UnitTest CustomAction="CustomAction1" Property="Property1" Value="[Property2]" Operator="equal" />
<lux:UnitTest CustomAction="CustomAction2" Property="Property1" Value="_Value2" Operator="equal" />
</Fragment>
</Wix>

Test lux43546C624A69F85AB7AC8BDD9409CE61 passed: Property 'Property1' matched expected value '[Property2]'. Test lux6F15CE0ABF7C9B6EA43A2C41FFC35C86 passed: Property 'Property1' matched expected value '_Value2'. All 2 tests passed.

So it seems that the element behaves like a type 51 custom action; it will set the value of Property1 to the value of Property2.

I did not expect that to be the case; the element should just check the value for equality and not behave like a type 51 custom action.

Thank you.

wixbot commented 11 years ago

Originally changed by barnson Area changed from Lux to extensions Release changed from v4.0 to v3.x