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

Get TARGETDIR?


5 replies to this topic

Peptron

Peptron
  • Members
  • 4 posts

Posted 18 October 2004 - 19:02

Is there a way to get the TARGETDIR in an MSI?

My TARGETDIR is not set when I call the MSI. It is in it as a default when we click on it. When it asks where to install the product, there is already a default directory. How can I find that information in the MSI? And is it the TARGETDIR or it has an another name?


I've found that we can get that information by opening the file in an Hex Editor, but that's not the most "clean" method I know, and I would like to know if I can do that with the API.

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 19 October 2004 - 09:08

You could open the MSI file (with Orca for instance) and examine the Component table to see where the components will be installed. You may also want to look at the directory table. Ususally the name is either TARGETDIR or INSTALLDIR. You can then set this directory on the command line.

Peptron

Peptron
  • Members
  • 4 posts

Posted 19 October 2004 - 20:44

Ok, I think I didn't express myself too well... (English is not my first language)

What I mean is that we do not call the MSI from the command line. We call it simply by clicking on it, in say, Windows Explorer.

When the install starts, an install wizard asks where to install. There is ALREADY a value in that field. How can I get that value using the API?
(I can see that value by opening the MSI in an Hex Editor.)

Peptron

Peptron
  • Members
  • 4 posts

Posted 20 October 2004 - 19:21

In that image, what I want to get is the value of the "Répertoire Virtuel" (Virtual Directory) field. The value is there by default the second the msi is clicked.
I can find it by opening the file in hexadecimal, but it is never at the same place, so I can't use a fixed adress to find it, and since there are other directories as well in the file, I can't tell them apart.

Is there a way to get that value with the API?

Attached Images

  • MSITARGET.jpg


Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 21 October 2004 - 10:31

an MSI file is a relational database. You can open it with orca to find out in which table that value is stored. then you can modify the database either manually with Orca, or by running SQL commands against the database.

Peptron

Peptron
  • Members
  • 4 posts

Posted 21 October 2004 - 15:04

Thank you, I finally found it!

It's in the table "CustomAction".

There will be a row with the action "WEBCA_TARGETVDIR" or "DIRCA_TARGETDIR" depending if it is a network/web installation or a local installation.

So I can do
"SELECT Target FROM CustomAction WHERE Action = 'WEBCA_TARGETVDIR'"
or
"SELECT Target FROM CustomAction WHERE Action = 'DIRCA_TARGETDIR'"
to get the info I was looking for.