Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

INSTALLDIR of an installed product


3 replies to this topic

Ajawl

Ajawl
  • Members
  • 54 posts

Posted 12 February 2002 - 15:15

I am doing a Major Upgrade in my setup.
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


Ian Blake

Ian Blake
  • Members
  • 483 posts

Posted 12 February 2002 - 15:50

A little thought and you will realise that products are not associated with directories.  On the other hand components are installed to a particular directory.  

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.


Ajawl

Ajawl
  • Members
  • 54 posts

Posted 14 February 2002 - 08:55

Hi Ian Blake,
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

Ian Blake

Ian Blake
  • Members
  • 483 posts

Posted 14 February 2002 - 10:00

In a C/C++ DLL you need to add the line
#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.