Commit c18b7755 authored by James Hawkins's avatar James Hawkins Committed by Alexandre Julliard

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

parent 24ede2f9
...@@ -3242,12 +3242,17 @@ static UINT ACTION_PublishProduct(MSIPACKAGE *package) ...@@ -3242,12 +3242,17 @@ static UINT ACTION_PublishProduct(MSIPACKAGE *package)
/* for registry stuff */ /* for registry stuff */
HKEY hkey=0; HKEY hkey=0;
HKEY hukey=0; HKEY hukey=0;
HKEY hudkey=0, props=0;
static const WCHAR szProductLanguage[] = static const WCHAR szProductLanguage[] =
{'P','r','o','d','u','c','t','L','a','n','g','u','a','g','e',0}; {'P','r','o','d','u','c','t','L','a','n','g','u','a','g','e',0};
static const WCHAR szARPProductIcon[] = static const WCHAR szARPProductIcon[] =
{'A','R','P','P','R','O','D','U','C','T','I','C','O','N',0}; {'A','R','P','P','R','O','D','U','C','T','I','C','O','N',0};
static const WCHAR szProductVersion[] = static const WCHAR szProductVersion[] =
{'P','r','o','d','u','c','t','V','e','r','s','i','o','n',0}; {'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; DWORD langid;
LPWSTR buffer; LPWSTR buffer;
DWORD size; DWORD size;
...@@ -3272,6 +3277,15 @@ static UINT ACTION_PublishProduct(MSIPACKAGE *package) ...@@ -3272,6 +3277,15 @@ static UINT ACTION_PublishProduct(MSIPACKAGE *package)
if (rc != ERROR_SUCCESS) if (rc != ERROR_SUCCESS)
goto end; 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 ); buffer = msi_dup_property( package, INSTALLPROPERTY_PRODUCTNAMEW );
msi_reg_set_val_str( hukey, INSTALLPROPERTY_PRODUCTNAMEW, buffer ); msi_reg_set_val_str( hukey, INSTALLPROPERTY_PRODUCTNAMEW, buffer );
...@@ -3335,9 +3349,10 @@ static UINT ACTION_PublishProduct(MSIPACKAGE *package) ...@@ -3335,9 +3349,10 @@ static UINT ACTION_PublishProduct(MSIPACKAGE *package)
} }
end: end:
RegCloseKey(hkey); RegCloseKey(hkey);
RegCloseKey(hukey); RegCloseKey(hukey);
RegCloseKey(hudkey);
RegCloseKey(props);
return rc; return rc;
} }
......
...@@ -2110,10 +2110,7 @@ static void test_Installer_InstallProduct(LPCWSTR szPath) ...@@ -2110,10 +2110,7 @@ static void test_Installer_InstallProduct(LPCWSTR szPath)
/* Installer::ProductState for our product code, which has been installed */ /* Installer::ProductState for our product code, which has been installed */
hr = Installer_ProductState(szProductCode, &iValue); hr = Installer_ProductState(szProductCode, &iValue);
ok(hr == S_OK, "Installer_ProductState failed, hresult 0x%08x\n", hr); 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 */ /* Installer::ProductInfo for our product code */
...@@ -2218,7 +2215,7 @@ static void test_Installer_InstallProduct(LPCWSTR szPath) ...@@ -2218,7 +2215,7 @@ static void test_Installer_InstallProduct(LPCWSTR szPath)
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); 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); 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) if (res == ERROR_SUCCESS)
{ {
res = delete_registry_key(hkey, "05FA3C1F65B896A40AC00077F34EF203"); res = delete_registry_key(hkey, "05FA3C1F65B896A40AC00077F34EF203");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment