I have a WiX install package. I use the TARGETD开发者_运维百科IR property to do some stuff in my uninstall custom actions. The TARGETDIR used to work fine, but then I made a change (I don't remember which one), and now I always have TARGETDIR = "C:\" , while other folder path properties have correct values on uninstall. I don't set it anywhere in the code or in the WiX install file, so I think it got corrupt because I've added some new files or directories to the installation package. Note that on install the TARGETDIR property contains a correct value. Any ideas why the TARGETDIR property could get corrupt?
TARGETDIR will usually be set to the same a ROOTDRIVE (The Drive with the most amount of free space, be it a local, network or USB drive). For this reason you can't really rely on it to be the same during installation and removal, especially if you plug in a USB disk with more space free than your "C:\"
, and you can't hardcode it to C:\
as computers may differ in their local disk configuration - some may not even have a C:\
If the TARGETDIR directory has no files inside of it in the install package, then the property is evaluated incorrectly. It took an hour for me to figure it out. Creating install packages is very painful.
精彩评论