James Hawkins : msi: Set the WindowsInstaller value of the UserData product key when publishing the product .

Alexandre Julliard julliard at wine.codeweavers.com
Wed Jun 27 09:11:23 CDT 2007


Module: wine
Branch: master
Commit: c18b77557d60017ef3f3c2eea5782bae17126006
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=c18b77557d60017ef3f3c2eea5782bae17126006

Author: James Hawkins <truiken at gmail.com>
Date:   Tue Jun 26 19:22:46 2007 -0700

msi: Set the WindowsInstaller value of the UserData product key when publishing the product.

---

 dlls/msi/action.c           |   17 ++++++++++++++++-
 dlls/msi/tests/automation.c |    7 ++-----
 2 files changed, 18 insertions(+), 6 deletions(-)

diff --git a/dlls/msi/action.c b/dlls/msi/action.c
index a6677bd..b550e54 100644
--- a/dlls/msi/action.c
+++ b/dlls/msi/action.c
@@ -3242,12 +3242,17 @@ static UINT ACTION_PublishProduct(MSIPACKAGE *package)
     /* for registry stuff */
     HKEY hkey=0;
     HKEY hukey=0;
+    HKEY hudkey=0, props=0;
     static const WCHAR szProductLanguage[] =
         {'P','r','o','d','u','c','t','L','a','n','g','u','a','g','e',0};
     static const WCHAR szARPProductIcon[] =
         {'A','R','P','P','R','O','D','U','C','T','I','C','O','N',0};
     static const WCHAR szProductVersion[] =
         {'P','r','o','d','u','c','t','V','e','r','s','i','o','n',0};
+    static const WCHAR szInstallProperties[] =
+        {'I','n','s','t','a','l','l','P','r','o','p','e','r','t','i','e','s',0};
+    static const WCHAR szWindowsInstaller[] =
+        {'W','i','n','d','o','w','s','I','n','s','t','a','l','l','e','r',0};
     DWORD langid;
     LPWSTR buffer;
     DWORD size;
@@ -3272,6 +3277,15 @@ static UINT ACTION_PublishProduct(MSIPACKAGE *package)
     if (rc != ERROR_SUCCESS)
         goto end;
 
+    rc = MSIREG_OpenUserDataProductKey(package->ProductCode,&hudkey,TRUE);
+    if (rc != ERROR_SUCCESS)
+        goto end;
+
+    rc = RegCreateKeyW(hudkey, szInstallProperties, &props);
+    if (rc != ERROR_SUCCESS)
+        goto end;
+
+    msi_reg_set_val_dword( props, szWindowsInstaller, 1 );
 
     buffer = msi_dup_property( package, INSTALLPROPERTY_PRODUCTNAMEW );
     msi_reg_set_val_str( hukey, INSTALLPROPERTY_PRODUCTNAMEW, buffer );
@@ -3335,9 +3349,10 @@ static UINT ACTION_PublishProduct(MSIPACKAGE *package)
     }
 
 end:
-
     RegCloseKey(hkey);
     RegCloseKey(hukey);
+    RegCloseKey(hudkey);
+    RegCloseKey(props);
 
     return rc;
 }
diff --git a/dlls/msi/tests/automation.c b/dlls/msi/tests/automation.c
index 84c3627..0189062 100644
--- a/dlls/msi/tests/automation.c
+++ b/dlls/msi/tests/automation.c
@@ -2110,10 +2110,7 @@ static void test_Installer_InstallProduct(LPCWSTR szPath)
     /* Installer::ProductState for our product code, which has been installed */
     hr = Installer_ProductState(szProductCode, &iValue);
     ok(hr == S_OK, "Installer_ProductState failed, hresult 0x%08x\n", hr);
-    todo_wine
-    {
-        ok(iValue == INSTALLSTATE_DEFAULT, "Installer_ProductState returned %d, expected %d\n", iValue, INSTALLSTATE_DEFAULT);
-    }
+    ok(iValue == INSTALLSTATE_DEFAULT, "Installer_ProductState returned %d, expected %d\n", iValue, INSTALLSTATE_DEFAULT);
 
     /* Installer::ProductInfo for our product code */
 
@@ -2218,7 +2215,7 @@ static void test_Installer_InstallProduct(LPCWSTR szPath)
     ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
 
     res = find_registry_key(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData", "05FA3C1F65B896A40AC00077F34EF203", &hkey);
-    todo_wine ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
+    ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
     if (res == ERROR_SUCCESS)
     {
         res = delete_registry_key(hkey, "05FA3C1F65B896A40AC00077F34EF203");




More information about the wine-cvs mailing list