[MSI_WINETEST] Sync with Wine Staging 2.9. CORE-13362
authorAmine Khaldi <amine.khaldi@reactos.org>
Sat, 3 Jun 2017 22:30:19 +0000 (22:30 +0000)
committerAmine Khaldi <amine.khaldi@reactos.org>
Sat, 3 Jun 2017 22:30:19 +0000 (22:30 +0000)
svn path=/trunk/; revision=74819

rostests/winetests/msi/install.c
rostests/winetests/msi/msi.c

index fe80968..47a8ad9 100644 (file)
@@ -1220,6 +1220,69 @@ static const char shc_install_exec_seq_dat[] =
     "PublishProduct\t\t1900\n"
     "InstallFinalize\t\t2000\n";
 
+static const char ft_file_dat[] =
+    "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
+    "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
+    "File\tFile\n"
+    "featuretree\tcomp\tfeaturetree.txt\t1000\t\t\t8192\t1\n";
+
+static const char ft_comp_dat[] =
+    "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
+    "s72\tS38\ts72\ti2\tS255\tS72\n"
+    "Component\tComponent\n"
+    "comp\t{12345678-1234-1234-1234-222222222222}\tTARGETDIR\t0\t\t\n"
+    "comp2\t{12345678-1234-1234-1234-333333333333}\tTARGETDIR\t0\t\tfeaturetree\n";
+
+static const char ft_feature_dat[] =
+    "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
+    "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
+    "Feature\tFeature\n"
+    "A\t\t\t\t2\t1\t\t0\n"
+    "C\tB\t\t\t2\t1\t\t0\n"
+    "B\tA\t\t\t4\t1\t\t0\n"
+    "D\t\t\t\t2\t1\t\t0\n";
+
+static const char ft_feature_comp_dat[] =
+    "Feature_\tComponent_\n"
+    "s38\ts72\n"
+    "FeatureComponents\tFeature_\tComponent_\n"
+    "C\tcomp\n"
+    "D\tcomp2\n";
+
+static const char ft_condition_dat[] =
+    "Feature_\tLevel\tCondition\n"
+    "s38\ti2\tS255\n"
+    "Condition\tFeature_\tLevel\n"
+    "A\t0\t\"0\"<>INSTALLTYPE\n";
+
+static const char ft_custom_action_dat[] =
+    "Action\tType\tSource\tTarget\tISComments\n"
+    "s72\ti2\tS64\tS0\tS255\n"
+    "CustomAction\tAction\n"
+    "Run A\t19\t\tA\t\n"
+    "Run B\t19\t\tB\t\n"
+    "Run C\t19\t\tC\t\n";
+
+static const char ft_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"
+    "Run C\t3 = &C AND NOT Installed\t600\n"
+    "Run B\t3 = &B AND NOT Installed\t700\n"
+    "Run A\t3 = &A AND NOT Installed\t800\n"
+    "ProcessComponents\t\t900\n"
+    "RemoveFiles\t\t1000\n"
+    "InstallFiles\t\t1100\n"
+    "RegisterProduct\t\t1200\n"
+    "PublishFeatures\t\t1300\n"
+    "PublishProduct\t\t1400\n"
+    "InstallFinalize\t\t1500\n";
+
 typedef struct _msi_table
 {
     const CHAR *filename;
@@ -1860,6 +1923,20 @@ static const msi_table shc2_tables[] =
     ADD_TABLE(shc2_property)
 };
 
+static const msi_table ft_tables[] =
+{
+    ADD_TABLE(media),
+    ADD_TABLE(directory),
+    ADD_TABLE(ft_file),
+    ADD_TABLE(ft_comp),
+    ADD_TABLE(ft_feature),
+    ADD_TABLE(ft_feature_comp),
+    ADD_TABLE(ft_condition),
+    ADD_TABLE(ft_custom_action),
+    ADD_TABLE(ft_install_exec_seq),
+    ADD_TABLE(property)
+};
+
 /* cabinet definitions */
 
 /* make the max size large so there is only one cab file */
@@ -5937,6 +6014,35 @@ static void test_remove_upgrade_code(void)
     DeleteFileA( msifile );
 }
 
+static void test_feature_tree(void)
+{
+    UINT r;
+
+    if (is_process_limited())
+    {
+        skip( "process is limited\n" );
+        return;
+    }
+
+    create_file( "msitest\\featuretree.txt", 1000 );
+    create_database( msifile, ft_tables, sizeof(ft_tables)/sizeof(ft_tables[0]) );
+
+    MsiSetInternalUI( INSTALLUILEVEL_NONE, NULL );
+
+    r = MsiInstallProductA( msifile, "INSTALLTYPE=\"0\"" );
+    ok( r == ERROR_INSTALL_FAILURE, "got %u\n", r );
+
+    r = MsiInstallProductA( msifile, "INSTALLTYPE=\"1\"" );
+    ok( r == ERROR_SUCCESS, "got %u\n", r );
+
+    r = MsiInstallProductA( msifile, "REMOVE=ALL" );
+    ok( r == ERROR_SUCCESS, "got %u\n", r );
+
+    DeleteFileA( "msitest\\featuretree.txt" );
+    RemoveDirectoryA( "msitest" );
+    DeleteFileA( msifile );
+}
+
 START_TEST(install)
 {
     DWORD len;
@@ -6024,6 +6130,7 @@ START_TEST(install)
     test_volume_props();
     test_shared_component();
     test_remove_upgrade_code();
+    test_feature_tree();
 
     DeleteFileA(log_file);
 
index f0bb461..1c46581 100644 (file)
@@ -3427,6 +3427,327 @@ static void test_MsiGetComponentPath(void)
     LocalFree(usersid);
 }
 
+static void test_MsiGetComponentPathEx(void)
+{
+    HKEY key_comp, key_installprop, key_prod;
+    char prod[MAX_PATH], prod_squashed[MAX_PATH];
+    char comp[MAX_PATH], comp_base85[MAX_PATH], comp_squashed[MAX_PATH];
+    char path[MAX_PATH], path_key[MAX_PATH], *usersid;
+    INSTALLSTATE state;
+    DWORD size, val;
+    REGSAM access = KEY_ALL_ACCESS;
+    LONG res;
+
+    if (!pMsiGetComponentPathExA)
+    {
+        win_skip( "MsiGetComponentPathExA not present\n" );
+        return;
+    }
+
+    if (is_wow64) access |= KEY_WOW64_64KEY;
+
+    create_test_guid( prod, prod_squashed );
+    compose_base85_guid( comp, comp_base85, comp_squashed );
+    usersid = get_user_sid();
+
+    /* NULL product */
+    size = MAX_PATH;
+    state = pMsiGetComponentPathExA( NULL, comp, NULL, MSIINSTALLCONTEXT_USERMANAGED, path, &size );
+    ok( state == INSTALLSTATE_INVALIDARG, "got %d\n", state );
+    todo_wine ok( !size, "got %u\n", size );
+
+    /* NULL component */
+    size = MAX_PATH;
+    state = pMsiGetComponentPathExA( prod, NULL, NULL, MSIINSTALLCONTEXT_USERMANAGED, path, &size );
+    ok( state == INSTALLSTATE_INVALIDARG, "got %d\n", state );
+    todo_wine ok( !size, "got %u\n", size );
+
+    /* non-NULL usersid, MSIINSTALLCONTEXT_MACHINE */
+    size = MAX_PATH;
+    state = pMsiGetComponentPathExA( prod, comp, usersid, MSIINSTALLCONTEXT_MACHINE, path, &size);
+    ok( state == INSTALLSTATE_INVALIDARG, "got %d\n", state );
+    todo_wine ok( !size, "got %u\n", size );
+
+    /* NULL buf */
+    size = MAX_PATH;
+    state = pMsiGetComponentPathExA( prod, comp, NULL, MSIINSTALLCONTEXT_MACHINE, NULL, &size );
+    ok( state == INSTALLSTATE_UNKNOWN, "got %d\n", state );
+    todo_wine ok( size == MAX_PATH * 2, "got %u\n", size );
+
+    /* NULL buflen */
+    size = MAX_PATH;
+    state = pMsiGetComponentPathExA( prod, comp, NULL, MSIINSTALLCONTEXT_MACHINE, path, NULL );
+    ok( state == INSTALLSTATE_INVALIDARG, "got %d\n", state );
+    ok( size == MAX_PATH, "got %u\n", size );
+
+    /* all params valid */
+    size = MAX_PATH;
+    state = pMsiGetComponentPathExA( prod, comp, NULL, MSIINSTALLCONTEXT_MACHINE, path, &size );
+    ok( state == INSTALLSTATE_UNKNOWN, "got %d\n", state );
+    todo_wine ok( !size, "got %u\n", size );
+
+    lstrcpyA( path_key, "Software\\Microsoft\\Windows\\CurrentVersion\\" );
+    lstrcatA( path_key, "Installer\\UserData\\S-1-5-18\\Components\\" );
+    lstrcatA( path_key, comp_squashed );
+
+    res = RegCreateKeyExA( HKEY_LOCAL_MACHINE, path_key, 0, NULL, 0, access, NULL, &key_comp, NULL );
+    if (res == ERROR_ACCESS_DENIED)
+    {
+        skip( "insufficient rights\n" );
+        LocalFree( usersid );
+        return;
+    }
+    ok( res == ERROR_SUCCESS, "got %d\n", res );
+
+    /* local system component key exists */
+    size = MAX_PATH;
+    state = pMsiGetComponentPathExA( prod, comp, NULL, MSIINSTALLCONTEXT_MACHINE, path, &size );
+    ok( state == INSTALLSTATE_UNKNOWN, "got %d\n", state );
+
+    res = RegSetValueExA( key_comp, prod_squashed, 0, REG_SZ, (const BYTE *)"c:\\testcomponentpath", 20 );
+    ok( res == ERROR_SUCCESS, "got %d\n", res );
+
+    /* product value exists */
+    path[0] = 0;
+    size = MAX_PATH;
+    state = pMsiGetComponentPathExA( prod, comp, NULL, MSIINSTALLCONTEXT_MACHINE, path, &size );
+    ok( state == INSTALLSTATE_ABSENT, "got %d\n", state );
+    ok( !lstrcmpA( path, "c:\\testcomponentpath" ), "got %s\n", path );
+    ok( size == 20, "got %u\n", size );
+
+    lstrcpyA( path_key, "Software\\Microsoft\\Windows\\CurrentVersion\\" );
+    lstrcatA( path_key, "Installer\\UserData\\S-1-5-18\\Products\\" );
+    lstrcatA( path_key, prod_squashed );
+    lstrcatA( path_key, "\\InstallProperties" );
+
+    res = RegCreateKeyExA( HKEY_LOCAL_MACHINE, path_key, 0, NULL, 0, access, NULL, &key_installprop, NULL );
+    ok( res == ERROR_SUCCESS, "got %d\n", res );
+
+    val = 1;
+    res = RegSetValueExA( key_installprop, "WindowsInstaller", 0, REG_DWORD, (const BYTE *)&val, sizeof(val) );
+    ok( res == ERROR_SUCCESS, "got %d\n", res );
+
+    /* install properties key exists */
+    path[0] = 0;
+    size = MAX_PATH;
+    state = pMsiGetComponentPathExA( prod, comp, NULL, MSIINSTALLCONTEXT_MACHINE, path, &size );
+    ok( state == INSTALLSTATE_ABSENT, "got %d\n", state );
+    ok( !lstrcmpA( path, "c:\\testcomponentpath"), "got %s\n", path );
+    ok( size == 20, "got %u\n", size );
+
+    create_file( "c:\\testcomponentpath", "c:\\testcomponentpath", 21 );
+
+    /* file exists */
+    path[0] = 0;
+    size = 0;
+    state = pMsiGetComponentPathExA( prod, comp, NULL, MSIINSTALLCONTEXT_MACHINE, path, &size );
+    ok( state == INSTALLSTATE_MOREDATA, "got %d\n", state );
+    ok( !path[0], "got %s\n", path );
+    todo_wine ok( size == 40, "got %u\n", size );
+
+    path[0] = 0;
+    size = MAX_PATH;
+    state = pMsiGetComponentPathExA( prod, comp, NULL, MSIINSTALLCONTEXT_MACHINE, path, &size );
+    ok( state == INSTALLSTATE_LOCAL, "got %d\n", state );
+    ok( !lstrcmpA( path, "c:\\testcomponentpath" ), "got %s\n", path );
+    ok( size == 20, "got %d\n", size );
+
+    RegDeleteValueA( key_comp, prod_squashed );
+    delete_key( key_comp, "", access & KEY_WOW64_64KEY );
+    RegDeleteValueA( key_installprop, "WindowsInstaller" );
+    delete_key( key_installprop, "", access & KEY_WOW64_64KEY );
+    RegCloseKey( key_comp );
+    RegCloseKey( key_installprop );
+    DeleteFileA( "c:\\testcomponentpath" );
+
+    lstrcpyA( path_key, "Software\\Microsoft\\Installer\\Products\\" );
+    lstrcatA( path_key, prod_squashed );
+
+    res = RegCreateKeyA( HKEY_CURRENT_USER, path_key, &key_prod );
+    ok( res == ERROR_SUCCESS, "got %d\n", res );
+
+    /* user unmanaged product key exists */
+    size = MAX_PATH;
+    state = pMsiGetComponentPathExA( prod, comp, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, path, &size );
+    ok( state == INSTALLSTATE_UNKNOWN, "got %d\n", state );
+    todo_wine ok(!size, "got %u\n", size);
+
+    lstrcpyA( path_key, "Software\\Microsoft\\Windows\\CurrentVersion\\" );
+    lstrcatA( path_key, "Installer\\UserData\\" );
+    lstrcatA( path_key, usersid );
+    lstrcatA( path_key, "\\Components\\" );
+    lstrcatA( path_key, comp_squashed );
+
+    res = RegCreateKeyExA( HKEY_LOCAL_MACHINE, path_key, 0, NULL, 0, access, NULL, &key_comp, NULL );
+    ok( res == ERROR_SUCCESS, "got %d\n", res );
+
+    /* user unmanaged component key exists */
+    size = MAX_PATH;
+    state = pMsiGetComponentPathExA( prod, comp, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, path, &size );
+    ok( state == INSTALLSTATE_UNKNOWN, "got %d\n", state );
+    todo_wine ok(!size, "got %u\n", size);
+
+    res = RegSetValueExA( key_comp, prod_squashed, 0, REG_SZ, (const BYTE *)"c:\\testcomponentpath", 20 );
+    ok( res == ERROR_SUCCESS, "got %d\n", res );
+
+    /* product value exists */
+    path[0] = 0;
+    size = MAX_PATH;
+    state = pMsiGetComponentPathExA( prod, comp, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, path, &size );
+    ok( state == INSTALLSTATE_ABSENT, "got %d\n", state );
+    ok( !lstrcmpA( path, "c:\\testcomponentpath"), "got %s\n", path );
+    ok( size == 20, "got %u\n", size );
+
+    create_file( "c:\\testcomponentpath", "c:\\testcomponentpath", 21 );
+
+    /* file exists */
+    path[0] = 0;
+    size = MAX_PATH;
+    state = pMsiGetComponentPathExA( prod, comp, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, path, &size );
+    ok( state == INSTALLSTATE_LOCAL, "got %d\n", state );
+    ok( !lstrcmpA( path, "c:\\testcomponentpath"), "got %s\n", path );
+    ok( size == 20, "got %u\n", size );
+
+    RegDeleteValueA( key_comp, prod_squashed );
+    RegDeleteKeyA( key_prod, "" );
+    delete_key( key_comp, "", access & KEY_WOW64_64KEY );
+    RegCloseKey( key_prod );
+    RegCloseKey( key_comp );
+    DeleteFileA( "c:\\testcomponentpath" );
+
+    lstrcpyA( path_key, "Software\\Microsoft\\Windows\\CurrentVersion\\" );
+    lstrcatA( path_key, "Installer\\Managed\\" );
+    lstrcatA( path_key, usersid );
+    lstrcatA( path_key, "\\Installer\\Products\\" );
+    lstrcatA( path_key, prod_squashed );
+
+    res = RegCreateKeyExA( HKEY_LOCAL_MACHINE, path_key, 0, NULL, 0, access, NULL, &key_prod, NULL );
+    ok( res == ERROR_SUCCESS, "got %d\n", res );
+
+    /* user managed product key exists */
+    size = MAX_PATH;
+    state = pMsiGetComponentPathExA( prod, comp, NULL, MSIINSTALLCONTEXT_USERMANAGED, path, &size );
+    ok( state == INSTALLSTATE_UNKNOWN, "got %d\n", state );
+
+    lstrcpyA( path_key, "Software\\Microsoft\\Windows\\CurrentVersion\\" );
+    lstrcatA( path_key, "Installer\\UserData\\" );
+    lstrcatA( path_key, usersid );
+    lstrcatA( path_key, "\\Components\\" );
+    lstrcatA( path_key, comp_squashed );
+
+    res = RegCreateKeyExA( HKEY_LOCAL_MACHINE, path_key, 0, NULL, 0, access, NULL, &key_comp, NULL );
+    ok( res == ERROR_SUCCESS, "got %d\n", res );
+
+    /* user managed component key exists */
+    size = MAX_PATH;
+    state = pMsiGetComponentPathExA( prod, comp, NULL, MSIINSTALLCONTEXT_USERMANAGED, path, &size );
+    ok( state == INSTALLSTATE_UNKNOWN, "got %d\n", state );
+
+    res = RegSetValueExA( key_comp, prod_squashed, 0, REG_SZ, (const BYTE *)"c:\\testcomponentpath", 20 );
+    ok( res == ERROR_SUCCESS, "got %d\n", res );
+
+    /* product value exists */
+    path[0] = 0;
+    size = MAX_PATH;
+    state = pMsiGetComponentPathExA( prod, comp, NULL, MSIINSTALLCONTEXT_USERMANAGED, path, &size );
+    ok( state == INSTALLSTATE_ABSENT, "got %d\n", state );
+    ok( !lstrcmpA( path, "c:\\testcomponentpath" ), "got %s\n", path );
+    ok( size == 20, "got %u\n", size );
+
+    lstrcpyA( path_key, "Software\\Microsoft\\Windows\\CurrentVersion\\" );
+    lstrcatA( path_key, "Installer\\UserData\\S-1-5-18\\Products\\" );
+    lstrcatA( path_key, prod_squashed );
+    lstrcatA( path_key, "\\InstallProperties" );
+
+    res = RegCreateKeyExA( HKEY_LOCAL_MACHINE, path_key, 0, NULL, 0, access, NULL, &key_installprop, NULL );
+    ok( res == ERROR_SUCCESS, "got %d\n", res );
+
+    val = 1;
+    res = RegSetValueExA( key_installprop, "WindowsInstaller", 0, REG_DWORD, (const BYTE *)&val, sizeof(val) );
+    ok( res == ERROR_SUCCESS, "got %d\n", res );
+
+    /* install properties key exists */
+    path[0] = 0;
+    size = MAX_PATH;
+    state = pMsiGetComponentPathExA( prod, comp, NULL, MSIINSTALLCONTEXT_USERMANAGED, path, &size );
+    ok( state == INSTALLSTATE_ABSENT, "got %d\n", state );
+    ok( !lstrcmpA( path, "c:\\testcomponentpath" ), "got %s\n", path );
+    ok( size == 20, "got %u\n", size );
+
+    create_file( "c:\\testcomponentpath", "C:\\testcomponentpath", 21 );
+
+    /* file exists */
+    path[0] = 0;
+    size = MAX_PATH;
+    state = pMsiGetComponentPathExA( prod, comp, NULL, MSIINSTALLCONTEXT_USERMANAGED, path, &size );
+    ok( state == INSTALLSTATE_LOCAL, "got %d\n", state );
+    ok( !lstrcmpA( path, "c:\\testcomponentpath" ), "got %s\n", path );
+    ok( size == 20, "got %u\n", size );
+
+    RegDeleteValueA( key_comp, prod_squashed );
+    delete_key( key_prod, "", access & KEY_WOW64_64KEY );
+    delete_key( key_comp, "", access & KEY_WOW64_64KEY );
+    RegDeleteValueA( key_installprop, "WindowsInstaller" );
+    delete_key( key_installprop, "", access & KEY_WOW64_64KEY );
+    RegCloseKey( key_prod );
+    RegCloseKey( key_comp );
+    RegCloseKey( key_installprop );
+    DeleteFileA( "c:\\testcomponentpath" );
+    lstrcpyA( path_key, "Software\\Classes\\Installer\\Products\\" );
+    lstrcatA( path_key, prod_squashed );
+
+    res = RegCreateKeyExA( HKEY_LOCAL_MACHINE, path_key, 0, NULL, 0, access, NULL, &key_prod, NULL );
+    ok( res == ERROR_SUCCESS, "got %d\n", res );
+
+    /* local classes product key exists */
+    size = MAX_PATH;
+    state = pMsiGetComponentPathExA( prod, comp, NULL, MSIINSTALLCONTEXT_MACHINE, path, &size );
+    ok( state == INSTALLSTATE_UNKNOWN, "got %d\n", state );
+    todo_wine ok(!size, "got %u\n", size);
+
+    lstrcpyA( path_key, "Software\\Microsoft\\Windows\\CurrentVersion\\" );
+    lstrcatA( path_key, "Installer\\UserData\\S-1-5-18\\Components\\" );
+    lstrcatA( path_key, comp_squashed );
+
+    res = RegCreateKeyExA( HKEY_LOCAL_MACHINE,  path_key, 0, NULL, 0, access, NULL, &key_comp, NULL );
+    ok( res == ERROR_SUCCESS, "got %d\n", res );
+
+    /* local user component key exists */
+    size = MAX_PATH;
+    state = pMsiGetComponentPathExA( prod, comp, NULL, MSIINSTALLCONTEXT_MACHINE, path, &size );
+    ok( state == INSTALLSTATE_UNKNOWN, "got %d\n", state );
+    todo_wine ok(!size, "got %u\n", size);
+
+    res = RegSetValueExA( key_comp, prod_squashed, 0, REG_SZ, (const BYTE *)"c:\\testcomponentpath", 20 );
+    ok( res == ERROR_SUCCESS, "got %d\n", res );
+
+    /* product value exists */
+    path[0] = 0;
+    size = MAX_PATH;
+    state = pMsiGetComponentPathExA( prod, comp, NULL, MSIINSTALLCONTEXT_MACHINE, path, &size );
+    ok( state == INSTALLSTATE_ABSENT, "got %d\n", state );
+    ok( !lstrcmpA( path, "c:\\testcomponentpath" ), "got %s\n", path );
+    ok( size == 20, "got %u\n", size );
+
+    create_file( "c:\\testcomponentpath", "c:\\testcomponentpath", 21 );
+
+    /* file exists */
+    path[0] = 0;
+    size = MAX_PATH;
+    state = pMsiGetComponentPathExA( prod, comp, NULL, MSIINSTALLCONTEXT_MACHINE, path, &size );
+    ok( state == INSTALLSTATE_LOCAL, "got %d\n", state );
+    ok( !lstrcmpA( path, "c:\\testcomponentpath" ), "got %s\n", path );
+    ok( size == 20, "got %u\n", size );
+
+    RegDeleteValueA( key_comp, prod_squashed );
+    delete_key( key_prod, "", access & KEY_WOW64_64KEY );
+    delete_key( key_comp, "", access & KEY_WOW64_64KEY );
+    RegCloseKey( key_prod );
+    RegCloseKey( key_comp );
+    DeleteFileA( "c:\\testcomponentpath" );
+    LocalFree( usersid );
+}
+
 static void test_MsiProvideComponent(void)
 {
     static const WCHAR sourcedirW[] =
@@ -10894,18 +11215,18 @@ static void test_MsiEnumPatchesEx_machine(void)
     ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
 
     delete_key(hpatch, "", access & KEY_WOW64_64KEY);
+    RegDeleteValueA(hpatch, "State");
     RegCloseKey(hpatch);
     delete_key(udpatch, "", access & KEY_WOW64_64KEY);
     RegCloseKey(udpatch);
+    delete_key(udprod, "", access & KEY_WOW64_64KEY);
+    RegCloseKey(udprod);
 
 done:
     RegDeleteValueA(patches, patch_squashed);
     RegDeleteValueA(patches, "Patches");
     delete_key(patches, "", access & KEY_WOW64_64KEY);
     RegCloseKey(patches);
-    RegDeleteValueA(hpatch, "State");
-    delete_key(udprod, "", access & KEY_WOW64_64KEY);
-    RegCloseKey(udprod);
     delete_key(prodkey, "", access & KEY_WOW64_64KEY);
     RegCloseKey(prodkey);
 }
@@ -12352,7 +12673,22 @@ static void test_MsiGetPatchInfoEx(void)
                             MSIINSTALLCONTEXT_USERMANAGED,
                             INSTALLPROPERTY_PATCHSTATEA, val, &size);
     ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-    todo_wine ok(!lstrcmpA(val, "1"), "Expected \"1\", got \"%s\"\n", val);
+    ok(!lstrcmpA(val, "1"), "Expected \"1\", got \"%s\"\n", val);
+    ok(size == 1, "Expected 1, got %d\n", size);
+
+    size = 1;
+    res = RegSetValueExA(hpatch, "Uninstallable", 0, REG_DWORD,
+                         (const BYTE *)&size, sizeof(DWORD));
+    ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
+
+    /* Uninstallable value exists */
+    size = MAX_PATH;
+    lstrcpyA(val, "apple");
+    r = pMsiGetPatchInfoExA(patchcode, prodcode, usersid,
+                            MSIINSTALLCONTEXT_USERMANAGED,
+                            INSTALLPROPERTY_UNINSTALLABLEA, val, &size);
+    ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+    ok(!lstrcmpA(val, "1"), "Expected \"1\", got \"%s\"\n", val);
     ok(size == 1, "Expected 1, got %d\n", size);
 
     res = RegSetValueExA(hpatch, "DisplayName", 0, REG_SZ,
@@ -14566,6 +14902,7 @@ START_TEST(msi)
         test_MsiQueryFeatureState();
         test_MsiQueryComponentState();
         test_MsiGetComponentPath();
+        test_MsiGetComponentPathEx();
         test_MsiProvideComponent();
         test_MsiGetProductCode();
         test_MsiEnumClients();