Einzelnen Beitrag anzeigen

generic

Registriert seit: 24. Mär 2004
Ort: bei Hannover
2.416 Beiträge
 
Delphi XE5 Professional
 
#6

Re: MSI Installationsverzeichnis

  Alt 4. Apr 2005, 17:15
schau dir mal im install sdk die dokumentation zu "MsiGetProductInfoEx" an.

"INSTALLPROPERTY_INSTALLLOCATION"


Zitat:
MsiGetProductInfo
The MsiGetProductInfo function returns product information for published and installed products.

UINT MsiGetProductInfo(
LPCTSTR szProduct,
LPCTSTR szProperty,
LPTSTR lpValueBuf,
DWORD* pcchValueBuf
);

Parameters
szProduct
[in] Specifies the product code for the product.
szProperty
[in] Specifies the property to be retrieved. The properties in the following list can only be retrieved from applications that are already installed. Note that required properties are guaranteed to be available, but other properties are available only if that property has been set. See the indicated links to the installer properties for information about how each property is set.Installed properties Meaning
INSTALLPROPERTY_HELPLINK Support link. See ARPHELPLINK property.
INSTALLPROPERTY_HELPTELEPHONE Support telephone. See ARPHELPTELEPHONE property.
INSTALLPROPERTY_INSTALLDATE Installation date.
INSTALLPROPERTY_INSTALLEDPRODUCTNAME Installed product name. See ProductName property.
INSTALLPROPERTY_INSTALLLOCATION Installation location. See ARPINSTALLLOCATION property.
INSTALLPROPERTY_INSTALLSOURCE Installation source. See SourceDir property.
INSTALLPROPERTY_LOCALPACKAGE Local cached package.
INSTALLPROPERTY_PUBLISHER Publisher. See Manufacturer property.
INSTALLPROPERTY_URLINFOABOUT URL information. See ARPURLINFOABOUT property.
INSTALLPROPERTY_URLUPDATEINFO URL update information. See ARPURLUPDATEINFO property.
INSTALLPROPERTY_VERSIONMINOR Minor product version derived from ProductVersion property.
INSTALLPROPERTY_VERSIONMAJOR Major product version derived from ProductVersion property.
INSTALLPROPERTY_VERSIONSTRING Product version. For more information, see ProductVersion property.

To retrieve the product ID, registered owner, or registered company from applications that are already installed, set szProperty to one of the following text string values. Value Description
ProductID The product identifier for the product. See ProductID Property.
RegCompany The company registered to use this product.
RegOwner The owner registered to use this product.



To retrieve the instance type of the product, set szProperty to the following value. This property is available for advertised or installed products.

Value Description
InstanceType A missing value or a value of 0 indicates a normal product installation. A value of 1 indicates a product installed using a multiple instance transform and the MSINEWINSTANCE property. Available with the installer running Windows Server 2003 family or Windows XP SP1. For more information see, Installing Multiple Instances of Products and Patches.


The properties in the following list can also be retrieved from applications that are advertised.

Advertised properties Description
INSTALLPROPERTY_TRANSFORMS Transforms.
INSTALLPROPERTY_LANGUAGE Product language.
INSTALLPROPERTY_PRODUCTNAME Human readable product name. See ProductName property.
INSTALLPROPERTY_ASSIGNMENTTYPE Equals zero (0) if the product is advertised or installed per-user.
Equals one (1) if the product is advertised or installed per-machine for all users.

INSTALLPROPERTY_PACKAGECODE Identifier of the package this product was installed from. For details, see Package Codes.
INSTALLPROPERTY_VERSION Product version derived from ProductVersion property.
INSTALLPROPERTY_PRODUCTICON Primary icon for the package. For details, see ARPPRODUCTICON property.
INSTALLPROPERTY_PACKAGENAME Name of the original installation package.


lpValueBuf
[out] Pointer to a buffer that receives the property value. This parameter can be null.
pcchValueBuf
[in, out] Pointer to a variable that specifies the size, in characters, of the buffer pointed to by the lpValueBuf parameter. On input, this is the full size of the buffer, including a space for a terminating null character. If the buffer passed in is too small, the count returned does not include the terminating null character.
If lpValueBuf is null, pcchValueBuf can be null.

Return Values
Value Meaning
ERROR_BAD_CONFIGURATION The configuration data is corrupt.
ERROR_INVALID_PARAMETER An invalid parameter was passed to the function.
ERROR_MORE_DATA A buffer is too small to hold the requested data.
ERROR_SUCCESS The function completed successfully.
ERROR_UNKNOWN_PRODUCT The product is unadvertised or uninstalled.
ERROR_UNKNOWN_PROPERTY The property is unrecognized.




Remarks
When the MsiGetProductInfo function returns, the pcchValueBuf parameter contains the length of the string stored in the buffer. The count returned does not include the terminating null character. If the buffer is not big enough, MsiGetProductInfo returns ERROR_MORE_DATA, and MsiGetProductInfo contains the size of the string, in characters, without counting the null character.

MsiGetProductInfo(INSTALLPROPERTY_LOCALPACKAGE) does not necessarily return a path to the cached package. The cached package is for internal use only. Maintenance mode installations should be invoked through the MsiConfigureFeature, MsiConfigureProduct, or MsiConfigureProductEx functions.

Requirements
Client: Requires Windows XP, Windows 2000 Professional, or Windows Me.
Server: Requires Windows Server 2003 or Windows 2000 Server.
Redistributable: Requires Windows Installer 1.0 or later on Windows NT 4.0 SP3 and Windows 98/95.
Unicode: Implemented as MsiGetProductInfoW(Unicode) and MsiGetProductInfoA(ANSI).
Header: Declared in Msi.h.
Library: Use Msi.lib.
DLL: msi.dll
  Mit Zitat antworten Zitat