7

Why does CostFinalize change my custom property in one installation and not the...

 2 years ago
source link: https://www.codesd.com/item/why-does-costfinalize-change-my-custom-property-in-one-installation-and-not-the-other.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Why does CostFinalize change my custom property in one installation and not the other?

advertisements

I have two installs with virtually identical code. I set a custom property like this:

<SetProperty Id="MYCONFIGPATH" Value="[CONFIGPATH]" Before="CostInitialize"/>

And then reference that property in a component:

<Component Id="CopyConfigFromConfigPath" Guid="{XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}" MultiInstance="yes">
    <Condition>CONFIGPATH</Condition>
    <CopyFile SourceProperty="MYCONFIGPATH" DestinationDirectory="ConfigBOR" DestinationName="ConfigBOR.xml" Id="CopyConfigBOR" />
</Component>

I'm not certain this is what's causing the failure to copy this file but I suspect it is:

MSI (s) (64:6C) [14:03:42:383]: PROPERTY CHANGE: Modifying MYCONFIGPATH property. Its current value is 'C:\Installs\ConfigBOR.xml'. Its new value: 'C:\Installs\ConfigBOR.xml\'.

Notice the trailing backslash. This happens shortly after starting CostFinalize. Just above that log entry are some suspicious looking entries but I can't figure out what they mean so I'm not sure they're relevant:

MSI (s) (64:6C) [14:03:42:380]: Doing action: CostFinalize
MSI (s) (64:6C) [14:03:42:380]: Note: 1: 2205 2:  3: ActionText

MSI (s) (64:6C) [14:03:42:382]: Note: 1: 2205 2:  3: Patch
MSI (s) (64:6C) [14:03:42:383]: Note: 1: 2205 2:  3: Condition

I have identical code in another installer (BOR is replaced with the product name in that one) but it doesn't modify this property and does correctly copy this file. Why doesn't it work here?


I don't think your question provides enough information to answer this for certain, but my psychic powers tell me that MYCONFIGPATH is in the Directory table in one package but not in the other. Thus the directory resolution phase of CostFinalize affects the two packages differently.


Recommend

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK