Continuing on from a post I made a while back 
(http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/Burn-and-util-ProductSearch-Result-quot-state-quot-td7578828.html)
 , the original issue has been fixed. When testing a bundle I've noticed an 
inconsistency between the documentation and the expected behavior. Using the 
following snippet on a clean VM, I've installed a bundle and then went to 
uninstall it. The second run the detect condition is returning 5 instead of 3.  
The documentation for the Util:ProductSearch only documents the states as:

state
Saves the state of the product: advertised (1), absent (2), or locally 
installed (3).


  <Fragment>

    <util:ProductSearch Guid="{710F4C1C-CC18-4C49-8CBF-51240C89A1A2}" 
Variable="VC2005SP1Installed" Result="state"/>

    <PackageGroup Id="VC2005SP1_MFCLOC_REDIST_X86">

      <ExePackage Id="VC2005SP1_MFCLOC_REDIST_X86"

                  Cache="no"

                  Compressed="no"

                  PerMachine="yes"

                  Permanent="yes"

                  Vital="yes"

                  DisplayName="Visual C++ 2005 SP1 (KB2538242)"

                  
SourceFile="!(wix.PrerequisitePath)\vcredist_2005_sp1-2_x86.exe"

                  Name="payload\vcredist_2005_sp1-2_x86.exe"

                  DownloadUrl="http://.../vcredist_2005_sp1-2_x86.exe";

                  InstallCommand='/q'

                  DetectCondition="(VC2005SP1Installed = 3)"

                  />

    </PackageGroup>



  </Fragment>

And from the second run burn log I see:
[0990:0BA4][2012-09-08T11:59:00]: Trying per-machine extended info for property 
'State' for product: {710F4C1C-CC18-4C49-8CBF-51240C89A1A2}
[0990:0BA4][2012-09-08T11:59:00]: Setting numeric variable 'VC2005SP1Installed' 
to value 5

>From 
>(http://msdn.microsoft.com/en-us/library/windows/desktop/aa370131(v=vs.85).aspx):
INSTALLPROPERTY_PRODUCTSTATE

The state of the product returned in string form as "1" for advertised and "5" 
for installed.


And finally, from Msi.h in the SDK,

typedef enum tagINSTALLSTATE
{
...
                INSTALLSTATE_ADVERTISED   =  1,  // advertised feature
                INSTALLSTATE_REMOVED      =  1,  // component being removed 
(action state, not settable)
                INSTALLSTATE_ABSENT       =  2,  // uninstalled (or action 
state absent but clients remain)
                INSTALLSTATE_LOCAL        =  3,  // installed on local drive
                INSTALLSTATE_SOURCE       =  4,  // run from source, CD or net
                INSTALLSTATE_DEFAULT      =  5,  // use default, local or source
} INSTALLSTATE;


Should the Wix Documentation read differently? (Ie, 1,2,5) I've tried searching 
to see if this is a known issue, but haven't been able to find anything. Should 
this be logged as a documentation bug?

Thanks,
Jacob

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to