cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
redbox
Level 4

Access INSTALLDIR from deferred execution during uninstall

I have a InstallScript Custom Action that:
1. Has to be run in system context.
2. Needs to retrieve the INSTALLDIR public property.

To meet the requirements:
A. The custom action is inserted to Execute Sequence after InstallInialize as a "Deferred Execution in System Context".
B. Call MsiGetProductInfo(...) to retrieve INSTALLPROPERTY_INSTALLLOCATION.

Problem:
The MsiGetProductInfo retrieved an empty INSTALLDIR.

So, I moved the custom action to "Aftert CostFinalize" and also has to change it to Immediate Execution because deferred Execution is not allow there.

New Problem:
This time, the INSTALLDIR was retrieved correctly. But, Immediate Execution can't run in system context.

Anyone can help me out?

Thanks ahead!!!
Labels (1)
0 Kudos
(2) Replies
alegerlotz
Level 7

redbox wrote:
I have a InstallScript Custom Action that:
1. Has to be run in system context.
2. Needs to retrieve the INSTALLDIR public property.

To meet the requirements:
A. The custom action is inserted to Execute Sequence after InstallInialize as a "Deferred Execution in System Context".
B. Call MsiGetProductInfo(...) to retrieve INSTALLPROPERTY_INSTALLLOCATION.

Problem:
The MsiGetProductInfo retrieved an empty INSTALLDIR.

So, I moved the custom action to "Aftert CostFinalize" and also has to change it to Immediate Execution because deferred Execution is not allow there.

New Problem:
This time, the INSTALLDIR was retrieved correctly. But, Immediate Execution can't run in system context.

Anyone can help me out?

Thanks ahead!!!



Search for "CustomActionData" and there should be several topics that explain it.
0 Kudos
redbox
Level 4

Thanks for the reply. Actually I tried CustomActionData before and it didn't work. Some of my custom actions use the CustomActionData mechanism during install. But it doesn't seem to be working for uninstall. I understand that only a few properties are available during uninstall time. I set the CustomActionDAta to [ARPINSTALLLOCATION], which InstallShield2008 has automatically made available during uninstall time.

alegerlotz wrote:
Search for "CustomActionData" and there should
be several topics that explain it.
0 Kudos