Hallo,
ich möchte vom Adobe Reader die Version feststellen.
Problem bei der ersten Variante (Registry->GUID) war, dass nicht jede Version den Wert verändert hat. Folglich würde bspw. immer eine alte Version festgestellt und ein kleiner Patch installiert werden, da meldet es sich mit bereits installiert oder sonstigen Fehlern.
Wie genau der es sonst feststellt weiß ich nicht, laut
blogs.adobe.com/dmcm...stration.pdf#page=25
gibt es noch folgende Möglichkeit:
1.7.3 MSI API
For 10.x product versions, you can use the MSI API to determine the product version. To use the MSI API,
use the MsiEnumRelatedProducts() and MsiGetProductInfo() as shown in Example 1.5.
For more information about these APIs, see
msdn.microsoft.com/e...aa370130(VS.85).aspx
Example 1.5: Product version via MSI API
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40:
| //UpgradeCode is a family of ProductCodes //ProductCode property is what you need to get installed Product Info void GetProductInfo() { /* Reader 7.0.5 {AC76BA86-7AD7-1033-7B44-A70500000002} Acrobat 7.0.1 and Reader 7.0.1 Update {AC76BA86-0000-7EC8-7489-000000000702} Acrobat 7.0.2 and Reader 7.0.2 Update {AC76BA86-0000-7EC8-7489-000000000703} Acrobat 7.0.3 and Reader 7.0.3 Update {AC76BA86-0000-7EC8-7489-000000000704} Acrobat 7.0.5 and Reader 7.0.5 Update Use the product ID 7.0 listed above Adobe Acrobat 7.0.7 and Reader 7.0.7 update {AC76BA86-1033-F400-7760-100000000002} Adobe Acrobat 7.0.8 and Reader 7.0.8 update {AC76BA86-1033-0000-7760-100000000002} Table 8 Example GUIDs Product GUID Trial Acrobat installations 2/8/12: Enterprise Administration for the Acrobat Family of Products 30 */ CString sUpgrdCode = _T("{A6EADE66-0000-0000-484E-7E8A45000000}");//All Reader installers (any version) have the same UpgradeCode //UpgradeCodes for Acrobat - these values do not change //APEX {AC76BA86-0000-0000-7761-7E8A45000000}; //Pro {AC76BA86-0000-0000-7760-7E8A45000000}; //Std {AC76BA86-0000-0000-BA7E-7E8A45000000}; CString sProdCode; DWORD dw = ERROR_SUCCESS; for(int index = 0; dw == ERROR_SUCCESS; index++) { dw = MsiEnumRelatedProducts(sUpgrdCode, 0, index, sProdCode.GetBuffer(MAX_PATH)); sProdCode.ReleaseBuffer(); if(dw == ERROR_SUCCESS) { UINT ret; TCHAR sVersionString[MAX_PATH] = {0}, sVerMajor[MAX_PATH] = {0}; DWORD dwSize = 10; ret = MsiGetProductInfo(sProdCode, INSTALLPROPERTY_VERSIONMAJOR, sVerMajor, &dwSize); //ret = MsiGetProductInfo(sProdCode, INSTALLPROPERTY_VERSIONSTRING, sVersionString, &dwSize); } } } |
wie ich diesen Code bzw. mit welchem Programm verwende weiß ich nicht.
Was genau passiert hier und wie komme ich damit ans Ziel?
Danke.
Moderiert von
Th69: Code-Tags hinzugefügt