I am setting a property value during a product upgrade. In the install I
want to use the value of this property in a SQL statement which is in
SqlString element, but I get an empty value. I looked at the verbose log
and although the property is set to a correct value it appears as blank
in the SQL statement.
Here is my code:
<sql:SqlString SQL=" -- This sequence restores the database in product
upgrade if there is a failure
if ('[KMFPRODUCTUPGRADE]' = 'KMFPRODUCTUPGRADE' OR
'[KMFPRODUCTREINSTALL]' = 'KMFPRODUCTREINSTALL')
BEGIN
alter database $(var.DataBaseName) set SINGLE_USER With Rollback Immediate
drop database $(var.DataBaseName)
restore database $(var.DataBaseName) from
disk='[TempFolder]$(var.DataBaseName).bak'
END" Id="RestoreOnRollBack" SqlDb="$(var.DataBaseName)"
RollbackOnReinstall="yes" ContinueOnError="no" RollbackOnInstall="yes"
Sequence="40" />
<InstallExecuteSequence>
<Custom Action="CheckIfInProductUpgrade"
After="CostFinalize">UPGRADINGPRODUCTCODE</Custom>
<Custom Action="CheckIfInProductReinstall"
After="CostFinalize">REINSTALLMODE</Custom>
</InstallExecuteSequence>
<CustomAction Id="CheckIfInProductUpgrade" Property="KMFPRODUCTUPGRADE"
Value="KMFPRODUCTUPGRADE"/>
<CustomAction Id="CheckIfInProductReinstall"
Property="KMFPRODUCTREINSTALL" Value="KMFPRODUCTREINSTALL"/>
Here is the relevant information from the log:
Action start 14:42:10: CheckIfInProductUpgrade.
MSI (s) (68:40) [14:42:10:939]: PROPERTY CHANGE: Adding
KMFPRODUCTUPGRADE property. Its value is 'KMFPRODUCTUPGRADE'.
Action ended 14:42:10: CheckIfInProductUpgrade. Return value 1.
MSI (s) (68:40) [14:42:10:939]: Skipping action: SkipIISCA (condition is
false)
Property(N): KMFPRODUCTUPGRADE = KMFPRODUCTUPGRADE
Action 14:42:25: ExecuteSqlStrings. Executing SQL Strings
Action start 14:42:25: ExecuteSqlStrings.
1: Executing SQL Strings
Action ended 14:42:25: ExecuteSqlStrings. Return value 1.
MSI (s) (68!B0) [14:42:25:537]: PROPERTY CHANGE: Adding
RollbackExecuteSqlStrings property. Its value is
'TaitKmfWIN-UVZN6CSJY0WTaitKmf51RestoreOnRollBack25 -- This
sequence restores the database in product upgrade if there is a failure
if ('' = 'KMFPRODUCTUPGRADE' OR '' = 'KMFPRODUCTREINSTALL')
BEGIN
alter database TaitKmf set SINGLE_USER With Rollback Immediate
drop database TaitKmf
restore database TaitKmf from
disk='C:\Users\ADMINI~1\AppData\Local\Temp\TaitKmf.bak'
END'.
MSI (s) (68!B0) [14:42:25:538]: Doing action: RollbackExecuteSqlStrings
.
=======================================================================
This email, including any attachments, is only for the intended
addressee. It is subject to copyright, is confidential and may be
the subject of legal or other privilege, none of which is waived or
lost by reason of this transmission.
If the receiver is not the intended addressee, please accept our
apologies, notify us by return, delete all copies and perform no
other act on the email.
Unfortunately, we cannot warrant that the email has not been
altered or corrupted during transmission.
=======================================================================
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users