cancel
Showing results forĀ 
ShowĀ Ā onlyĀ  | Search instead forĀ 
Did you mean:Ā 
agshah
Level 7

INSTALLDIR not available at uninstall time in InstallScript

Hi,

I have a Basic MSI project. I have a custom action that invokes a function in installscript code in setup.rul.

But INSTALLDIR value is not available.

e.g. I tried a simple message  box as below and the value is an empty string.

MessageBox("INSTALLDIR location: " + INSTALLDIR, INFORMATION);

Appreciate anyhelp.

Labels (1)
0 Kudos
(2) Replies
agshah
Level 7

Hi all,

appreciate any help with this.  I need to use INSTALLDIR value at uninstall time from the install script code.

0 Kudos
varul
Revenera Moderator Revenera Moderator
Revenera Moderator

Hi @agshah ,

  If you want to get installdir value on uninstall, you need to first store the installdir value in some registry while installing the setup.exe

and use another customaction to get the stored value from the registry on uninstall with condition to run only on uninstall.

Please refer below  KB article which explain on how to store installdir in registry,  which is written for major upgrade, however the use case is same.

https://community.flexera.com/t5/InstallShield-Knowledge-Base/Automatically-set-INSTALLDIR-to-the-same-value-for-base-version/ta-p/193597

Please refer a below link which discusses similar issue.

https://stackoverflow.com/questions/33781658/installshield-running-batch-files-during-uninstall-using-installdir-property

0 Kudos