diff --git a/dlls/msi/automation.c b/dlls/msi/automation.c index 0b631acad6b..dc94cbc3459 100644 --- a/dlls/msi/automation.c +++ b/dlls/msi/automation.c @@ -30,6 +30,7 @@ #include "msipriv.h" #include "activscp.h" #include "oleauto.h" +#include "shlwapi.h" #include "wine/debug.h" #include "wine/unicode.h" @@ -1648,6 +1649,26 @@ static HRESULT WINAPI InstallerImpl_Invoke( else return DISP_E_MEMBERNOTFOUND; break; + case DISPID_INSTALLER_VERSION: + if (wFlags & DISPATCH_PROPERTYGET) { + DLLVERSIONINFO verinfo; + WCHAR version[MAX_PATH]; + + static const WCHAR format[] = {'%','d','.','%','d','.','%','d','.','%','d',0}; + + verinfo.cbSize = sizeof(DLLVERSIONINFO); + hr = DllGetVersion(&verinfo); + if (FAILED(hr)) return hr; + + sprintfW(version, format, verinfo.dwMajorVersion, verinfo.dwMinorVersion, + verinfo.dwBuildNumber, verinfo.dwPlatformID); + + V_VT(pVarResult) = VT_BSTR; + V_BSTR(pVarResult) = SysAllocString(version); + } + else return DISP_E_MEMBERNOTFOUND; + break; + case DISPID_INSTALLER_REGISTRYVALUE: if (wFlags & DISPATCH_METHOD) { HKEY hkey; diff --git a/dlls/msi/msiserver.idl b/dlls/msi/msiserver.idl index 1c462ecf5a0..317a3acac82 100644 --- a/dlls/msi/msiserver.idl +++ b/dlls/msi/msiserver.idl @@ -145,6 +145,8 @@ library WindowsInstaller void InstallProduct( [in] BSTR PackagePath, [in, optional, defaultvalue("0")] BSTR PropertyValues); + [id(DISPID_INSTALLER_VERSION)] + BSTR Version(); [id(DISPID_INSTALLER_REGISTRYVALUE), propget] BSTR RegistryValue( [in] VARIANT Root, diff --git a/dlls/msi/msiserver_dispids.h b/dlls/msi/msiserver_dispids.h index 8d673dd4cc1..afbadbba5db 100644 --- a/dlls/msi/msiserver_dispids.h +++ b/dlls/msi/msiserver_dispids.h @@ -20,6 +20,7 @@ #define DISPID_INSTALLER_OPENPACKAGE 2 #define DISPID_INSTALLER_OPENDATABASE 4 #define DISPID_INSTALLER_INSTALLPRODUCT 8 +#define DISPID_INSTALLER_VERSION 9 #define DISPID_INSTALLER_REGISTRYVALUE 11 #define DISPID_INSTALLER_PRODUCTSTATE 17 #define DISPID_INSTALLER_PRODUCTINFO 18 diff --git a/dlls/msi/tests/automation.c b/dlls/msi/tests/automation.c index 269d17c3502..90e4b1f62b0 100644 --- a/dlls/msi/tests/automation.c +++ b/dlls/msi/tests/automation.c @@ -475,8 +475,8 @@ static void test_dispid(void) ok( get_dispid( pInstaller, "EnableLog" ) == 7, "dispid wrong\n"); } ok( get_dispid( pInstaller, "InstallProduct" ) == 8, "dispid wrong\n"); - todo_wine { ok( get_dispid( pInstaller, "Version" ) == 9, "dispid wrong\n"); + todo_wine { ok( get_dispid( pInstaller, "LastErrorRecord" ) == 10, "dispid wrong\n"); } ok( get_dispid( pInstaller, "RegistryValue" ) == 11, "dispid wrong\n"); @@ -2379,11 +2379,9 @@ static void test_Installer(void) } /* Installer::Version */ - todo_wine { - memset(szPath, 0, sizeof(szPath)); - hr = Installer_VersionGet(szPath); - ok(hr == S_OK, "Installer_VersionGet failed, hresult 0x%08x\n", hr); - } + memset(szPath, 0, sizeof(szPath)); + hr = Installer_VersionGet(szPath); + ok(hr == S_OK, "Installer_VersionGet failed, hresult 0x%08x\n", hr); /* Installer::InstallProduct and other tests that depend on our product being installed */ test_Installer_InstallProduct();