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

INSTALLDIR In Exec. Seq

Hi!

I've searched the forum for answers but I didn't manage to find out how to access the INSTALLDIR from an InstallScript CA scheduled in Exec Seq after InstallFiles.

I want to know the install dir when I execute a program installed with our product. The ability for the user to change the install dir is included (DestinationFolder dialog). I'm using the this call to read the INSTALLDIR.

MsiGetProperty(hMSI,"INSTALLDIR",appPath,valueBuf);

I've also added the INSTALLDIR to the property: "SecureCustomProperties" but that didn't seem to work either.

I've also tried (as proposed on a forum post) to use a Set Property CA. I set this property: NEWFOLDER and set it's value to: [INSTALLDIR]. It was scheduled after "InstallWelcome". This did not work. :mad:


Thanks,

Lars-Erik Lis
Labels (1)
0 Kudos
4 Replies
KathyMorey
Level 10

Basic question - did you set the buffersize (valueBuf) before you made the MsiGetProperty call? What did you get back?

When you included the Set Property CA, did you log the install? Again, what value, if any, was returned?
0 Kudos
speedy
Level 3

Thanks for the reply Kathy.

I forgot to mention that the CA that reads the INSTALLDIR property has the "In-Script Execution" set to "Deferred Execution in System Context".

I did set the valueBuf and the value I got back was nothing -> ""

I didn't log the install when running the Set Prop. CA but the result was the same: ""
0 Kudos
DebbieL
Level 17

Deferred custom actions do not have access to most properties. You'd need to use the CustomActionData property, as explained in the following help topic:
Accessing or Setting Windows Installer Properties Through Deferred, Commit, and Rollback Custom Actions
(Please note that the property name that you enter for step 1 in that procedure must match the name of the custom action that you create in step 4.)

I hope that helps.
0 Kudos
speedy
Level 3

DebbieL:
Thanks a bunch! It worked out great...

I made the changes listed on that link you gave me.
0 Kudos