This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: Retrieving value of a property during uninstall but set in UI install
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 11, 2009
11:11 PM
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.
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.
(5) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 12, 2009
08:44 AM
Not sure but have you tried to remove the property from the Property Manager.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 12, 2009
09:49 AM
Perhaps this tip (PDF) will help:
http://www.acresso.com/webdocuments/PDF/MsiPropUninst.pdf
http://www.acresso.com/webdocuments/PDF/MsiPropUninst.pdf
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 12, 2009
06:09 PM
thanks. The link does not work by cliking on it, but does work if you copy and paste it to a browser.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 13, 2009
01:15 AM
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.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 13, 2009
07:50 AM
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]