cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
flyhoney
Level 3

Using INSTALLDIR in a Deferred Custom Action

I need to run an exe after an installation completes. Currently, I have a deferred custom action that runs just before the InstallFinalize action. I've followed the steps here: http://helpnet.acresso.com/robo/projects/installshield12helplib/AccessingProps-DeferredCAs.htm to use the CustomActionData to pass the INSTALLDIR to my Custom Action. However, this tutorial only shows you how to display the INSTALLDIR. I need to store it and use it in my Custom Action's function. What is the best way to do this? If I follow the tutorial and create a set-a-property Action to set the value of INSTALLDIR, it always winds up empty if I try to access via:


string installDir;
number length = MAX_PATH;
MsiGetProperty(hMSI, "CustomActionData", installDir, length);


It seems that knowing the INSTALLDIR in a deferred custom action has to be a common thing for people to do. Am I going about this the entirely wrong way?
Labels (1)
0 Kudos
(2) Replies
Reureu
Level 10

The example shown at http://helpnet.acresso.com/robo/projects/installshield12helplib/AccessingProps-DeferredCAs.htm is related to the "SUPPORTDIR" property. It seems that this "SUPPORTDIR" property is only set you have added some support files.
If you haven't got any support file, it returns an empty string.

But you are trying to get the value of the "INSTALLDIR" property.
Did you make sure that the Custom Action that sets the property has got a Property Value of [INSTALLDIR], including the brackets?
Its property name must correspond to the name of the custom action that will use this custom action data.
0 Kudos
flyhoney
Level 3

Its property name must correspond to the name of the custom action that will use this custom action data.


Yeah that's where I was screwing up. I finally noticed the text in the help files that mentioned this. Problem solved.

Thanks for the help.
0 Kudos