winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
July 2007
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
3 participants
957 discussions
Start a n
N
ew thread
James Hawkins : msi: Add tests for MsiQueryFeatureState.
by Alexandre Julliard
03 Jul '07
03 Jul '07
Module: wine Branch: master Commit: ceb4e6d4ef0e7ae7950783254c438595df967e1a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ceb4e6d4ef0e7ae7950783254…
Author: James Hawkins <truiken(a)gmail.com> Date: Mon Jul 2 20:22:29 2007 -0700 msi: Add tests for MsiQueryFeatureState. --- dlls/msi/tests/msi.c | 213 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 213 insertions(+), 0 deletions(-) diff --git a/dlls/msi/tests/msi.c b/dlls/msi/tests/msi.c index 2aee5e1..72713c1 100644 --- a/dlls/msi/tests/msi.c +++ b/dlls/msi/tests/msi.c @@ -450,6 +450,218 @@ static void test_MsiQueryProductState(void) RegCloseKey(props); } +static const char table_enc85[] = +"!$%&'()*+,-.0123456789=?@ABCDEFGHIJKLMNO" +"PQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwx" +"yz{}~"; + +/* + * Encodes a base85 guid given a GUID pointer + * Caller should provide a 21 character buffer for the encoded string. + * + * returns TRUE if successful, FALSE if not + */ +static BOOL encode_base85_guid( GUID *guid, LPWSTR str ) +{ + unsigned int x, *p, i; + + p = (unsigned int*) guid; + for( i=0; i<4; i++ ) + { + x = p[i]; + *str++ = table_enc85[x%85]; + x = x/85; + *str++ = table_enc85[x%85]; + x = x/85; + *str++ = table_enc85[x%85]; + x = x/85; + *str++ = table_enc85[x%85]; + x = x/85; + *str++ = table_enc85[x%85]; + } + *str = 0; + + return TRUE; +} + +static void compose_base85_guid(LPSTR component, LPSTR comp_base85, LPSTR squashed) +{ + WCHAR guidW[MAX_PATH]; + WCHAR base85W[MAX_PATH]; + WCHAR squashedW[MAX_PATH]; + GUID guid; + HRESULT hr; + int size; + + hr = CoCreateGuid(&guid); + ok(hr == S_OK, "Expected S_OK, got %d\n", hr); + + size = StringFromGUID2(&guid, (LPOLESTR)guidW, MAX_PATH); + ok(size == 39, "Expected 39, got %d\n", hr); + + WideCharToMultiByte(CP_ACP, 0, guidW, size, component, MAX_PATH, NULL, NULL); + encode_base85_guid(&guid, base85W); + WideCharToMultiByte(CP_ACP, 0, base85W, -1, comp_base85, MAX_PATH, NULL, NULL); + squash_guid(guidW, squashedW); + WideCharToMultiByte(CP_ACP, 0, squashedW, -1, squashed, MAX_PATH, NULL, NULL); +} + +static void test_MsiQueryFeatureState(void) +{ + HKEY userkey, localkey, compkey; + CHAR prodcode[MAX_PATH]; + CHAR prod_squashed[MAX_PATH]; + CHAR component[MAX_PATH]; + CHAR comp_base85[MAX_PATH]; + CHAR comp_squashed[MAX_PATH]; + CHAR keypath[MAX_PATH*2]; + INSTALLSTATE state; + LPSTR usersid; + LONG res; + + create_test_guid(prodcode, prod_squashed); + compose_base85_guid(component, comp_base85, comp_squashed); + get_user_sid(&usersid); + + /* NULL prodcode */ + state = MsiQueryFeatureStateA(NULL, "feature"); + ok(state == INSTALLSTATE_INVALIDARG, "Expected INSTALLSTATE_INVALIDARG, got %d\n", state); + + /* empty prodcode */ + state = MsiQueryFeatureStateA("", "feature"); + ok(state == INSTALLSTATE_INVALIDARG, "Expected INSTALLSTATE_INVALIDARG, got %d\n", state); + + /* garbage prodcode */ + state = MsiQueryFeatureStateA("garbage", "feature"); + ok(state == INSTALLSTATE_INVALIDARG, "Expected INSTALLSTATE_INVALIDARG, got %d\n", state); + + /* guid without brackets */ + state = MsiQueryFeatureStateA("6700E8CF-95AB-4D9C-BC2C-15840DEA7A5D", "feature"); + ok(state == INSTALLSTATE_INVALIDARG, "Expected INSTALLSTATE_INVALIDARG, got %d\n", state); + + /* guid with brackets */ + state = MsiQueryFeatureStateA("{6700E8CF-95AB-4D9C-BC2C-15840DEA7A5D}", "feature"); + ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state); + + /* same length as guid, but random */ + state = MsiQueryFeatureStateA("A938G02JF-2NF3N93-VN3-2NNF-3KGKALDNF93", "feature"); + ok(state == INSTALLSTATE_INVALIDARG, "Expected INSTALLSTATE_INVALIDARG, got %d\n", state); + + /* NULL szFeature */ + state = MsiQueryFeatureStateA(prodcode, NULL); + ok(state == INSTALLSTATE_INVALIDARG, "Expected INSTALLSTATE_INVALIDARG, got %d\n", state); + + /* empty szFeature */ + state = MsiQueryFeatureStateA(prodcode, ""); + ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state); + + /* feature key does not exist yet */ + state = MsiQueryFeatureStateA(prodcode, "feature"); + ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state); + + lstrcpyA(keypath, "Software\\Microsoft\\Installer\\Features\\"); + lstrcatA(keypath, prod_squashed); + + res = RegCreateKeyA(HKEY_CURRENT_USER, keypath, &userkey); + ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); + + /* feature key exists */ + state = MsiQueryFeatureStateA(prodcode, "feature"); + ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state); + + res = RegSetValueExA(userkey, "feature", 0, REG_SZ, (const BYTE *)"", 8); + ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); + + state = MsiQueryFeatureStateA(prodcode, "feature"); + todo_wine + { + ok(state == INSTALLSTATE_ADVERTISED, "Expected INSTALLSTATE_ADVERTISED, got %d\n", state); + } + + lstrcpyA(keypath, "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\"); + lstrcatA(keypath, usersid); + lstrcatA(keypath, "\\Products\\"); + lstrcatA(keypath, prod_squashed); + lstrcatA(keypath, "\\Features"); + + res = RegCreateKeyA(HKEY_LOCAL_MACHINE, keypath, &localkey); + ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); + + state = MsiQueryFeatureStateA(prodcode, "feature"); + todo_wine + { + ok(state == INSTALLSTATE_ADVERTISED, "Expected INSTALLSTATE_ADVERTISED, got %d\n", state); + } + + res = RegSetValueExA(localkey, "feature", 0, REG_SZ, (const BYTE *)"aaaaaaaaaaaaaaaaaaa", 20); + ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); + + state = MsiQueryFeatureStateA(prodcode, "feature"); + todo_wine + { + ok(state == INSTALLSTATE_BADCONFIG, "Expected INSTALLSTATE_BADCONFIG, got %d\n", state); + } + + res = RegSetValueExA(localkey, "feature", 0, REG_SZ, (const BYTE *)"aaaaaaaaaaaaaaaaaaaa", 21); + ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); + + state = MsiQueryFeatureStateA(prodcode, "feature"); + todo_wine + { + ok(state == INSTALLSTATE_ADVERTISED, "Expected INSTALLSTATE_ADVERTISED, got %d\n", state); + } + + res = RegSetValueExA(localkey, "feature", 0, REG_SZ, (const BYTE *)"aaaaaaaaaaaaaaaaaaaaa", 22); + ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); + + state = MsiQueryFeatureStateA(prodcode, "feature"); + todo_wine + { + ok(state == INSTALLSTATE_ADVERTISED, "Expected INSTALLSTATE_ADVERTISED, got %d\n", state); + } + + res = RegSetValueExA(localkey, "feature", 0, REG_SZ, (const BYTE *)comp_base85, 21); + ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); + + state = MsiQueryFeatureStateA(prodcode, "feature"); + todo_wine + { + ok(state == INSTALLSTATE_ADVERTISED, "Expected INSTALLSTATE_ADVERTISED, got %d\n", state); + } + + lstrcpyA(keypath, "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\"); + lstrcatA(keypath, usersid); + lstrcatA(keypath, "\\Components\\"); + lstrcatA(keypath, comp_squashed); + + res = RegCreateKeyA(HKEY_LOCAL_MACHINE, keypath, &compkey); + ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); + + state = MsiQueryFeatureStateA(prodcode, "feature"); + todo_wine + { + ok(state == INSTALLSTATE_ADVERTISED, "Expected INSTALLSTATE_ADVERTISED, got %d\n", state); + } + + res = RegSetValueExA(compkey, prod_squashed, 0, REG_SZ, (const BYTE *)"", 1); + ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); + + state = MsiQueryFeatureStateA(prodcode, "feature"); + todo_wine + { + ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state); + } + + RegDeleteValueA(compkey, prod_squashed); + RegDeleteValueA(compkey, ""); + RegDeleteValueA(localkey, "feature"); + RegDeleteValueA(userkey, "feature"); + RegDeleteKeyA(userkey, ""); + RegCloseKey(compkey); + RegCloseKey(localkey); + RegCloseKey(userkey); +} + START_TEST(msi) { HMODULE hmod = GetModuleHandle("msi.dll"); @@ -469,4 +681,5 @@ START_TEST(msi) test_getcomponentpath(); test_filehash(); test_MsiQueryProductState(); + test_MsiQueryFeatureState(); }
1
0
0
0
James Hawkins : msi: Set the WindowsInstaller value in RegisterProduct instead of PublishProduct .
by Alexandre Julliard
03 Jul '07
03 Jul '07
Module: wine Branch: master Commit: 0e44e090c591f485776c7e3898dec5a9e7296f85 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0e44e090c591f485776c7e389…
Author: James Hawkins <truiken(a)gmail.com> Date: Mon Jul 2 20:21:58 2007 -0700 msi: Set the WindowsInstaller value in RegisterProduct instead of PublishProduct. --- dlls/msi/action.c | 28 +++++++++++++++++++--------- dlls/msi/msipriv.h | 1 + dlls/msi/registry.c | 39 +++++++++++++++++++++++++++++++++++++++ dlls/msi/tests/install.c | 5 +---- 4 files changed, 60 insertions(+), 13 deletions(-) diff --git a/dlls/msi/action.c b/dlls/msi/action.c index 6c857f0..37ad1ab 100644 --- a/dlls/msi/action.c +++ b/dlls/msi/action.c @@ -3279,10 +3279,6 @@ static UINT ACTION_PublishProduct(MSIPACKAGE *package) {'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; @@ -3315,12 +3311,10 @@ static UINT ACTION_PublishProduct(MSIPACKAGE *package) if (rc != ERROR_SUCCESS) goto end; - rc = RegCreateKeyW(hudkey, szInstallProperties, &props); + rc = MSIREG_OpenInstallPropertiesKey(package->ProductCode,&props,TRUE); 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 ); msi_free(buffer); @@ -3806,6 +3800,7 @@ static UINT msi_write_uninstall_property_vals( MSIPACKAGE *package, HKEY hkey ) static UINT ACTION_RegisterProduct(MSIPACKAGE *package) { HKEY hkey=0; + HKEY hudkey=0, props=0; LPWSTR buffer = NULL; UINT rc; DWORD size, langid; @@ -3830,7 +3825,11 @@ static UINT ACTION_RegisterProduct(MSIPACKAGE *package) SYSTEMTIME systime; static const WCHAR date_fmt[] = {'%','i','%','i','%','i',0}; LPWSTR upgrade_code; - WCHAR szDate[9]; + WCHAR szDate[9]; + + /* FIXME: also need to publish if the product is in advertise mode */ + if (!msi_check_publish(package)) + return ERROR_SUCCESS; rc = MSIREG_OpenUninstallKey(package->ProductCode,&hkey,TRUE); if (rc != ERROR_SUCCESS) @@ -3892,7 +3891,18 @@ static UINT ACTION_RegisterProduct(MSIPACKAGE *package) RegCloseKey(hkey); - /* FIXME: call ui_actiondata */ + rc = MSIREG_OpenUserDataProductKey(package->ProductCode, &hudkey, TRUE); + if (rc != ERROR_SUCCESS) + return rc; + + RegCloseKey(hudkey); + + rc = MSIREG_OpenInstallPropertiesKey(package->ProductCode, &props, TRUE); + if (rc != ERROR_SUCCESS) + return rc; + + msi_reg_set_val_dword( props, szWindowsInstaller, 1 ); + RegCloseKey(props); return ERROR_SUCCESS; } diff --git a/dlls/msi/msipriv.h b/dlls/msi/msipriv.h index 14a365e..a62f8d9 100644 --- a/dlls/msi/msipriv.h +++ b/dlls/msi/msipriv.h @@ -709,6 +709,7 @@ extern UINT MSIREG_OpenComponentsKey(LPCWSTR szComponent, HKEY* key, BOOL create extern UINT MSIREG_OpenProductsKey(LPCWSTR szProduct, HKEY* key, BOOL create); extern UINT MSIREG_OpenPatchesKey(LPCWSTR szPatch, HKEY* key, BOOL create); extern UINT MSIREG_OpenUserDataProductKey(LPCWSTR szProduct, HKEY* key, BOOL create); +extern UINT MSIREG_OpenInstallPropertiesKey(LPCWSTR szProduct, HKEY* key, BOOL create); extern UINT MSIREG_OpenUserFeaturesKey(LPCWSTR szProduct, HKEY* key, BOOL create); extern UINT MSIREG_OpenUserComponentsKey(LPCWSTR szComponent, HKEY* key, BOOL create); extern UINT MSIREG_OpenUpgradeCodesKey(LPCWSTR szProduct, HKEY* key, BOOL create); diff --git a/dlls/msi/registry.c b/dlls/msi/registry.c index 238cdd1..5787bc7 100644 --- a/dlls/msi/registry.c +++ b/dlls/msi/registry.c @@ -166,6 +166,16 @@ static const WCHAR szUserDataProd_fmt[] = { 'U','s','e','r','D','a','t','a','\\', '%','s','\\','P','r','o','d','u','c','t','s','\\','%','s',0}; +static const WCHAR szInstallProperties_fmt[] = { +'S','o','f','t','w','a','r','e','\\', +'M','i','c','r','o','s','o','f','t','\\', +'W','i','n','d','o','w','s','\\', +'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\', +'I','n','s','t','a','l','l','e','r','\\', +'U','s','e','r','D','a','t','a','\\', +'%','s','\\','P','r','o','d','u','c','t','s','\\','%','s','\\', +'I','n','s','t','a','l','l','P','r','o','p','e','r','t','i','e','s',0}; + #define SQUISH_GUID_SIZE 33 @@ -611,6 +621,35 @@ UINT MSIREG_OpenUserDataProductKey(LPCWSTR szProduct, HKEY *key, BOOL create) return rc; } +UINT MSIREG_OpenInstallPropertiesKey(LPCWSTR szProduct, HKEY *key, BOOL create) +{ + UINT rc; + WCHAR squished_pc[GUID_SIZE]; + WCHAR keypath[0x200]; + LPWSTR usersid; + + TRACE("%s\n", debugstr_w(szProduct)); + squash_guid(szProduct, squished_pc); + TRACE("squished (%s)\n", debugstr_w(squished_pc)); + + rc = get_user_sid(&usersid); + if (rc != ERROR_SUCCESS || !usersid) + { + ERR("Failed to retrieve user SID: %d\n", rc); + return rc; + } + + sprintfW(keypath, szInstallProperties_fmt, usersid, squished_pc); + + if (create) + rc = RegCreateKeyW(HKEY_LOCAL_MACHINE, keypath, key); + else + rc = RegOpenKeyW(HKEY_LOCAL_MACHINE, keypath, key); + + msi_free(usersid); + return rc; +} + UINT MSIREG_DeleteUserDataProductKey(LPCWSTR szProduct) { UINT rc; diff --git a/dlls/msi/tests/install.c b/dlls/msi/tests/install.c index f6d59c8..4cf3ca4 100644 --- a/dlls/msi/tests/install.c +++ b/dlls/msi/tests/install.c @@ -1683,10 +1683,7 @@ static void test_publish(void) ok(pf_exists("msitest"), "File not installed\n"); state = MsiQueryProductState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}"); - todo_wine - { - ok(state == INSTALLSTATE_ADVERTISED, "Expected INSTALLSTATE_ADVERTISED, got %d\n", state); - } + ok(state == INSTALLSTATE_ADVERTISED, "Expected INSTALLSTATE_ADVERTISED, got %d\n", state); state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "feature"); ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
1
0
0
0
James Hawkins : msi: Only publish the product if at least one feature is to be installed.
by Alexandre Julliard
03 Jul '07
03 Jul '07
Module: wine Branch: master Commit: a2df31aea1746fcf067c77af56453100077a336f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a2df31aea1746fcf067c77af5…
Author: James Hawkins <truiken(a)gmail.com> Date: Mon Jul 2 20:21:26 2007 -0700 msi: Only publish the product if at least one feature is to be installed. --- dlls/msi/action.c | 17 ++++++++++++ dlls/msi/tests/install.c | 64 ++++++++++++--------------------------------- 2 files changed, 34 insertions(+), 47 deletions(-) diff --git a/dlls/msi/action.c b/dlls/msi/action.c index 0911a29..6c857f0 100644 --- a/dlls/msi/action.c +++ b/dlls/msi/action.c @@ -3241,6 +3241,19 @@ static UINT ITERATE_PublishProduct(MSIRECORD *row, LPVOID param) return ERROR_SUCCESS; } +static BOOL msi_check_publish(MSIPACKAGE *package) +{ + MSIFEATURE *feature; + + LIST_FOR_EACH_ENTRY(feature, &package->features, MSIFEATURE, entry) + { + if (feature->ActionRequest == INSTALLSTATE_LOCAL) + return TRUE; + } + + return FALSE; +} + /* * 99% of the work done here is only done for * advertised installs. However this is where the @@ -3275,6 +3288,10 @@ static UINT ACTION_PublishProduct(MSIPACKAGE *package) DWORD size; MSIHANDLE hDb, hSumInfo; + /* FIXME: also need to publish if the product is in advertise mode */ + if (!msi_check_publish(package)) + return ERROR_SUCCESS; + /* write out icon files */ rc = MSI_DatabaseOpenViewW(package->db, Query, &view); diff --git a/dlls/msi/tests/install.c b/dlls/msi/tests/install.c index 42d41a2..f6d59c8 100644 --- a/dlls/msi/tests/install.c +++ b/dlls/msi/tests/install.c @@ -1594,6 +1594,9 @@ static void test_publish(void) MsiSetInternalUI(INSTALLUILEVEL_FULL, NULL); state = MsiQueryProductState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}"); + ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state); + + state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "feature"); if (state != INSTALLSTATE_UNKNOWN) { skip("Install database not in a clean state\n"); @@ -1602,9 +1605,6 @@ static void test_publish(void) ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state); - state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "feature"); - ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state); - state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "montecristo"); ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state); @@ -1775,10 +1775,7 @@ static void test_publish(void) ok(pf_exists("msitest"), "File deleted\n"); state = MsiQueryProductState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}"); - todo_wine - { - ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state); - } + ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state); state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "feature"); todo_wine @@ -1827,10 +1824,7 @@ static void test_publish(void) ok(pf_exists("msitest"), "File deleted\n"); state = MsiQueryProductState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}"); - todo_wine - { - ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state); - } + ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state); state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "feature"); todo_wine @@ -1859,10 +1853,7 @@ static void test_publish(void) ok(state == INSTALLSTATE_DEFAULT, "Expected INSTALLSTATE_DEFAULT, got %d\n", state); state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "feature"); - todo_wine - { - ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state); - } + ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state); state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "montecristo"); todo_wine @@ -1888,10 +1879,7 @@ static void test_publish(void) } state = MsiQueryProductState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}"); - todo_wine - { - ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state); - } + ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state); state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "feature");\ todo_wine @@ -1920,10 +1908,7 @@ static void test_publish(void) ok(state == INSTALLSTATE_DEFAULT, "Expected INSTALLSTATE_DEFAULT, got %d\n", state); state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "feature"); - todo_wine - { - ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state); - } + ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state); state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "montecristo"); todo_wine @@ -2108,10 +2093,7 @@ static void test_publish(void) } state = MsiQueryProductState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}"); - todo_wine - { - ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state); - } + ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state); state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "feature"); todo_wine @@ -2161,11 +2143,8 @@ static void test_publishsourcelist(void) size = 0xdeadbeef; r = MsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAME, NULL, &size); - todo_wine - { - ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r); - ok(size == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", size); - } + ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r); + ok(size == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", size); r = MsiInstallProductA(msifile, "REGISTER_PRODUCT=1"); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); @@ -2176,11 +2155,8 @@ static void test_publishsourcelist(void) size = 0xdeadbeef; r = MsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAME, NULL, &size); - todo_wine - { - ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r); - ok(size == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", size); - } + ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r); + ok(size == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", size); r = MsiInstallProductA(msifile, "PROCESS_COMPONENTS=1"); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); @@ -2191,11 +2167,8 @@ static void test_publishsourcelist(void) size = 0xdeadbeef; r = MsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAME, NULL, &size); - todo_wine - { - ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r); - ok(size == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", size); - } + ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r); + ok(size == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", size); r = MsiInstallProductA(msifile, "PUBLISH_FEATURES=1"); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); @@ -2206,11 +2179,8 @@ static void test_publishsourcelist(void) size = 0xdeadbeef; r = MsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAME, NULL, &size); - todo_wine - { - ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r); - ok(size == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", size); - } + ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r); + ok(size == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", size); r = MsiInstallProductA(msifile, "PUBLISH_PRODUCT=1"); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
1
0
0
0
James Hawkins : msi: Unpublish the product when it is entirely removed.
by Alexandre Julliard
03 Jul '07
03 Jul '07
Module: wine Branch: master Commit: 624bbbe78a68598003eb906ddc1839a250bed340 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=624bbbe78a68598003eb906dd…
Author: James Hawkins <truiken(a)gmail.com> Date: Mon Jul 2 20:20:54 2007 -0700 msi: Unpublish the product when it is entirely removed. --- dlls/msi/action.c | 50 +++++++++++++++++++++++++++++++++++++++++++ dlls/msi/msipriv.h | 3 ++ dlls/msi/registry.c | 53 ++++++++++++++++++++++++++++++++++++++++++++++ dlls/msi/tests/install.c | 40 +++++++--------------------------- 4 files changed, 114 insertions(+), 32 deletions(-) diff --git a/dlls/msi/action.c b/dlls/msi/action.c index c9d4fa8..0911a29 100644 --- a/dlls/msi/action.c +++ b/dlls/msi/action.c @@ -3885,10 +3885,60 @@ static UINT ACTION_InstallExecute(MSIPACKAGE *package) return execute_script(package,INSTALL_SCRIPT); } +static UINT msi_unpublish_product(MSIPACKAGE *package) +{ + LPWSTR remove = NULL; + LPWSTR *features = NULL; + BOOL full_uninstall = TRUE; + MSIFEATURE *feature; + + static const WCHAR szRemove[] = {'R','E','M','O','V','E',0}; + static const WCHAR szAll[] = {'A','L','L',0}; + + remove = msi_dup_property(package, szRemove); + if (!remove) + return ERROR_SUCCESS; + + features = msi_split_string(remove, ','); + if (!features) + { + msi_free(remove); + ERR("REMOVE feature list is empty!\n"); + return ERROR_FUNCTION_FAILED; + } + + if (!lstrcmpW(features[0], szAll)) + full_uninstall = TRUE; + else + { + LIST_FOR_EACH_ENTRY(feature, &package->features, MSIFEATURE, entry) + { + if (feature->Action != INSTALLSTATE_ABSENT) + full_uninstall = FALSE; + } + } + + if (!full_uninstall) + goto done; + + MSIREG_DeleteProductKey(package->ProductCode); + MSIREG_DeleteUserProductKey(package->ProductCode); + MSIREG_DeleteUserDataProductKey(package->ProductCode); + +done: + msi_free(remove); + msi_free(features); + return ERROR_SUCCESS; +} + static UINT ACTION_InstallFinalize(MSIPACKAGE *package) { UINT rc; + rc = msi_unpublish_product(package); + if (rc != ERROR_SUCCESS) + return rc; + /* turn off scheduling */ package->script->CurrentlyScripting= FALSE; diff --git a/dlls/msi/msipriv.h b/dlls/msi/msipriv.h index e5b5ea3..14a365e 100644 --- a/dlls/msi/msipriv.h +++ b/dlls/msi/msipriv.h @@ -713,6 +713,9 @@ extern UINT MSIREG_OpenUserFeaturesKey(LPCWSTR szProduct, HKEY* key, BOOL create extern UINT MSIREG_OpenUserComponentsKey(LPCWSTR szComponent, HKEY* key, BOOL create); extern UINT MSIREG_OpenUpgradeCodesKey(LPCWSTR szProduct, HKEY* key, BOOL create); extern UINT MSIREG_OpenUserUpgradeCodesKey(LPCWSTR szProduct, HKEY* key, BOOL create); +extern UINT MSIREG_DeleteProductKey(LPCWSTR szProduct); +extern UINT MSIREG_DeleteUserProductKey(LPCWSTR szProduct); +extern UINT MSIREG_DeleteUserDataProductKey(LPCWSTR szProduct); extern LPWSTR msi_reg_get_val_str( HKEY hkey, LPCWSTR name ); extern BOOL msi_reg_get_val_dword( HKEY hkey, LPCWSTR name, DWORD *val); diff --git a/dlls/msi/registry.c b/dlls/msi/registry.c index c557264..238cdd1 100644 --- a/dlls/msi/registry.c +++ b/dlls/msi/registry.c @@ -437,6 +437,20 @@ UINT MSIREG_OpenUserProductsKey(LPCWSTR szProduct, HKEY* key, BOOL create) return rc; } +UINT MSIREG_DeleteUserProductKey(LPCWSTR szProduct) +{ + WCHAR squished_pc[GUID_SIZE]; + WCHAR keypath[0x200]; + + TRACE("%s\n",debugstr_w(szProduct)); + squash_guid(szProduct,squished_pc); + TRACE("squished (%s)\n", debugstr_w(squished_pc)); + + sprintfW(keypath,szUserProduct_fmt,squished_pc); + + return RegDeleteTreeW(HKEY_CURRENT_USER, keypath); +} + UINT MSIREG_OpenUserPatchesKey(LPCWSTR szPatch, HKEY* key, BOOL create) { UINT rc; @@ -593,9 +607,34 @@ UINT MSIREG_OpenUserDataProductKey(LPCWSTR szProduct, HKEY *key, BOOL create) else rc = RegOpenKeyW(HKEY_LOCAL_MACHINE, keypath, key); + msi_free(usersid); return rc; } +UINT MSIREG_DeleteUserDataProductKey(LPCWSTR szProduct) +{ + UINT rc; + WCHAR squished_pc[GUID_SIZE]; + WCHAR keypath[0x200]; + LPWSTR usersid; + + TRACE("%s\n", debugstr_w(szProduct)); + squash_guid(szProduct, squished_pc); + TRACE("squished (%s)\n", debugstr_w(squished_pc)); + + rc = get_user_sid(&usersid); + if (rc != ERROR_SUCCESS || !usersid) + { + ERR("Failed to retrieve user SID: %d\n", rc); + return rc; + } + + sprintfW(keypath, szUserDataProd_fmt, usersid, squished_pc); + + msi_free(usersid); + return RegDeleteTreeW(HKEY_LOCAL_MACHINE, keypath); +} + UINT MSIREG_OpenProducts(HKEY* key) { return RegCreateKeyW(HKEY_LOCAL_MACHINE,szInstaller_Products,key); @@ -621,6 +660,20 @@ UINT MSIREG_OpenProductsKey(LPCWSTR szProduct, HKEY* key, BOOL create) return rc; } +UINT MSIREG_DeleteProductKey(LPCWSTR szProduct) +{ + WCHAR squished_pc[GUID_SIZE]; + WCHAR keypath[0x200]; + + TRACE("%s\n", debugstr_w(szProduct)); + squash_guid(szProduct, squished_pc); + TRACE("squished (%s)\n", debugstr_w(squished_pc)); + + sprintfW(keypath, szInstaller_Products_fmt, squished_pc); + + return RegDeleteTreeW(HKEY_LOCAL_MACHINE, keypath); +} + UINT MSIREG_OpenPatchesKey(LPCWSTR szPatch, HKEY* key, BOOL create) { UINT rc; diff --git a/dlls/msi/tests/install.c b/dlls/msi/tests/install.c index f7df7eb..42d41a2 100644 --- a/dlls/msi/tests/install.c +++ b/dlls/msi/tests/install.c @@ -1706,10 +1706,7 @@ static void test_publish(void) ok(pf_exists("msitest"), "File deleted\n"); state = MsiQueryProductState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}"); - todo_wine - { - ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state); - } + ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state); state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "feature"); ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state); @@ -1952,10 +1949,7 @@ static void test_publish(void) } state = MsiQueryProductState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}"); - todo_wine - { - ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state); - } + ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state); state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "feature"); todo_wine @@ -1984,10 +1978,7 @@ static void test_publish(void) ok(state == INSTALLSTATE_DEFAULT, "Expected INSTALLSTATE_DEFAULT, got %d\n", state); state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "feature"); - todo_wine - { - ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state); - } + ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state); state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "montecristo"); todo_wine @@ -2013,16 +2004,10 @@ static void test_publish(void) ok(state == INSTALLSTATE_DEFAULT, "Expected INSTALLSTATE_DEFAULT, got %d\n", state); state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "feature"); - todo_wine - { - ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state); - } + ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state); state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "montecristo"); - todo_wine - { - ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state); - } + ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state); r = MsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state); @@ -2071,10 +2056,7 @@ static void test_publish(void) } state = MsiQueryProductState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}"); - todo_wine - { - ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state); - } + ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state); state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "feature"); todo_wine @@ -2103,16 +2085,10 @@ static void test_publish(void) ok(state == INSTALLSTATE_DEFAULT, "Expected INSTALLSTATE_DEFAULT, got %d\n", state); state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "feature"); - todo_wine - { - ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state); - } + ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state); state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "montecristo"); - todo_wine - { - ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state); - } + ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state); r = MsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
1
0
0
0
James Hawkins : msi: Delay publishing of the SourceList until the PublishProduct action.
by Alexandre Julliard
03 Jul '07
03 Jul '07
Module: wine Branch: master Commit: 5e46fc9019dce5befe72b50695b8d309aba4f65f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5e46fc9019dce5befe72b5069…
Author: James Hawkins <truiken(a)gmail.com> Date: Mon Jul 2 20:20:20 2007 -0700 msi: Delay publishing of the SourceList until the PublishProduct action. --- dlls/msi/action.c | 17 +++++++++++++++++ dlls/msi/files.c | 18 +++++++----------- dlls/msi/helpers.c | 21 ++++++++++++++++++++- dlls/msi/msipriv.h | 24 ++++++++++++++++++++++++ dlls/msi/package.c | 39 +++++++++++++++++++++++++++++++++++++++ dlls/msi/tests/install.c | 5 ++++- 6 files changed, 111 insertions(+), 13 deletions(-) diff --git a/dlls/msi/action.c b/dlls/msi/action.c index f09a1b9..c9d4fa8 100644 --- a/dlls/msi/action.c +++ b/dlls/msi/action.c @@ -3251,6 +3251,8 @@ static UINT ACTION_PublishProduct(MSIPACKAGE *package) { UINT rc; MSIQUERY * view; + MSISOURCELISTINFO *info; + MSIMEDIADISK *disk; static const WCHAR Query[]= {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ', '`','I','c','o','n','`',0}; @@ -3363,6 +3365,21 @@ static UINT ACTION_PublishProduct(MSIPACKAGE *package) rc = ERROR_SUCCESS; } + /* publish the SourceList info */ + LIST_FOR_EACH_ENTRY(info, &package->sourcelist_info, MSISOURCELISTINFO, entry) + { + MsiSourceListSetInfoW(package->ProductCode, NULL, + info->context, info->options, + info->property, info->value); + } + + LIST_FOR_EACH_ENTRY(disk, &package->sourcelist_media, MSIMEDIADISK, entry) + { + MsiSourceListAddMediaDiskW(package->ProductCode, NULL, + disk->context, disk->options, + disk->disk_id, disk->volume_label, disk->disk_prompt); + } + end: RegCloseKey(hkey); RegCloseKey(hukey); diff --git a/dlls/msi/files.c b/dlls/msi/files.c index 14fb83b..f2561d4 100644 --- a/dlls/msi/files.c +++ b/dlls/msi/files.c @@ -580,14 +580,12 @@ static UINT load_media_info(MSIPACKAGE *package, MSIFILE *file, struct media_inf lstrcatW(mi->source, mi->cabinet); } - MsiSourceListAddMediaDiskW(package->ProductCode, NULL, - MSIINSTALLCONTEXT_USERMANAGED, MSICODE_PRODUCT, - mi->disk_id, mi->volume_label, mi->disk_prompt); + msi_package_add_media_disk(package, MSIINSTALLCONTEXT_USERMANAGED, MSICODE_PRODUCT, + mi->disk_id, mi->volume_label, mi->disk_prompt); - MsiSourceListSetInfoW(package->ProductCode, NULL, - MSIINSTALLCONTEXT_USERMANAGED, - MSICODE_PRODUCT | MSISOURCETYPE_MEDIA, - INSTALLPROPERTY_LASTUSEDSOURCEW, mi->source); + msi_package_add_info(package, MSIINSTALLCONTEXT_USERMANAGED, + MSICODE_PRODUCT | MSISOURCETYPE_MEDIA, + INSTALLPROPERTY_LASTUSEDSOURCEW, mi->source); msi_free(source_dir); return ERROR_SUCCESS; @@ -754,10 +752,8 @@ UINT ACTION_InstallFiles(MSIPACKAGE *package) if (ptr) { ptr++; - MsiSourceListSetInfoW(package->ProductCode, NULL, - MSIINSTALLCONTEXT_USERMANAGED, - MSICODE_PRODUCT, - INSTALLPROPERTY_PACKAGENAMEW, ptr); + msi_package_add_info(package, MSIINSTALLCONTEXT_USERMANAGED, + MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAMEW, ptr); } schedule_install_files(package); diff --git a/dlls/msi/helpers.c b/dlls/msi/helpers.c index 36cbda4..d314699 100644 --- a/dlls/msi/helpers.c +++ b/dlls/msi/helpers.c @@ -489,7 +489,7 @@ void ACTION_free_package_structures( MSIPACKAGE* package) { INT i; struct list *item, *cursor; - + TRACE("Freeing package action data\n"); remove_tracked_tempfiles(package); @@ -607,6 +607,25 @@ void ACTION_free_package_structures( MSIPACKAGE* package) msi_free( appid ); } + LIST_FOR_EACH_SAFE( item, cursor, &package->sourcelist_info ) + { + MSISOURCELISTINFO *info = LIST_ENTRY( item, MSISOURCELISTINFO, entry ); + + list_remove( &info->entry ); + msi_free( info->value ); + msi_free( info ); + } + + LIST_FOR_EACH_SAFE( item, cursor, &package->sourcelist_media ) + { + MSIMEDIADISK *info = LIST_ENTRY( item, MSIMEDIADISK, entry ); + + list_remove( &info->entry ); + msi_free( info->volume_label ); + msi_free( info->disk_prompt ); + msi_free( info ); + } + if (package->script) { for (i = 0; i < TOTAL_SCRIPTS; i++) diff --git a/dlls/msi/msipriv.h b/dlls/msi/msipriv.h index 7e563a4..e5b5ea3 100644 --- a/dlls/msi/msipriv.h +++ b/dlls/msi/msipriv.h @@ -113,6 +113,25 @@ typedef struct tagMSIRECORD MSIFIELD fields[1]; /* nb. array size is count+1 */ } MSIRECORD; +typedef struct tagMSISOURCELISTINFO +{ + struct list entry; + DWORD context; + DWORD options; + LPCWSTR property; + LPWSTR value; +} MSISOURCELISTINFO; + +typedef struct tagMSIMEDIADISK +{ + struct list entry; + DWORD context; + DWORD options; + DWORD disk_id; + LPWSTR volume_label; + LPWSTR disk_prompt; +} MSIMEDIADISK; + typedef const struct tagMSICOLUMNHASHENTRY *MSIITERHANDLE; typedef struct tagMSIVIEWOPS @@ -249,6 +268,9 @@ typedef struct tagMSIPACKAGE struct list subscriptions; + struct list sourcelist_info; + struct list sourcelist_media; + unsigned char scheduled_action_running : 1; unsigned char commit_action_running : 1; unsigned char rollback_action_running : 1; @@ -664,6 +686,8 @@ extern UINT MSI_GetComponentStateW( MSIPACKAGE *, LPCWSTR, INSTALLSTATE *, INSTA extern UINT MSI_GetFeatureStateW( MSIPACKAGE *, LPCWSTR, INSTALLSTATE *, INSTALLSTATE * ); extern UINT WINAPI MSI_SetFeatureStateW(MSIPACKAGE*, LPCWSTR, INSTALLSTATE ); extern LPCWSTR msi_download_file( LPCWSTR szUrl, LPWSTR filename ); +extern UINT msi_package_add_info(MSIPACKAGE *, DWORD, DWORD, LPCWSTR, LPWSTR); +extern UINT msi_package_add_media_disk(MSIPACKAGE *, DWORD, DWORD, DWORD, LPWSTR, LPWSTR); /* for deformating */ extern UINT MSI_FormatRecordW( MSIPACKAGE *, MSIRECORD *, LPWSTR, DWORD * ); diff --git a/dlls/msi/package.c b/dlls/msi/package.c index 8cb2771..e7482e0 100644 --- a/dlls/msi/package.c +++ b/dlls/msi/package.c @@ -699,6 +699,8 @@ static MSIPACKAGE *msi_alloc_package( void ) list_init( &package->extensions ); list_init( &package->progids ); list_init( &package->RunningActions ); + list_init( &package->sourcelist_info ); + list_init( &package->sourcelist_media ); package->ActionFormat = NULL; package->LastAction = NULL; @@ -1573,3 +1575,40 @@ HRESULT create_msi_remote_package( IUnknown *pOuter, LPVOID *ppObj ) return S_OK; } + +UINT msi_package_add_info(MSIPACKAGE *package, DWORD context, DWORD options, + LPCWSTR property, LPWSTR value) +{ + MSISOURCELISTINFO *info; + + info = msi_alloc(sizeof(MSISOURCELISTINFO)); + if (!info) + return ERROR_OUTOFMEMORY; + + info->context = context; + info->options = options; + info->property = property; + info->value = strdupW(value); + list_add_head(&package->sourcelist_info, &info->entry); + + return ERROR_SUCCESS; +} + +UINT msi_package_add_media_disk(MSIPACKAGE *package, DWORD context, DWORD options, + DWORD disk_id, LPWSTR volume_label, LPWSTR disk_prompt) +{ + MSIMEDIADISK *disk; + + disk = msi_alloc(sizeof(MSIMEDIADISK)); + if (!disk) + return ERROR_OUTOFMEMORY; + + disk->context = context; + disk->options = options; + disk->disk_id = disk_id; + disk->volume_label = strdupW(volume_label); + disk->disk_prompt = strdupW(disk_prompt); + list_add_head(&package->sourcelist_media, &disk->entry); + + return ERROR_SUCCESS; +} diff --git a/dlls/msi/tests/install.c b/dlls/msi/tests/install.c index 421fd85..f7df7eb 100644 --- a/dlls/msi/tests/install.c +++ b/dlls/msi/tests/install.c @@ -1706,7 +1706,10 @@ static void test_publish(void) ok(pf_exists("msitest"), "File deleted\n"); state = MsiQueryProductState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}"); - ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state); + todo_wine + { + ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state); + } state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "feature"); ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
1
0
0
0
James Hawkins : msi: PackagePath must also include the package name.
by Alexandre Julliard
03 Jul '07
03 Jul '07
Module: wine Branch: master Commit: 08443b3bf7f5535dc438b64e9f8aeb9976b64424 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=08443b3bf7f5535dc438b64e9…
Author: James Hawkins <truiken(a)gmail.com> Date: Mon Jul 2 20:19:46 2007 -0700 msi: PackagePath must also include the package name. --- dlls/msi/action.c | 40 ++++++++++++++++++++++++---------------- dlls/msi/tests/install.c | 7 ++----- 2 files changed, 26 insertions(+), 21 deletions(-) diff --git a/dlls/msi/action.c b/dlls/msi/action.c index cc2583d..f09a1b9 100644 --- a/dlls/msi/action.c +++ b/dlls/msi/action.c @@ -629,35 +629,43 @@ UINT MSI_InstallPackage( MSIPACKAGE *package, LPCWSTR szPackagePath, if (szPackagePath) { - LPWSTR p, check, path; - - path = strdupW(szPackagePath); - p = strrchrW(path,'\\'); + LPWSTR p, check, dir; + + dir = strdupW(szPackagePath); + p = strrchrW(dir, '\\'); if (p) + *(++p) = 0; + else { - p++; - *p=0; + msi_free(dir); + dir = msi_alloc(MAX_PATH*sizeof(WCHAR)); + GetCurrentDirectoryW(MAX_PATH, dir); + lstrcatW(dir, cszbs); + p = (LPWSTR)szPackagePath; } - else + + msi_free( package->PackagePath ); + package->PackagePath = msi_alloc((lstrlenW(dir) + lstrlenW(p) + 2) * sizeof(WCHAR)); + if (!package->PackagePath) { - msi_free(path); - path = msi_alloc(MAX_PATH*sizeof(WCHAR)); - GetCurrentDirectoryW(MAX_PATH,path); - strcatW(path,cszbs); + msi_free(dir); + return ERROR_OUTOFMEMORY; } + lstrcpyW(package->PackagePath, dir); + lstrcatW(package->PackagePath, cszbs); + lstrcatW(package->PackagePath, p); + check = msi_dup_property( package, cszSourceDir ); if (!check) - MSI_SetPropertyW(package, cszSourceDir, path); + MSI_SetPropertyW(package, cszSourceDir, dir); msi_free(check); check = msi_dup_property( package, cszSOURCEDIR ); if (!check) - MSI_SetPropertyW(package, cszSOURCEDIR, path); - - msi_free( package->PackagePath ); - package->PackagePath = path; + MSI_SetPropertyW(package, cszSOURCEDIR, dir); + msi_free(dir); msi_free(check); } diff --git a/dlls/msi/tests/install.c b/dlls/msi/tests/install.c index 7af097e..421fd85 100644 --- a/dlls/msi/tests/install.c +++ b/dlls/msi/tests/install.c @@ -2244,11 +2244,8 @@ static void test_publishsourcelist(void) r = MsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAME, value, &size); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); - todo_wine - { - ok(!lstrcmpA(value, "msitest.msi"), "Expected 'msitest.msi', got %s\n", value); - ok(size == 11, "Expected 11, got %d\n", size); - } + ok(!lstrcmpA(value, "msitest.msi"), "Expected 'msitest.msi', got %s\n", value); + ok(size == 11, "Expected 11, got %d\n", size); /* complete uninstall */ r = MsiInstallProductA(msifile, "FULL=1 REMOVE=ALL");
1
0
0
0
James Hawkins : msi: Add tests to show when the SourceList is published to the registry.
by Alexandre Julliard
03 Jul '07
03 Jul '07
Module: wine Branch: master Commit: 56129f252c6180be1f75c4698b6bb759344d4490 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=56129f252c6180be1f75c4698…
Author: James Hawkins <truiken(a)gmail.com> Date: Mon Jul 2 20:19:10 2007 -0700 msi: Add tests to show when the SourceList is published to the registry. --- dlls/msi/tests/install.c | 109 ++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 109 insertions(+), 0 deletions(-) diff --git a/dlls/msi/tests/install.c b/dlls/msi/tests/install.c index e92abbf..7af097e 100644 --- a/dlls/msi/tests/install.c +++ b/dlls/msi/tests/install.c @@ -2159,6 +2159,114 @@ static void test_publish(void) RemoveDirectory("msitest"); } +static void test_publishsourcelist(void) +{ + UINT r; + DWORD size; + CHAR value[MAX_PATH]; + CHAR prodcode[] = "{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}"; + + CreateDirectoryA("msitest", NULL); + create_file("msitest\\maximus", 500); + + create_database(msifile, pp_tables, sizeof(pp_tables) / sizeof(msi_table)); + + MsiSetInternalUI(INSTALLUILEVEL_FULL, NULL); + + r = MsiInstallProductA(msifile, NULL); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); + ok(pf_exists("msitest\\maximus"), "File not installed\n"); + ok(pf_exists("msitest"), "File not installed\n"); + + /* nothing published */ + size = 0xdeadbeef; + r = MsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, + MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAME, NULL, &size); + todo_wine + { + ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r); + ok(size == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", size); + } + + r = MsiInstallProductA(msifile, "REGISTER_PRODUCT=1"); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); + ok(pf_exists("msitest\\maximus"), "File not installed\n"); + ok(pf_exists("msitest"), "File not installed\n"); + + /* after RegisterProduct */ + size = 0xdeadbeef; + r = MsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, + MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAME, NULL, &size); + todo_wine + { + ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r); + ok(size == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", size); + } + + r = MsiInstallProductA(msifile, "PROCESS_COMPONENTS=1"); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); + ok(pf_exists("msitest\\maximus"), "File not installed\n"); + ok(pf_exists("msitest"), "File not installed\n"); + + /* after ProcessComponents */ + size = 0xdeadbeef; + r = MsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, + MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAME, NULL, &size); + todo_wine + { + ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r); + ok(size == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", size); + } + + r = MsiInstallProductA(msifile, "PUBLISH_FEATURES=1"); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); + ok(pf_exists("msitest\\maximus"), "File not installed\n"); + ok(pf_exists("msitest"), "File not installed\n"); + + /* after PublishFeatures */ + size = 0xdeadbeef; + r = MsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, + MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAME, NULL, &size); + todo_wine + { + ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r); + ok(size == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", size); + } + + r = MsiInstallProductA(msifile, "PUBLISH_PRODUCT=1"); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); + ok(pf_exists("msitest\\maximus"), "File not installed\n"); + ok(pf_exists("msitest"), "File not installed\n"); + + /* after PublishProduct */ + size = MAX_PATH; + lstrcpyA(value, "aaa"); + r = MsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, + MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAME, value, &size); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + todo_wine + { + ok(!lstrcmpA(value, "msitest.msi"), "Expected 'msitest.msi', got %s\n", value); + ok(size == 11, "Expected 11, got %d\n", size); + } + + /* complete uninstall */ + r = MsiInstallProductA(msifile, "FULL=1 REMOVE=ALL"); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + todo_wine + { + ok(!pf_exists("msitest\\maximus"), "File not deleted\n"); + ok(!pf_exists("msitest"), "File not deleted\n"); + } + + /* make sure 'Program Files\msitest' is removed */ + delete_pfmsitest_files(); + + DeleteFile(msifile); + DeleteFile("msitest\\maximus"); + RemoveDirectory("msitest"); +} + START_TEST(install) { DWORD len; @@ -2190,6 +2298,7 @@ START_TEST(install) test_concurrentinstall(); test_setpropertyfolder(); test_publish(); + test_publishsourcelist(); SetCurrentDirectoryA(prev_path); }
1
0
0
0
James Hawkins : msi: Add support for the MSICODE_PATCH option.
by Alexandre Julliard
03 Jul '07
03 Jul '07
Module: wine Branch: master Commit: 04c67c2a1cce0986a2587b9605092b9eef317a4e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=04c67c2a1cce0986a2587b960…
Author: James Hawkins <truiken(a)gmail.com> Date: Mon Jul 2 20:18:34 2007 -0700 msi: Add support for the MSICODE_PATCH option. --- dlls/msi/msipriv.h | 2 + dlls/msi/registry.c | 56 +++++++++++++++++++++++++++++++++++++++++++++++ dlls/msi/source.c | 45 ++++++++++++++++++++++--------------- dlls/msi/tests/source.c | 22 +++++++----------- 4 files changed, 94 insertions(+), 31 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=04c67c2a1cce0986a2587…
1
0
0
0
James Hawkins : msi: pcchValue represents the length of szValue in TCHARS, not bytes.
by Alexandre Julliard
03 Jul '07
03 Jul '07
Module: wine Branch: master Commit: 0cd708e7f5eb91d6ec8c7448180451cf400f062e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0cd708e7f5eb91d6ec8c74481…
Author: James Hawkins <truiken(a)gmail.com> Date: Mon Jul 2 20:17:59 2007 -0700 msi: pcchValue represents the length of szValue in TCHARS, not bytes. --- dlls/msi/source.c | 16 ++++++++++++++-- dlls/msi/tests/source.c | 5 +---- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/dlls/msi/source.c b/dlls/msi/source.c index 74e2881..6223400 100644 --- a/dlls/msi/source.c +++ b/dlls/msi/source.c @@ -184,6 +184,7 @@ UINT WINAPI MsiSourceListGetInfoA( LPCSTR szProduct, LPCSTR szUserSid, if (!value) return ERROR_OUTOFMEMORY; + *value = '\0'; ret = MsiSourceListGetInfoW(product, usersid, dwContext, dwOptions, property, value, &len); if (ret != ERROR_SUCCESS) @@ -341,10 +342,21 @@ UINT WINAPI MsiSourceListGetInfoW( LPCWSTR szProduct, LPCWSTR szUserSid, } else if (strcmpW(INSTALLPROPERTY_PACKAGENAMEW, szProperty)==0) { - rc = RegQueryValueExW(sourcekey, INSTALLPROPERTY_PACKAGENAMEW, 0, 0, - (LPBYTE)szValue, pcchValue); + *pcchValue = *pcchValue * sizeof(WCHAR); + rc = RegQueryValueExW(sourcekey, INSTALLPROPERTY_PACKAGENAMEW, 0, 0, + (LPBYTE)szValue, pcchValue); if (rc != ERROR_SUCCESS && rc != ERROR_MORE_DATA) + { + *pcchValue = 0; rc = ERROR_SUCCESS; + } + else + { + if (*pcchValue) + *pcchValue = (*pcchValue - 1) / sizeof(WCHAR); + if (szValue) + szValue[*pcchValue] = '\0'; + } } else { diff --git a/dlls/msi/tests/source.c b/dlls/msi/tests/source.c index 2c2fe05..58c2e86 100644 --- a/dlls/msi/tests/source.c +++ b/dlls/msi/tests/source.c @@ -209,10 +209,7 @@ static void test_MsiSourceListGetInfo(void) r = MsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAME, NULL, &size); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); - todo_wine - { - ok(size == 0, "Expected 0, got %d\n", size); - } + ok(size == 0, "Expected 0, got %d\n", size); data = "msitest.msi"; res = RegSetValueExA(hkey, "PackageName", 0, REG_SZ, (const BYTE *)data, lstrlenA(data) + 1);
1
0
0
0
James Hawkins : msi: Handle remote calls to MsiSetProperty.
by Alexandre Julliard
03 Jul '07
03 Jul '07
Module: wine Branch: master Commit: 4d668e06a26cdd68fad87e35d0d11008e5efe859 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4d668e06a26cdd68fad87e35d…
Author: James Hawkins <truiken(a)gmail.com> Date: Mon Jul 2 20:17:04 2007 -0700 msi: Handle remote calls to MsiSetProperty. --- dlls/msi/package.c | 24 +++++++++++++++++++++++- 1 files changed, 23 insertions(+), 1 deletions(-) diff --git a/dlls/msi/package.c b/dlls/msi/package.c index d096466..8cb2771 100644 --- a/dlls/msi/package.c +++ b/dlls/msi/package.c @@ -1254,7 +1254,29 @@ UINT WINAPI MsiSetPropertyW( MSIHANDLE hInstall, LPCWSTR szName, LPCWSTR szValue package = msihandle2msiinfo( hInstall, MSIHANDLETYPE_PACKAGE); if( !package ) - return ERROR_INVALID_HANDLE; + { + HRESULT hr; + IWineMsiRemotePackage *remote_package; + + remote_package = (IWineMsiRemotePackage *)msi_get_remote( hInstall ); + if (!remote_package) + return ERROR_INVALID_HANDLE; + + hr = IWineMsiRemotePackage_SetProperty( remote_package, (BSTR *)szName, (BSTR *)szValue ); + + IWineMsiRemotePackage_Release(remote_package); + + if (FAILED(hr)) + { + if (HRESULT_FACILITY(hr) == FACILITY_WIN32) + return HRESULT_CODE(hr); + + return ERROR_FUNCTION_FAILED; + } + + return ERROR_SUCCESS; + } + ret = MSI_SetPropertyW( package, szName, szValue); msiobj_release( &package->hdr ); return ret;
1
0
0
0
← Newer
1
...
87
88
89
90
91
92
93
...
96
Older →
Jump to page:
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
Results per page:
10
25
50
100
200