Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Set Directory CA 35 ??


4 replies to this topic

Anthony Hughes

Anthony Hughes
  • Members
  • 30 posts

Posted 12 February 2002 - 16:56

Argh! This is driving me mad!

I'm trying to set a Directory table entry ALTDIR equal to INSTALLDIR and then use that as the location for a feature that I want to default to installdir but allow the user to change in the custom dialog.

So far I've got a CA type 35 (Set a dir) with source = ALTDIR and target = [INSTALLDIR] and I've got it in my UI sequence just after CostFinalize. I've got ALTDIR in the Directory table, but when I run the installer, the default value for the feature appears as "C:\ALTDIR\" - i.e. the name of the dir property, not it's value....

What am I doing wrong??
Cheers
Ant


Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 12 February 2002 - 17:00

How did you specify the feature target? [ALTDIR] with brackets?

Anthony Hughes

Anthony Hughes
  • Members
  • 30 posts

Posted 12 February 2002 - 17:05

Yup

[ALTDIR]

Ant


Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 15 February 2002 - 22:13

Hmmm, I don't see why this fails. But if all you want is have ALTDIR default to INSTALLDIR, why don't you just enter INSTALLDIR in the Parent column of the directory table row for ALTDIR, and a period in the last column?

aford

aford
  • Members
  • 12 posts

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.