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

Custom Actions, Directories and Subdirectories


2 replies to this topic

rmatheson

rmatheson
  • Full Members
  • 9 posts

Posted 17 January 2007 - 20:54

Hi,

I have been working through some problems setting installdir and various other directories through custom actions, and as I have not seen any concrete documentation on this issue, I thought I would post what I think is happening and see if anyone out there can confirm or deny.

1. If you set a property with the same name as a key in the directory table (e.g. from the command line or using a custom action), it becomes the default path for that directory while CostFinalize is run. This also becomes the base point for all subdirectories (as they are resolved after this point).

This makes sense because you set directories via the commandline as properties. I have seen this hinted in the microsoft documentation but the behaviour does not appear to be explicitly documented.

2. If you set a directory after CostFinalize is run (using custom action 35) this will change the directory, but not any subdirectories, I imagine because they have already been resolved during CostFinalize. Is this correct?

Thanks,

Richard

Zweitze

Zweitze
  • Full Members
  • 522 posts

Posted 20 January 2007 - 01:00

If you want to set a directory after CostFinalize, use function MsiSetTargetPath or Custom Action type 35.
These functions update the child folders of the folder, and validate the new folder too (check if the new value is a valid destination).

rmatheson

rmatheson
  • Full Members
  • 9 posts

Posted 21 January 2007 - 00:05

Fantastic - thanks.