INSTALLDIR of an installed product
Posted 12 February 2002 - 15:15
The new version is going to be installed in a new directory and I need to copy some files from the old version.
How can I know, where was installed the old version (since the user could install the old version in any directory) ?
Can I do some kind of search with the old Product-Code?
Thanks a lot,
Ajawl
Posted 12 February 2002 - 15:50
So select a component that is certain to be installed to the old INSTALLDIR and use the COMPLOCATOR/APPSEARCH tables or MsiLocateComponent in a CA to find the old component.
Posted 14 February 2002 - 08:55
Thank you very much for your help.
I have used the COMPLOCATOR/APPSEARCH tables to find the component.
But, How can I use MsiLocateComponent in a CA? I have never used this kind of CA.
Thank you again,
Ajawl
Posted 14 February 2002 - 10:00
#include "msi.h"
which defines many of the msi functions. (If you are using the database functions you also need msiquery.h). You also need to tell the linker to search "msi.lib". You can then use the MsiXXX functions and definitions like any other routine.
These functions can also be called from VBS or InstallScript but I do know the details.
If you have the product code then it is better to use MsiGetComponentPath because MsiLocateComponent may not choose the correct product if it exists in more than one product.
The most of the MsiXXXX functions are documented in the msi documentation.