Using MsiGetProductInfo to get installation path
Posted 27 September 2002 - 08:31
I try to increase the buffer lenght but it has no effect ??
iState = MsiGetProductInfo(
"{C01A0196-D15D-11D6-8071-0050DA398C60}", INSTALLPROPERTY_INSTALLLOCATION,
szValueBuf,
iValueCount);
Thank you for your help.
Annie.
Posted 27 September 2002 - 10:08
Stefan Krüger
InstallSite.org twitter facebook
Posted 27 September 2002 - 10:39
Stefan Krüger
InstallSite.org twitter facebook
Posted 27 September 2002 - 12:36
But the function returns 0 in the buffer size ?!?
I put the function call in the maintenance mode to get the previous installation path when modifying installation.
Do you have an idea ??
Thank you.
Annie.
Posted 27 September 2002 - 13:32
Stefan Krüger
InstallSite.org twitter facebook
Posted 27 September 2002 - 14:12
Annie.
Posted 19 November 2003 - 14:00
I have the same problem:
DWORD bufLen = MAX_PATH;
LPTSTR pBuff = m_strRootPath.GetBuffer(bufLen);
if (pBuff!=NULL)
{
UINT retCode = MsiGetProductInfo(m_strProdCode,
INSTALLPROPERTY_INSTALLLOCATION,
pBuff,&bufLen);
After executing this code:
retCode = 0 (ERROR_SUCCESS)
bufLen = 0
pBuff = ""
Other properties works OK with this code
What's wrong ? Isn't something changed since the last post (about a year ago)
Is there some other method of getting the product path?
Thank you,
Valery
Posted 19 November 2003 - 15:38
The function MsiGetProductInfo returns info from the following registry key:
HKLM\Software\Microsoft\Windows\CurrentVersion\Installer\UserData\S-x-x-x\Products\<Package code>\InstalProperties\
The registry value "InstallLocation" was empty when I tryed to get the install path with MsiGetProductInfo. I typed manually some letters to this value and - oops ! I got these letters in my program
Searching info for this topic I found some considerations about that:
Someone tells that this value must be explicitly set during the last installation stage by using scripts...
Anyway, its seems to be a good solution to place the installation path as the registry value under
HKLM\Software\[Manufacturer]\[ProductCode] = [INSTALLDIR]
Posted 20 November 2003 - 09:05
Stefan Krüger
InstallSite.org twitter facebook
Posted 20 November 2003 - 09:42
MSDN tells about this propery:
"Typically needs to be set by a custom action"
Edited by vips, 20 November 2003 - 09:44.
Posted 20 November 2003 - 09:51
Stefan Krüger
InstallSite.org twitter facebook
Posted 20 November 2003 - 10:32
I've tested InstallShield Developer 8.0 - it puts this property automaticaly though even don't show it in the property table
Posted 20 November 2003 - 12:03
Stefan Krüger
InstallSite.org twitter facebook