cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
bornali
Level 5

Retrieving value of a property during uninstall but set in UI install

Hi,

I am using basic MSI and i have a function below which runs as CA during uninstall (with condition REMOVE~="ALL" ).

function removeAllInstalledFiles(hMsi)
STRING sFunction, svDir, svWarDir, warfile, unwarfolder;
NUMBER nvSize, returnVal;
begin
sFunction= "removeAllInstalledFiles() " ;
nvSize=256;
MsiGetProperty (hMsi, "TOMCATAPP_INSTALL_DIR", svDir, nvSize);
svWarDir=svDir^"webapps";
warfile="reports.war";
unwarfolder="reports" ;
DeleteFile(svWarDir^warfile);
DeleteDir(svWarDir^unwarfolder, ALLCONTENTS);
DeleteDir(INSTALLDIR^"SRV"^"Reports", ALLCONTENTS);
DeleteFile(INSTALLDIR^"SRV"^PROP_FILE);
end;

During installation, the property TOMCATAPP_INSTALL_DIR gets filled properly to whatever the user chooses during UI installation. This is the path to where tomcat is installed.
But during uninstall, this property holds only the default value from property manager (not the one user had entered in the dialogue, say using 'change folder'). So i am unable to get the actual value of TOMCATAPP_INSTALL_DIR, which results in (the first) DeleteFile and DeleteDir not working.

How can i retrieve the value of a property during uninstall that was filled during installation?

Thank you in advance.
Labels (1)
0 Kudos
(5) Replies
Holger_G
Level 10

Not sure but have you tried to remove the property from the Property Manager.
0 Kudos
DebbieL
Level 17

0 Kudos
bornali
Level 5

thanks. The link does not work by cliking on it, but does work if you copy and paste it to a browser.
0 Kudos
Holger_G
Level 10

bornali wrote:
Holger,

I need the property to be defined in the property manager so that it can be used during installation.
This property is set to a default value so that when the user gets to the dialogue, it displays 'C:\apache-tomcat-6.0.18' as installation dir for tomcat, but if they choose to select some other directory because tomcat might be installed somewhere else for them, then they can use the 'change' button to select the path. This path is set as value for TOMCATAPP_INSTALL_DIR , which i use to install some files in this path.
So now during uninstall, i need to retrieve the exact path that the user selected, so that i can remove these same files.

thanks


I see, then you should follow the tip that Debbie mentioned previously.
0 Kudos
DebbieL
Level 17

Can you please provide the link again, this one does not seem to work. On acresso site, it says the page may have a new address. I was unable to find anything in search for the PropUninst.pdf.


Can you try the link again? I don't see the same error when I try clicking the link.

As an alternative, maybe you could try navigating to the PDF file this way:
[LIST=1]
  • Visit http://www.acresso.com/.
  • Click the InstallShield button in the right column.
  • Click the Resources tab.
  • Click the Tips & Tricks tab.
  • Click the link for Saving MSI property values to make them available after the initial installation.
  • 0 Kudos