Two thoughts that I have. 
 
1.  Your SetCAP_RestoreWebConfig custom action is sequenced at 265.  Has the TargetDir property been determined by Windows Installer at this point?  If it hasn't, then you're going to be getting a blank TargetDir value.  I"m not real sure of when that happens, but that's a thought of what might be happening.
2.  Your BackupWebConfig custom action is executed as deferred.  Deferred custom actions cannot get or set the normal MSI properties.  They can only use the CustomActionData property to pass information from the install into the custom action.  So, for this reason, the msgbox displaying TARGETDIR may be correctly displaying a blank string.  And, for the reason mentioned in item 1, your message box displaying CustomActionData could also be correctly displaying a blank string.
 
Finally, to get a better idea of what is really happening, run your upgrade installation with verbose logging turned on.  (msiexec /l*v Log.txt /i ProductName.msi).   Then read your log file to determine what the value of TARGETDIR actually is during the uninstall, and possibly when it gets set. 
 
Hope this helps.
-Tina
 

 
On 11/9/06, Rob MacFadyen <[EMAIL PROTECTED]> wrote:
Hey all,

I'm trying to implement handling for major upgrades for a web application
installation.

The use case I'm currently testing is:
1. User installs v1.0.0 of the application
       - Install gathers information about the virtual
         directory and database server
       - App is installed, vdir created, db created,
         web.config is updated with connection string
         and encrypted

2. User installs v1.0.1 of the application
       - no prompts for virtual directory or database
         server (upgrading... should use existing
         vdir and db).
       - Old version is removed as part of the install.

The challenge I'm facing is the web.config file... I _need_ to keep the
current version from the v1.0.0 install.

So... I've decided that during Uninstall, if uninstalling because of a
backup, a backup of the web.config file will be made (filesystemobject
copyfile). This isn't working out at all... the CA seem to get the TARGETDIR
property.

Here's the backup CA definition:
<CustomAction
   Id="BackupWebConfig"
   Return="check"
   Execute="deferred"
   Impersonate="yes"
   BinaryKey="Callwebconfig"
   _vbscript_Call="Backup"
/>

<CustomAction
   Id="SetCAP_BackupWebConfig"
   Property="BackupWebConfig"
   Value="[TARGETDIR]"
/>

Here's the relevant InstallExecuteSequence entries:

<Custom Sequence="265" Action="" />

... snip ...

<InstallInitialize Sequence="1500" />
<RemoveExistingProducts Sequence="1550" />
<Custom Action="" Sequence="1555">
REMOVE="ALL" AND UPGRADINGPRODUCTCODE
</Custom>


In the _vbscript_ I have the following debug messages:

msgbox "CustomActionData: " & Session.Property("CustomActionData")
msgbox "TARGETDIR: " & Session.Property("TARGETDIR")

Both of which display empty strings!


So... from my point of view... it looks like an uninstall that is initiated
by RemoveExistingProducts doesn't quite operate like a normal uninstall...
but that doesn't make much sense.

Anyone have any suggestions?

Regards,

Rob




-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to