ReactOS.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
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
List overview
Download
Ros-diffs
March 2022
----- 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
ros-diffs@reactos.org
20 participants
436 discussions
Start a n
N
ew thread
[reactos] 101/360: [WINESYNC] msi: Only delete empty registry keys in delete_key().
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ba86f76417c383373370b…
commit ba86f76417c383373370b30e71a16610dc756e2d Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sat Mar 12 16:34:04 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:27:53 2022 +0100 [WINESYNC] msi: Only delete empty registry keys in delete_key(). Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 91e418073f64368110a9339d17fad36ad26c1a7f by Zebediah Figura <z.figura12(a)gmail.com> --- dll/win32/msi/action.c | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/dll/win32/msi/action.c b/dll/win32/msi/action.c index dbd08e57db4..e5633821af0 100644 --- a/dll/win32/msi/action.c +++ b/dll/win32/msi/action.c @@ -2988,12 +2988,27 @@ static UINT ACTION_WriteRegistryValues(MSIPACKAGE *package) return rc; } +static int is_key_empty(const MSICOMPONENT *comp, HKEY root, const WCHAR *path) +{ + DWORD subkeys, values; + HKEY key; + LONG res; + + key = open_key(comp, root, path, FALSE, get_registry_view(comp) | KEY_READ); + if (!key) return 0; + + res = RegQueryInfoKeyW(key, 0, 0, 0, &subkeys, 0, 0, &values, 0, 0, 0, 0); + RegCloseKey(key); + + return !res && !subkeys && !values; +} + static void delete_key( const MSICOMPONENT *comp, HKEY root, const WCHAR *path ) { + LONG res = ERROR_SUCCESS; REGSAM access = 0; WCHAR *subkey, *p; HKEY hkey; - LONG res; access |= get_registry_view( comp ); @@ -3006,10 +3021,15 @@ static void delete_key( const MSICOMPONENT *comp, HKEY root, const WCHAR *path ) if (!p[1]) continue; /* trailing backslash */ hkey = open_key( comp, root, subkey, FALSE, access | READ_CONTROL ); if (!hkey) break; + if (!is_key_empty(comp, hkey, p + 1)) + { + RegCloseKey(hkey); + break; + } res = RegDeleteKeyExW( hkey, p + 1, access, 0 ); RegCloseKey( hkey ); } - else + else if (is_key_empty(comp, root, subkey)) res = RegDeleteKeyExW( root, subkey, access, 0 ); if (res) { @@ -3024,17 +3044,14 @@ static void delete_value( const MSICOMPONENT *comp, HKEY root, const WCHAR *path { LONG res; HKEY hkey; - DWORD num_subkeys, num_values; if ((hkey = open_key( comp, root, path, FALSE, KEY_SET_VALUE | KEY_QUERY_VALUE ))) { if ((res = RegDeleteValueW( hkey, value ))) TRACE("failed to delete value %s (%d)\n", debugstr_w(value), res); - res = RegQueryInfoKeyW( hkey, NULL, NULL, NULL, &num_subkeys, NULL, NULL, &num_values, - NULL, NULL, NULL, NULL ); RegCloseKey( hkey ); - if (!res && !num_subkeys && !num_values) + if (is_key_empty(comp, root, path)) { TRACE("removing empty key %s\n", debugstr_w(path)); delete_key( comp, root, path );
2 years, 9 months
1
0
0
0
[reactos] 100/360: [WINESYNC] msi/tests: Remove duplicate service tests.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=cdbd0095f02f56eacca9d…
commit cdbd0095f02f56eacca9d39ffcf7b3fd2b437fd8 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sat Mar 12 16:34:03 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:27:53 2022 +0100 [WINESYNC] msi/tests: Remove duplicate service tests. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id f655bb7ee71a5e271fc7091013a60bb799b315df by Hans Leidekker <hans(a)codeweavers.com> --- modules/rostests/winetests/msi/install.c | 86 ++------------------------------ 1 file changed, 5 insertions(+), 81 deletions(-) diff --git a/modules/rostests/winetests/msi/install.c b/modules/rostests/winetests/msi/install.c index f0e4857fe19..a4726d631cf 100644 --- a/modules/rostests/winetests/msi/install.c +++ b/modules/rostests/winetests/msi/install.c @@ -84,8 +84,7 @@ static const CHAR component_dat[] = "Component\tComponentId\tDirectory_\tAttribu "Three\t{010B6ADD-B27D-4EDD-9B3D-34C4F7D61684}\tCHANGEDDIR\t2\t\tthree.txt\n" "Two\t{BF03D1A6-20DA-4A65-82F3-6CAC995915CE}\tFIRSTDIR\t2\t\ttwo.txt\n" "dangler\t{6091DF25-EF96-45F1-B8E9-A9B1420C7A3C}\tTARGETDIR\t4\t\tregdata\n" - "component\t\tMSITESTDIR\t0\t1\tfile\n" - "service_comp\t\tMSITESTDIR\t0\t1\tservice_file"; + "component\t\tMSITESTDIR\t0\t1\tfile\n"; static const CHAR directory_dat[] = "Directory\tDirectory_Parent\tDefaultDir\n" "s72\tS72\tl255\n" @@ -106,8 +105,7 @@ static const CHAR feature_dat[] = "Feature\tFeature_Parent\tTitle\tDescription\t "One\t\tOne\tThe One Feature\t1\t3\tMSITESTDIR\t0\n" "Three\t\tThree\tThe Three Feature\t3\t3\tCHANGEDDIR\t0\n" "Two\t\tTwo\tThe Two Feature\t2\t3\tFIRSTDIR\t0\n" - "feature\t\t\t\t2\t1\tTARGETDIR\t0\n" - "service_feature\t\t\t\t2\t1\tTARGETDIR\t0"; + "feature\t\t\t\t2\t1\tTARGETDIR\t0\n"; static const CHAR feature_comp_dat[] = "Feature_\tComponent_\n" "s38\ts72\n" @@ -117,8 +115,7 @@ static const CHAR feature_comp_dat[] = "Feature_\tComponent_\n" "One\tOne\n" "Three\tThree\n" "Two\tTwo\n" - "feature\tcomponent\n" - "service_feature\tservice_comp\n"; + "feature\tcomponent\n"; static const CHAR file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n" "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n" @@ -128,8 +125,7 @@ static const CHAR file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tL "one.txt\tOne\tone.txt\t1000\t\t\t0\t1\n" "three.txt\tThree\tthree.txt\t1000\t\t\t0\t3\n" "two.txt\tTwo\ttwo.txt\t1000\t\t\t0\t2\n" - "file\tcomponent\tfilename\t100\t\t\t8192\t1\n" - "service_file\tservice_comp\tservice.exe\t100\t\t\t8192\t1"; + "file\tcomponent\tfilename\t100\t\t\t8192\t1\n"; static const CHAR install_exec_seq_dat[] = "Action\tCondition\tSequence\n" "s72\tS255\tI2\n" @@ -144,7 +140,6 @@ static const CHAR install_exec_seq_dat[] = "Action\tCondition\tSequence\n" "DuplicateFiles\t\t4500\n" "WriteEnvironmentStrings\t\t4550\n" "CreateShortcuts\t\t4600\n" - "InstallServices\t\t5000\n" "InstallFinalize\t\t6600\n" "InstallInitialize\t\t1500\n" "InstallValidate\t\t1400\n" @@ -177,8 +172,6 @@ static const CHAR property_dat[] = "Property\tValue\n" "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n" "AdminProperties\tPOSTADMIN\n" "ROOTDRIVE\tC:\\\n" - "SERVNAME\tTestService\n" - "SERVDISP\tTestServiceDisp\n" "MSIFASTINSTALL\t1\n"; static const CHAR aup_property_dat[] = "Property\tValue\n" @@ -201,8 +194,6 @@ static const CHAR aup_property_dat[] = "Property\tValue\n" "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n" "AdminProperties\tPOSTADMIN\n" "ROOTDRIVE\tC:\\\n" - "SERVNAME\tTestService\n" - "SERVDISP\tTestServiceDisp\n" "MSIFASTINSTALL\t1\n"; static const CHAR aup2_property_dat[] = "Property\tValue\n" @@ -225,8 +216,6 @@ static const CHAR aup2_property_dat[] = "Property\tValue\n" "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n" "AdminProperties\tPOSTADMIN\n" "ROOTDRIVE\tC:\\\n" - "SERVNAME\tTestService\n" - "SERVDISP\tTestServiceDisp\n" "MSIFASTINSTALL\t1\n"; static const CHAR icon_property_dat[] = "Property\tValue\n" @@ -248,8 +237,6 @@ static const CHAR icon_property_dat[] = "Property\tValue\n" "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n" "AdminProperties\tPOSTADMIN\n" "ROOTDRIVE\tC:\\\n" - "SERVNAME\tTestService\n" - "SERVDISP\tTestServiceDisp\n" "MSIFASTINSTALL\t1\n"; static const CHAR shortcut_dat[] = "Shortcut\tDirectory_\tName\tComponent_\tTarget\tArguments\tDescription\tHotkey\tIcon_\tIconIndex\tShowCmd\tWkDir\n" @@ -281,8 +268,6 @@ static const CHAR up_property_dat[] = "Property\tValue\n" "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n" "AdminProperties\tPOSTADMIN\n" "ROOTDRIVE\tC:\\\n" - "SERVNAME\tTestService\n" - "SERVDISP\tTestServiceDisp\n" "RemovePreviousVersions\t1\n" "MSIFASTINSTALL\t1\n"; @@ -305,8 +290,6 @@ static const CHAR up2_property_dat[] = "Property\tValue\n" "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n" "AdminProperties\tPOSTADMIN\n" "ROOTDRIVE\tC:\\\n" - "SERVNAME\tTestService\n" - "SERVDISP\tTestServiceDisp\n" "MSIFASTINSTALL\t1\n"; static const CHAR up3_property_dat[] = "Property\tValue\n" @@ -328,8 +311,6 @@ static const CHAR up3_property_dat[] = "Property\tValue\n" "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n" "AdminProperties\tPOSTADMIN\n" "ROOTDRIVE\tC:\\\n" - "SERVNAME\tTestService\n" - "SERVDISP\tTestServiceDisp\n" "RemovePreviousVersions\t1\n" "MSIFASTINSTALL\t1\n"; @@ -341,17 +322,6 @@ static const CHAR registry_dat[] = "Registry\tRoot\tKey\tName\tValue\tComponent_ "regdata\t1\tSOFTWARE\\Wine\\msitest\tblah\tbad\tdangler\n" "OrderTest\t1\tSOFTWARE\\Wine\\msitest\tOrderTestName\tOrderTestValue\tcomponent"; -static const CHAR service_install_dat[] = "ServiceInstall\tName\tDisplayName\tServiceType\tStartType\tErrorControl\t" - "LoadOrderGroup\tDependencies\tStartName\tPassword\tArguments\tComponent_\tDescription\n" - "s72\ts255\tL255\ti4\ti4\ti4\tS255\tS255\tS255\tS255\tS255\ts72\tL255\n" - "ServiceInstall\tServiceInstall\n" - "TestService\t[SERVNAME]\t[SERVDISP]\t2\t3\t0\t\t\tTestService\t\t\tservice_comp\t\t"; - -static const CHAR service_control_dat[] = "ServiceControl\tName\tEvent\tArguments\tWait\tComponent_\n" - "s72\tl255\ti2\tL255\tI2\ts72\n" - "ServiceControl\tServiceControl\n" - "ServiceControl\tTestService\t8\t\t0\tservice_comp"; - /* tables for test_continuouscabs */ static const CHAR cc_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n" "s72\tS38\ts72\ti2\tS255\tS72\n" @@ -859,8 +829,7 @@ static const CHAR ai_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion "one.txt\tOne\tone.txt\t1000\t\t\t16384\t1\n" "three.txt\tThree\tthree.txt\t1000\t\t\t16384\t3\n" "two.txt\tTwo\ttwo.txt\t1000\t\t\t16384\t2\n" - "file\tcomponent\tfilename\t100\t\t\t8192\t1\n" - "service_file\tservice_comp\tservice.exe\t100\t\t\t8192\t1"; + "file\tcomponent\tfilename\t100\t\t\t8192\t1\n"; static const CHAR ip_install_exec_seq_dat[] = "Action\tCondition\tSequence\n" "s72\tS255\tI2\n" @@ -1358,8 +1327,6 @@ static const msi_table tables[] = ADD_TABLE(media), ADD_TABLE(property), ADD_TABLE(registry), - ADD_TABLE(service_install), - ADD_TABLE(service_control) }; static const msi_table sc_tables[] = @@ -1399,8 +1366,6 @@ static const msi_table up_tables[] = ADD_TABLE(media), ADD_TABLE(up_property), ADD_TABLE(registry), - ADD_TABLE(service_install), - ADD_TABLE(service_control) }; static const msi_table up2_tables[] = @@ -1414,8 +1379,6 @@ static const msi_table up2_tables[] = ADD_TABLE(media), ADD_TABLE(up2_property), ADD_TABLE(registry), - ADD_TABLE(service_install), - ADD_TABLE(service_control) }; static const msi_table up3_tables[] = @@ -1429,8 +1392,6 @@ static const msi_table up3_tables[] = ADD_TABLE(media), ADD_TABLE(up3_property), ADD_TABLE(registry), - ADD_TABLE(service_install), - ADD_TABLE(service_control) }; static const msi_table up4_tables[] = @@ -1444,8 +1405,6 @@ static const msi_table up4_tables[] = ADD_TABLE(media), ADD_TABLE(property), ADD_TABLE(registry), - ADD_TABLE(service_install), - ADD_TABLE(service_control) }; static const msi_table up5_tables[] = @@ -1459,8 +1418,6 @@ static const msi_table up5_tables[] = ADD_TABLE(media), ADD_TABLE(up_property), ADD_TABLE(registry), - ADD_TABLE(service_install), - ADD_TABLE(service_control) }; static const msi_table up6_tables[] = @@ -1474,8 +1431,6 @@ static const msi_table up6_tables[] = ADD_TABLE(media), ADD_TABLE(up2_property), ADD_TABLE(registry), - ADD_TABLE(service_install), - ADD_TABLE(service_control) }; static const msi_table up7_tables[] = @@ -1489,8 +1444,6 @@ static const msi_table up7_tables[] = ADD_TABLE(media), ADD_TABLE(up3_property), ADD_TABLE(registry), - ADD_TABLE(service_install), - ADD_TABLE(service_control) }; static const msi_table cc_tables[] = @@ -2409,7 +2362,6 @@ static void create_test_files(void) create_cab_file("msitest.cab", MEDIA_SIZE, "four.txt\0five.txt\0"); create_file("msitest\\filename", 100); - create_file("msitest\\service.exe", 100); DeleteFileA("four.txt"); DeleteFileA("five.txt"); @@ -2487,7 +2439,6 @@ static void delete_test_files(void) DeleteFileA("msitest\\second\\three.txt"); DeleteFileA("msitest\\first\\two.txt"); DeleteFileA("msitest\\one.txt"); - DeleteFileA("msitest\\service.exe"); DeleteFileA("msitest\\filename"); RemoveDirectoryA("msitest\\second"); RemoveDirectoryA("msitest\\first"); @@ -2506,7 +2457,6 @@ static void delete_pf_files(void) ok(delete_pf("msitest\\first", FALSE), "Directory not created\n"); ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n"); ok(delete_pf("msitest\\filename", TRUE), "File not installed\n"); - ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n"); ok(delete_pf("msitest", FALSE), "Directory not created\n"); } @@ -2656,24 +2606,6 @@ void create_database_wordcount(const CHAR *name, const msi_table *tables, int nu HeapFree( GetProcessHeap(), 0, nameW ); } -static void check_service_is_installed(void) -{ - SC_HANDLE scm, service; - BOOL res; - - scm = OpenSCManagerA(NULL, NULL, SC_MANAGER_ALL_ACCESS); - ok(scm != NULL, "Failed to open the SC Manager\n"); - - service = OpenServiceA(scm, "TestService", SC_MANAGER_ALL_ACCESS); - ok(service != NULL, "Failed to open TestService\n"); - - res = DeleteService(service); - ok(res, "Failed to delete TestService\n"); - - CloseServiceHandle(service); - CloseServiceHandle(scm); -} - static BOOL notify_system_change(DWORD event_type, STATEMGRSTATUS *status) { RESTOREPOINTINFOA spec; @@ -2777,8 +2709,6 @@ static void test_MsiInstallProduct(void) ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); ok(!lstrcmpA(path, "OrderTestValue"), "Expected OrderTestValue, got %s\n", path); - check_service_is_installed(); - delete_key(HKEY_CURRENT_USER, "SOFTWARE\\Wine\\msitest", access); /* not published, reinstall */ @@ -4823,7 +4753,6 @@ static void test_adminimage(void) create_file("msitest\\cabout\\four.txt", 100); create_file("msitest\\cabout\\new\\five.txt", 100); create_file("msitest\\filename", 100); - create_file("msitest\\service.exe", 100); create_database_wordcount(msifile, ai_tables, sizeof(ai_tables) / sizeof(msi_table), @@ -4849,7 +4778,6 @@ error: DeleteFileA("msitest\\second\\three.txt"); DeleteFileA("msitest\\first\\two.txt"); DeleteFileA("msitest\\one.txt"); - DeleteFileA("msitest\\service.exe"); DeleteFileA("msitest\\filename"); RemoveDirectoryA("msitest\\cabout\\new"); RemoveDirectoryA("msitest\\cabout"); @@ -5049,7 +4977,6 @@ static void test_preselected(void) ok(!delete_pf("msitest\\first", FALSE), "Directory created\n"); ok(!delete_pf("msitest\\filename", TRUE), "File installed\n"); ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n"); - ok(!delete_pf("msitest\\service.exe", TRUE), "File installed\n"); ok(delete_pf("msitest", FALSE), "Directory not created\n"); r = MsiInstallProductA(msifile, NULL); @@ -5065,7 +4992,6 @@ static void test_preselected(void) ok(delete_pf("msitest\\first", FALSE), "Directory not created\n"); ok(delete_pf("msitest\\filename", TRUE), "File not installed\n"); ok(!delete_pf("msitest\\one.txt", TRUE), "File installed\n"); - ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n"); ok(delete_pf("msitest", FALSE), "Directory not created\n"); error: @@ -6162,7 +6088,6 @@ static void test_wow64(void) ok(!delete_pf("msitest\\first", FALSE), "Directory created\n"); ok(!delete_pf("msitest\\one.txt", TRUE), "File installed\n"); ok(!delete_pf("msitest\\filename", TRUE), "File installed\n"); - ok(!delete_pf("msitest\\service.exe", TRUE), "File installed\n"); ok(!delete_pf("msitest", FALSE), "Directory created\n"); ok(delete_pf_native("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n"); @@ -6175,7 +6100,6 @@ static void test_wow64(void) ok(delete_pf_native("msitest\\first", FALSE), "Directory not created\n"); ok(delete_pf_native("msitest\\one.txt", TRUE), "File not installed\n"); ok(delete_pf_native("msitest\\filename", TRUE), "File not installed\n"); - ok(delete_pf_native("msitest\\service.exe", TRUE), "File not installed\n"); ok(delete_pf_native("msitest", FALSE), "Directory not created\n"); pWow64RevertWow64FsRedirection(cookie);
2 years, 9 months
1
0
0
0
[reactos] 99/360: [WINESYNC] msi/tests: Test deferral of WriteIniValues and RemoveIniValues.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=5239ed572c8942d09bbfe…
commit 5239ed572c8942d09bbfe4d1102f70b80cc945ef Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sat Mar 12 16:34:03 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:27:52 2022 +0100 [WINESYNC] msi/tests: Test deferral of WriteIniValues and RemoveIniValues. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 377d32c4fb6ea72c68436eb590541ec88d0c74f9 by Zebediah Figura <z.figura12(a)gmail.com> --- modules/rostests/winetests/msi/action.c | 14 +++++++++++++ modules/rostests/winetests/msi/custom.c | 32 ++++++++++++++++++++++++++++++ modules/rostests/winetests/msi/custom.spec | 2 ++ 3 files changed, 48 insertions(+) diff --git a/modules/rostests/winetests/msi/action.c b/modules/rostests/winetests/msi/action.c index b22462223bf..35f851f21e7 100644 --- a/modules/rostests/winetests/msi/action.c +++ b/modules/rostests/winetests/msi/action.c @@ -1457,12 +1457,25 @@ static const char ini_install_exec_seq_dat[] = "RemoveFiles\t\t1700\n" "InstallFiles\t\t2000\n" "RemoveIniValues\t\t3000\n" + "riv_immediate\tREMOVE\t3001\n" + "riv_deferred\tREMOVE\t3002\n" "WriteIniValues\t\t3100\n" + "wiv_immediate\tNOT REMOVE\t3101\n" + "wiv_deferred\tNOT REMOVE\t3102\n" "RegisterProduct\t\t5000\n" "PublishFeatures\t\t5100\n" "PublishProduct\t\t5200\n" "InstallFinalize\t\t6000\n"; +static const char ini_custom_action_dat[] = + "Action\tType\tSource\tTarget\n" + "s72\ti2\tS64\tS0\n" + "CustomAction\tAction\n" + "wiv_immediate\t1\tcustom.dll\tini_absent\n" + "wiv_deferred\t1025\tcustom.dll\tini_present\n" + "riv_immediate\t1\tcustom.dll\tini_present\n" + "riv_deferred\t1025\tcustom.dll\tini_absent\n"; + static const char rci_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n" "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n" @@ -2260,6 +2273,7 @@ static const msi_table ini_tables[] = ADD_TABLE(ini_ini_file), ADD_TABLE(ini_remove_ini_file), ADD_TABLE(ini_install_exec_seq), + ADD_TABLE(ini_custom_action), ADD_TABLE(media), ADD_TABLE(property) }; diff --git a/modules/rostests/winetests/msi/custom.c b/modules/rostests/winetests/msi/custom.c index b1823043df2..3e742e381bc 100644 --- a/modules/rostests/winetests/msi/custom.c +++ b/modules/rostests/winetests/msi/custom.c @@ -1890,3 +1890,35 @@ todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) { return ERROR_SUCCESS; } + +UINT WINAPI ini_present(MSIHANDLE hinst) +{ + char path[MAX_PATH], buf[10]; + DWORD len; + + if (FAILED(SHGetFolderPathA(NULL, CSIDL_PROGRAM_FILESX86, NULL, 0, path))) + SHGetFolderPathA(NULL, CSIDL_PROGRAM_FILES, NULL, 0, path); + strcat(path, "\\msitest\\test.ini"); + + len = GetPrivateProfileStringA("section1", "key1", NULL, buf, sizeof(buf), path); +todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) + ok(hinst, len == 6, "got %u\n", len); + + return ERROR_SUCCESS; +} + +UINT WINAPI ini_absent(MSIHANDLE hinst) +{ + char path[MAX_PATH], buf[10]; + DWORD len; + + if (FAILED(SHGetFolderPathA(NULL, CSIDL_PROGRAM_FILESX86, NULL, 0, path))) + SHGetFolderPathA(NULL, CSIDL_PROGRAM_FILES, NULL, 0, path); + strcat(path, "\\msitest\\test.ini"); + + len = GetPrivateProfileStringA("section1", "key1", NULL, buf, sizeof(buf), path); +todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) + ok(hinst, !len, "got %u\n", len); + + return ERROR_SUCCESS; +} diff --git a/modules/rostests/winetests/msi/custom.spec b/modules/rostests/winetests/msi/custom.spec index 8b3c2fbf389..bfd83928e44 100644 --- a/modules/rostests/winetests/msi/custom.spec +++ b/modules/rostests/winetests/msi/custom.spec @@ -13,6 +13,8 @@ @ stdcall file_absent(long) @ stdcall font_present(long) @ stdcall font_absent(long) +@ stdcall ini_present(long) +@ stdcall ini_absent(long) @ stdcall mov_present(long) @ stdcall mov_absent(long) @ stdcall odbc_present(long)
2 years, 9 months
1
0
0
0
[reactos] 98/360: [WINESYNC] msi/tests: Add a simple test for WriteIniValues.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=759a9872434891c2bfdf4…
commit 759a9872434891c2bfdf4ccc69ef96817139905a Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sat Mar 12 16:34:02 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:27:52 2022 +0100 [WINESYNC] msi/tests: Add a simple test for WriteIniValues. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 1a78380e6fbaafb78a9d1b522a5b18b251ac4787 by Zebediah Figura <z.figura12(a)gmail.com> --- modules/rostests/winetests/msi/action.c | 40 ++++++++++++++++----------------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/modules/rostests/winetests/msi/action.c b/modules/rostests/winetests/msi/action.c index 2c444f2511e..b22462223bf 100644 --- a/modules/rostests/winetests/msi/action.c +++ b/modules/rostests/winetests/msi/action.c @@ -1407,43 +1407,43 @@ static const char frp_install_exec_seq_dat[] = "PublishProduct\t\t5200\n" "InstallFinalize\t\t6000\n"; -static const char riv_file_dat[] = +static const char ini_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n" "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n" "File\tFile\n" "inifile.txt\tinifile\tinifile.txt\t1000\t\t\t8192\t1\n"; -static const char riv_feature_dat[] = +static const char ini_feature_dat[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n" "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n" "Feature\tFeature\n" "inifile\t\t\tinifile feature\t1\t2\tMSITESTDIR\t0\n"; -static const char riv_feature_comp_dat[] = +static const char ini_feature_comp_dat[] = "Feature_\tComponent_\n" "s38\ts72\n" "FeatureComponents\tFeature_\tComponent_\n" "inifile\tinifile\n"; -static const char riv_component_dat[] = +static const char ini_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n" "s72\tS38\ts72\ti2\tS255\tS72\n" "Component\tComponent\n" "inifile\t{A0F15705-4F57-4437-88C4-6C8B37ACC6DE}\tMSITESTDIR\t0\t\tinifile.txt\n"; -static const char riv_ini_file_dat[] = +static const char ini_ini_file_dat[] = "IniFile\tFileName\tDirProperty\tSection\tKey\tValue\tAction\tComponent_\n" "s72\tl255\tS72\tl96\tl128\tl255\ti2\ts72\n" "IniFile\tIniFile\n" "inifile1\ttest.ini\tMSITESTDIR\tsection1\tkey1\tvalue1\t0\tinifile\n"; -static const char riv_remove_ini_file_dat[] = +static const char ini_remove_ini_file_dat[] = "RemoveIniFile\tFileName\tDirProperty\tSection\tKey\tValue\tAction\tComponent_\n" "s72\tl255\tS72\tl96\tl128\tL255\ti2\ts72\n" "RemoveIniFile\tRemoveIniFile\n" "inifile1\ttest.ini\tMSITESTDIR\tsectionA\tkeyA\tvalueA\t2\tinifile\n"; -static const char riv_install_exec_seq_dat[] = +static const char ini_install_exec_seq_dat[] = "Action\tCondition\tSequence\n" "s72\tS255\tI2\n" "InstallExecuteSequence\tAction\n" @@ -1457,6 +1457,7 @@ static const char riv_install_exec_seq_dat[] = "RemoveFiles\t\t1700\n" "InstallFiles\t\t2000\n" "RemoveIniValues\t\t3000\n" + "WriteIniValues\t\t3100\n" "RegisterProduct\t\t5000\n" "PublishFeatures\t\t5100\n" "PublishProduct\t\t5200\n" @@ -2249,16 +2250,16 @@ static const msi_table frp_tables[] = ADD_TABLE(property) }; -static const msi_table riv_tables[] = +static const msi_table ini_tables[] = { ADD_TABLE(directory), - ADD_TABLE(riv_component), - ADD_TABLE(riv_feature), - ADD_TABLE(riv_feature_comp), - ADD_TABLE(riv_file), - ADD_TABLE(riv_ini_file), - ADD_TABLE(riv_remove_ini_file), - ADD_TABLE(riv_install_exec_seq), + ADD_TABLE(ini_component), + ADD_TABLE(ini_feature), + ADD_TABLE(ini_feature_comp), + ADD_TABLE(ini_file), + ADD_TABLE(ini_ini_file), + ADD_TABLE(ini_remove_ini_file), + ADD_TABLE(ini_install_exec_seq), ADD_TABLE(media), ADD_TABLE(property) }; @@ -5987,7 +5988,7 @@ error: DeleteFileA(msifile); } -static void test_remove_ini_values(void) +static void test_ini_values(void) { UINT r; DWORD len; @@ -6003,7 +6004,7 @@ static void test_remove_ini_values(void) create_test_files(); create_file("msitest\\inifile.txt", 1000); - create_database(msifile, riv_tables, sizeof(riv_tables) / sizeof(msi_table)); + create_database(msifile, ini_tables, sizeof(ini_tables) / sizeof(msi_table)); lstrcpyA(inifile, PROG_FILES_DIR); lstrcatA(inifile, "\\msitest"); @@ -6017,9 +6018,6 @@ static void test_remove_ini_values(void) file = CreateFileA(inifile, GENERIC_WRITE|GENERIC_READ, 0, NULL, CREATE_ALWAYS, 0, NULL); CloseHandle(file); - ret = WritePrivateProfileStringA("section1", "key1", "value1", inifile); - ok(ret, "failed to write profile string %u\n", GetLastError()); - ret = WritePrivateProfileStringA("sectionA", "keyA", "valueA", inifile); ok(ret, "failed to write profile string %u\n", GetLastError()); @@ -6662,7 +6660,7 @@ START_TEST(action) test_remove_duplicate_files(); test_remove_registry_values(); test_find_related_products(); - test_remove_ini_values(); + test_ini_values(); test_register_class_info(); test_register_extension_info(); test_register_progid_info();
2 years, 9 months
1
0
0
0
[reactos] 97/360: [WINESYNC] msi/tests: Test deferral of WriteEnvironmentStrings and RemoveEnvironmentStrings.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=39c835f2a3c43cb9a319f…
commit 39c835f2a3c43cb9a319f97743f60b486ba20024 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sat Mar 12 16:34:02 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:27:52 2022 +0100 [WINESYNC] msi/tests: Test deferral of WriteEnvironmentStrings and RemoveEnvironmentStrings. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id aae3d6b5afaa67530ee62f922a301fce1967151a by Zebediah Figura <z.figura12(a)gmail.com> --- modules/rostests/winetests/msi/action.c | 14 +++++++++++++ modules/rostests/winetests/msi/custom.c | 32 ++++++++++++++++++++++++++++++ modules/rostests/winetests/msi/custom.spec | 2 ++ 3 files changed, 48 insertions(+) diff --git a/modules/rostests/winetests/msi/action.c b/modules/rostests/winetests/msi/action.c index cc222ed09cd..2c444f2511e 100644 --- a/modules/rostests/winetests/msi/action.c +++ b/modules/rostests/winetests/msi/action.c @@ -199,12 +199,25 @@ static const char env_install_exec_seq_dat[] = "InstallInitialize\t\t500\n" "ProcessComponents\t\t600\n" "WriteEnvironmentStrings\t\t700\n" + "wes_immediate\tNOT REMOVE\t701\n" + "wes_deferred\tNOT REMOVE\t702\n" "RemoveEnvironmentStrings\t\t800\n" + "res_immediate\tREMOVE\t801\n" + "res_deferred\tREMOVE\t802\n" "RegisterProduct\t\t900\n" "PublishFeatures\t\t1000\n" "PublishProduct\t\t1100\n" "InstallFinalize\t\t1200\n"; +static const char env_custom_action_dat[] = + "Action\tType\tSource\tTarget\n" + "s72\ti2\tS64\tS0\n" + "CustomAction\tAction\n" + "wes_immediate\t1\tcustom.dll\tenv_absent\n" + "wes_deferred\t1025\tcustom.dll\tenv_present\n" + "res_immediate\t1\tcustom.dll\tenv_present\n" + "res_deferred\t1025\tcustom.dll\tenv_absent\n"; + static const char env_environment_dat[] = "Environment\tName\tValue\tComponent_\n" "s72\tl255\tL255\ts72\n" @@ -1953,6 +1966,7 @@ static const msi_table env_tables[] = ADD_TABLE(feature_comp), ADD_TABLE(file), ADD_TABLE(env_install_exec_seq), + ADD_TABLE(env_custom_action), ADD_TABLE(media), ADD_TABLE(property), ADD_TABLE(env_environment) diff --git a/modules/rostests/winetests/msi/custom.c b/modules/rostests/winetests/msi/custom.c index 3fb538203f8..b1823043df2 100644 --- a/modules/rostests/winetests/msi/custom.c +++ b/modules/rostests/winetests/msi/custom.c @@ -1858,3 +1858,35 @@ todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) return ERROR_SUCCESS; } + +UINT WINAPI env_present(MSIHANDLE hinst) +{ + HKEY key; + LONG res; + + res = RegOpenKeyA(HKEY_CURRENT_USER, "Environment", &key); + ok(hinst, !res, "got %u\n", res); +todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) { + check_reg_str(hinst, key, "MSITESTVAR3", "1"); + check_reg_str(hinst, key, "MSITESTVAR4", "1"); +} + RegCloseKey(key); + + return ERROR_SUCCESS; +} + +UINT WINAPI env_absent(MSIHANDLE hinst) +{ + HKEY key; + LONG res; + + res = RegOpenKeyA(HKEY_CURRENT_USER, "Environment", &key); + ok(hinst, !res, "got %u\n", res); +todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) { + check_reg_str(hinst, key, "MSITESTVAR3", NULL); + check_reg_str(hinst, key, "MSITESTVAR4", NULL); +} + RegCloseKey(key); + + return ERROR_SUCCESS; +} diff --git a/modules/rostests/winetests/msi/custom.spec b/modules/rostests/winetests/msi/custom.spec index 2ec5b6cc6d7..8b3c2fbf389 100644 --- a/modules/rostests/winetests/msi/custom.spec +++ b/modules/rostests/winetests/msi/custom.spec @@ -7,6 +7,8 @@ @ stdcall cf_absent(long) @ stdcall crs_present(long) @ stdcall crs_absent(long) +@ stdcall env_present(long) +@ stdcall env_absent(long) @ stdcall file_present(long) @ stdcall file_absent(long) @ stdcall font_present(long)
2 years, 9 months
1
0
0
0
[reactos] 96/360: [WINESYNC] msi/tests: Simplify and combine environment variable tests.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=7b0084e68a41e070ea79f…
commit 7b0084e68a41e070ea79f9322267f57fce6be785 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sat Mar 12 16:34:01 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:27:52 2022 +0100 [WINESYNC] msi/tests: Simplify and combine environment variable tests. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 2765b4778092a9ee25156c2b0facc34fe3861587 by Zebediah Figura <z.figura12(a)gmail.com> --- modules/rostests/winetests/msi/action.c | 416 +++++--------------------------- 1 file changed, 64 insertions(+), 352 deletions(-) diff --git a/modules/rostests/winetests/msi/action.c b/modules/rostests/winetests/msi/action.c index 2152629e849..cc222ed09cd 100644 --- a/modules/rostests/winetests/msi/action.c +++ b/modules/rostests/winetests/msi/action.c @@ -146,7 +146,6 @@ static const char install_exec_seq_dat[] = "MoveFiles\t\t1700\n" "InstallFiles\t\t4000\n" "DuplicateFiles\t\t4500\n" - "WriteEnvironmentStrings\t\t4550\n" "CreateShortcuts\t\t4600\n" "InstallServices\t\t5000\n" "InstallFinalize\t\t6600\n" @@ -189,7 +188,24 @@ static const char property_dat[] = "MSIFASTINSTALL\t1\n" "regdata15\t#x01\n"; -static const char environment_dat[] = +static const char env_install_exec_seq_dat[] = + "Action\tCondition\tSequence\n" + "s72\tS255\tI2\n" + "InstallExecuteSequence\tAction\n" + "CostInitialize\t\t100\n" + "FileCost\t\t200\n" + "CostFinalize\t\t300\n" + "InstallValidate\t\t400\n" + "InstallInitialize\t\t500\n" + "ProcessComponents\t\t600\n" + "WriteEnvironmentStrings\t\t700\n" + "RemoveEnvironmentStrings\t\t800\n" + "RegisterProduct\t\t900\n" + "PublishFeatures\t\t1000\n" + "PublishProduct\t\t1100\n" + "InstallFinalize\t\t1200\n"; + +static const char env_environment_dat[] = "Environment\tName\tValue\tComponent_\n" "s72\tl255\tL255\ts72\n" "Environment\tEnvironment\n" @@ -219,7 +235,9 @@ static const char environment_dat[] = "Var24\t+-MSITESTVAR19\t[~]2\tOne\n" "Var25\t+-MSITESTVAR20\t1\tOne\n" "Var26\t+-MSITESTVAR20\t2[~]\tOne\n" - "Var27\t+-MSITESTVAR21\t[~];1\tOne\n"; + "Var27\t+-MSITESTVAR21\t[~];1\tOne\n" + "Var28\t-MSITESTVAR22\t1\tOne\n" + "Var29\t-MSITESTVAR23\t2\tOne\n"; static const char service_install_dat[] = "ServiceInstall\tName\tDisplayName\tServiceType\tStartType\tErrorControl\t" @@ -1431,65 +1449,6 @@ static const char riv_install_exec_seq_dat[] = "PublishProduct\t\t5200\n" "InstallFinalize\t\t6000\n"; -static const char res_file_dat[] = - "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n" - "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n" - "File\tFile\n" - "envvar.txt\tenvvar\tenvvar.txt\t1000\t\t\t8192\t1\n"; - -static const char res_feature_dat[] = - "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n" - "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n" - "Feature\tFeature\n" - "envvar\t\t\tenvvar feature\t1\t2\tMSITESTDIR\t0\n"; - -static const char res_feature_comp_dat[] = - "Feature_\tComponent_\n" - "s38\ts72\n" - "FeatureComponents\tFeature_\tComponent_\n" - "envvar\tenvvar\n"; - -static const char res_component_dat[] = - "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n" - "s72\tS38\ts72\ti2\tS255\tS72\n" - "Component\tComponent\n" - "envvar\t{45EE9AF4-E5D1-445F-8BB7-B22D4EEBD29E}\tMSITESTDIR\t0\t\tenvvar.txt\n"; - -static const char res_environment_dat[] = - "Environment\tName\tValue\tComponent_\n" - "s72\tl255\tL255\ts72\n" - "Environment\tEnvironment\n" - "var1\t=-MSITESTVAR1\t1\tenvvar\n" - "var2\t=+-MSITESTVAR2\t1\tenvvar\n" - "var3\t=MSITESTVAR3\t1\tenvvar\n" - "var4\t=-MSITESTVAR4\t\tenvvar\n" - "var5\t=MSITESTVAR5\t\tenvvar\n" - "Var6\t-MSITESTVAR6\t1;[~]\tenvvar\n" - "Var7\t-MSITESTVAR7\t[~];1\tenvvar\n" - "Var8\t-MSITESTVAR8\t1;[~]\tenvvar\n" - "Var9\t-MSITESTVAR9\t[~];1\tenvvar\n" - "Var10\t-MSITESTVAR10\t1\tenvvar\n" - "Var11\t-MSITESTVAR11\t2\tenvvar\n"; - -static const char res_install_exec_seq_dat[] = - "Action\tCondition\tSequence\n" - "s72\tS255\tI2\n" - "InstallExecuteSequence\tAction\n" - "LaunchConditions\t\t100\n" - "CostInitialize\t\t800\n" - "FileCost\t\t900\n" - "CostFinalize\t\t1000\n" - "InstallValidate\t\t1400\n" - "InstallInitialize\t\t1500\n" - "ProcessComponents\t\t1600\n" - "RemoveFiles\t\t1700\n" - "InstallFiles\t\t2000\n" - "RemoveEnvironmentStrings\t\t3000\n" - "RegisterProduct\t\t5000\n" - "PublishFeatures\t\t5100\n" - "PublishProduct\t\t5200\n" - "InstallFinalize\t\t6000\n"; - static const char rci_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n" "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n" @@ -1993,10 +1952,10 @@ static const msi_table env_tables[] = ADD_TABLE(feature), ADD_TABLE(feature_comp), ADD_TABLE(file), - ADD_TABLE(install_exec_seq), + ADD_TABLE(env_install_exec_seq), ADD_TABLE(media), ADD_TABLE(property), - ADD_TABLE(environment) + ADD_TABLE(env_environment) }; static const msi_table pp_tables[] = @@ -2290,19 +2249,6 @@ static const msi_table riv_tables[] = ADD_TABLE(property) }; -static const msi_table res_tables[] = -{ - ADD_TABLE(directory), - ADD_TABLE(res_component), - ADD_TABLE(res_feature), - ADD_TABLE(res_feature_comp), - ADD_TABLE(res_file), - ADD_TABLE(res_environment), - ADD_TABLE(res_install_exec_seq), - ADD_TABLE(media), - ADD_TABLE(property) -}; - static const msi_table rci_tables[] = { ADD_TABLE(directory), @@ -4972,27 +4918,10 @@ error: static void test_envvar(void) { - static const char *results[] = - { - "1;2", /* MSITESTVAR11 */ - "1", /* MSITESTVAR12 */ - "1;2", /* MSITESTVAR13 */ - ";1;", /* MSITESTVAR14 */ - ";;1;;", /* MSITESTVAR15 */ - " 1 ", /* MSITESTVAR16 */ - ";;2;;1", /* MSITESTVAR17 */ - "1;;2;;", /* MSITESTVAR18 */ - "1", /* MSITESTVAR19 */ - "1", /* MSITESTVAR20 */ - "1", /* MSITESTVAR21 */ - NULL - }; - UINT r; + char buffer[16]; + UINT r, i; HKEY env; LONG res; - DWORD type, size; - char buffer[16]; - UINT i; if (is_process_limited()) { @@ -5000,7 +4929,6 @@ static void test_envvar(void) return; } - create_test_files(); create_database(msifile, env_tables, sizeof(env_tables) / sizeof(msi_table)); res = RegCreateKeyExA(HKEY_CURRENT_USER, "Environment", 0, NULL, 0, KEY_ALL_ACCESS, NULL, &env, NULL); @@ -5025,33 +4953,10 @@ static void test_envvar(void) } ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); - type = REG_NONE; - size = sizeof(buffer); - buffer[0] = 0; - res = RegQueryValueExA(env, "MSITESTVAR1", NULL, &type, (LPBYTE)buffer, &size); - ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); - ok(type == REG_SZ, "Expected REG_SZ, got %u\n", type); - ok(!lstrcmpA(buffer, "1"), "Expected \"1\", got %s\n", buffer); - - res = RegDeleteValueA(env, "MSITESTVAR1"); - ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); - - type = REG_NONE; - size = sizeof(buffer); - buffer[0] = 0; - res = RegQueryValueExA(env, "MSITESTVAR2", NULL, &type, (LPBYTE)buffer, &size); - ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); - ok(type == REG_SZ, "Expected REG_SZ, got %u\n", type); - ok(!lstrcmpA(buffer, "1"), "Expected \"1\", got %s\n", buffer); - - res = RegDeleteValueA(env, "MSITESTVAR2"); - ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); - - res = RegDeleteValueA(env, "MSITESTVAR3"); - ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); - - res = RegDeleteValueA(env, "MSITESTVAR4"); - ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); + CHECK_REG_STR(env, "MSITESTVAR1", "1"); + CHECK_REG_STR(env, "MSITESTVAR2", "1"); + CHECK_REG_STR(env, "MSITESTVAR3", "1"); + CHECK_REG_STR(env, "MSITESTVAR4", "1"); res = RegDeleteValueA(env, "MSITESTVAR5"); ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res); @@ -5071,46 +4976,50 @@ static void test_envvar(void) res = RegDeleteValueA(env, "MSITESTVAR10"); ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res); - i = 11; - while (results[i - 11]) + CHECK_REG_STR(env, "MSITESTVAR11", "1;2"); + CHECK_REG_STR(env, "MSITESTVAR12", "1"); + CHECK_REG_STR(env, "MSITESTVAR13", "1;2"); + CHECK_REG_STR(env, "MSITESTVAR14", ";1;"); + CHECK_REG_STR(env, "MSITESTVAR15", ";;1;;"); + CHECK_REG_STR(env, "MSITESTVAR16", " 1 "); + CHECK_REG_STR(env, "MSITESTVAR17", ";;2;;1"); + CHECK_REG_STR(env, "MSITESTVAR18", "1;;2;;"); + CHECK_REG_STR(env, "MSITESTVAR19", "1"); + CHECK_REG_STR(env, "MSITESTVAR20", "1"); + CHECK_REG_STR(env, "MSITESTVAR21", "1"); + + res = RegSetValueExA(env, "MSITESTVAR22", 0, REG_SZ, (const BYTE *)"1", 2); + ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); + + res = RegSetValueExA(env, "MSITESTVAR23", 0, REG_SZ, (const BYTE *)"1", 2); + ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); + + r = MsiInstallProductA(msifile, "REMOVE=ALL"); + ok(!r, "got %u\n", r); + + CHECK_DEL_REG_STR(env, "MSITESTVAR13", "1;2"); + CHECK_DEL_REG_STR(env, "MSITESTVAR14", ";1;"); + CHECK_DEL_REG_STR(env, "MSITESTVAR15", ";;1;;"); + CHECK_DEL_REG_STR(env, "MSITESTVAR16", " 1 "); +todo_wine { + CHECK_DEL_REG_STR(env, "MSITESTVAR17", "1"); + CHECK_DEL_REG_STR(env, "MSITESTVAR18", "1"); +} + CHECK_DEL_REG_STR(env, "MSITESTVAR23", "1"); + + for (i = 1; i <= 23; i++) { - char name[20]; - sprintf(name, "MSITESTVAR%d", i); - - type = REG_NONE; - size = sizeof(buffer); - buffer[0] = 0; - res = RegQueryValueExA(env, name, NULL, &type, (LPBYTE)buffer, &size); - ok(res == ERROR_SUCCESS, "%d: Expected ERROR_SUCCESS, got %d\n", i, res); - ok(type == REG_SZ, "%d: Expected REG_SZ, got %u\n", i, type); - ok(!lstrcmpA(buffer, results[i - 11]), "%d: Expected %s, got %s\n", i, results[i - 11], buffer); - - res = RegDeleteValueA(env, name); - ok(res == ERROR_SUCCESS, "%d: Expected ERROR_SUCCESS, got %d\n", i, res); - i++; + sprintf(buffer, "MSITESTVAR%i", i); + res = RegDeleteValueA(env, buffer); + ok(res == ERROR_FILE_NOT_FOUND, "[%d] got %u\n", i, res); } - delete_pf("msitest\\cabout\\new\\five.txt", TRUE); - delete_pf("msitest\\cabout\\new", FALSE); - delete_pf("msitest\\cabout\\four.txt", TRUE); - delete_pf("msitest\\cabout", FALSE); - delete_pf("msitest\\changed\\three.txt", TRUE); - delete_pf("msitest\\changed", FALSE); - delete_pf("msitest\\first\\two.txt", TRUE); - delete_pf("msitest\\first", FALSE); - delete_pf("msitest\\filename", TRUE); - delete_pf("msitest\\one.txt", TRUE); - delete_pf("msitest\\service.exe", TRUE); - delete_pf("msitest\\service2.exe", TRUE); - delete_pf("msitest", FALSE); - error: RegDeleteValueA(env, "MSITESTVAR1"); RegDeleteValueA(env, "MSITESTVAR2"); RegDeleteValueA(env, "MSITESTVAR21"); RegCloseKey(env); - delete_test_files(); DeleteFileA(msifile); } @@ -6130,202 +6039,6 @@ error: DeleteFileA(msifile); } -static void test_remove_env_strings(void) -{ - UINT r; - LONG res; - HKEY key; - DWORD type, size; - char buffer[0x10]; - - if (is_process_limited()) - { - skip("process is limited\n"); - return; - } - - create_test_files(); - create_file("msitest\\envvar.txt", 1000); - create_database(msifile, res_tables, sizeof(res_tables) / sizeof(msi_table)); - - MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); - - res = RegOpenKeyA(HKEY_CURRENT_USER, "Environment", &key); - ok(!res, "failed to open environment key %d\n", res); - - RegSetValueExA(key, "MSITESTVAR1", 0, REG_SZ, (const BYTE *)"1", 2); - RegSetValueExA(key, "MSITESTVAR2", 0, REG_SZ, (const BYTE *)"1", 2); - RegSetValueExA(key, "MSITESTVAR3", 0, REG_SZ, (const BYTE *)"1", 2); - RegSetValueExA(key, "MSITESTVAR4", 0, REG_SZ, (const BYTE *)"1", 2); - RegSetValueExA(key, "MSITESTVAR5", 0, REG_SZ, (const BYTE *)"1", 2); - RegSetValueExA(key, "MSITESTVAR6", 0, REG_SZ, (const BYTE *)"1;2", 4); - RegSetValueExA(key, "MSITESTVAR7", 0, REG_SZ, (const BYTE *)"1;2", 4); - RegSetValueExA(key, "MSITESTVAR8", 0, REG_SZ, (const BYTE *)"2;1;0", 6); - RegSetValueExA(key, "MSITESTVAR9", 0, REG_SZ, (const BYTE *)"0;1;2", 6); - RegSetValueExA(key, "MSITESTVAR10", 0, REG_SZ, (const BYTE *)"1", 2); - RegSetValueExA(key, "MSITESTVAR11", 0, REG_SZ, (const BYTE *)"1", 2); - - RegCloseKey(key); - - r = MsiInstallProductA(msifile, NULL); - if (r == ERROR_INSTALL_PACKAGE_REJECTED) - { - skip("Not enough rights to perform tests\n"); - goto error; - } - ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); - - res = RegOpenKeyA(HKEY_CURRENT_USER, "Environment", &key); - ok(!res, "failed to open environment key %d\n", res); - - type = REG_NONE; - buffer[0] = 0; - size = sizeof(buffer); - res = RegQueryValueExA(key, "MSITESTVAR1", NULL, &type, (LPBYTE)buffer, &size); - ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); - ok(type == REG_SZ, "expected REG_SZ, got %u\n", type); - ok(!lstrcmpA(buffer, "1"), "expected \"1\", got \"%s\"\n", buffer); - - type = REG_NONE; - buffer[0] = 0; - size = sizeof(buffer); - res = RegQueryValueExA(key, "MSITESTVAR2", NULL, &type, (LPBYTE)buffer, &size); - ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); - ok(type == REG_SZ, "expected REG_SZ, got %u\n", type); - ok(!lstrcmpA(buffer, "1"), "expected \"1\", got \"%s\"\n", buffer); - - type = REG_NONE; - buffer[0] = 0; - size = sizeof(buffer); - res = RegQueryValueExA(key, "MSITESTVAR3", NULL, &type, (LPBYTE)buffer, &size); - ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); - ok(type == REG_SZ, "expected REG_SZ, got %u\n", type); - ok(!lstrcmpA(buffer, "1"), "expected \"1\", got \"%s\"\n", buffer); - - type = REG_NONE; - buffer[0] = 0; - size = sizeof(buffer); - res = RegQueryValueExA(key, "MSITESTVAR4", NULL, &type, (LPBYTE)buffer, &size); - ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); - ok(type == REG_SZ, "expected REG_SZ, got %u\n", type); - ok(!lstrcmpA(buffer, "1"), "expected \"1\", got \"%s\"\n", buffer); - - type = REG_NONE; - buffer[0] = 0; - size = sizeof(buffer); - res = RegQueryValueExA(key, "MSITESTVAR5", NULL, &type, (LPBYTE)buffer, &size); - ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); - ok(type == REG_SZ, "expected REG_SZ, got %u\n", type); - ok(!lstrcmpA(buffer, "1"), "expected \"1\", got \"%s\"\n", buffer); - - RegCloseKey(key); - - r = MsiInstallProductA(msifile, "REMOVE=ALL"); - ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); - - res = RegOpenKeyA(HKEY_CURRENT_USER, "Environment", &key); - ok(!res, "failed to open environment key %d\n", res); - - res = RegQueryValueExA(key, "MSITESTVAR1", NULL, NULL, NULL, NULL); - ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res); - - res = RegQueryValueExA(key, "MSITESTVAR2", NULL, NULL, NULL, NULL); - ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res); - - type = REG_NONE; - buffer[0] = 0; - size = sizeof(buffer); - res = RegQueryValueExA(key, "MSITESTVAR3", NULL, &type, (LPBYTE)buffer, &size); - ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); - ok(type == REG_SZ, "expected REG_SZ, got %u\n", type); - ok(!lstrcmpA(buffer, "1"), "expected \"1\", got \"%s\"\n", buffer); - RegDeleteValueA(key, "MSITESTVAR3"); - - res = RegQueryValueExA(key, "MSITESTVAR4", NULL, NULL, NULL, NULL); - ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res); - - type = REG_NONE; - buffer[0] = 0; - size = sizeof(buffer); - res = RegQueryValueExA(key, "MSITESTVAR5", NULL, &type, (LPBYTE)buffer, &size); - ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); - ok(type == REG_SZ, "expected REG_SZ, got %u\n", type); - ok(!lstrcmpA(buffer, "1"), "expected \"1\", got \"%s\"\n", buffer); - RegDeleteValueA(key, "MSITESTVAR5"); - - type = REG_NONE; - buffer[0] = 0; - size = sizeof(buffer); - res = RegQueryValueExA(key, "MSITESTVAR6", NULL, &type, (LPBYTE)buffer, &size); - ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); - ok(type == REG_SZ, "expected REG_SZ, got %u\n", type); - ok(!lstrcmpA(buffer, "2"), "expected \"2\", got \"%s\"\n", buffer); - RegDeleteValueA(key, "MSITESTVAR6"); - - type = REG_NONE; - buffer[0] = 0; - size = sizeof(buffer); - res = RegQueryValueExA(key, "MSITESTVAR7", NULL, &type, (LPBYTE)buffer, &size); - ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); - ok(type == REG_SZ, "expected REG_SZ, got %u\n", type); - ok(!lstrcmpA(buffer, "2"), "expected \"2\", got \"%s\"\n", buffer); - RegDeleteValueA(key, "MSITESTVAR7"); - - type = REG_NONE; - buffer[0] = 0; - size = sizeof(buffer); - res = RegQueryValueExA(key, "MSITESTVAR8", NULL, &type, (LPBYTE)buffer, &size); - ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); - ok(type == REG_SZ, "expected REG_SZ, got %u\n", type); - ok(!lstrcmpA(buffer, "2;0"), "expected \"2;0\", got \"%s\"\n", buffer); - RegDeleteValueA(key, "MSITESTVAR8"); - - type = REG_NONE; - buffer[0] = 0; - size = sizeof(buffer); - res = RegQueryValueExA(key, "MSITESTVAR9", NULL, &type, (LPBYTE)buffer, &size); - ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); - ok(type == REG_SZ, "expected REG_SZ, got %u\n", type); - ok(!lstrcmpA(buffer, "0;2"), "expected \"0;2\", got \"%s\"\n", buffer); - RegDeleteValueA(key, "MSITESTVAR9"); - - type = REG_NONE; - buffer[0] = 0; - size = sizeof(buffer); - res = RegQueryValueExA(key, "MSITESTVAR10", NULL, &type, (LPBYTE)buffer, &size); - ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res); - - type = REG_NONE; - buffer[0] = 0; - size = sizeof(buffer); - res = RegQueryValueExA(key, "MSITESTVAR11", NULL, &type, (LPBYTE)buffer, &size); - ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); - ok(type == REG_SZ, "expected REG_SZ, got %u\n", type); - ok(!lstrcmpA(buffer, "1"), "expected \"1\", got \"%s\"\n", buffer); - RegDeleteValueA(key, "MSITESTVAR11"); - - ok(!delete_pf("msitest\\envvar.txt", TRUE), "file not removed\n"); - ok(!delete_pf("msitest", FALSE), "directory not removed\n"); - -error: - RegDeleteValueA(key, "MSITESTVAR1"); - RegDeleteValueA(key, "MSITESTVAR2"); - RegDeleteValueA(key, "MSITESTVAR3"); - RegDeleteValueA(key, "MSITESTVAR4"); - RegDeleteValueA(key, "MSITESTVAR5"); - RegDeleteValueA(key, "MSITESTVAR6"); - RegDeleteValueA(key, "MSITESTVAR7"); - RegDeleteValueA(key, "MSITESTVAR8"); - RegDeleteValueA(key, "MSITESTVAR9"); - RegDeleteValueA(key, "MSITESTVAR10"); - RegDeleteValueA(key, "MSITESTVAR11"); - RegCloseKey(key); - - DeleteFileA("msitest\\envvar.txt"); - delete_test_files(); - DeleteFileA(msifile); -} - static void test_register_class_info(void) { UINT r; @@ -6936,7 +6649,6 @@ START_TEST(action) test_remove_registry_values(); test_find_related_products(); test_remove_ini_values(); - test_remove_env_strings(); test_register_class_info(); test_register_extension_info(); test_register_progid_info();
2 years, 9 months
1
0
0
0
[reactos] 95/360: [WINESYNC] msi/tests: Test deferral of SelfRegModules and SelfUnregModules.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=342159af51a40c3684c31…
commit 342159af51a40c3684c31261bc814ec9d33683f9 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sat Mar 12 16:34:01 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:27:52 2022 +0100 [WINESYNC] msi/tests: Test deferral of SelfRegModules and SelfUnregModules. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id a08438afbd1d111e78ebb7fb0743a456f1da4d19 by Zebediah Figura <z.figura12(a)gmail.com> --- modules/rostests/winetests/msi/action.c | 14 ++++++++++++++ modules/rostests/winetests/msi/custom.c | 25 +++++++++++++++++++++++++ modules/rostests/winetests/msi/custom.spec | 2 ++ 3 files changed, 41 insertions(+) diff --git a/modules/rostests/winetests/msi/action.c b/modules/rostests/winetests/msi/action.c index 8f26385b36a..2152629e849 100644 --- a/modules/rostests/winetests/msi/action.c +++ b/modules/rostests/winetests/msi/action.c @@ -777,15 +777,28 @@ static const char sr_install_exec_seq_dat[] = "InstallInitialize\t\t1500\n" "ProcessComponents\t\t1600\n" "SelfUnregModules\t\t3800\n" + "su_immediate\tREMOVE\t3801\n" + "su_deferred\tREMOVE\t3802\n" "RemoveFiles\t\t3900\n" "InstallFiles\t\t4000\n" "SelfRegModules\t\t4100\n" + "sr_immediate\tNOT REMOVE\t4101\n" + "sr_deferred\tNOT REMOVE\t4102\n" "CreateShortcuts\t\t4600\n" "RegisterProduct\t\t5100\n" "PublishFeatures\t\t5200\n" "PublishProduct\t\t5300\n" "InstallFinalize\t\t6600\n"; +static const char sr_custom_action_dat[] = + "Action\tType\tSource\tTarget\n" + "s72\ti2\tS64\tS0\n" + "CustomAction\tAction\n" + "sr_immediate\t1\tcustom.dll\tsr_absent\n" + "sr_deferred\t1025\tcustom.dll\tsr_present\n" + "su_immediate\t1\tcustom.dll\tsr_present\n" + "su_deferred\t1025\tcustom.dll\tsr_absent\n"; + static const char font_media_dat[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n" "i2\ti4\tL64\tS255\tS32\tS72\n" @@ -2131,6 +2144,7 @@ static const msi_table sr_tables[] = ADD_TABLE(sr_file), ADD_TABLE(sr_selfreg), ADD_TABLE(sr_install_exec_seq), + ADD_TABLE(sr_custom_action), ADD_TABLE(media), ADD_TABLE(property) }; diff --git a/modules/rostests/winetests/msi/custom.c b/modules/rostests/winetests/msi/custom.c index b7da2b8fcc8..3fb538203f8 100644 --- a/modules/rostests/winetests/msi/custom.c +++ b/modules/rostests/winetests/msi/custom.c @@ -1833,3 +1833,28 @@ todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) return ERROR_SUCCESS; } + +UINT WINAPI sr_present(MSIHANDLE hinst) +{ + HKEY key; + LONG res; + + res = RegOpenKeyA(HKEY_CLASSES_ROOT, "selfreg_test", &key); +todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) + ok(hinst, !res, "got %u\n", res); + RegCloseKey(key); + + return ERROR_SUCCESS; +} + +UINT WINAPI sr_absent(MSIHANDLE hinst) +{ + HKEY key; + LONG res; + + res = RegOpenKeyA(HKEY_CLASSES_ROOT, "selfreg_test", &key); +todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) + ok(hinst, res == ERROR_FILE_NOT_FOUND, "got %u\n", res); + + return ERROR_SUCCESS; +} diff --git a/modules/rostests/winetests/msi/custom.spec b/modules/rostests/winetests/msi/custom.spec index 058a9172f1f..2ec5b6cc6d7 100644 --- a/modules/rostests/winetests/msi/custom.spec +++ b/modules/rostests/winetests/msi/custom.spec @@ -43,6 +43,8 @@ @ stdcall sds_absent(long) @ stdcall sis_present(long) @ stdcall sis_absent(long) +@ stdcall sr_present(long) +@ stdcall sr_absent(long) @ stdcall sss_started(long) @ stdcall sss_stopped(long) @ stdcall tl_present(long)
2 years, 9 months
1
0
0
0
[reactos] 94/360: [WINESYNC] msi/tests: Test self-registration of a valid DLL.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=761e72c7d0b3d5a7988c5…
commit 761e72c7d0b3d5a7988c515f70715e11469851ce Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sat Mar 12 16:17:14 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:27:51 2022 +0100 [WINESYNC] msi/tests: Test self-registration of a valid DLL. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 8867712944d839385837ae4db8b50fff1380c507 by Zebediah Figura <z.figura12(a)gmail.com> --- modules/rostests/winetests/msi/CMakeLists.txt | 9 ++- modules/rostests/winetests/msi/action.c | 83 +++++++++++++++++--------- modules/rostests/winetests/msi/msi_winetest.rc | 1 + modules/rostests/winetests/msi/selfreg.c | 38 ++++++++++++ modules/rostests/winetests/msi/selfreg.spec | 2 + 5 files changed, 103 insertions(+), 30 deletions(-) diff --git a/modules/rostests/winetests/msi/CMakeLists.txt b/modules/rostests/winetests/msi/CMakeLists.txt index acdd7c13a47..8a6c44c7070 100644 --- a/modules/rostests/winetests/msi/CMakeLists.txt +++ b/modules/rostests/winetests/msi/CMakeLists.txt @@ -5,6 +5,11 @@ target_link_libraries(custom uuid) set_module_type(custom win32dll) add_importlibs(custom msi ole32 oleaut32 odbccp32 shell32 advapi32 msvcrt kernel32) +spec2def(selfreg.dll selfreg.spec) +add_library(selfreg MODULE selfreg.c ${CMAKE_CURRENT_BINARY_DIR}/selfreg.def) +set_module_type(selfreg win32dll) +add_importlibs(selfreg advapi32 msvcrt kernel32) + list(APPEND SOURCE action.c automation.c @@ -25,7 +30,7 @@ list(APPEND PCH_SKIP_SOURCE # CMake 3.9 and higher requires to specify this dependency manually # see
https://gitlab.kitware.com/cmake/cmake/issues/19933
-set_property(SOURCE msi_winetest.rc PROPERTY OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/custom.dll ${CMAKE_CURRENT_BINARY_DIR}/typelib.tlb) +set_property(SOURCE msi_winetest.rc PROPERTY OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/custom.dll ${CMAKE_CURRENT_BINARY_DIR}/selfreg.dll ${CMAKE_CURRENT_BINARY_DIR}/typelib.tlb) add_executable(msi_winetest ${SOURCE} @@ -52,4 +57,4 @@ set_module_type(msi_winetest win32cui) add_importlibs(msi_winetest cabinet msi shell32 ole32 oleaut32 odbccp32 user32 advapi32 version msvcrt kernel32) add_pch(msi_winetest precomp.h "${PCH_SKIP_SOURCE}") add_rostests_file(TARGET msi_winetest) -add_dependencies(msi_winetest custom msi_winetest_idlheader stdole2) +add_dependencies(msi_winetest custom selfreg msi_winetest_idlheader stdole2) diff --git a/modules/rostests/winetests/msi/action.c b/modules/rostests/winetests/msi/action.c index 98d030354ca..8f26385b36a 100644 --- a/modules/rostests/winetests/msi/action.c +++ b/modules/rostests/winetests/msi/action.c @@ -736,30 +736,55 @@ static const char cf_custom_action_dat[] = "rf_immediate\t1\tcustom.dll\tcf_present\n" "rf_deferred\t1025\tcustom.dll\tcf_absent\n"; +static const char sr_file_dat[] = + "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n" + "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n" + "File\tFile\n" + "selfreg.dll\tselfreg\tselfreg.dll\t1000\t\t\t8192\t1\n"; + +static const char sr_feature_dat[] = + "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n" + "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n" + "Feature\tFeature\n" + "selfreg\t\t\tselfreg feature\t1\t2\tMSITESTDIR\t0\n"; + +static const char sr_feature_comp_dat[] = + "Feature_\tComponent_\n" + "s38\ts72\n" + "FeatureComponents\tFeature_\tComponent_\n" + "selfreg\tselfreg\n"; + +static const char sr_component_dat[] = + "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n" + "s72\tS38\ts72\ti2\tS255\tS72\n" + "Component\tComponent\n" + "selfreg\t{BB4C26FD-89D8-4E49-AF1C-DB4DCB5BF1B0}\tMSITESTDIR\t0\t\tselfreg.dll\n"; + static const char sr_selfreg_dat[] = "File_\tCost\n" "s72\tI2\n" "SelfReg\tFile_\n" - "one.txt\t1\n"; + "selfreg.dll\t\n"; static const char sr_install_exec_seq_dat[] = "Action\tCondition\tSequence\n" "s72\tS255\tI2\n" "InstallExecuteSequence\tAction\n" - "CostFinalize\t\t1000\n" "CostInitialize\t\t800\n" "FileCost\t\t900\n" - "ResolveSource\t\t950\n" - "MoveFiles\t\t1700\n" - "SelfUnregModules\t\t3900\n" + "CostFinalize\t\t1000\n" + "InstallValidate\t\t1400\n" + "InstallInitialize\t\t1500\n" + "ProcessComponents\t\t1600\n" + "SelfUnregModules\t\t3800\n" + "RemoveFiles\t\t3900\n" "InstallFiles\t\t4000\n" - "DuplicateFiles\t\t4500\n" - "WriteEnvironmentStrings\t\t4550\n" + "SelfRegModules\t\t4100\n" "CreateShortcuts\t\t4600\n" - "InstallFinalize\t\t6600\n" - "InstallInitialize\t\t1500\n" - "InstallValidate\t\t1400\n" - "LaunchConditions\t\t100\n"; + "RegisterProduct\t\t5100\n" + "PublishFeatures\t\t5200\n" + "PublishProduct\t\t5300\n" + "InstallFinalize\t\t6600\n"; static const char font_media_dat[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n" @@ -2099,11 +2124,11 @@ static const msi_table sis_tables[] = static const msi_table sr_tables[] = { - ADD_TABLE(component), + ADD_TABLE(sr_component), ADD_TABLE(directory), - ADD_TABLE(feature), - ADD_TABLE(feature_comp), - ADD_TABLE(file), + ADD_TABLE(sr_feature), + ADD_TABLE(sr_feature_comp), + ADD_TABLE(sr_file), ADD_TABLE(sr_selfreg), ADD_TABLE(sr_install_exec_seq), ADD_TABLE(media), @@ -5398,6 +5423,7 @@ error: static void test_self_registration(void) { + HKEY key; UINT r; if (is_process_limited()) @@ -5407,6 +5433,7 @@ static void test_self_registration(void) } create_test_files(); + extract_resource("selfreg.dll", "TESTDLL", "msitest\\selfreg.dll"); create_database(msifile, sr_tables, sizeof(sr_tables) / sizeof(msi_table)); MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); @@ -5419,21 +5446,21 @@ static void test_self_registration(void) } ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); - ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n"); - ok(delete_pf("msitest\\cabout\\new", FALSE), "Directory not created\n"); - ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n"); - ok(delete_pf("msitest\\cabout", FALSE), "Directory not created\n"); - ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n"); - ok(delete_pf("msitest\\changed", FALSE), "Directory not created\n"); - ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n"); - ok(delete_pf("msitest\\first", FALSE), "Directory not created\n"); - ok(delete_pf("msitest\\filename", TRUE), "File not installed\n"); - ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n"); - ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n"); - ok(delete_pf("msitest\\service2.exe", TRUE), "File not installed\n"); - ok(delete_pf("msitest", FALSE), "Directory not created\n"); + r = RegOpenKeyA(HKEY_CLASSES_ROOT, "selfreg_test", &key); + ok(!r, "got %u\n", r); + RegCloseKey(key); + + r = MsiInstallProductA(msifile, "REMOVE=ALL"); + ok(!r, "got %u\n", r); + + r = RegOpenKeyA(HKEY_CLASSES_ROOT, "selfreg_test", &key); + ok(r == ERROR_FILE_NOT_FOUND, "got %u\n", r); + + ok(!delete_pf("msitest\\selfreg.dll", TRUE), "file not removed\n"); + ok(!delete_pf("msitest", FALSE), "directory not removed\n"); error: + DeleteFileA("msitest\\selfreg.dll"); delete_test_files(); DeleteFileA(msifile); } diff --git a/modules/rostests/winetests/msi/msi_winetest.rc b/modules/rostests/winetests/msi/msi_winetest.rc index f1840396a75..661f39bad2c 100644 --- a/modules/rostests/winetests/msi/msi_winetest.rc +++ b/modules/rostests/winetests/msi/msi_winetest.rc @@ -1,4 +1,5 @@ CUSTOM.DLL TESTDLL "custom.dll" +SELFREG.DLL TESTDLL "selfreg.dll" typelib.tlb TYPELIB "typelib.tlb" diff --git a/modules/rostests/winetests/msi/selfreg.c b/modules/rostests/winetests/msi/selfreg.c new file mode 100644 index 00000000000..668e742e9ba --- /dev/null +++ b/modules/rostests/winetests/msi/selfreg.c @@ -0,0 +1,38 @@ +/* + * DLL for testing self-registration + * + * Copyright 2018 Zebediah Figura + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include <stdarg.h> +#include <windef.h> +#include <winbase.h> +#include <winreg.h> + +HRESULT WINAPI DllRegisterServer(void) +{ + HKEY key; + RegCreateKeyA(HKEY_CLASSES_ROOT, "selfreg_test", &key); + RegCloseKey(key); + return S_OK; +} + +HRESULT WINAPI DllUnregisterServer(void) +{ + RegDeleteKeyA(HKEY_CLASSES_ROOT, "selfreg_test"); + return S_OK; +} diff --git a/modules/rostests/winetests/msi/selfreg.spec b/modules/rostests/winetests/msi/selfreg.spec new file mode 100644 index 00000000000..0f9b07355f7 --- /dev/null +++ b/modules/rostests/winetests/msi/selfreg.spec @@ -0,0 +1,2 @@ +@ stdcall -private DllRegisterServer() +@ stdcall -private DllUnregisterServer()
2 years, 9 months
1
0
0
0
[reactos] 93/360: [WINESYNC] msi/tests: Test deferral of RegisterTypeLibraries and UnregisterTypeLibraries.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=cc5bb28b0cc5005d752c1…
commit cc5bb28b0cc5005d752c1b35a3c8d2e47023fb34 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sat Mar 12 16:13:28 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:27:51 2022 +0100 [WINESYNC] msi/tests: Test deferral of RegisterTypeLibraries and UnregisterTypeLibraries. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id d3023ad3f7c87f29da762e82c7e0d47f6830df19 by Zebediah Figura <z.figura12(a)gmail.com> --- modules/rostests/winetests/msi/CMakeLists.txt | 2 +- modules/rostests/winetests/msi/action.c | 14 +++++++++++++ modules/rostests/winetests/msi/custom.c | 29 +++++++++++++++++++++++++++ modules/rostests/winetests/msi/custom.spec | 2 ++ 4 files changed, 46 insertions(+), 1 deletion(-) diff --git a/modules/rostests/winetests/msi/CMakeLists.txt b/modules/rostests/winetests/msi/CMakeLists.txt index 66187352588..acdd7c13a47 100644 --- a/modules/rostests/winetests/msi/CMakeLists.txt +++ b/modules/rostests/winetests/msi/CMakeLists.txt @@ -3,7 +3,7 @@ spec2def(custom.dll custom.spec) add_library(custom MODULE custom.c ${CMAKE_CURRENT_BINARY_DIR}/custom.def) target_link_libraries(custom uuid) set_module_type(custom win32dll) -add_importlibs(custom msi ole32 odbccp32 shell32 advapi32 msvcrt kernel32) +add_importlibs(custom msi ole32 oleaut32 odbccp32 shell32 advapi32 msvcrt kernel32) list(APPEND SOURCE action.c diff --git a/modules/rostests/winetests/msi/action.c b/modules/rostests/winetests/msi/action.c index 7026a0c5b73..98d030354ca 100644 --- a/modules/rostests/winetests/msi/action.c +++ b/modules/rostests/winetests/msi/action.c @@ -1009,14 +1009,27 @@ static const char tl_install_exec_seq_dat[] = "InstallInitialize\t\t1500\n" "ProcessComponents\t\t1600\n" "UnregisterTypeLibraries\t\t3100\n" + "ut_immediate\tREMOVE\t3101\n" + "ut_deferred\tREMOVE\t3102\n" "RemoveFiles\t\t3200\n" "InstallFiles\t\t3300\n" "RegisterTypeLibraries\t\t3400\n" + "rt_immediate\tNOT REMOVE\t3401\n" + "rt_deferred\tNOT REMOVE\t3402\n" "RegisterProduct\t\t5100\n" "PublishFeatures\t\t5200\n" "PublishProduct\t\t5300\n" "InstallFinalize\t\t6000\n"; +static const char tl_custom_action_dat[] = + "Action\tType\tSource\tTarget\n" + "s72\ti2\tS64\tS0\n" + "CustomAction\tAction\n" + "rt_immediate\t1\tcustom.dll\ttl_absent\n" + "rt_deferred\t1025\tcustom.dll\ttl_present\n" + "ut_immediate\t1\tcustom.dll\ttl_present\n" + "ut_deferred\t1025\tcustom.dll\ttl_absent\n"; + static const char crs_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n" "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n" @@ -2149,6 +2162,7 @@ static const msi_table tl_tables[] = ADD_TABLE(tl_file), ADD_TABLE(tl_typelib), ADD_TABLE(tl_install_exec_seq), + ADD_TABLE(tl_custom_action), ADD_TABLE(media), ADD_TABLE(property) }; diff --git a/modules/rostests/winetests/msi/custom.c b/modules/rostests/winetests/msi/custom.c index 7a3f01ed29a..b7da2b8fcc8 100644 --- a/modules/rostests/winetests/msi/custom.c +++ b/modules/rostests/winetests/msi/custom.c @@ -1804,3 +1804,32 @@ todo_wine return ERROR_SUCCESS; } + +static const GUID LIBID_register_test = + {0xeac5166a, 0x9734, 0x4d91, {0x87,0x8f, 0x1d,0xd0,0x23,0x04,0xc6,0x6c}}; + +UINT WINAPI tl_present(MSIHANDLE hinst) +{ + ITypeLib *tlb; + HRESULT hr; + + hr = LoadRegTypeLib(&LIBID_register_test, 7, 1, 0, &tlb); +todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) + ok(hinst, hr == S_OK, "got %#x\n", hr); + if (tlb) + ITypeLib_Release(tlb); + + return ERROR_SUCCESS; +} + +UINT WINAPI tl_absent(MSIHANDLE hinst) +{ + ITypeLib *tlb; + HRESULT hr; + + hr = LoadRegTypeLib(&LIBID_register_test, 7, 1, 0, &tlb); +todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) + ok(hinst, hr == TYPE_E_LIBNOTREGISTERED, "got %#x\n", hr); + + return ERROR_SUCCESS; +} diff --git a/modules/rostests/winetests/msi/custom.spec b/modules/rostests/winetests/msi/custom.spec index eec6a43c0a1..058a9172f1f 100644 --- a/modules/rostests/winetests/msi/custom.spec +++ b/modules/rostests/winetests/msi/custom.spec @@ -45,3 +45,5 @@ @ stdcall sis_absent(long) @ stdcall sss_started(long) @ stdcall sss_stopped(long) +@ stdcall tl_present(long) +@ stdcall tl_absent(long)
2 years, 9 months
1
0
0
0
[reactos] 92/360: [WINESYNC] msi/tests: Test registration of a valid typelib.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=45a3a9f56b2b7ad9a896d…
commit 45a3a9f56b2b7ad9a896dd36da9ba545e82aa8c8 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sat Mar 12 15:14:54 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:27:51 2022 +0100 [WINESYNC] msi/tests: Test registration of a valid typelib. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id f5da1902aa24433375fc3c99eaadad00917daa9f by Zebediah Figura <z.figura12(a)gmail.com> --- modules/rostests/winetests/msi/CMakeLists.txt | 12 ++++-- modules/rostests/winetests/msi/action.c | 52 ++++++++++++++++++++++---- modules/rostests/winetests/msi/msi_winetest.rc | 2 + modules/rostests/winetests/msi/typelib.idl | 29 ++++++++++++++ 4 files changed, 84 insertions(+), 11 deletions(-) diff --git a/modules/rostests/winetests/msi/CMakeLists.txt b/modules/rostests/winetests/msi/CMakeLists.txt index e40bf5dc904..66187352588 100644 --- a/modules/rostests/winetests/msi/CMakeLists.txt +++ b/modules/rostests/winetests/msi/CMakeLists.txt @@ -16,20 +16,26 @@ list(APPEND SOURCE patch.c record.c source.c - suminfo.c) + suminfo.c + typelib.idl) list(APPEND PCH_SKIP_SOURCE + ${CMAKE_CURRENT_BINARY_DIR}/typelib_i.c testlist.c) # CMake 3.9 and higher requires to specify this dependency manually # see
https://gitlab.kitware.com/cmake/cmake/issues/19933
-set_property(SOURCE msi_winetest.rc PROPERTY OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/custom.dll) +set_property(SOURCE msi_winetest.rc PROPERTY OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/custom.dll ${CMAKE_CURRENT_BINARY_DIR}/typelib.tlb) add_executable(msi_winetest ${SOURCE} ${PCH_SKIP_SOURCE} msi_winetest.rc) +add_idl_headers(msi_winetest_idlheader typelib.idl) +generate_idl_iids(typelib.idl) +add_typelib(typelib.idl) + target_compile_definitions(msi_winetest PRIVATE __WINESRC__ USE_WINE_TODOS) if(CMAKE_C_COMPILER_ID STREQUAL "GNU") @@ -46,4 +52,4 @@ set_module_type(msi_winetest win32cui) add_importlibs(msi_winetest cabinet msi shell32 ole32 oleaut32 odbccp32 user32 advapi32 version msvcrt kernel32) add_pch(msi_winetest precomp.h "${PCH_SKIP_SOURCE}") add_rostests_file(TARGET msi_winetest) -add_dependencies(msi_winetest custom) +add_dependencies(msi_winetest custom msi_winetest_idlheader stdole2) diff --git a/modules/rostests/winetests/msi/action.c b/modules/rostests/winetests/msi/action.c index ea8c0e86c75..7026a0c5b73 100644 --- a/modules/rostests/winetests/msi/action.c +++ b/modules/rostests/winetests/msi/action.c @@ -23,6 +23,7 @@ #include <stdio.h> #include <stdlib.h> +#define COBJMACROS #include <windows.h> #include <msiquery.h> #include <msidefs.h> @@ -33,9 +34,13 @@ #include <shellapi.h> #include <winsvc.h> #include <odbcinst.h> +#ifdef __REACTOS__ +#include <oleauto.h> +#endif #include "wine/test.h" #include "utils.h" +#include "typelib.h" static UINT (WINAPI *pMsiQueryComponentStateA) (LPCSTR, LPCSTR, MSIINSTALLCONTEXT, LPCSTR, INSTALLSTATE *); @@ -1003,10 +1008,10 @@ static const char tl_install_exec_seq_dat[] = "InstallValidate\t\t1400\n" "InstallInitialize\t\t1500\n" "ProcessComponents\t\t1600\n" - "RemoveFiles\t\t1700\n" - "InstallFiles\t\t2000\n" - "RegisterTypeLibraries\tREGISTER_TYPELIB=1\t3000\n" "UnregisterTypeLibraries\t\t3100\n" + "RemoveFiles\t\t3200\n" + "InstallFiles\t\t3300\n" + "RegisterTypeLibraries\t\t3400\n" "RegisterProduct\t\t5100\n" "PublishFeatures\t\t5200\n" "PublishProduct\t\t5300\n" @@ -2647,6 +2652,24 @@ static DWORD get_estimated_size(void) return size; } +static void extract_resource(const char *name, const char *type, const char *path) +{ + DWORD written; + HANDLE file; + HRSRC res; + void *ptr; + + file = CreateFileA(path, GENERIC_READ|GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, 0); + ok(file != INVALID_HANDLE_VALUE, "file creation failed, at %s, error %d\n", path, GetLastError()); + + res = FindResourceA(NULL, name, type); + ok( res != 0, "couldn't find resource\n" ); + ptr = LockResource( LoadResource( GetModuleHandleA(NULL), res )); + WriteFile( file, ptr, SizeofResource( GetModuleHandleA(NULL), res ), &written, NULL ); + ok( written == SizeofResource( GetModuleHandleA(NULL), res ), "couldn't write resource\n" ); + CloseHandle( file ); +} + static void test_register_product(void) { UINT r; @@ -5594,6 +5617,8 @@ error: static void test_register_typelib(void) { + ITypeLib *tlb; + HRESULT hr; UINT r; if (is_process_limited()) @@ -5602,26 +5627,37 @@ static void test_register_typelib(void) return; } + /* UnregisterTypeLibraries action fails in 64-bit Windows <= 7 */ + if (sizeof(void *) == 8) + { + win_skip("broken on 64-bit Windows\n"); + return; + } + create_test_files(); - create_file("msitest\\typelib.dll", 1000); + extract_resource("typelib.tlb", "TYPELIB", "msitest\\typelib.dll"); create_database(msifile, tl_tables, sizeof(tl_tables) / sizeof(msi_table)); MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); - r = MsiInstallProductA(msifile, "REGISTER_TYPELIB=1"); + r = MsiInstallProductA(msifile, NULL); if (r == ERROR_INSTALL_PACKAGE_REJECTED) { skip("Not enough rights to perform tests\n"); goto error; } - ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n", r); + ok(r == ERROR_SUCCESS, "got %u\n", r); - r = MsiInstallProductA(msifile, NULL); - ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); + hr = LoadRegTypeLib(&LIBID_register_test, 7, 1, 0, &tlb); + ok(hr == S_OK, "got %#x\n", hr); + ITypeLib_Release(tlb); r = MsiInstallProductA(msifile, "REMOVE=ALL"); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); + hr = LoadRegTypeLib(&LIBID_register_test, 7, 1, 0, &tlb); + ok(hr == TYPE_E_LIBNOTREGISTERED, "got %#x\n", hr); + ok(!delete_pf("msitest\\typelib.dll", TRUE), "file not removed\n"); ok(!delete_pf("msitest", FALSE), "directory not removed\n"); diff --git a/modules/rostests/winetests/msi/msi_winetest.rc b/modules/rostests/winetests/msi/msi_winetest.rc index 6aa15fe499b..f1840396a75 100644 --- a/modules/rostests/winetests/msi/msi_winetest.rc +++ b/modules/rostests/winetests/msi/msi_winetest.rc @@ -1,2 +1,4 @@ CUSTOM.DLL TESTDLL "custom.dll" + +typelib.tlb TYPELIB "typelib.tlb" diff --git a/modules/rostests/winetests/msi/typelib.idl b/modules/rostests/winetests/msi/typelib.idl new file mode 100644 index 00000000000..f447c60ea09 --- /dev/null +++ b/modules/rostests/winetests/msi/typelib.idl @@ -0,0 +1,29 @@ +/* + * Copyright 2018 Zebediah Figura + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#pragma makedep ident +#pragma makedep typelib +#pragma makedep header + +[ + uuid(eac5166a-9734-4d91-878f-1dd02304c66c), + version(7.1) +] +library register_test +{ +}
2 years, 9 months
1
0
0
0
← Newer
1
...
28
29
30
31
32
33
34
...
44
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
Results per page:
10
25
50
100
200