>> Long story short: XmlFile is being executed during upgrades when I
>> only want it executed on new installations.
>>
>
> The owning component controls whether XmlFile is run; conditionalize it
> so it doesn't run during upgrade.

Thanks for the reply Bob, unfortunately I already tried this with no luck:

<Component Id="WebConfigSqlDbWinAuthComponent" KeyPath="yes" Guid="Blah">
  <Condition>NOT Installed AND USEINTEGRATEDSECURITY = 1</Condition>
  <util:XmlFile Id="UpdateWebConfigSqlDbWinAuth"
                File="[INSTALLLOCATION]\Web.config"

ElementPath="/configuration/connectionStrings/add[...@name='Database'[\]]/@connectionString"

Value="Database=[TARGETDBNAME];Server=[TARGETDBSERVER];Integrated
Security=SSPI;"
                Action="setValue" />
</Component>

<Component Id="WebConfigSqlDbSqlAuthComponent" KeyPath="yes" Guid="Blah">
  <Condition>NOT Installed AND NOT USEINTEGRATEDSECURITY = 1></Condition>
  <util:XmlFile Id="UpdateWebConfigSqlDbSqlAuth"
                File="[INSTALLLOCATION]\Web.config"

ElementPath="/configuration/connectionStrings/add[...@name='Database'[\]]/@connectionString"

Value="Database=[TARGETDBNAME];Server=[TARGETDBSERVER];uid=[TARGETDBUSERNAME];pwd=[TARGETDBUSERPASSWORD];"
                Action="setValue" />
</Component>

I tried both "NOT Installed" and "NOT UPGRADEFOUND" for the component
condition, neither worked.

I was wondering if it may be because the custom UI we show for
collecting sql credentials wasn't being shown on upgrades, so the
property values would be null, but I don't understand why the
connectionString attribue is empty, rather than
"Database=;Server=;uid=;pwd;" which is what I would've expected if the
properties were empty.

Looking, through the upgrade log file, it appears that
ExecXmlFileRollback action is being called:

MSI (s) (28:A8) [16:09:22:671]: Doing action: SchedXmlFile
Action 16:09:22: SchedXmlFile.
Action start 16:09:22: SchedXmlFile.
MSI (s) (28:14) [16:09:22:677]: Invoking remote custom action. DLL:
C:\Windows\Installer\MSI8A93.tmp, Entrypoint: SchedXmlFile
MSI (s) (28!1C) [16:09:22:719]: PROPERTY CHANGE: Adding
ExecXmlFileRollback property. Its value is '0€C:\Program Files
(x86)\blah\\web.config...@xxxxxx[snip]
MSI (s) (28!1C) [16:09:22:720]: Doing action: ExecXmlFileRollback
Action 16:09:22: ExecXmlFileRollback.
Action start 16:09:22: ExecXmlFileRollback.
ExecXmlFileRollback:
Action ended 16:09:22: ExecXmlFileRollback. Return value 1.
MSI (s) (28!1C) [16:09:22:726]: PROPERTY CHANGE: Adding ExecXmlFile
property. Its value is '1€0€C:\Program Files
(x86)\Blah\\Web.config€4€0€/configuration/connectionStrings/a...@name='Database']/@connectionString€€Database=Blah;Server=(local);Integrated
Security=SSPI;'.
MSI (s) (28!1C) [16:09:22:727]: Doing action: ExecXmlFile
Action 16:09:22: ExecXmlFile.
Action start 16:09:22: ExecXmlFile.
ExecXmlFile:
Action ended 16:09:22: ExecXmlFile. Return value 1.
Action ended 16:09:22: SchedXmlFile. Return value 1.


Another potential issue is that we create the web.config on install
using CopyFile, and run SchedXmlFile after DuplicateFiles.  I don't
think this would cause a problem, but figured it was worth a mention.

Thanks again.

------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to