I am looking for advice on how to use Lux and Nit. I have read the chm docs
and the two posts to Joy of Setups. I have also reviewed the sample
projects in the source and looked at the lux related targets in the source
code. I have tried several approaches to using Lux without success, so I
created a very simple MSI project which builds successfully.
I then added the code from the lux samples and got the project to
successfully build. When I add a DependsOnTarget='Test' to my Target which
runs AfterTarget="Build" then it calls _ScanForUnitTests and then
_GenerateTestConsumer and calls Lux. But when Nix is then launched it fails
as follows:
Target "Test" in file "C:\Program Files
(x86)\MSBuild\Microsoft\WiX\v3.x\Lux.targets" from project
"C:\Development\Installs\Research\MsiTestProperties\MsiTestProperties.wixproj"
(target "RpdSummary" depends on it):
Task "Nit"
Task
Parameter:TestPackages=C:\Development\Installs\Research\MsiTestProperties\bin\Release\MsiTestProperties.msi
Task Parameter:ToolPath=C:\Program Files (x86)\WiX Toolset
v3.9\bin\
Command:
C:\Program Files (x86)\WiX Toolset v3.9\bin\Nit.exe
C:\Development\Installs\Research\MsiTestProperties\bin\Release\MsiTestProperties.msi
Windows Installer XML Toolset Unit Test Runner version
3.9.1006.0
Copyright (c) Outercurve Foundation. All rights reserved.
nit.exe(0,0): error NIT0001: SQL query syntax invalid or unsupported.
Exception Type:
Microsoft.Deployment.WindowsInstaller.BadQuerySyntaxException
Stack Trace:
at
Microsoft.Deployment.WindowsInstaller.Database.OpenView(String
sqlFormat, Object[] args)
at
Microsoft.Deployment.WindowsInstaller.Database.ExecuteStringQuery(String
sql, Record record)
at
Microsoft.Deployment.WindowsInstaller.Database.ExecuteStringQuery(String
sqlFormat, Object[] args)
at
Microsoft.Tools.WindowsInstallerXml.Lux.TestRunner.RunTests(Int32&
passes, Int32& failures)
at Microsoft.Tools.WindowsInstallerXml.Lux.Nit.Run(String[]
args)
The command exited with code 1.
Done executing task "Nit" -- FAILED.
Done building target "Test" in project "MsiTestProperties.wixproj" --
FAILED.
Here is my CustomAction.wxs file (mostly lifted from the wix source):
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:lux="http://schemas.microsoft.com/wix/2009/Lux"
>
<Fragment>
<CustomAction Id="TestCustomActionSimple" Property="SIMPLE"
Value="[INSTALLFOLDER]" />
<CustomAction Id="TestCustomActionSimpleNumber" Property="SIMPLENUMBER"
Value="1" />
<CustomAction Id="TestCustomActionMultiValue" Property="MULTIVALUE"
Value="1*[INSTALLFOLDER]*WIXEAST" />
<CustomAction Id="TestCustomActionNameValuePairs"
Property="NAMEVALUEPAIRS"
Value="InstallationRoot#[INSTALLFOLDER]#Developers#WIXEAST" />
<InstallExecuteSequence>
<Custom Action="TestCustomActionSimple" After="InstallFiles" />
<Custom Action="TestCustomActionSimpleNumber"
After="TestCustomActionSimple" />
<Custom Action="TestCustomActionMultiValue"
After="TestCustomActionSimpleNumber" />
<Custom Action="TestCustomActionNameValuePairs"
Before="InstallFinalize" />
</InstallExecuteSequence>
</Fragment>
<Fragment>
<lux:UnitTest CustomAction="TestCustomActionSimple" Property="SIMPLE"
Value="[INSTALLFOLDER]" Operator="equal" />
<lux:UnitTest CustomAction="TestCustomActionSimpleNumber"
Property="SIMPLENUMBER" Value="1" />
<lux:Mutation Id="SimulateDiskFull">
<lux:UnitTest Id="DiskFullSimple"
CustomAction="TestCustomActionSimple" Property="SIMPLE"
Value="[INSTALLFOLDER]" Operator="equal" />
<lux:UnitTest Id="DiskFullSimpleNumber"
CustomAction="TestCustomActionSimpleNumber" Property="SIMPLENUMBER"
Value="1" />
</lux:Mutation>
<lux:Mutation Id="SimulateUpgrade">
<lux:UnitTest CustomAction="TestCustomActionMultiValue"
Property="MULTIVALUE" ValueSeparator="*">
<lux:Condition>VersionNT</lux:Condition>
<lux:UnitTest Index="0" Value="INTENTIONAL_FAILURE" />
<lux:UnitTest Index="1" Value="[INSTALLFOLDER]">
<lux:Condition>NOT Installed</lux:Condition>
</lux:UnitTest>
<lux:UnitTest Index="2" Value="WIXEAST" />
</lux:UnitTest>
</lux:Mutation>
<lux:Mutation Id="SimulateUpgradeFailure">
<lux:UnitTest CustomAction="TestCustomActionNameValuePairs"
Property="NAMEVALUEPAIRS" NameValueSeparator="#">
<lux:UnitTest Index="InstallationRoot" Value="[INSTALLFOLDER]" />
<lux:UnitTest Index="Developers" Operator="caseInsensitiveNotEqual"
Value="WIXWEST" />
</lux:UnitTest>
</lux:Mutation>
</Fragment>
</Wix>
And my 'product' file includes this:
<CustomActionRef Id="TestCustomActionSimple" />
<CustomActionRef Id="TestCustomActionMultiValue" />
<CustomActionRef Id="TestCustomActionNameValuePairs" />
When I added the Lux 'Test' target, I was expecting it to generate a msi
with the name $(OutputName)_test.msi, but it builds the lux package with the
same name as the project's msi package. So I though maybe I needed two
wixproj files with different OutputNames, but that results in the same Nit
error.
So I am missing something conceptually. Any advice on sorting this out is
appreciated. Thanks Phill
--
View this message in context:
http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/Using-Lux-and-Nit-tp7597183.html
Sent from the wix-users mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
WiX-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wix-users