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

Change in Directory during installation


4 replies to this topic

its_me

its_me
  • Members
  • 19 posts

Posted 10 February 2005 - 11:24

I have on msi in which i can change the directory fromt he deafult INSTALLDIR.
during installation of this msi, i will be changing the default INSTALLDIR and i want to get this directory path from another ism.
I cannot write to teh registry the path from the msi.
I tried using VB script to open the first msi and get the INSTALLDIR ans also the Component destination path but it is returning the default INSTALLDIR and not the modified path..

Is there anyway i can get this new path

Taco Bell

Taco Bell

    IS6 Expert

  • Moderators
  • 1,281 posts

Posted 10 February 2005 - 15:30

You probably could manually modify e the MSI install by opening it in an MSI install editor like Orca.

However, I'm not sure as this isn't really an InstallScript question, so ... **moving topic**


user posted image

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 10 February 2005 - 16:57

Not sure if that is your question, but you can write the value of INSTALLDIR to registry by setting up a registry entry with value [INSTALLDIR].

MikeBergman

MikeBergman
  • Members
  • 27 posts

Posted 10 February 2005 - 22:00

Using the Windows API you can call MsiGetProductInfo to get various properties such as the location of the installation, but you have to know tht product code of the target:

CODE
TCHAR szYourVersion[MAX_PATH];
DWORD dwBuffer = MAX_PATH;
UINT uResult = ::MsiGetProductInfo( pszProductCode, INSTALLPROPERTY_INSTALLLOCATION, szLocation, &dwLocationBuffer ) ;


You can find MsiGetProductInfo in the platform sdk under "Installer Function Reference"

Offhand, I don't know how you would do this in script.



Michael Bergman
LumenVox LLC

mandy

mandy
  • Members
  • 121 posts

Posted 10 February 2005 - 22:06

In vbscript it would look like this:

Const sPRODCODE = "{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}"

Set oInst = CreateObject("WindowsInstaller.Installer")

msgbox oInst.ProductInfo(sPRODCODE, "InstallLocation")

Set oInst = Nothing