This is a pattern I use, when I want command line value to override (it's
heavily based on Rob's "remember" pattern):
<?define PropertyList = INSTALLLOCATION;SERVER_NAME ?>
* * *
<?foreach REGPROP in $(var.PropertyList) ?>
<PropertyRef Id="$(var.REGPROP)" />
<CustomAction Id="SaveCmdLine.$(var.REGPROP)"
Property="CMDLINE_$(var.REGPROP)" Value="[$(var.REGPROP)]"
Execute="firstSequence" />
<CustomAction Id="SetFromCmdLine.$(var.REGPROP)" Property="$(var.REGPROP)"
Value="[CMDLINE_$(var.REGPROP)]" Execute="firstSequence" />
<CustomAction Id="SetDefault.$(var.REGPROP)" Property="$(var.REGPROP)"
Value="[$(var.REGPROP)_Default]" Execute="firstSequence" />
<?endforeach ?>
* * *
<InstallExecuteSequence>
<?foreach REGPROP in $(var.PropertyList) ?>
<Custom Action="SaveCmdLine.$(var.REGPROP)" Before="AppSearch">
<![CDATA[$(var.REGPROP)]]>
</Custom>
<Custom Action="SetFromCmdLine.$(var.REGPROP)" After="AppSearch">
<![CDATA[CMDLINE_$(var.REGPROP)]]>
</Custom>
<Custom Action="SetDefault.$(var.REGPROP)" After="LaunchConditions">
<![CDATA[NOT $(var.REGPROP) AND $(var.REGPROP)_Default]]>
</Custom>
<?endforeach ?>
</InstallExecuteSequence>
The properties in REGPROP are all registry backed (they have a RegistrySearch
and a corresponding Component that writes the registry).
--
John Merryweather Cooper
Build & Install Engineer - ESA
Jack Henry & Associates, Inc.®
Shawnee Mission, KS 66227
Office: 913-341-3434 x791011
[email protected]
www.jackhenry.com
-----Original Message-----
From: trush44 [mailto:[email protected]]
Sent: Monday, January 6, 2014 9:48 AM
To: [email protected]
Subject: Re: [WiX-users] Unable to override SetProperty value with Edit Control
value
Thank you - that worked but I could use some help in understanding how/why.
How does setting the condition "Not PROPSERVERHOSTNAME" force the property to
be updated to the user override value on the backend when the xml file is
updated?
There's also one other kink I'm trying to figure out in regards to my original
question. I did simplify my code in the original question, but what I'm
actually trying to do is set a default value for a property, allow the user to
override that property value then store the value in the registry and then load
the property on subsequent upgrades. If I include the condition you specified,
then my Registry key now will never load because PROPSERVERHOSTNAME already has
a value of "Sample". Any thoughts on how I can get this to work?
<Property Id="PROPSERVERHOSTNAME" Value="Sample" Secure="yes"/>
<Property Id="PROP_REG_APPSERVER_HOSTNAME">
<RegistrySearch Id="REG_APPSERVER_NAME" Root="HKLM" Key="$(var.RegPath)"
Name="APPSERVER_HOSTNAME" Type="raw"/>
</Property>
<SetProperty Id="PROPSERVERHOSTNAME" Value="[PROP_REG_APPSERVER_HOSTNAME]"
After="AppSearch">Not PROPSERVERHOSTNAME AND
PROP_REG_APPSERVER_HOSTNAME</SetProperty>
--
View this message in context:
http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/Unable-to-override-SetProperty-value-with-Edit-Control-value-tp7591569p7591593.html
Sent from the wix-users mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT
organizations don't have a clear picture of how application performance affects
their revenue. With AppDynamics, you get 100% visibility into your Java,.NET, &
PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
WiX-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wix-users
NOTICE: This electronic mail message and any files transmitted with it are
intended
exclusively for the individual or entity to which it is addressed. The message,
together with any attachment, may contain confidential and/or privileged
information.
Any unauthorized review, use, printing, saving, copying, disclosure or
distribution
is strictly prohibited. If you have received this message in error, please
immediately advise the sender by reply email and delete all copies.
------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT
organizations don't have a clear picture of how application performance
affects their revenue. With AppDynamics, you get 100% visibility into your
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
WiX-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wix-users