The Windows Installer does not let you conditionally install Resources
(files, registry keys, shortcuts, etc). Instead, you must add a Condition to
the Component itself. See the Component/Condition element.

On Tue, Feb 2, 2010 at 8:07 AM, David Battey <dbat...@phoenixcon.com> wrote:

> I want to set a registry value to a DWORD of 1, unless a optional
> parameter of BAR=1 is specified when the installer runs. I've tried
> variations on what's listed below, but can't get it to work (the listing
> below doesn't work because I'm trying to use an expression in the
> SetProperty element). Can someone tell me the best way to do this?
>
> <?xml version="1.0" encoding="UTF-8"?>
> <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi";>
>        <Product Id="ec3c351b-30ac-4185-b6ec-c11c74160fee" Name="
> RegValTest" Language="1033" Version="1.0.0.0" Manufacturer="RegValTest"
> UpgradeCode="20916b03-0ec3-4f57-8d41-49e5ffeba1bd">
>                <Package InstallerVersion="200" Compressed="yes" />
>
>                <Media Id="1" Cabinet="media1.cab" EmbedCab="yes" />
>                <Property Id="FOO" Value="1" />
>                <Directory Id="TARGETDIR" Name="SourceDir">
>                        <Directory Id="ProgramFilesFolder">
>                                <Directory Id="INSTALLLOCATION" Name="
> RegValTest">
>                                        <Component Id="RegValTest" Guid="
> {D2507858-6E11-4770-BA36-2CF6317F90F2}">
>                                                <RegistryValue Id="
> RegValTest" Root="HKLM" Key="SOFTWARE\RegValTest" Name="RegValTest" Type="
> integer" Value="[FOO]" />
>                                        </Component>
>                                </Directory>
>                        </Directory>
>                </Directory>
>
>                <Feature Id="ProductFeature" Title="RegValTest" Level="1">
>                        <ComponentRef Id="RegValTest" />
>                </Feature>
>                <SetProperty Id="FOO" After="CostFinalize" Value="NOT
> [BAR]" />
>        </Product>
> </Wix>
>
> Thanks,
> David
>
> ------------------------------------------------------------------------------
> The Planet: dedicated and managed hosting, cloud storage, colocation
> Stay online with enterprise data centers and the best network in the
> business
> Choose flexible plans and management services without long-term contracts
> Personal 24x7 support from experience hosting pros just a phone call away.
> http://p.sf.net/sfu/theplanet-com
> _______________________________________________
> WiX-users mailing list
> WiX-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
>


-- 
virtually, Rob Mensching - http://RobMensching.com LLC
------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to