[wix-users] Condition question - "Installed"

Walter Dexter wfdexter at gmail.com
Wed Oct 11 16:19:52 PDT 2017


Great, thank you.

I don't think these will ever get repaired or modified, but the changes make sense just in case. 

I wasn't sure if the feature condition would affect the feature's components. That's why I put in the transitive. Guess I'll take it back out.

Thanks again!

Sent from my iPad

> On Oct 11, 2017, at 2:51 PM, Joel Budreau <joel.budreau at gmail.com> wrote:
> 
> - I’d drop “Installed OR”. It doesn’t affect a fresh install, but if you later run a repair or modify you might run into problems where both of these features evaluate to true.
> - You don’t need to set KeyPath=“no” (“no” is the default value)
> - Win64=“yes” is fine
> - You only need to set Transitive=“yes” if the component has a condition that you would want re-evaluated during a repair. So, no component condition -> drop Transitive attribute (default is “no”).
> 
> - Joel
> 
>> On Oct 11, 2017, at 10:00 AM, Walter Dexter via wix-users <wix-users at lists.wixtoolset.org> wrote:
>> 
>> Hi-
>> 
>> I have an installer that installs either one set of files or the other set
>> of files depending on a registry value.
>> 
>> This seems like it's working, but I'm not sure if I should be including
>> "Installed OR" in my condition. In my limited testing it doesn't seem like
>> it matters, but maybe I'm missing something. WiX source snips are below.
>> 
>> Notes:
>> 
>>  - This MSI is for internal use only, installing only on Server 2003
>>  (32-bit) or Server 2012 (64-bit.)
>>  - HKLM\SOFTWARE\a\b\c\d is a REG_SZ that will always contain 6.2 digits.
>>  - Server 2003 platforms will never have a value that satisfies the
>>  Feature2 condition.
>>  - The components within the ComponentGroups all have versioned files as
>>  their KeyPath (A DLL with version resource.)
>>  - The non-KeyPath files within the components land in the same location
>>  from both ComponentGroups.
>>     - "CGOne" installs copies of "one.dll" and "a.ini" to three different
>>     directories.
>>     - "CGTwo" installs  "two.dll" and "a.ini" to the same three
>>     directories.
>>  - It is likely that an older version of the same MSI (same UpgradeCode,
>>  different ProductCode) will already have been installed on the target
>>  system, along with files "old.dll" and "a.ini" already present in the same
>>  three directories.
>>  - Please excuse any typos; I re-keyed, simplified and anonymized the
>>  following XML. My employer prefers that we remain semi-anonymous.
>> 
>> <Property Id="VALUE" Secure="yes">
>> <RegistrySearch Id="RS_VALUE" Root="HKLM" Key="SOFTWARE\a\b\c" Name="d"
>> Type="raw" Win64="yes" />
>> </Property>
>> 
>> <Feature Id="Feature1" Title="Files for Less" Level="0">
>>   <ComponentGroupRef Id="CGOne" />
>>   <Condition Level="1"><![CDATA[Installed OR VALUE < "120000.00"
>> ]]></Condition>
>> </Feature>
>> 
>> <Feature Id="Feature2" Title="Files for More" Level="0">
>>   <ComponentGroupRef Id="CGTwo" />
>>   <Condition Level="1"><![CDATA[Installed OR VALUE >= "120000.00"
>> ]]></Condition>
>> </Feature>
>> 
>> <ComponentGroup Id="CGOne">
>>   <Component Id="CG1a" Guid="...." Directory="DIR_COPYA" Transitive="yes"
>>> 
>>       <File Id="CG1aDLL" Source="one.dll" KeyPath="yes" />
>>       <File Id="CG1aINI" Source="a.ini" KeyPath="no" />
>>   </Component>
>>   <Component Id="CG1b" Guid="...." Directory="DIR_COPYB" Transitive="yes"
>>> 
>>       <File Id="CG1bDLL" Source="one.dll" KeyPath="yes" />
>>       <File Id="CG1bINI" Source="a.ini" KeyPath="no" />
>>   </Component>
>>   <Component Id="CG1c" Guid="...." Directory="DIR_COPYC" Transitive="yes"
>>> 
>>       <File Id="CG1cDLL" Source="one.dll" KeyPath="yes" />
>>       <File Id="CG1cINI" Source="a.ini" KeyPath="no" />
>>   </Component>
>> </ComponentGroup>
>> 
>> <ComponentGroup Id="CGTwo">
>>   <Component Id="CG2a" Guid="...." Directory="DIR_COPYA" Transitive="yes"
>>> 
>>       <File Id="CG2aDLL" Source="two.dll" KeyPath="yes" />
>>       <File Id="CG2aINI" Source="a.ini" KeyPath="no" />
>>   </Component>
>>   <Component Id="CG2b" Guid="...." Directory="DIR_COPYB" Transitive="yes"
>>> 
>>       <File Id="CG2bDLL" Source="two.dll" KeyPath="yes" />
>>       <File Id="CG2bINI" Source="a.ini" KeyPath="no" />
>>   </Component>
>>   <Component Id="CG2c" Guid="...." Directory="DIR_COPYC" Transitive="yes"
>>> 
>>       <File Id="CG2cDLL" Source="two.dll" KeyPath="yes" />
>>       <File Id="CG2cINI" Source="a.ini" KeyPath="no" />
>>   </Component>
>> </ComponentGroup>
>> 
>> So what do you guys think - "Installed" needed, or better without it? Why?
>> 
>> Any other feedback? I was uncomfortable with the "Win64=yes" but based on
>> logs it's reading the registry key successfully on the 32-bit platform.
>> 
>> I'm also not quite sure if the "Transitive" is gaining me anything.
>> 
>> Thanks!
>> 
>> Walt
>> 
>> ____________________________________________________________________
>> WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/
> 



More information about the wix-users mailing list