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

MsiGetTargetPath and Custom Action Table


2 replies to this topic

mfindlay

mfindlay
  • Members
  • 5 posts

Posted 12 March 2002 - 04:38

I am using MsiGetTargetPath to resolve each entry in the DIRECTORY table to
its target path. For the most part this is successful. But when there are
Custom Actions (Type 51) that influence the path, the MsiGetTargetPath does
not take these into account. Therefore I end up with invalid target path
names.

Here is my pseudocode:

1) Load a string array with all the 'Directory' column data from the
DIRECTORY table. This is done via a database handle.
2) Get the Installer handle.
3) Perform MSIDoAction with "CostInitialize", then with "FileCost", then
with "CostFinalize".
4) For each string in the string array, call GetTargetPath() using the
string as the input.

All of the strings resolve correctly EXCEPT for those where a custom action
table entry type 51 is supposed to override it.

Is there another action I need to perform so that when I call GetTargetPath
it also takes into account the custom action table entries?

Thanks in advance!

Mark

Scott Williams

Scott Williams
  • Members
  • 38 posts

Posted 12 March 2002 - 16:59

Umm, do the CA's of type 51 ever get called?   Just off the top of my head, I would call the MsiDoAction function with those CA's if possible and then see what the path is.

mfindlay

mfindlay
  • Members
  • 5 posts

Posted 12 March 2002 - 17:51

That did it. I first read the Custom Action table and loaded the names of each custom action into a string array. Then after a CostInitialize, did a MsiDoAction on each of the custom actions and then all calls of MsiGetTargetPath returned the properly resolved directory path.

Thanks very much!