Posted 09 January 2003 - 20:15
I just came across a similar problem. I used a vbscript custom action (scheduled after CostFinalize) to set the value of a directory. Obviously I'm leaving out a bunch of code, but here's the general idea.
Session.Property("MYDIR") = "MyApp2K"
The custom action is in both the UI and Exec sequence, is set to Execute Only Once and has a condition of Not Installed. When I run the installation, everything worked as intended. It installed the files to the custom location and I could over-ride this via the CustomSetup dialog.
However, the initial value shown for the feature in the CustomSetup dialog still shows the old value, "MyApp". If I click on the Change button, the correct directory name is displayed.
From digging and observation, I think the CustomSetup dialog is getting it's default value from the Directory table. When I used Session.Property to change the value, I think it ony updated the *copy* of the directory name that CostFinalize put in the Property table.
Anyway, I figured out a work around for my problem. Right after I call my VBscript custom action, I call a Set Directory custom action (type 35). eg:
Directory Name: MYDIR
Directory Value: [MYDIR]
From observation, I think this uses the value in the Property table and updates the value in the Directory table. If I figure out a way to make my Vbscript custom action update both the Property table and the Directory table, I'll add to this posting.