ReactOS 0.4.15-dev-5829-g6b6a045
action.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
#include <msiquery.h>
#include <msidefs.h>
#include <msi.h>
#include <fci.h>
#include <srrestoreptapi.h>
#include <wtypes.h>
#include <shellapi.h>
#include <winsvc.h>
#include <odbcinst.h>
#include <sddl.h>
#include "wine/test.h"
#include "utils.h"
#include "typelib.h"
Include dependency graph for action.c:

Go to the source code of this file.

Macros

#define _WIN32_MSI   300
 
#define COBJMACROS
 
#define MEDIA_SIZE   0x7FFFFFFF
 
#define GET_PROC(mod, func)
 
#define CHECK_REG_STR(prodkey, name, expected)    check_reg_str(prodkey, name, expected, TRUE, FALSE, __LINE__);
 
#define CHECK_DEL_REG_STR(prodkey, name, expected)
 
#define CHECK_DEL_REG_STR_TODO(prodkey, name, expected)
 
#define CHECK_REG_ISTR(prodkey, name, expected)    check_reg_str(prodkey, name, expected, FALSE, FALSE, __LINE__);
 
#define CHECK_DEL_REG_ISTR(prodkey, name, expected)
 
#define CHECK_REG_MULTI(key, name, expect)    check_reg_multi(key, name, expect, __LINE__);
 
#define CHECK_DEL_REG_MULTI(key, name, expect)
 
#define CHECK_REG_DWORD(prodkey, name, expected)    check_reg_dword(prodkey, name, expected, FALSE, __LINE__);
 
#define CHECK_REG_DWORD_TODO(prodkey, name, expected)    check_reg_dword(prodkey, name, expected, TRUE, __LINE__);
 
#define CHECK_DEL_REG_DWORD(prodkey, name, expected)
 
#define CHECK_DEL_REG_DWORD_TODO(prodkey, name, expected)
 

Functions

static UINT (WINAPI *pMsiQueryComponentStateA)(LPCSTR
 
static INSTALLSTATE (WINAPI *pMsiGetComponentPathExA)(LPCSTR
 
static INSTALLSTATE *static LONG (WINAPI *pRegDeleteKeyExA)(HKEY
 
static BOOL (WINAPI *pIsWow64Process)(HANDLE
 
static void init_functionpointers (void)
 
static charget_user_sid (void)
 
static void create_test_files (void)
 
static void delete_test_files (void)
 
static BOOL notify_system_change (DWORD event_type, STATEMGRSTATUS *status)
 
static void remove_restore_point (DWORD seq_number)
 
static LONG delete_key (HKEY key, LPCSTR subkey, REGSAM access)
 
static void delete_pfmsitest_files (void)
 
static void check_reg_str (HKEY prodkey, LPCSTR name, LPCSTR expected, BOOL bcase, BOOL todo, DWORD line)
 
static void check_reg_multi (HKEY prodkey, const char *name, const char *expect, DWORD line)
 
static void check_reg_dword (HKEY prodkey, LPCSTR name, DWORD expected, BOOL todo, DWORD line)
 
static void get_date_str (LPSTR date)
 
static DWORD get_estimated_size (void)
 
static void extract_resource (const char *name, const char *type, const char *path)
 
static void test_register_product (void)
 
static void test_publish_product (void)
 
static void test_publish_features (void)
 
static LPSTR reg_get_val_str (HKEY hkey, LPCSTR name)
 
static void get_owner_company (LPSTR *owner, LPSTR *company)
 
static void test_register_user (void)
 
static void test_process_components (void)
 
static void test_publish (void)
 
static void test_publish_sourcelist (void)
 
static void test_remove_files (void)
 
static void test_move_files (void)
 
static void test_duplicate_files (void)
 
static void test_write_registry_values (void)
 
static void test_envvar (void)
 
static void test_create_remove_folder (void)
 
static void test_start_stop_services (void)
 
static void delete_test_service (const char *name)
 
static void test_delete_services (void)
 
static void test_install_services (void)
 
static void test_self_registration (void)
 
static void test_register_font (void)
 
static void test_validate_product_id (void)
 
static void test_install_remove_odbc (void)
 
static void test_register_typelib (void)
 
static void test_create_remove_shortcut (void)
 
static void test_publish_components (void)
 
static void test_remove_duplicate_files (void)
 
static void test_find_related_products (void)
 
static void test_ini_values (void)
 
static void test_register_class_info (void)
 
static void test_register_extension_info (void)
 
static void test_register_progid_info (void)
 
static void test_register_mime_info (void)
 
static void test_publish_assemblies (void)
 
static void test_remove_existing_products (void)
 
 START_TEST (action)
 

Variables

static LPCSTR
 
static MSIINSTALLCONTEXT
 
static INSTALLSTATE *static DWORD
 
static INSTALLSTATE *static LPSTR
 
static INSTALLSTATE *static LPDWORD
 
static INSTALLSTATE *static REGSAM
 
static PBOOL
 
static STATEMGRSTATUS *static BOOL is_wow64
 
static const BOOL is_64bit = sizeof(void *) > sizeof(int)
 
static const charmsifile = "msitest.msi"
 
static const char component_dat []
 
static const char directory_dat []
 
static const char feature_dat []
 
static const char feature_comp_dat []
 
static const char file_dat []
 
static const char install_exec_seq_dat []
 
static const char media_dat []
 
static const char property_dat []
 
static const char env_install_exec_seq_dat []
 
static const char env_custom_action_dat []
 
static const char env_environment_dat []
 
static const char service_install_dat []
 
static const char service_install2_dat []
 
static const char service_control_dat []
 
static const char sss_service_control_dat []
 
static const char sss_install_exec_seq_dat []
 
static const char sss_custom_action_dat []
 
static const char sds_install_exec_seq_dat []
 
static const char sds_custom_action_dat []
 
static const char sis_install_exec_seq_dat []
 
static const char sis_custom_action_dat []
 
static const char rof_component_dat []
 
static const char rof_feature_dat []
 
static const char rof_feature_comp_dat []
 
static const char rof_file_dat []
 
static const char rof_media_dat []
 
static const char ci2_feature_comp_dat []
 
static const char ci2_file_dat []
 
static const char pp_install_exec_seq_dat []
 
static const char pp_custom_action_dat []
 
static const char pp_component_dat []
 
static const char ppc_component_dat []
 
static const char ppc_file_dat []
 
static const char ppc_media_dat []
 
static const char ppc_feature_comp_dat []
 
static const char cwd_component_dat []
 
static const char rem_component_dat []
 
static const char rem_feature_comp_dat []
 
static const char rem_file_dat []
 
static const char rem_install_exec_seq_dat []
 
static const char rem_remove_files_dat []
 
static const char mov_move_file_dat []
 
static const char mov_install_exec_seq_dat []
 
static const char mov_custom_action_dat []
 
static const char df_directory_dat []
 
static const char df_duplicate_file_dat []
 
static const char wrv_component_dat []
 
static const char wrv_feature_dat []
 
static const char wrv_feature_comp_dat []
 
static const char wrv_registry_dat []
 
static const char wrv_remove_registry_dat []
 
static const char wrv_install_exec_seq_dat []
 
static const char wrv_custom_action_dat []
 
static const char cf_directory_dat []
 
static const char cf_component_dat []
 
static const char cf_feature_dat []
 
static const char cf_feature_comp_dat []
 
static const char cf_file_dat []
 
static const char cf_create_folders_dat []
 
static const char cf_install_exec_seq_dat []
 
static const char cf_custom_action_dat []
 
static const char sr_file_dat []
 
static const char sr_feature_dat []
 
static const char sr_feature_comp_dat []
 
static const char sr_component_dat []
 
static const char sr_selfreg_dat []
 
static const char sr_install_exec_seq_dat []
 
static const char sr_custom_action_dat []
 
static const char font_media_dat []
 
static const char font_file_dat []
 
static const char font_feature_dat []
 
static const char font_component_dat []
 
static const char font_feature_comp_dat []
 
static const char font_dat []
 
static const char font_install_exec_seq_dat []
 
static const char font_custom_action_dat []
 
static const char vp_property_dat []
 
static const char vp_custom_action_dat []
 
static const char vp_install_exec_seq_dat []
 
static const char odbc_file_dat []
 
static const char odbc_feature_dat []
 
static const char odbc_feature_comp_dat []
 
static const char odbc_component_dat []
 
static const char odbc_driver_dat []
 
static const char odbc_translator_dat []
 
static const char odbc_datasource_dat []
 
static const char odbc_install_exec_seq_dat []
 
static const char odbc_custom_action_dat []
 
static const char odbc_media_dat []
 
static const char tl_file_dat []
 
static const char tl_feature_dat []
 
static const char tl_feature_comp_dat []
 
static const char tl_component_dat []
 
static const char tl_typelib_dat []
 
static const char tl_install_exec_seq_dat []
 
static const char tl_custom_action_dat []
 
static const char crs_file_dat []
 
static const char crs_feature_dat []
 
static const char crs_feature_comp_dat []
 
static const char crs_component_dat []
 
static const char crs_shortcut_dat []
 
static const char crs_install_exec_seq_dat []
 
static const char crs_custom_action_dat []
 
static const char pub_file_dat []
 
static const char pub_feature_dat []
 
static const char pub_feature_comp_dat []
 
static const char pub_component_dat []
 
static const char pub_publish_component_dat []
 
static const char pub_install_exec_seq_dat []
 
static const char pub_custom_action_dat []
 
static const char rd_file_dat []
 
static const char rd_feature_dat []
 
static const char rd_feature_comp_dat []
 
static const char rd_component_dat []
 
static const char rd_duplicate_file_dat []
 
static const char rd_install_exec_seq_dat []
 
static const char rd_custom_action_dat []
 
static const char frp_file_dat []
 
static const char frp_feature_dat []
 
static const char frp_feature_comp_dat []
 
static const char frp_component_dat []
 
static const char frp_custom_action_dat []
 
static const char frp_upgrade_dat []
 
static const char frp_install_exec_seq_dat []
 
static const char ini_file_dat []
 
static const char ini_feature_dat []
 
static const char ini_feature_comp_dat []
 
static const char ini_component_dat []
 
static const char ini_ini_file_dat []
 
static const char ini_remove_ini_file_dat []
 
static const char ini_install_exec_seq_dat []
 
static const char ini_custom_action_dat []
 
static const char rci_file_dat []
 
static const char rci_feature_dat []
 
static const char rci_feature_comp_dat []
 
static const char rci_component_dat []
 
static const char rci_appid_dat []
 
static const char rci_class_dat []
 
static const char rci_install_exec_seq_dat []
 
static const char rci_custom_action_dat []
 
static const char rei_file_dat []
 
static const char rei_feature_dat []
 
static const char rei_feature_comp_dat []
 
static const char rei_component_dat []
 
static const char rei_extension_dat []
 
static const char rei_verb_dat []
 
static const char rei_progid_dat []
 
static const char rei_install_exec_seq_dat []
 
static const char rei_custom_action_dat []
 
static const char rpi_file_dat []
 
static const char rpi_feature_dat []
 
static const char rpi_feature_comp_dat []
 
static const char rpi_component_dat []
 
static const char rpi_appid_dat []
 
static const char rpi_class_dat []
 
static const char rpi_extension_dat []
 
static const char rpi_verb_dat []
 
static const char rpi_progid_dat []
 
static const char rpi_install_exec_seq_dat []
 
static const char rpi_custom_action_dat []
 
static const char rmi_file_dat []
 
static const char rmi_feature_dat []
 
static const char rmi_feature_comp_dat []
 
static const char rmi_component_dat []
 
static const char rmi_extension_dat []
 
static const char rmi_verb_dat []
 
static const char rmi_mime_dat []
 
static const char rmi_install_exec_seq_dat []
 
static const char rmi_custom_action_dat []
 
static const char pa_file_dat []
 
static const char pa_feature_dat []
 
static const char pa_feature_comp_dat []
 
static const char pa_component_dat []
 
static const char pa_msi_assembly_dat []
 
static const char pa_msi_assembly_name_dat []
 
static const char pa_install_exec_seq_dat []
 
static const char pa_custom_action_dat []
 
static const char rep_file_dat []
 
static const char rep_feature_dat []
 
static const char rep_feature_comp_dat []
 
static const char rep_component_dat []
 
static const char rep_upgrade_dat []
 
static const char rep_property_dat []
 
static const char rep_install_exec_seq_dat []
 
static const msi_table env_tables []
 
static const msi_table pp_tables []
 
static const msi_table ppc_tables []
 
static const msi_table rem_tables []
 
static const msi_table mov_tables []
 
static const msi_table df_tables []
 
static const msi_table wrv_tables []
 
static const msi_table cf_tables []
 
static const msi_table sss_tables []
 
static const msi_table sds_tables []
 
static const msi_table sis_tables []
 
static const msi_table sr_tables []
 
static const msi_table font_tables []
 
static const msi_table vp_tables []
 
static const msi_table odbc_tables []
 
static const msi_table tl_tables []
 
static const msi_table crs_tables []
 
static const msi_table pub_tables []
 
static const msi_table rd_tables []
 
static const msi_table frp_tables []
 
static const msi_table ini_tables []
 
static const msi_table rci_tables []
 
static const msi_table rei_tables []
 
static const msi_table rpi_tables []
 
static const msi_table rmi_tables []
 
static const msi_table pa_tables []
 
static const msi_table rep_tables []
 

Macro Definition Documentation

◆ _WIN32_MSI

#define _WIN32_MSI   300

Definition at line 22 of file action.c.

◆ CHECK_DEL_REG_DWORD

#define CHECK_DEL_REG_DWORD (   prodkey,
  name,
  expected 
)
Value:
do { \
check_reg_dword(prodkey, name, expected, FALSE, __LINE__); \
RegDeleteValueA(prodkey, name); \
} while(0)
#define FALSE
Definition: types.h:117
BOOL expected
Definition: store.c:2063
Definition: name.c:39

Definition at line 2602 of file action.c.

◆ CHECK_DEL_REG_DWORD_TODO

#define CHECK_DEL_REG_DWORD_TODO (   prodkey,
  name,
  expected 
)
Value:
do { \
check_reg_dword(prodkey, name, expected, TRUE, __LINE__); \
RegDeleteValueA(prodkey, name); \
} while(0)
#define TRUE
Definition: types.h:120

Definition at line 2608 of file action.c.

◆ CHECK_DEL_REG_ISTR

#define CHECK_DEL_REG_ISTR (   prodkey,
  name,
  expected 
)
Value:
do { \
check_reg_str(prodkey, name, expected, FALSE, FALSE, __LINE__); \
RegDeleteValueA(prodkey, name); \
} while(0)

Definition at line 2581 of file action.c.

◆ CHECK_DEL_REG_MULTI

#define CHECK_DEL_REG_MULTI (   key,
  name,
  expect 
)
Value:
do { \
check_reg_multi(key, name, expect, __LINE__); \
RegDeleteValueA(key, name); \
} while(0)
#define expect(expected, got)
Definition: combo.c:36
Definition: copy.c:22

Definition at line 2590 of file action.c.

◆ CHECK_DEL_REG_STR

#define CHECK_DEL_REG_STR (   prodkey,
  name,
  expected 
)
Value:
do { \
check_reg_str(prodkey, name, expected, TRUE, FALSE, __LINE__); \
RegDeleteValueA(prodkey, name); \
} while(0)

Definition at line 2566 of file action.c.

◆ CHECK_DEL_REG_STR_TODO

#define CHECK_DEL_REG_STR_TODO (   prodkey,
  name,
  expected 
)
Value:
do { \
check_reg_str(prodkey, name, expected, TRUE, TRUE, __LINE__); \
RegDeleteValueA(prodkey, name); \
} while(0)

Definition at line 2572 of file action.c.

◆ CHECK_REG_DWORD

#define CHECK_REG_DWORD (   prodkey,
  name,
  expected 
)     check_reg_dword(prodkey, name, expected, FALSE, __LINE__);

Definition at line 2596 of file action.c.

◆ CHECK_REG_DWORD_TODO

#define CHECK_REG_DWORD_TODO (   prodkey,
  name,
  expected 
)     check_reg_dword(prodkey, name, expected, TRUE, __LINE__);

Definition at line 2599 of file action.c.

◆ CHECK_REG_ISTR

#define CHECK_REG_ISTR (   prodkey,
  name,
  expected 
)     check_reg_str(prodkey, name, expected, FALSE, FALSE, __LINE__);

Definition at line 2578 of file action.c.

◆ CHECK_REG_MULTI

#define CHECK_REG_MULTI (   key,
  name,
  expect 
)     check_reg_multi(key, name, expect, __LINE__);

Definition at line 2587 of file action.c.

◆ CHECK_REG_STR

#define CHECK_REG_STR (   prodkey,
  name,
  expected 
)     check_reg_str(prodkey, name, expected, TRUE, FALSE, __LINE__);

Definition at line 2563 of file action.c.

◆ COBJMACROS

#define COBJMACROS

Definition at line 26 of file action.c.

◆ GET_PROC

#define GET_PROC (   mod,
  func 
)
Value:
p ## func = (void*)GetProcAddress(mod, #func); \
if(!p ## func) \
trace("GetProcAddress(%s) failed\n", #func);
#define GetProcAddress(x, y)
Definition: compat.h:753
GLenum func
Definition: glext.h:6028
GLfloat GLfloat p
Definition: glext.h:8902
static int mod
Definition: i386-dis.c:1289

◆ MEDIA_SIZE

#define MEDIA_SIZE   0x7FFFFFFF

Definition at line 2376 of file action.c.

Function Documentation

◆ BOOL()

static BOOL ( WINAPI pIsWow64Process)
static

◆ check_reg_dword()

static void check_reg_dword ( HKEY  prodkey,
LPCSTR  name,
DWORD  expected,
BOOL  todo,
DWORD  line 
)
static

Definition at line 2550 of file action.c.

2551{
2552 DWORD val, size, type;
2553 LONG res;
2554
2555 size = sizeof(DWORD);
2556 res = RegQueryValueExA(prodkey, name, NULL, &type, (BYTE *)&val, &size);
2557 ok_(__FILE__, line)(!res, "Failed to query value, error %ld\n", res);
2558 ok_(__FILE__, line)(type == REG_DWORD, "Got wrong type %lu\n", type);
2560 ok_(__FILE__, line)(val == expected, "Expected %lu, got %lu\n", expected, val);
2561}
#define ok_(x1, x2)
Definition: atltest.h:61
#define NULL
Definition: types.h:112
LONG WINAPI RegQueryValueExA(_In_ HKEY hkeyorg, _In_ LPCSTR name, _In_ LPDWORD reserved, _Out_opt_ LPDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ LPDWORD count)
Definition: reg.c:4027
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLsizeiptr size
Definition: glext.h:5919
GLuint res
Definition: glext.h:9613
GLuint GLfloat * val
Definition: glext.h:7180
BOOL todo
Definition: filedlg.c:313
#define todo_wine_if(is_todo)
Definition: custom.c:76
#define DWORD
Definition: nt_native.h:44
long LONG
Definition: pedump.c:60
#define REG_DWORD
Definition: sdbapi.c:596
Definition: parser.c:49
unsigned char BYTE
Definition: xxhash.c:193

◆ check_reg_multi()

static void check_reg_multi ( HKEY  prodkey,
const char name,
const char expect,
DWORD  line 
)
static

Definition at line 2530 of file action.c.

2531{
2532 char val[MAX_PATH];
2533 DWORD expect_size = 0, size, type;
2534 const char *p;
2535 LONG res;
2536
2537 for (p = expect; *p; p += strlen(p) + 1)
2538 ;
2539 expect_size = (p + 1) - expect;
2540
2541 size = MAX_PATH;
2542 val[0] = '\0';
2543 res = RegQueryValueExA(prodkey, name, NULL, &type, (BYTE *)val, &size);
2544 ok_(__FILE__, line)(!res, "Failed to query value, error %ld\n", res);
2545 ok_(__FILE__, line)(type == REG_MULTI_SZ, "Got wrong type %lu\n", type);
2546 ok_(__FILE__, line)(size == expect_size, "expected size %lu, got %lu\n", expect_size, size);
2547 ok_(__FILE__, line)(!memcmp(val, expect, size), "got %s\n", debugstr_an(val, size));
2548}
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
static __inline const char * debugstr_an(const char *s, int n)
Definition: compat.h:55
#define MAX_PATH
Definition: compat.h:34
#define REG_MULTI_SZ
Definition: nt_native.h:1501

◆ check_reg_str()

static void check_reg_str ( HKEY  prodkey,
LPCSTR  name,
LPCSTR  expected,
BOOL  bcase,
BOOL  todo,
DWORD  line 
)
static

Definition at line 2510 of file action.c.

2511{
2512 char val[MAX_PATH];
2513 DWORD size, type;
2514 LONG res;
2515
2516 size = MAX_PATH;
2517 val[0] = '\0';
2518 res = RegQueryValueExA(prodkey, name, NULL, &type, (BYTE *)val, &size);
2519 ok_(__FILE__, line)(!res, "Failed to query value, error %ld\n", res);
2520 ok_(__FILE__, line)(type == REG_SZ || type == REG_EXPAND_SZ, "Got wrong type %lu\n", type);
2522 {
2523 if (bcase)
2524 ok_(__FILE__, line)(!strcmp(val, expected), "got %s\n", debugstr_a(val));
2525 else
2526 ok_(__FILE__, line)(!strcasecmp(val, expected), "got %s\n", debugstr_a(val));
2527 }
2528}
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
#define strcasecmp
Definition: fake.h:9
#define debugstr_a
Definition: kernel32.h:31
#define REG_SZ
Definition: layer.c:22
#define REG_EXPAND_SZ
Definition: nt_native.h:1494

◆ create_test_files()

static void create_test_files ( void  )
static

Definition at line 2424 of file action.c.

2425{
2426 CreateDirectoryA("msitest", NULL);
2427 create_file("msitest\\one.txt", 100);
2428 CreateDirectoryA("msitest\\first", NULL);
2429 create_file("msitest\\first\\two.txt", 100);
2430 CreateDirectoryA("msitest\\second", NULL);
2431 create_file("msitest\\second\\three.txt", 100);
2432
2433 create_file("four.txt", 100);
2434 create_file("five.txt", 100);
2435 create_cab_file("msitest.cab", MEDIA_SIZE, "four.txt\0five.txt\0");
2436
2437 create_file("msitest\\filename", 100);
2438 create_file("msitest\\service.exe", 100);
2439 create_file("msitest\\service2.exe", 100);
2440
2441 DeleteFileA("four.txt");
2442 DeleteFileA("five.txt");
2443}
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
Definition: delete.c:24
BOOL WINAPI CreateDirectoryA(IN LPCSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
Definition: dir.c:37
static void create_cab_file(void)
Definition: files.c:356
#define create_file(name, size)
Definition: asmcache.c:813
#define MEDIA_SIZE
Definition: action.c:2376

Referenced by test_create_remove_shortcut(), test_delete_services(), test_find_related_products(), test_ini_values(), test_install_remove_odbc(), test_install_services(), test_publish_assemblies(), test_publish_components(), test_register_class_info(), test_register_extension_info(), test_register_font(), test_register_mime_info(), test_register_progid_info(), test_register_typelib(), test_remove_duplicate_files(), test_remove_existing_products(), test_self_registration(), test_start_stop_services(), and test_validate_product_id().

◆ delete_key()

static LONG delete_key ( HKEY  key,
LPCSTR  subkey,
REGSAM  access 
)
static

Definition at line 2481 of file action.c.

2482{
2483 if (pRegDeleteKeyExA)
2484 return pRegDeleteKeyExA( key, subkey, access, 0 );
2485 return RegDeleteKeyA( key, subkey );
2486}
LONG WINAPI RegDeleteKeyA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey)
Definition: reg.c:1222
GLuint GLint GLboolean GLint GLenum access
Definition: glext.h:7866

◆ delete_pfmsitest_files()

static void delete_pfmsitest_files ( void  )
static

Definition at line 2488 of file action.c.

2489{
2490 SHFILEOPSTRUCTA shfl;
2491 CHAR path[MAX_PATH+11];
2492
2494 lstrcatA(path, "\\msitest\\*");
2495 path[strlen(path) + 1] = '\0';
2496
2497 shfl.hwnd = NULL;
2498 shfl.wFunc = FO_DELETE;
2499 shfl.pFrom = path;
2500 shfl.pTo = NULL;
2502
2503 SHFileOperationA(&shfl);
2504
2506 lstrcatA(path, "\\msitest");
2508}
BOOL WINAPI RemoveDirectoryA(IN LPCSTR lpPathName)
Definition: dir.c:714
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:100
LPSTR WINAPI lstrcatA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:123
static char PROG_FILES_DIR[MAX_PATH]
Definition: automation.c:362
#define FO_DELETE
Definition: shellapi.h:135
#define FOF_FILESONLY
Definition: shellapi.h:145
#define FOF_NOERRORUI
Definition: shellapi.h:148
#define FOF_NOCONFIRMATION
Definition: shellapi.h:142
#define FOF_SILENT
Definition: shellapi.h:140
#define FOF_NORECURSION
Definition: shlfileop.c:38
int WINAPI SHFileOperationA(LPSHFILEOPSTRUCTA lpFileOp)
Definition: shlfileop.cpp:1069
FILEOP_FLAGS fFlags
Definition: shellapi.h:346
char CHAR
Definition: xmlstorage.h:175

Referenced by test_publish(), and test_publish_sourcelist().

◆ delete_test_files()

static void delete_test_files ( void  )
static

◆ delete_test_service()

static void delete_test_service ( const char name)
static

Definition at line 5246 of file action.c.

5247{
5248 BOOL ret;
5249 SC_HANDLE manager, service;
5250
5252 ok(manager != NULL, "can't open service manager\n");
5253 if (!manager) return;
5254
5255 service = OpenServiceA(manager, name, GENERIC_ALL);
5256 if (service)
5257 {
5258 ret = DeleteService( service );
5259 ok( ret, "failed to delete service %lu\n", GetLastError() );
5260 CloseServiceHandle(service);
5261 }
5262 CloseServiceHandle(manager);
5263}
#define ok(value,...)
Definition: atltest.h:57
unsigned int BOOL
Definition: ntddk_ex.h:94
#define GENERIC_ALL
Definition: nt_native.h:92
BOOL WINAPI DeleteService(SC_HANDLE hService)
Definition: scm.c:921
SC_HANDLE WINAPI OpenServiceA(SC_HANDLE hSCManager, LPCSTR lpServiceName, DWORD dwDesiredAccess)
Definition: scm.c:2060
SC_HANDLE WINAPI OpenSCManagerA(LPCSTR lpMachineName, LPCSTR lpDatabaseName, DWORD dwDesiredAccess)
Definition: scm.c:1972
BOOL WINAPI CloseServiceHandle(SC_HANDLE hSCObject)
Definition: scm.c:580
int ret
DWORD WINAPI GetLastError(void)
Definition: except.c:1040
#define SC_MANAGER_ALL_ACCESS
Definition: winsvc.h:13

Referenced by test_delete_services(), and test_install_services().

◆ extract_resource()

static void extract_resource ( const char name,
const char type,
const char path 
)
static

Definition at line 2639 of file action.c.

2640{
2641 DWORD written;
2642 HANDLE file;
2643 HRSRC res;
2644 void *ptr;
2645
2647 ok(file != INVALID_HANDLE_VALUE, "file creation failed, at %s, error %lu\n", path, GetLastError());
2648
2650 ok( res != 0, "couldn't find resource\n" );
2653 ok( written == SizeofResource( GetModuleHandleA(NULL), res ), "couldn't write resource\n" );
2654 CloseHandle( file );
2655}
#define CloseHandle
Definition: compat.h:739
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define CreateFileA(a, b, c, d, e, f, g)
Definition: compat.h:740
#define GENERIC_READ
Definition: compat.h:135
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: rw.c:24
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:812
HRSRC WINAPI FindResourceA(HMODULE hModule, LPCSTR name, LPCSTR type)
Definition: res.c:155
DWORD WINAPI SizeofResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:568
LPVOID WINAPI LockResource(HGLOBAL handle)
Definition: res.c:550
HGLOBAL WINAPI LoadResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:532
#define CREATE_ALWAYS
Definition: disk.h:72
static PVOID ptr
Definition: dispmode.c:27
#define GENERIC_WRITE
Definition: nt_native.h:90
Definition: fci.c:127

Referenced by test_register_typelib(), and test_self_registration().

◆ get_date_str()

static void get_date_str ( LPSTR  date)
static

Definition at line 2614 of file action.c.

2615{
2616 SYSTEMTIME systime;
2617
2618 static const char date_fmt[] = "%d%02d%02d";
2619 GetLocalTime(&systime);
2620 sprintf(date, date_fmt, systime.wYear, systime.wMonth, systime.wDay);
2621}
VOID WINAPI GetLocalTime(OUT LPSYSTEMTIME lpSystemTime)
Definition: time.c:286
__u16 date
Definition: mkdosfs.c:8
#define sprintf(buf, format,...)
Definition: sprintf.c:55
WORD wYear
Definition: winbase.h:905
WORD wMonth
Definition: winbase.h:906
WORD wDay
Definition: winbase.h:908

Referenced by test_publish(), and test_register_product().

◆ get_estimated_size()

static DWORD get_estimated_size ( void  )
static

Definition at line 2624 of file action.c.

2625{
2626 SYSTEM_INFO si;
2627 HANDLE file;
2628 DWORD size;
2629
2630 GetSystemInfo(&si);
2631
2633 size = ((GetFileSize(file, NULL) + si.dwPageSize - 1) / si.dwPageSize + 1);
2634 size = size * si.dwPageSize / 1024;
2636 return size;
2637}
#define OPEN_EXISTING
Definition: compat.h:775
DWORD WINAPI GetFileSize(HANDLE hFile, LPDWORD lpFileSizeHigh)
Definition: fileinfo.c:331
VOID WINAPI GetSystemInfo(IN LPSYSTEM_INFO lpSystemInfo)
Definition: sysinfo.c:142
static const char * msifile
Definition: action.c:66
DWORD dwPageSize
Definition: winbase.h:1161

Referenced by test_publish(), and test_register_product().

◆ get_owner_company()

static void get_owner_company ( LPSTR owner,
LPSTR company 
)
static

Definition at line 3411 of file action.c.

3412{
3413 LONG res;
3414 HKEY hkey;
3416
3417 *owner = *company = NULL;
3418
3419 if (is_wow64)
3421
3423 "Software\\Microsoft\\MS Setup (ACME)\\User Info", &hkey);
3424 if (res == ERROR_SUCCESS)
3425 {
3426 *owner = reg_get_val_str(hkey, "DefName");
3427 *company = reg_get_val_str(hkey, "DefCompany");
3428 RegCloseKey(hkey);
3429 }
3430
3431 if (!*owner || !*company)
3432 {
3434 "Software\\Microsoft\\Windows NT\\CurrentVersion", 0, access, &hkey);
3435 if (res == ERROR_SUCCESS)
3436 {
3437 *owner = reg_get_val_str(hkey, "RegisteredOwner");
3438 *company = reg_get_val_str(hkey, "RegisteredOrganization");
3439 RegCloseKey(hkey);
3440 }
3441 }
3442
3443 if (!*owner || !*company)
3444 {
3446 "Software\\Microsoft\\Windows\\CurrentVersion", 0, access, &hkey);
3447 if (res == ERROR_SUCCESS)
3448 {
3449 *owner = reg_get_val_str(hkey, "RegisteredOwner");
3450 *company = reg_get_val_str(hkey, "RegisteredOrganization");
3451 RegCloseKey(hkey);
3452 }
3453 }
3454}
#define RegCloseKey(hKey)
Definition: registry.h:47
#define ERROR_SUCCESS
Definition: deptool.c:10
LONG WINAPI RegOpenKeyExA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey, _In_ DWORD ulOptions, _In_ REGSAM samDesired, _Out_ PHKEY phkResult)
Definition: reg.c:3321
LONG WINAPI RegOpenKeyA(HKEY hKey, LPCSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3257
BOOL is_wow64
Definition: msi.c:54
static LPSTR reg_get_val_str(HKEY hkey, LPCSTR name)
Definition: action.c:3393
#define KEY_ALL_ACCESS
Definition: nt_native.h:1041
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define HKEY_CURRENT_USER
Definition: winreg.h:11
ACCESS_MASK REGSAM
Definition: winreg.h:69
#define KEY_WOW64_64KEY
Definition: cmtypes.h:46

Referenced by test_register_user().

◆ get_user_sid()

static char * get_user_sid ( void  )
static

Definition at line 2405 of file action.c.

2406{
2407 HANDLE token;
2408 DWORD size = 0;
2410 char *usersid = NULL;
2411
2414
2415 user = malloc(size);
2417 ConvertSidToStringSidA(user->User.Sid, &usersid);
2418 free(user);
2419
2421 return usersid;
2422}
void user(int argc, const char *argv[])
Definition: cmds.c:1350
#define free
Definition: debug_ros.c:5
#define malloc
Definition: debug_ros.c:4
BOOL WINAPI GetTokenInformation(HANDLE TokenHandle, TOKEN_INFORMATION_CLASS TokenInformationClass, LPVOID TokenInformation, DWORD TokenInformationLength, PDWORD ReturnLength)
Definition: security.c:413
BOOL WINAPI OpenProcessToken(HANDLE ProcessHandle, DWORD DesiredAccess, PHANDLE TokenHandle)
Definition: security.c:296
BOOL WINAPI ConvertSidToStringSidA(PSID Sid, LPSTR *StringSid)
Definition: security.c:3436
#define GetCurrentProcess()
Definition: compat.h:759
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat token
Definition: glfuncs.h:210
#define TOKEN_QUERY
Definition: setypes.h:924
@ TokenUser
Definition: setypes.h:962

Referenced by test_process_components(), test_publish_features(), test_publish_product(), test_register_product(), and test_register_user().

◆ init_functionpointers()

static void init_functionpointers ( void  )
static

Definition at line 2378 of file action.c.

2379{
2380 HMODULE hmsi = GetModuleHandleA("msi.dll");
2381 HMODULE hadvapi32 = GetModuleHandleA("advapi32.dll");
2382 HMODULE hkernel32 = GetModuleHandleA("kernel32.dll");
2383 HMODULE hsrclient = LoadLibraryA("srclient.dll");
2384
2385#define GET_PROC(mod, func) \
2386 p ## func = (void*)GetProcAddress(mod, #func); \
2387 if(!p ## func) \
2388 trace("GetProcAddress(%s) failed\n", #func);
2389
2395
2396 GET_PROC(hadvapi32, RegDeleteKeyExA)
2398
2399 GET_PROC(hsrclient, SRRemoveRestorePoint);
2400 GET_PROC(hsrclient, SRSetRestorePointA);
2401
2402#undef GET_PROC
2403}
LONG WINAPI RegDeleteKeyExA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey, _In_ REGSAM samDesired, _In_ DWORD Reserved)
Definition: reg.c:1252
#define IsWow64Process
Definition: compat.h:760
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
Definition: loader.c:111
INSTALLSTATE WINAPI MsiGetComponentPathExA(LPCSTR product, LPCSTR comp, LPCSTR usersid, MSIINSTALLCONTEXT ctx, LPSTR buf, LPDWORD buflen)
Definition: msi.c:2866
UINT WINAPI MsiQueryComponentStateA(LPCSTR szProductCode, LPCSTR szUserSid, MSIINSTALLCONTEXT dwContext, LPCSTR szComponent, INSTALLSTATE *pdwState)
Definition: msi.c:2057
UINT WINAPI MsiQueryFeatureStateExA(LPCSTR product, LPCSTR usersid, MSIINSTALLCONTEXT ctx, LPCSTR feature, INSTALLSTATE *state)
Definition: msi.c:2993
UINT WINAPI MsiSourceListEnumSourcesA(const char *szProductCodeOrPatch, const char *szUserSid, MSIINSTALLCONTEXT dwContext, DWORD dwOptions, DWORD dwIndex, char *szSource, DWORD *pcchSource)
Definition: source.c:329
UINT WINAPI MsiSourceListGetInfoA(LPCSTR szProduct, LPCSTR szUserSid, MSIINSTALLCONTEXT dwContext, DWORD dwOptions, LPCSTR szProperty, LPSTR szValue, LPDWORD pcchValue)
Definition: source.c:470
static HINSTANCE hkernel32
Definition: process.c:66
#define GET_PROC(mod, func)
BOOL WINAPI SRSetRestorePointA(PRESTOREPOINTINFOA pRestorePtSpec, PSTATEMGRSTATUS pSMgrStatus)
Definition: sfc.c:54
DWORD WINAPI SRRemoveRestorePoint(DWORD dwNumber)
Definition: srclient_main.c:71

Referenced by START_TEST().

◆ INSTALLSTATE()

static INSTALLSTATE ( WINAPI pMsiGetComponentPathExA)
static

◆ LONG()

static INSTALLSTATE *static LONG ( WINAPI pRegDeleteKeyExA)
static

◆ notify_system_change()

static BOOL notify_system_change ( DWORD  event_type,
STATEMGRSTATUS status 
)
static

Definition at line 2460 of file action.c.

2461{
2462 RESTOREPOINTINFOA spec;
2463
2464 spec.dwEventType = event_type;
2466 spec.llSequenceNumber = status->llSequenceNumber;
2467 lstrcpyA(spec.szDescription, "msitest restore point");
2468
2469 return pSRSetRestorePointA(&spec, status);
2470}
#define APPLICATION_INSTALL
CHAR szDescription[MAX_DESC]
Definition: ps.c:97

Referenced by START_TEST().

◆ reg_get_val_str()

static LPSTR reg_get_val_str ( HKEY  hkey,
LPCSTR  name 
)
static

Definition at line 3393 of file action.c.

3394{
3395 DWORD len = 0;
3396 LPSTR val;
3397 LONG r;
3398
3399 r = RegQueryValueExA(hkey, name, NULL, NULL, NULL, &len);
3400 if (r != ERROR_SUCCESS)
3401 return NULL;
3402
3403 len += sizeof (WCHAR);
3404 val = malloc(len);
3405 if (!val) return NULL;
3406 val[0] = 0;
3408 return val;
3409}
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLenum GLsizei len
Definition: glext.h:6722
unsigned char * LPBYTE
Definition: typedefs.h:53
char * LPSTR
Definition: xmlstorage.h:182
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by get_owner_company().

◆ remove_restore_point()

static void remove_restore_point ( DWORD  seq_number)
static

Definition at line 2472 of file action.c.

2473{
2474 DWORD res;
2475
2476 res = pSRRemoveRestorePoint(seq_number);
2477 if (res != ERROR_SUCCESS)
2478 trace("Failed to remove the restore point : %#lx\n", res);
2479}
#define trace
Definition: atltest.h:70

Referenced by START_TEST().

◆ START_TEST()

START_TEST ( action  )

Definition at line 6533 of file action.c.

6534{
6535 DWORD len;
6536 char temp_path[MAX_PATH], prev_path[MAX_PATH], log_file[MAX_PATH];
6538 BOOL ret = FALSE;
6539
6541 subtest("custom");
6542
6543 if (pIsWow64Process)
6544 pIsWow64Process(GetCurrentProcess(), &is_wow64);
6545
6546 GetCurrentDirectoryA(MAX_PATH, prev_path);
6549
6552
6553 if(len && (CURR_DIR[len - 1] == '\\'))
6554 CURR_DIR[len - 1] = 0;
6555
6556 ok(get_system_dirs(), "failed to retrieve system dirs\n");
6557 ok(get_user_dirs(), "failed to retrieve user dirs\n");
6558
6559 /* Create a restore point ourselves so we circumvent the multitude of restore points
6560 * that would have been created by all the installation and removal tests.
6561 *
6562 * This is not needed on version 5.0 where setting MSIFASTINSTALL prevents the
6563 * creation of restore points.
6564 */
6565 if (pSRSetRestorePointA && !pMsiGetComponentPathExA)
6566 {
6567 memset(&status, 0, sizeof(status));
6569 }
6570
6571 /* Create only one log file and don't append. We have to pass something
6572 * for the log mode for this to work. The logfile needs to have an absolute
6573 * path otherwise we still end up with some extra logfiles as some tests
6574 * change the current directory.
6575 */
6577 lstrcatA(log_file, "\\msitest.log");
6579
6585 test_publish();
6591 test_envvar();
6612
6614
6615 if (pSRSetRestorePointA && !pMsiGetComponentPathExA && ret)
6616 {
6618 if (ret)
6619 remove_restore_point(status.llSequenceNumber);
6620 }
6621
6622 SetCurrentDirectoryA(prev_path);
6623}
static char CURR_DIR[MAX_PATH]
DWORD WINAPI GetCurrentDirectoryA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)
Definition: path.c:2146
BOOL WINAPI SetCurrentDirectoryA(IN LPCSTR lpPathName)
Definition: path.c:2206
DWORD WINAPI GetTempPathA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)
Definition: path.c:2054
UINT WINAPI MsiEnableLogA(DWORD dwLogMode, const char *szLogFile, DWORD attributes)
Definition: msi.c:1884
UNICODE_STRING log_file
Definition: btrfs.c:89
int WINAPI lstrlenA(LPCSTR lpString)
Definition: lstring.c:145
static void remove_restore_point(DWORD seq_number)
Definition: action.c:2472
static void test_remove_duplicate_files(void)
Definition: action.c:5836
static void test_register_product(void)
Definition: action.c:2657
static BOOL notify_system_change(DWORD event_type, STATEMGRSTATUS *status)
Definition: action.c:2460
static void test_register_font(void)
Definition: action.c:5460
static void test_delete_services(void)
Definition: action.c:5265
static void test_publish_features(void)
Definition: action.c:3268
static void test_publish_product(void)
Definition: action.c:3031
static void test_envvar(void)
Definition: action.c:4977
static void test_remove_existing_products(void)
Definition: action.c:6497
static void test_ini_values(void)
Definition: action.c:5926
static void test_publish_assemblies(void)
Definition: action.c:6277
static void test_find_related_products(void)
Definition: action.c:5886
static void test_register_mime_info(void)
Definition: action.c:6232
static void test_install_remove_odbc(void)
Definition: action.c:5567
static void init_functionpointers(void)
Definition: action.c:2378
static void test_create_remove_folder(void)
Definition: action.c:5095
static void test_start_stop_services(void)
Definition: action.c:5148
static void test_publish(void)
Definition: action.c:3688
static void test_duplicate_files(void)
Definition: action.c:4769
static void test_register_user(void)
Definition: action.c:3456
static void test_write_registry_values(void)
Definition: action.c:4808
static void test_remove_files(void)
Definition: action.c:4488
static void test_create_remove_shortcut(void)
Definition: action.c:5703
static void test_publish_components(void)
Definition: action.c:5743
static void test_process_components(void)
Definition: action.c:3553
static void test_install_services(void)
Definition: action.c:5337
static void test_register_class_info(void)
Definition: action.c:5989
static void test_move_files(void)
Definition: action.c:4622
static void test_validate_product_id(void)
Definition: action.c:5516
static void test_publish_sourcelist(void)
Definition: action.c:4281
static void test_self_registration(void)
Definition: action.c:5416
static void test_register_extension_info(void)
Definition: action.c:6054
static void test_register_typelib(void)
Definition: action.c:5651
static void test_register_progid_info(void)
Definition: action.c:6106
BOOL get_user_dirs(void)
Definition: install.c:2404
BOOL get_system_dirs(void)
Definition: install.c:2423
@ INSTALLLOGMODE_FATALEXIT
Definition: msi.h:131
char temp_path[MAX_PATH]
Definition: mspatcha.c:123
#define subtest
Definition: test.h:157
#define memset(x, y, z)
Definition: compat.h:39
#define BEGIN_NESTED_SYSTEM_CHANGE
#define END_NESTED_SYSTEM_CHANGE

◆ test_create_remove_folder()

static void test_create_remove_folder ( void  )
static

Definition at line 5095 of file action.c.

5096{
5097 UINT r;
5098
5099 if (is_process_limited())
5100 {
5101 skip("process is limited\n");
5102 return;
5103 }
5104
5105 CreateDirectoryA("msitest", NULL);
5106 CreateDirectoryA("msitest\\first", NULL);
5107 CreateDirectoryA("msitest\\second", NULL);
5108 create_file("msitest\\first\\one.txt", 1000);
5109 create_file("msitest\\second\\two.txt", 1000);
5111
5113
5116 {
5117 skip("Not enough rights to perform tests\n");
5118 goto error;
5119 }
5120 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5121
5122 ok(pf_exists("msitest\\first\\one.txt"), "file not installed\n");
5123 ok(pf_exists("msitest\\first"), "directory not created\n");
5124 ok(pf_exists("msitest\\second\\two.txt"), "file not installed\n");
5125 ok(pf_exists("msitest\\second"), "directory not created\n");
5126 ok(pf_exists("msitest\\third"), "directory not created\n");
5127 ok(pf_exists("msitest"), "directory not created\n");
5128
5129 r = MsiInstallProductA(msifile, "REMOVE=ALL");
5130 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5131
5132 ok(!pf_exists("msitest\\first\\one.txt"), "file not removed\n");
5133 ok(!pf_exists("msitest\\first"), "directory not removed\n");
5134 ok(!pf_exists("msitest\\second\\two.txt"), "file not removed\n");
5135 ok(!pf_exists("msitest\\second"), "directory not removed\n");
5136 ok(!pf_exists("msitest\\third"), "directory not removed\n");
5137 todo_wine ok(!pf_exists("msitest"), "directory not removed\n");
5138
5139error:
5140 DeleteFileA("msitest\\first\\one.txt");
5141 DeleteFileA("msitest\\second\\two.txt");
5142 RemoveDirectoryA("msitest\\first");
5143 RemoveDirectoryA("msitest\\second");
5144 RemoveDirectoryA("msitest");
5146}
#define skip(...)
Definition: atltest.h:64
UINT WINAPI MsiInstallProductA(LPCSTR szPackagePath, LPCSTR szCommandLine)
Definition: msi.c:200
INSTALLUILEVEL WINAPI MsiSetInternalUI(INSTALLUILEVEL dwUILevel, HWND *phWnd)
Definition: msi.c:2284
#define error(str)
Definition: mkdosfs.c:1605
static BOOL is_process_limited(void)
Definition: atl.c:113
static const msi_table cf_tables[]
Definition: action.c:2081
static BOOL pf_exists(const char *file)
Definition: custom.c:1406
#define todo_wine
Definition: custom.c:79
#define create_database(name, tables, num_tables)
Definition: utils.h:42
@ INSTALLUILEVEL_NONE
Definition: msi.h:66
unsigned int UINT
Definition: ndis.h:50
#define ARRAY_SIZE(a)
Definition: notepad.h:31
#define ERROR_INSTALL_PACKAGE_REJECTED
Definition: winerror.h:983

Referenced by START_TEST().

◆ test_create_remove_shortcut()

static void test_create_remove_shortcut ( void  )
static

Definition at line 5703 of file action.c.

5704{
5705 UINT r;
5706
5707 if (is_process_limited())
5708 {
5709 skip("process is limited\n");
5710 return;
5711 }
5712
5714 create_file("msitest\\target.txt", 1000);
5716
5718
5721 {
5722 skip("Not enough rights to perform tests\n");
5723 goto error;
5724 }
5725 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5726
5727 ok(pf_exists("msitest\\target.txt"), "file not created\n");
5728 ok(pf_exists("msitest\\shortcut.lnk"), "file not created\n");
5729
5730 r = MsiInstallProductA(msifile, "REMOVE=ALL");
5731 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5732
5733 ok(!delete_pf("msitest\\shortcut.lnk", TRUE), "file not removed\n");
5734 ok(!delete_pf("msitest\\target.txt", TRUE), "file not removed\n");
5735 todo_wine ok(!delete_pf("msitest", FALSE), "directory not removed\n");
5736
5737error:
5738 DeleteFileA("msitest\\target.txt");
5741}
static void delete_test_files(void)
Definition: action.c:2445
static void create_test_files(void)
Definition: action.c:2424
static const msi_table crs_tables[]
Definition: action.c:2209
static BOOL delete_pf(const CHAR *rel_path, BOOL is_file)
Definition: automation.c:414

Referenced by START_TEST().

◆ test_delete_services()

static void test_delete_services ( void  )
static

Definition at line 5265 of file action.c.

5266{
5267 UINT r;
5268 SC_HANDLE manager, service;
5269 DWORD error;
5270
5271 if (is_process_limited())
5272 {
5273 skip("process is limited\n");
5274 return;
5275 }
5276
5278 ok(manager != NULL, "can't open service manager %lu\n", GetLastError());
5279 if (!manager) return;
5280
5281 service = CreateServiceA(manager, "TestService3", "TestService3",
5283 SERVICE_ERROR_NORMAL, "C:\\doesnt_exist.exe", NULL, NULL, NULL, NULL, NULL);
5284 ok(service != NULL, "can't create service %lu\n", GetLastError());
5285 CloseServiceHandle(service);
5286 CloseServiceHandle(manager);
5287 if (!service) return;
5288
5291
5293
5296 {
5297 skip("Not enough rights to perform tests\n");
5298 goto error;
5299 }
5300 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5301
5303 ok(manager != NULL, "can't open service manager\n");
5304 if (!manager) goto error;
5305
5306 service = OpenServiceA(manager, "TestService3", GENERIC_ALL);
5307 error = GetLastError();
5308 ok(service == NULL, "TestService3 not deleted\n");
5309 ok(error == ERROR_SERVICE_DOES_NOT_EXIST, "wrong error %lu\n", error);
5310 CloseServiceHandle(manager);
5311
5312 r = MsiInstallProductA(msifile, "REMOVE=ALL");
5313 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5314
5315 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
5316 ok(delete_pf("msitest\\cabout\\new", FALSE), "Directory not created\n");
5317 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
5318 ok(delete_pf("msitest\\cabout", FALSE), "Directory not created\n");
5319 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
5320 ok(delete_pf("msitest\\changed", FALSE), "Directory not created\n");
5321 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
5322 ok(delete_pf("msitest\\first", FALSE), "Directory not created\n");
5323 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
5324 ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
5325 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
5326 ok(delete_pf("msitest\\service2.exe", TRUE), "File not installed\n");
5327 ok(delete_pf("msitest", FALSE), "Directory not created\n");
5328
5329error:
5330 delete_test_service("TestService");
5331 delete_test_service("TestService2");
5332 delete_test_service("TestService3");
5335}
static void delete_test_service(const char *name)
Definition: action.c:5246
static const msi_table sds_tables[]
Definition: action.c:2109
SC_HANDLE WINAPI CreateServiceA(SC_HANDLE hSCManager, LPCSTR lpServiceName, LPCSTR lpDisplayName, DWORD dwDesiredAccess, DWORD dwServiceType, DWORD dwStartType, DWORD dwErrorControl, LPCSTR lpBinaryPathName, LPCSTR lpLoadOrderGroup, LPDWORD lpdwTagId, LPCSTR lpDependencies, LPCSTR lpServiceStartName, LPCSTR lpPassword)
Definition: scm.c:680
#define ERROR_SERVICE_DOES_NOT_EXIST
Definition: winerror.h:611
#define SERVICE_ALL_ACCESS
Definition: winsvc.h:62
#define SERVICE_DEMAND_START
Definition: cmtypes.h:978
#define SERVICE_WIN32_OWN_PROCESS
Definition: cmtypes.h:962
#define SERVICE_ERROR_NORMAL
Definition: cmtypes.h:982

Referenced by START_TEST().

◆ test_duplicate_files()

static void test_duplicate_files ( void  )
static

Definition at line 4769 of file action.c.

4770{
4771 UINT r;
4772
4773 if (is_process_limited())
4774 {
4775 skip("process is limited\n");
4776 return;
4777 }
4778
4779 CreateDirectoryA("msitest", NULL);
4780 create_file("msitest\\maximus", 500);
4782
4784
4785 /* fails if the destination folder is not a valid property */
4786
4789 {
4790 skip("Not enough rights to perform tests\n");
4791 goto error;
4792 }
4793 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4794 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
4795 ok(delete_pf("msitest\\augustus", TRUE), "File not duplicated\n");
4796 ok(delete_pf("msitest\\this\\doesnot\\exist\\maximus", TRUE), "File not duplicated\n");
4797 ok(delete_pf("msitest\\this\\doesnot\\exist", FALSE), "Directory not created\n");
4798 ok(delete_pf("msitest\\this\\doesnot", FALSE), "Directory not created\n");
4799 ok(delete_pf("msitest\\this", FALSE), "Directory not created\n");
4800 ok(delete_pf("msitest", FALSE), "Directory not created\n");
4801
4802error:
4803 DeleteFileA("msitest\\maximus");
4804 RemoveDirectoryA("msitest");
4806}
static const msi_table df_tables[]
Definition: action.c:2054

Referenced by START_TEST().

◆ test_envvar()

static void test_envvar ( void  )
static

Definition at line 4977 of file action.c.

4978{
4979 char buffer[16];
4980 UINT r, i;
4981 HKEY env, env2;
4982 LONG res;
4983
4984 if (is_process_limited())
4985 {
4986 skip("process is limited\n");
4987 return;
4988 }
4989
4991
4992 res = RegCreateKeyExA(HKEY_CURRENT_USER, "Environment", 0, NULL, 0, KEY_ALL_ACCESS, NULL, &env, NULL);
4993 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
4994
4995 res = RegCreateKeyExA(HKEY_LOCAL_MACHINE, "System\\CurrentControlSet\\Control\\Session Manager\\Environment",
4996 0, NULL, 0, KEY_ALL_ACCESS, NULL, &env2, NULL);
4997 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
4998
4999 res = RegSetValueExA(env, "MSITESTVAR1", 0, REG_SZ, (const BYTE *)"0", 2);
5000 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
5001
5002 res = RegSetValueExA(env, "MSITESTVAR2", 0, REG_SZ, (const BYTE *)"0", 2);
5003 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
5004
5005 res = RegSetValueExA(env, "MSITESTVAR21", 0, REG_SZ, (const BYTE *)"1", 2);
5006 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
5007
5009
5012 {
5013 skip("Not enough rights to perform tests\n");
5014 goto error;
5015 }
5016 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5017
5018 CHECK_REG_STR(env, "MSITESTVAR1", "1");
5019 CHECK_REG_STR(env, "MSITESTVAR2", "1");
5020 CHECK_REG_STR(env, "MSITESTVAR3", "1");
5021 CHECK_REG_STR(env, "MSITESTVAR4", "1");
5022
5023 res = RegDeleteValueA(env, "MSITESTVAR5");
5024 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %ld\n", res);
5025
5026 res = RegDeleteValueA(env, "MSITESTVAR6");
5027 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %ld\n", res);
5028
5029 res = RegDeleteValueA(env, "MSITESTVAR7");
5030 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %ld\n", res);
5031
5032 res = RegDeleteValueA(env, "MSITESTVAR8");
5033 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %ld\n", res);
5034
5035 res = RegDeleteValueA(env, "MSITESTVAR9");
5036 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %ld\n", res);
5037
5038 res = RegDeleteValueA(env, "MSITESTVAR10");
5039 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %ld\n", res);
5040
5041 CHECK_REG_STR(env, "MSITESTVAR11", "1;2");
5042 CHECK_REG_STR(env, "MSITESTVAR12", "1");
5043 CHECK_REG_STR(env, "MSITESTVAR13", "1;2");
5044 CHECK_REG_STR(env, "MSITESTVAR14", ";1;");
5045 CHECK_REG_STR(env, "MSITESTVAR15", ";;1;;");
5046 CHECK_REG_STR(env, "MSITESTVAR16", " 1 ");
5047 CHECK_REG_STR(env, "MSITESTVAR17", ";;2;;1");
5048 CHECK_REG_STR(env, "MSITESTVAR18", "1;;2;;");
5049 CHECK_REG_STR(env, "MSITESTVAR19", "1");
5050 CHECK_REG_STR(env, "MSITESTVAR20", "1");
5051 CHECK_REG_STR(env, "MSITESTVAR21", "1");
5052 CHECK_REG_STR(env, "MSITESTVAR24", "TestService");
5053 CHECK_REG_STR(env2, "MSITESTVAR100", "1");
5054
5055 res = RegSetValueExA(env, "MSITESTVAR22", 0, REG_SZ, (const BYTE *)"1", 2);
5056 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
5057
5058 res = RegSetValueExA(env, "MSITESTVAR23", 0, REG_SZ, (const BYTE *)"1", 2);
5059 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
5060
5061 res = RegDeleteValueA(env, "MSITESTVAR25");
5062 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %ld\n", res);
5063
5064 r = MsiInstallProductA(msifile, "REMOVE=ALL");
5065 ok(!r, "got %u\n", r);
5066
5067 CHECK_DEL_REG_STR(env, "MSITESTVAR13", "1;2");
5068 CHECK_DEL_REG_STR(env, "MSITESTVAR14", ";1;");
5069 CHECK_DEL_REG_STR(env, "MSITESTVAR15", ";;1;;");
5070 CHECK_DEL_REG_STR(env, "MSITESTVAR16", " 1 ");
5071 CHECK_DEL_REG_STR_TODO(env, "MSITESTVAR17", "1");
5072 CHECK_DEL_REG_STR_TODO(env, "MSITESTVAR18", "1");
5073 CHECK_DEL_REG_STR(env, "MSITESTVAR23", "1");
5074
5075 for (i = 1; i <= 23; i++)
5076 {
5077 sprintf(buffer, "MSITESTVAR%i", i);
5079 ok(res == ERROR_FILE_NOT_FOUND, "[%d] got %ld\n", i, res);
5080 }
5081
5082 res = RegDeleteValueA(env2, "MSITESTVAR100");
5083 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %ld\n", res);
5084
5085error:
5086 RegDeleteValueA(env, "MSITESTVAR1");
5087 RegDeleteValueA(env, "MSITESTVAR2");
5088 RegDeleteValueA(env, "MSITESTVAR21");
5090 RegCloseKey(env2);
5091
5093}
static LPCWSTR LPCWSTR LPCWSTR env
Definition: db.cpp:170
LONG WINAPI RegSetValueExA(HKEY hKey, LPCSTR lpValueName, DWORD Reserved, DWORD dwType, CONST BYTE *lpData, DWORD cbData)
Definition: reg.c:4817
LONG WINAPI RegDeleteValueA(HKEY hKey, LPCSTR lpValueName)
Definition: reg.c:2319
LONG WINAPI RegCreateKeyExA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey, _In_ DWORD Reserved, _In_ LPSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_ LPDWORD lpdwDisposition)
Definition: reg.c:1029
GLuint buffer
Definition: glext.h:5915
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
#define CHECK_REG_STR(prodkey, name, expected)
Definition: action.c:2563
static const msi_table env_tables[]
Definition: action.c:1987
#define CHECK_DEL_REG_STR_TODO(prodkey, name, expected)
Definition: action.c:2572
#define CHECK_DEL_REG_STR(prodkey, name, expected)
Definition: action.c:2566

Referenced by START_TEST().

◆ test_find_related_products()

static void test_find_related_products ( void  )
static

Definition at line 5886 of file action.c.

5887{
5888 UINT r;
5889
5890 if (is_process_limited())
5891 {
5892 skip("process is limited\n");
5893 return;
5894 }
5895
5897 create_file("msitest\\product.txt", 1000);
5899
5901
5904 {
5905 skip("Not enough rights to perform tests\n");
5906 goto error;
5907 }
5908 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5909
5910 /* install again, so it finds the upgrade code */
5912 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5913
5914 r = MsiInstallProductA(msifile, "REMOVE=ALL");
5915 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5916
5917 ok(!delete_pf("msitest\\product.txt", TRUE), "file not removed\n");
5918 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
5919
5920error:
5921 DeleteFileA("msitest\\product.txt");
5924}
static const msi_table frp_tables[]
Definition: action.c:2251

Referenced by START_TEST().

◆ test_ini_values()

static void test_ini_values ( void  )
static

Definition at line 5926 of file action.c.

5927{
5928 UINT r;
5929 DWORD len;
5930 char inifile[MAX_PATH], buf[0x10];
5931 HANDLE file;
5932 BOOL ret;
5933
5934 if (is_process_limited())
5935 {
5936 skip("process is limited\n");
5937 return;
5938 }
5939
5941 create_file("msitest\\inifile.txt", 1000);
5943
5944 lstrcpyA(inifile, PROG_FILES_DIR);
5945 lstrcatA(inifile, "\\msitest");
5946 ret = CreateDirectoryA(inifile, NULL);
5948 {
5949 skip("Not enough rights to perform tests\n");
5950 goto error;
5951 }
5952 lstrcatA(inifile, "\\test.ini");
5955
5956 ret = WritePrivateProfileStringA("sectionA", "keyA", "valueA", inifile);
5957 ok(ret, "failed to write profile string %lu\n", GetLastError());
5958
5960
5962 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5963
5964 len = GetPrivateProfileStringA("section1", "key1", NULL, buf, sizeof(buf), inifile);
5965 ok(len == 6, "got %lu expected 6\n", len);
5966
5967 len = GetPrivateProfileStringA("sectionA", "keyA", NULL, buf, sizeof(buf), inifile);
5968 ok(!len, "got %lu expected 0\n", len);
5969
5970 r = MsiInstallProductA(msifile, "REMOVE=ALL");
5971 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5972
5973 len = GetPrivateProfileStringA("section1", "key1", NULL, buf, sizeof(buf), inifile);
5974 ok(!len, "got %lu expected 0\n", len);
5975
5976 len = GetPrivateProfileStringA("sectionA", "keyA", NULL, buf, sizeof(buf), inifile);
5977 ok(!len, "got %lu expected 0\n", len);
5978
5979 todo_wine ok(!delete_pf("msitest\\test.ini", TRUE), "file removed\n");
5980 ok(!delete_pf("msitest\\inifile.txt", TRUE), "file not removed\n");
5981 ok(delete_pf("msitest", FALSE), "directory removed\n");
5982
5983error:
5984 DeleteFileA("msitest\\inifile.txt");
5987}
#define ERROR_ACCESS_DENIED
Definition: compat.h:97
INT WINAPI GetPrivateProfileStringA(LPCSTR section, LPCSTR entry, LPCSTR def_val, LPSTR buffer, UINT len, LPCSTR filename)
Definition: profile.c:1204
BOOL WINAPI DECLSPEC_HOTPATCH WritePrivateProfileStringA(LPCSTR section, LPCSTR entry, LPCSTR string, LPCSTR filename)
Definition: profile.c:1484
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
static const msi_table ini_tables[]
Definition: action.c:2265

Referenced by START_TEST().

◆ test_install_remove_odbc()

static void test_install_remove_odbc ( void  )
static

Definition at line 5567 of file action.c.

5568{
5569 int gotdriver = 0, gotdriver2 = 0;
5570 char buffer[1000], *p;
5571 WORD len;
5572 UINT r;
5573
5574 if (is_process_limited())
5575 {
5576 skip("process is limited\n");
5577 return;
5578 }
5579
5581 create_file("msitest\\ODBCdriver.dll", 1000);
5582 create_file("msitest\\ODBCdriver2.dll", 1000);
5583 create_file("msitest\\ODBCtranslator.dll", 1000);
5584 create_file("msitest\\ODBCtranslator2.dll", 1000);
5585 create_file("msitest\\ODBCsetup.dll", 1000);
5587
5589
5592 {
5593 skip("Not enough rights to perform tests\n");
5594 goto error;
5595 }
5596 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5597
5598 ok(pf_exists("msitest\\ODBCdriver.dll"), "file not created\n");
5599 ok(pf_exists("msitest\\ODBCdriver2.dll"), "file not created\n");
5600 ok(pf_exists("msitest\\ODBCtranslator.dll"), "file not created\n");
5601 ok(pf_exists("msitest\\ODBCtranslator2.dll"), "file not created\n");
5602 ok(pf_exists("msitest\\ODBCsetup.dll"), "file not created\n");
5603
5605 ok(len < sizeof(buffer), "buffer too small\n");
5606 ok(r, "SQLGetInstalledDrivers failed\n");
5607 for (p = buffer; *p; p += strlen(p) + 1)
5608 {
5609 if (!strcmp(p, "ODBC test driver"))
5610 gotdriver = 1;
5611 if (!strcmp(p, "ODBC test driver2"))
5612 gotdriver2 = 1;
5613 }
5614 ok(gotdriver, "driver not installed\n");
5615 ok(gotdriver2, "driver 2 not installed\n");
5616
5617 r = MsiInstallProductA(msifile, "REMOVE=ALL");
5618 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5619
5620 ok(!delete_pf("msitest\\ODBCdriver.dll", TRUE), "file not removed\n");
5621 ok(!delete_pf("msitest\\ODBCdriver2.dll", TRUE), "file not removed\n");
5622 ok(!delete_pf("msitest\\ODBCtranslator.dll", TRUE), "file not removed\n");
5623 ok(!delete_pf("msitest\\ODBCtranslator2.dll", TRUE), "file not removed\n");
5624 ok(!delete_pf("msitest\\ODBCsetup.dll", TRUE), "file not removed\n");
5625 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
5626
5627 gotdriver = gotdriver2 = 0;
5629 ok(len < sizeof(buffer), "buffer too small\n");
5630 ok(r, "SQLGetInstalledDrivers failed\n");
5631 for (p = buffer; *p; p += strlen(p) + 1)
5632 {
5633 if (!strcmp(p, "ODBC test driver"))
5634 gotdriver = 1;
5635 if (!strcmp(p, "ODBC test driver2"))
5636 gotdriver2 = 1;
5637 }
5638 ok(!gotdriver, "driver not installed\n");
5639 ok(!gotdriver2, "driver 2 not installed\n");
5640
5641error:
5642 DeleteFileA("msitest\\ODBCdriver.dll");
5643 DeleteFileA("msitest\\ODBCdriver2.dll");
5644 DeleteFileA("msitest\\ODBCtranslator.dll");
5645 DeleteFileA("msitest\\ODBCtranslator2.dll");
5646 DeleteFileA("msitest\\ODBCsetup.dll");
5649}
unsigned short WORD
Definition: ntddk_ex.h:93
static const msi_table odbc_tables[]
Definition: action.c:2179
BOOL WINAPI SQLGetInstalledDrivers(char *buf, WORD size, WORD *sizeout)
Definition: odbccp32.c:561

Referenced by START_TEST().

◆ test_install_services()

static void test_install_services ( void  )
static

Definition at line 5337 of file action.c.

5338{
5339 UINT r;
5340 SC_HANDLE manager, service;
5341 LONG res;
5342 HKEY hKey;
5343 DWORD err_control, err_controlsize, err_controltype;
5344
5345 if (is_process_limited())
5346 {
5347 skip("process is limited\n");
5348 return;
5349 }
5350
5353
5355
5358 {
5359 skip("Not enough rights to perform tests\n");
5360 goto error;
5361 }
5362 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5363
5365 ok(manager != NULL, "can't open service manager\n");
5366 if (!manager) goto error;
5367
5368 service = OpenServiceA(manager, "TestService", GENERIC_ALL);
5369 ok(service != NULL, "TestService not installed\n");
5370 CloseServiceHandle(service);
5371
5372 service = OpenServiceA(manager, "TestService4", GENERIC_ALL);
5373 ok(service == NULL, "TestService4 installed\n");
5374
5375 res = RegOpenKeyA(HKEY_LOCAL_MACHINE, "SYSTEM\\CurrentControlSet\\Services\\TestService", &hKey);
5376 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
5377
5378 if (res == ERROR_SUCCESS)
5379 {
5380 err_control = 0xBEEF;
5381 err_controltype = REG_DWORD;
5382 err_controlsize = sizeof(err_control);
5383 res = RegQueryValueExA(hKey, "ErrorControl", NULL, &err_controltype, (LPBYTE)&err_control, &err_controlsize);
5384 ok(err_control == 0, "TestService.ErrorControl wrong, expected 0, got %lu\n", err_control);
5386 }
5387
5388 r = MsiInstallProductA(msifile, "REMOVE=ALL");
5389 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5390
5391 service = OpenServiceA(manager, "TestService", GENERIC_ALL);
5392 ok(service != NULL, "TestService deleted\n");
5393 CloseServiceHandle(service);
5394 CloseServiceHandle(manager);
5395
5396 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
5397 ok(delete_pf("msitest\\cabout\\new", FALSE), "Directory not created\n");
5398 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
5399 ok(delete_pf("msitest\\cabout", FALSE), "Directory not created\n");
5400 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
5401 ok(delete_pf("msitest\\changed", FALSE), "Directory not created\n");
5402 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
5403 ok(delete_pf("msitest\\first", FALSE), "Directory not created\n");
5404 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
5405 ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
5406 ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
5407 ok(delete_pf("msitest\\service2.exe", TRUE), "File not installed\n");
5408 ok(delete_pf("msitest", FALSE), "Directory not created\n");
5409
5410error:
5411 delete_test_service("TestService");
5414}
FxAutoRegKey hKey
static const msi_table sis_tables[]
Definition: action.c:2124

Referenced by START_TEST().

◆ test_move_files()

static void test_move_files ( void  )
static

Definition at line 4622 of file action.c.

4623{
4624 UINT r;
4625 char props[4 * MAX_PATH + 74];
4626
4627 if (is_process_limited())
4628 {
4629 skip("process is limited\n");
4630 return;
4631 }
4632
4633 CreateDirectoryA("msitest", NULL);
4634 create_file("msitest\\augustus", 100);
4635 create_file("cameroon", 100);
4636 create_file("djibouti", 100);
4637 create_file("egypt", 100);
4638 create_file("finland", 100);
4639 create_file("gambai", 100);
4640 create_file("honduras", 100);
4641 create_file("msitest\\india", 100);
4642 create_file("japan", 100);
4643 create_file("kenya", 100);
4644 CreateDirectoryA("latvia", NULL);
4645 create_file("nauru", 100);
4646 create_file("peru", 100);
4647 create_file("apple", 100);
4648 create_file("application", 100);
4649 create_file("ape", 100);
4650 create_file("foo", 100);
4651 create_file("fao", 100);
4652 create_file("fbod", 100);
4653 create_file("budding", 100);
4654 create_file("buddy", 100);
4655 create_file("bud", 100);
4656 create_file("bar", 100);
4657 create_file("bur", 100);
4658 create_file("bird", 100);
4659
4661
4663
4664 /* if the source or dest property is not a full path,
4665 * windows tries to access it as a network resource
4666 */
4667
4668 sprintf(props, "SOURCEFULL=\"%s\\\" DESTFULL=\"%s\\msitest\" "
4669 "FILEPATHBAD=\"%s\\japan\" FILEPATHGOOD=\"%s\\kenya\"",
4671
4674 {
4675 skip("Not enough rights to perform tests\n");
4676 goto error;
4677 }
4678 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4679 ok(delete_pf("msitest\\augustus", TRUE), "File not installed\n");
4680 ok(!delete_pf("msitest\\dest", TRUE), "File copied\n");
4681 ok(delete_pf("msitest\\canada", TRUE), "File not copied\n");
4682 ok(delete_pf("msitest\\dominica", TRUE), "File not moved\n");
4683 ok(!delete_pf("msitest\\elsalvador", TRUE), "File moved\n");
4684 ok(!delete_pf("msitest\\france", TRUE), "File moved\n");
4685 ok(!delete_pf("msitest\\georgia", TRUE), "File moved\n");
4686 ok(delete_pf("msitest\\hungary", TRUE), "File not moved\n");
4687 ok(!delete_pf("msitest\\indonesia", TRUE), "File moved\n");
4688 ok(!delete_pf("msitest\\jordan", TRUE), "File moved\n");
4689 ok(delete_pf("msitest\\kiribati", TRUE), "File not moved\n");
4690 ok(!delete_pf("msitest\\lebanon", TRUE), "File moved\n");
4691 ok(!delete_pf("msitest\\lebanon", FALSE), "Directory moved\n");
4692 ok(delete_pf("msitest\\poland", TRUE), "File not moved\n");
4693 /* either apple or application will be moved depending on directory order */
4694 if (!delete_pf("msitest\\apple", TRUE))
4695 ok(delete_pf("msitest\\application", TRUE), "File not moved\n");
4696 else
4697 ok(!delete_pf("msitest\\application", TRUE), "File should not exist\n");
4698 ok(delete_pf("msitest\\wildcard", TRUE), "File not moved\n");
4699 ok(!delete_pf("msitest\\ape", TRUE), "File moved\n");
4700 /* either fao or foo will be moved depending on directory order */
4701 if (delete_pf("msitest\\foo", TRUE))
4702 ok(!delete_pf("msitest\\fao", TRUE), "File should not exist\n");
4703 else
4704 ok(delete_pf("msitest\\fao", TRUE), "File not moved\n");
4705 ok(delete_pf("msitest\\single", TRUE), "File not moved\n");
4706 ok(!delete_pf("msitest\\fbod", TRUE), "File moved\n");
4707 ok(delete_pf("msitest\\budding", TRUE), "File not moved\n");
4708 ok(delete_pf("msitest\\buddy", TRUE), "File not moved\n");
4709 ok(!delete_pf("msitest\\bud", TRUE), "File moved\n");
4710 ok(delete_pf("msitest\\bar", TRUE), "File not moved\n");
4711 ok(delete_pf("msitest\\bur", TRUE), "File not moved\n");
4712 ok(!delete_pf("msitest\\bird", TRUE), "File moved\n");
4713 ok(delete_pf("msitest", FALSE), "Directory not created\n");
4714 ok(DeleteFileA("cameroon"), "File moved\n");
4715 ok(!DeleteFileA("djibouti"), "File not moved\n");
4716 ok(DeleteFileA("egypt"), "File moved\n");
4717 ok(DeleteFileA("finland"), "File moved\n");
4718 ok(DeleteFileA("gambai"), "File moved\n");
4719 ok(!DeleteFileA("honduras"), "File not moved\n");
4720 ok(DeleteFileA("msitest\\india"), "File moved\n");
4721 ok(DeleteFileA("japan"), "File moved\n");
4722 ok(!DeleteFileA("kenya"), "File not moved\n");
4723 ok(RemoveDirectoryA("latvia"), "Directory moved\n");
4724 ok(!DeleteFileA("nauru"), "File not moved\n");
4725 ok(!DeleteFileA("peru"), "File not moved\n");
4726 ok(!DeleteFileA("apple"), "File not moved\n");
4727 ok(!DeleteFileA("application"), "File not moved\n");
4728 ok(DeleteFileA("ape"), "File moved\n");
4729 ok(!DeleteFileA("foo"), "File not moved\n");
4730 ok(!DeleteFileA("fao"), "File not moved\n");
4731 ok(DeleteFileA("fbod"), "File moved\n");
4732 ok(!DeleteFileA("budding"), "File not moved\n");
4733 ok(!DeleteFileA("buddy"), "File not moved\n");
4734 ok(DeleteFileA("bud"), "File moved\n");
4735 ok(!DeleteFileA("bar"), "File not moved\n");
4736 ok(!DeleteFileA("bur"), "File not moved\n");
4737 ok(DeleteFileA("bird"), "File moved\n");
4738
4739error:
4740 DeleteFileA("cameroon");
4741 DeleteFileA("djibouti");
4742 DeleteFileA("egypt");
4743 DeleteFileA("finland");
4744 DeleteFileA("gambai");
4745 DeleteFileA("honduras");
4746 DeleteFileA("japan");
4747 DeleteFileA("kenya");
4748 DeleteFileA("nauru");
4749 DeleteFileA("peru");
4750 DeleteFileA("apple");
4751 DeleteFileA("application");
4752 DeleteFileA("ape");
4753 DeleteFileA("foo");
4754 DeleteFileA("fao");
4755 DeleteFileA("fbod");
4756 DeleteFileA("budding");
4757 DeleteFileA("buddy");
4758 DeleteFileA("bud");
4759 DeleteFileA("bar");
4760 DeleteFileA("bur");
4761 DeleteFileA("bird");
4762 DeleteFileA("msitest\\india");
4763 DeleteFileA("msitest\\augustus");
4764 RemoveDirectoryA("latvia");
4765 RemoveDirectoryA("msitest");
4767}
static const msi_table mov_tables[]
Definition: action.c:2040
static const WCHAR props[]
Definition: wbemdisp.c:288

Referenced by START_TEST().

◆ test_process_components()

static void test_process_components ( void  )
static

Definition at line 3553 of file action.c.

3554{
3555 static const char keyfmt[] =
3556 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\%s\\Components\\%s";
3557 static const char compkey[] =
3558 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\Components";
3559 UINT r;
3560 LONG res;
3561 DWORD size;
3562 HKEY comp, hkey;
3563 LPSTR usersid;
3564 CHAR val[MAX_PATH];
3565 CHAR keypath[MAX_PATH];
3566 CHAR program_files_maximus[MAX_PATH];
3568
3569 if (is_process_limited())
3570 {
3571 skip("process is limited\n");
3572 return;
3573 }
3574
3575 if (!(usersid = get_user_sid()))
3576 return;
3577
3578 CreateDirectoryA("msitest", NULL);
3579 create_file("msitest\\maximus", 500);
3580
3582
3583 if (is_wow64)
3585
3587
3588 /* ProcessComponents, per-user */
3589 r = MsiInstallProductA(msifile, "PROCESS_COMPONENTS=1");
3591 {
3592 skip("Not enough rights to perform tests\n");
3593 goto error;
3594 }
3595 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3596 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
3597 ok(delete_pf("msitest", FALSE), "Directory not created\n");
3598
3599 sprintf(keypath, keyfmt, usersid, "CBABC2FDCCB35E749A8944D8C1C098B5");
3600 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &comp);
3601 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
3602
3603 size = MAX_PATH;
3604 res = RegQueryValueExA(comp, "84A88FD7F6998CE40A22FB59F6B9C2BB",
3605 NULL, NULL, (LPBYTE)val, &size);
3606 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
3607
3608 lstrcpyA(program_files_maximus,PROG_FILES_DIR);
3609 lstrcatA(program_files_maximus,"\\msitest\\maximus");
3610
3611 ok(!lstrcmpiA(val, program_files_maximus),
3612 "Expected \"%s\", got \"%s\"\n", program_files_maximus, val);
3613
3614 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, compkey, 0, access, &hkey);
3615 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %ld\n", res);
3616
3617 RegDeleteValueA(comp, "84A88FD7F6998CE40A22FB59F6B9C2BB");
3618 delete_key(comp, "", access);
3619 RegCloseKey(comp);
3620
3621 sprintf(keypath, keyfmt, usersid, "241C3DA58FECD0945B9687D408766058");
3622 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &comp);
3623 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
3624
3625 size = MAX_PATH;
3626 res = RegQueryValueExA(comp, "84A88FD7F6998CE40A22FB59F6B9C2BB",
3627 NULL, NULL, (LPBYTE)val, &size);
3628 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
3629 ok(!lstrcmpA(val, "01\\msitest\\augustus"),
3630 "Expected \"01\\msitest\\augustus\", got \"%s\"\n", val);
3631
3632 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, compkey, 0, access, &hkey);
3633 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %ld\n", res);
3634
3635 RegDeleteValueA(comp, "84A88FD7F6998CE40A22FB59F6B9C2BB");
3636 delete_key(comp, "", access);
3637 RegCloseKey(comp);
3638
3639 /* ProcessComponents, machine */
3640 r = MsiInstallProductA(msifile, "PROCESS_COMPONENTS=1 ALLUSERS=1");
3641 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3642 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
3643 ok(delete_pf("msitest", FALSE), "Directory not created\n");
3644
3645 sprintf(keypath, keyfmt, "S-1-5-18", "CBABC2FDCCB35E749A8944D8C1C098B5");
3646 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &comp);
3647 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
3648
3649 size = MAX_PATH;
3650 res = RegQueryValueExA(comp, "84A88FD7F6998CE40A22FB59F6B9C2BB",
3651 NULL, NULL, (LPBYTE)val, &size);
3652 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
3653 ok(!lstrcmpiA(val, program_files_maximus),
3654 "Expected \"%s\", got \"%s\"\n", program_files_maximus, val);
3655
3656 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, compkey, 0, access, &hkey);
3657 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %ld\n", res);
3658
3659 RegDeleteValueA(comp, "84A88FD7F6998CE40A22FB59F6B9C2BB");
3660 delete_key(comp, "", access);
3661 RegCloseKey(comp);
3662
3663 sprintf(keypath, keyfmt, "S-1-5-18", "241C3DA58FECD0945B9687D408766058");
3664 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &comp);
3665 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
3666
3667 size = MAX_PATH;
3668 res = RegQueryValueExA(comp, "84A88FD7F6998CE40A22FB59F6B9C2BB",
3669 NULL, NULL, (LPBYTE)val, &size);
3670 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
3671 ok(!lstrcmpA(val, "01\\msitest\\augustus"),
3672 "Expected \"01\\msitest\\augustus\", got \"%s\"\n", val);
3673
3674 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, compkey, 0, access, &hkey);
3675 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %ld\n", res);
3676
3677 RegDeleteValueA(comp, "84A88FD7F6998CE40A22FB59F6B9C2BB");
3678 delete_key(comp, "", access);
3679 RegCloseKey(comp);
3680
3681error:
3683 DeleteFileA("msitest\\maximus");
3684 RemoveDirectoryA("msitest");
3685 LocalFree(usersid);
3686}
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1577
int WINAPI lstrcmpiA(LPCSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:42
int WINAPI lstrcmpA(LPCSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:18
static char * get_user_sid(void)
Definition: action.c:2405
static const msi_table ppc_tables[]
Definition: action.c:2014
#define delete_key(r, p, s)
Definition: reg_test.h:64

Referenced by START_TEST().

◆ test_publish()

static void test_publish ( void  )
static

Definition at line 3688 of file action.c.

3689{
3690 static const char subkey[] = "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall";
3691 static const char subkey_32node[] = "Software\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall";
3692 UINT r;
3693 LONG res;
3694 HKEY uninstall, prodkey, uninstall_32node = NULL;
3696 char date[MAX_PATH], temp[MAX_PATH], prodcode[] = "{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}";
3698 DWORD error;
3699
3700 if (!pMsiQueryFeatureStateExA)
3701 {
3702 win_skip("MsiQueryFeatureStateExA is not available\n");
3703 return;
3704 }
3705 if (is_process_limited())
3706 {
3707 skip("process is limited\n");
3708 return;
3709 }
3710
3713
3714 if (is_wow64)
3716
3717 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, subkey, 0, KEY_ALL_ACCESS, &uninstall);
3718 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
3719
3720 if (is_64bit)
3721 {
3722 res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, subkey_32node, 0, KEY_ALL_ACCESS, &uninstall_32node);
3723 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
3724 }
3725
3726 CreateDirectoryA("msitest", NULL);
3727 create_file("msitest\\maximus", 500);
3728
3730
3732
3733 state = MsiQueryProductStateA(prodcode);
3734 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3735
3736 state = MsiQueryFeatureStateA(prodcode, "feature");
3737 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3738
3739 state = 0xdead;
3740 SetLastError(0xdeadbeef);
3741 r = pMsiQueryFeatureStateExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, "feature", &state);
3742 error = GetLastError();
3743 ok(r == ERROR_UNKNOWN_PRODUCT, "got %u\n", r);
3744 ok(state == 0xdead, "got %d\n", state);
3745 ok(error == 0xdeadbeef, "got %lu\n", error);
3746
3747 state = 0xdead;
3748 SetLastError(0xdeadbeef);
3749 r = pMsiQueryFeatureStateExA(prodcode, NULL, MSIINSTALLCONTEXT_USERMANAGED, "feature", &state);
3750 error = GetLastError();
3751 ok(r == ERROR_UNKNOWN_PRODUCT, "got %u\n", r);
3752 ok(state == 0xdead, "got %d\n", state);
3753 ok(error == ERROR_SUCCESS, "got %lu\n", error);
3754
3755 state = 0xdead;
3756 SetLastError(0xdeadbeef);
3757 r = pMsiQueryFeatureStateExA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, "feature", &state);
3758 error = GetLastError();
3759 ok(r == ERROR_UNKNOWN_PRODUCT, "got %u\n", r);
3760 ok(state == 0xdead, "got %d\n", state);
3761 ok(error == ERROR_SUCCESS, "got %lu\n", error);
3762
3763 state = MsiQueryFeatureStateA(prodcode, "feature");
3764 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3765
3766 state = MsiQueryFeatureStateA(prodcode, "montecristo");
3767 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3768
3769 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
3770 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
3771 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
3772 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3773
3774 res = RegOpenKeyExA(uninstall, prodcode, 0, access, &prodkey);
3775 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %ld\n", res);
3776
3777 /* nothing published */
3780 {
3781 skip("Not enough rights to perform tests\n");
3782 goto error;
3783 }
3784 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3785 ok(pf_exists("msitest\\maximus"), "File not installed\n");
3786 ok(pf_exists("msitest"), "File not installed\n");
3787
3788 state = MsiQueryProductStateA(prodcode);
3789 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3790
3791 state = MsiQueryFeatureStateA(prodcode, "feature");
3792 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3793
3794 state = MsiQueryFeatureStateA(prodcode, "montecristo");
3795 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3796
3797 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
3798 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
3799 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
3800 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3801
3802 res = RegOpenKeyExA(uninstall, prodcode, 0, access, &prodkey);
3803 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %ld\n", res);
3804
3805 /* PublishProduct and RegisterProduct */
3806 r = MsiInstallProductA(msifile, "REGISTER_PRODUCT=1 PUBLISH_PRODUCT=1");
3807 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3808 ok(pf_exists("msitest\\maximus"), "File not installed\n");
3809 ok(pf_exists("msitest"), "File not installed\n");
3810
3811 state = MsiQueryProductStateA(prodcode);
3812 ok(state == INSTALLSTATE_DEFAULT, "Expected INSTALLSTATE_DEFAULT, got %d\n", state);
3813
3814 state = MsiQueryFeatureStateA(prodcode, "feature");
3815 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3816
3817 state = MsiQueryFeatureStateA(prodcode, "montecristo");
3818 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3819
3820 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
3821 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
3822 ok(r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r);
3823 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3824
3825 if (is_64bit)
3826 {
3827 res = RegOpenKeyExA(uninstall_32node, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
3828 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
3829 }
3830 else
3831 {
3832 res = RegOpenKeyExA(uninstall, prodcode, 0, access, &prodkey);
3833 if (is_wow64 && res == ERROR_FILE_NOT_FOUND) /* XP - Vista, Wow64 */
3834 res = RegOpenKeyExA(uninstall, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
3835 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
3836 }
3837
3838 CHECK_REG_STR(prodkey, "DisplayName", "MSITEST");
3839 CHECK_REG_STR(prodkey, "DisplayVersion", "1.1.1");
3840 CHECK_REG_STR(prodkey, "InstallDate", date);
3841 CHECK_REG_STR(prodkey, "InstallSource", temp);
3842 CHECK_REG_ISTR(prodkey, "ModifyPath", "MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3843 CHECK_REG_STR(prodkey, "Publisher", "Wine");
3844 CHECK_REG_STR(prodkey, "UninstallString", "MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3845 CHECK_REG_STR(prodkey, "AuthorizedCDFPrefix", "");
3846 CHECK_REG_STR(prodkey, "Comments", "");
3847 CHECK_REG_STR(prodkey, "Contact", "");
3848 CHECK_REG_STR(prodkey, "HelpLink", "");
3849 CHECK_REG_STR(prodkey, "HelpTelephone", "");
3850 CHECK_REG_STR(prodkey, "InstallLocation", "");
3851 CHECK_REG_DWORD(prodkey, "NoModify", 1);
3852 CHECK_REG_STR(prodkey, "Readme", "");
3853 CHECK_REG_STR(prodkey, "Size", "");
3854 CHECK_REG_STR(prodkey, "URLInfoAbout", "");
3855 CHECK_REG_STR(prodkey, "URLUpdateInfo", "");
3856 CHECK_REG_DWORD(prodkey, "Language", 1033);
3857 CHECK_REG_DWORD(prodkey, "Version", 0x1010001);
3858 CHECK_REG_DWORD(prodkey, "VersionMajor", 1);
3859 CHECK_REG_DWORD(prodkey, "VersionMinor", 1);
3860 CHECK_REG_DWORD(prodkey, "WindowsInstaller", 1);
3861 CHECK_REG_DWORD_TODO(prodkey, "EstimatedSize", get_estimated_size());
3862
3863 RegCloseKey(prodkey);
3864
3865 r = MsiInstallProductA(msifile, "FULL=1 REMOVE=ALL");
3866 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3867 ok(pf_exists("msitest\\maximus"), "File deleted\n");
3868 ok(pf_exists("msitest"), "File deleted\n");
3869
3870 state = MsiQueryProductStateA(prodcode);
3871 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3872
3873 state = MsiQueryFeatureStateA(prodcode, "feature");
3874 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3875
3876 state = MsiQueryFeatureStateA(prodcode, "montecristo");
3877 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3878
3879 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
3880 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
3881 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
3882 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3883
3884 res = RegOpenKeyExA(uninstall, prodcode, 0, access, &prodkey);
3885 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %ld\n", res);
3886
3887 /* complete install */
3888 r = MsiInstallProductA(msifile, "FULL=1");
3889 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3890 ok(pf_exists("msitest\\maximus"), "File not installed\n");
3891 ok(pf_exists("msitest"), "File not installed\n");
3892
3893 state = MsiQueryProductStateA(prodcode);
3894 ok(state == INSTALLSTATE_DEFAULT, "Expected INSTALLSTATE_DEFAULT, got %d\n", state);
3895
3896 state = MsiQueryFeatureStateA(prodcode, "feature");
3897 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3898
3899 state = 0xdead;
3900 SetLastError(0xdeadbeef);
3901 r = pMsiQueryFeatureStateExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, "feature", &state);
3902 error = GetLastError();
3903 ok(r == ERROR_UNKNOWN_PRODUCT, "got %u\n", r);
3904 ok(state == 0xdead, "got %d\n", state);
3905 ok(error == 0xdeadbeef, "got %lu\n", error);
3906
3907 state = 0xdead;
3908 SetLastError(0xdeadbeef);
3909 r = pMsiQueryFeatureStateExA(prodcode, NULL, MSIINSTALLCONTEXT_USERMANAGED, "feature", &state);
3910 error = GetLastError();
3911 ok(r == ERROR_UNKNOWN_PRODUCT, "got %u\n", r);
3912 ok(state == 0xdead, "got %d\n", state);
3913 ok(error == ERROR_SUCCESS, "got %lu\n", error);
3914
3915 state = 0xdead;
3916 SetLastError(0xdeadbeef);
3917 r = pMsiQueryFeatureStateExA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, "feature", &state);
3918 error = GetLastError();
3919 ok(r == ERROR_SUCCESS, "got %u\n", r);
3920 ok(state == INSTALLSTATE_LOCAL, "got %d\n", state);
3921 ok(error == ERROR_SUCCESS, "got %lu\n", error);
3922
3923 state = MsiQueryFeatureStateA(prodcode, "montecristo");
3924 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3925
3926 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
3927 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
3928 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3929 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
3930
3931 if (is_64bit)
3932 {
3933 res = RegOpenKeyExA(uninstall_32node, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
3934 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
3935 }
3936 else
3937 {
3938 res = RegOpenKeyExA(uninstall, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
3939 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
3940 }
3941
3942 CHECK_REG_STR(prodkey, "DisplayName", "MSITEST");
3943 CHECK_REG_STR(prodkey, "DisplayVersion", "1.1.1");
3944 CHECK_REG_STR(prodkey, "InstallDate", date);
3945 CHECK_REG_STR(prodkey, "InstallSource", temp);
3946 CHECK_REG_ISTR(prodkey, "ModifyPath", "MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3947 CHECK_REG_STR(prodkey, "Publisher", "Wine");
3948 CHECK_REG_STR(prodkey, "UninstallString", "MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3949 CHECK_REG_STR(prodkey, "AuthorizedCDFPrefix", "");
3950 CHECK_REG_STR(prodkey, "Comments", "");
3951 CHECK_REG_STR(prodkey, "Contact", "");
3952 CHECK_REG_STR(prodkey, "HelpLink", "");
3953 CHECK_REG_STR(prodkey, "HelpTelephone", "");
3954 CHECK_REG_STR(prodkey, "InstallLocation", "");
3955 CHECK_REG_DWORD(prodkey, "NoModify", 1);
3956 CHECK_REG_STR(prodkey, "Readme", "");
3957 CHECK_REG_STR(prodkey, "Size", "");
3958 CHECK_REG_STR(prodkey, "URLInfoAbout", "");
3959 CHECK_REG_STR(prodkey, "URLUpdateInfo", "");
3960 CHECK_REG_DWORD(prodkey, "Language", 1033);
3961 CHECK_REG_DWORD(prodkey, "Version", 0x1010001);
3962 CHECK_REG_DWORD(prodkey, "VersionMajor", 1);
3963 CHECK_REG_DWORD(prodkey, "VersionMinor", 1);
3964 CHECK_REG_DWORD(prodkey, "WindowsInstaller", 1);
3965 CHECK_REG_DWORD_TODO(prodkey, "EstimatedSize", get_estimated_size());
3966
3967 RegCloseKey(prodkey);
3968
3969 /* no UnpublishFeatures */
3970 r = MsiInstallProductA(msifile, "REMOVE=ALL");
3971 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3972 ok(!pf_exists("msitest\\maximus"), "File not deleted\n");
3973 ok(!pf_exists("msitest"), "Directory not deleted\n");
3974
3975 state = MsiQueryProductStateA(prodcode);
3976 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3977
3978 state = MsiQueryFeatureStateA(prodcode, "feature");
3979 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3980
3981 state = MsiQueryFeatureStateA(prodcode, "montecristo");
3982 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3983
3984 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
3985 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
3986 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
3987 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
3988
3989 res = RegOpenKeyExA(uninstall, prodcode, 0, access, &prodkey);
3990 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %ld\n", res);
3991
3992 /* complete install */
3993 r = MsiInstallProductA(msifile, "FULL=1");
3994 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3995 ok(pf_exists("msitest\\maximus"), "File not installed\n");
3996 ok(pf_exists("msitest"), "File not installed\n");
3997
3998 state = MsiQueryProductStateA(prodcode);
3999 ok(state == INSTALLSTATE_DEFAULT, "Expected INSTALLSTATE_DEFAULT, got %d\n", state);
4000
4001 state = MsiQueryFeatureStateA(prodcode, "feature");
4002 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4003
4004 state = MsiQueryFeatureStateA(prodcode, "montecristo");
4005 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4006
4007 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4008 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
4009 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4010 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4011
4012 if (is_64bit)
4013 {
4014 res = RegOpenKeyExA(uninstall_32node, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
4015 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
4016 }
4017 else
4018 {
4019 res = RegOpenKeyExA(uninstall, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
4020 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
4021 }
4022
4023 CHECK_REG_STR(prodkey, "DisplayName", "MSITEST");
4024 CHECK_REG_STR(prodkey, "DisplayVersion", "1.1.1");
4025 CHECK_REG_STR(prodkey, "InstallDate", date);
4026 CHECK_REG_STR(prodkey, "InstallSource", temp);
4027 CHECK_REG_ISTR(prodkey, "ModifyPath", "MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4028 CHECK_REG_STR(prodkey, "Publisher", "Wine");
4029 CHECK_REG_STR(prodkey, "UninstallString", "MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4030 CHECK_REG_STR(prodkey, "AuthorizedCDFPrefix", "");
4031 CHECK_REG_STR(prodkey, "Comments", "");
4032 CHECK_REG_STR(prodkey, "Contact", "");
4033 CHECK_REG_STR(prodkey, "HelpLink", "");
4034 CHECK_REG_STR(prodkey, "HelpTelephone", "");
4035 CHECK_REG_STR(prodkey, "InstallLocation", "");
4036 CHECK_REG_DWORD(prodkey, "NoModify", 1);
4037 CHECK_REG_STR(prodkey, "Readme", "");
4038 CHECK_REG_STR(prodkey, "Size", "");
4039 CHECK_REG_STR(prodkey, "URLInfoAbout", "");
4040 CHECK_REG_STR(prodkey, "URLUpdateInfo", "");
4041 CHECK_REG_DWORD(prodkey, "Language", 1033);
4042 CHECK_REG_DWORD(prodkey, "Version", 0x1010001);
4043 CHECK_REG_DWORD(prodkey, "VersionMajor", 1);
4044 CHECK_REG_DWORD(prodkey, "VersionMinor", 1);
4045 CHECK_REG_DWORD(prodkey, "WindowsInstaller", 1);
4046 CHECK_REG_DWORD_TODO(prodkey, "EstimatedSize", get_estimated_size());
4047
4048 RegCloseKey(prodkey);
4049
4050 /* UnpublishFeatures, only feature removed. Only works when entire product is removed */
4051 r = MsiInstallProductA(msifile, "UNPUBLISH_FEATURES=1 REMOVE=feature");
4052 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4053 ok(pf_exists("msitest\\maximus"), "File deleted\n");
4054 ok(pf_exists("msitest"), "Directory deleted\n");
4055
4056 state = MsiQueryProductStateA(prodcode);
4057 ok(state == INSTALLSTATE_DEFAULT, "Expected INSTALLSTATE_DEFAULT, got %d\n", state);
4058
4059 state = MsiQueryFeatureStateA(prodcode, "feature");
4060 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4061
4062 state = MsiQueryFeatureStateA(prodcode, "montecristo");
4063 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4064
4065 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4066 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
4067 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4068 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4069
4070 if (is_64bit)
4071 {
4072 res = RegOpenKeyExA(uninstall_32node, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
4073 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
4074 }
4075 else
4076 {
4077 res = RegOpenKeyExA(uninstall, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
4078 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
4079 }
4080
4081 CHECK_REG_STR(prodkey, "DisplayName", "MSITEST");
4082 CHECK_REG_STR(prodkey, "DisplayVersion", "1.1.1");
4083 CHECK_REG_STR(prodkey, "InstallDate", date);
4084 CHECK_REG_STR(prodkey, "InstallSource", temp);
4085 CHECK_REG_ISTR(prodkey, "ModifyPath", "MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4086 CHECK_REG_STR(prodkey, "Publisher", "Wine");
4087 CHECK_REG_STR(prodkey, "UninstallString", "MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4088 CHECK_REG_STR(prodkey, "AuthorizedCDFPrefix", "");
4089 CHECK_REG_STR(prodkey, "Comments", "");
4090 CHECK_REG_STR(prodkey, "Contact", "");
4091 CHECK_REG_STR(prodkey, "HelpLink", "");
4092 CHECK_REG_STR(prodkey, "HelpTelephone", "");
4093 CHECK_REG_STR(prodkey, "InstallLocation", "");
4094 CHECK_REG_DWORD(prodkey, "NoModify", 1);
4095 CHECK_REG_STR(prodkey, "Readme", "");
4096 CHECK_REG_STR(prodkey, "Size", "");
4097 CHECK_REG_STR(prodkey, "URLInfoAbout", "");
4098 CHECK_REG_STR(prodkey, "URLUpdateInfo", "");
4099 CHECK_REG_DWORD(prodkey, "Language", 1033);
4100 CHECK_REG_DWORD(prodkey, "Version", 0x1010001);
4101 CHECK_REG_DWORD(prodkey, "VersionMajor", 1);
4102 CHECK_REG_DWORD(prodkey, "VersionMinor", 1);
4103 CHECK_REG_DWORD(prodkey, "WindowsInstaller", 1);
4104 CHECK_REG_DWORD_TODO(prodkey, "EstimatedSize", get_estimated_size());
4105
4106 RegCloseKey(prodkey);
4107
4108 /* complete install */
4109 r = MsiInstallProductA(msifile, "FULL=1");
4110 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4111 ok(pf_exists("msitest\\maximus"), "File not installed\n");
4112 ok(pf_exists("msitest"), "File not installed\n");
4113
4114 state = MsiQueryProductStateA(prodcode);
4115 ok(state == INSTALLSTATE_DEFAULT, "Expected INSTALLSTATE_DEFAULT, got %d\n", state);
4116
4117 state = MsiQueryFeatureStateA(prodcode, "feature");
4118 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4119
4120 state = MsiQueryFeatureStateA(prodcode, "montecristo");
4121 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4122
4123 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4124 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
4125 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4126 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4127
4128 if (is_64bit)
4129 {
4130 res = RegOpenKeyExA(uninstall_32node, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
4131 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
4132 }
4133 else
4134 {
4135 res = RegOpenKeyExA(uninstall, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
4136 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
4137 }
4138
4139 CHECK_REG_STR(prodkey, "DisplayName", "MSITEST");
4140 CHECK_REG_STR(prodkey, "DisplayVersion", "1.1.1");
4141 CHECK_REG_STR(prodkey, "InstallDate", date);
4142 CHECK_REG_STR(prodkey, "InstallSource", temp);
4143 CHECK_REG_ISTR(prodkey, "ModifyPath", "MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4144 CHECK_REG_STR(prodkey, "Publisher", "Wine");
4145 CHECK_REG_STR(prodkey, "UninstallString", "MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4146 CHECK_REG_STR(prodkey, "AuthorizedCDFPrefix", "");
4147 CHECK_REG_STR(prodkey, "Comments", "");
4148 CHECK_REG_STR(prodkey, "Contact", "");
4149 CHECK_REG_STR(prodkey, "HelpLink", "");
4150 CHECK_REG_STR(prodkey, "HelpTelephone", "");
4151 CHECK_REG_STR(prodkey, "InstallLocation", "");
4152 CHECK_REG_DWORD(prodkey, "NoModify", 1);
4153 CHECK_REG_STR(prodkey, "Readme", "");
4154 CHECK_REG_STR(prodkey, "Size", "");
4155 CHECK_REG_STR(prodkey, "URLInfoAbout", "");
4156 CHECK_REG_STR(prodkey, "URLUpdateInfo", "");
4157 CHECK_REG_DWORD(prodkey, "Language", 1033);
4158 CHECK_REG_DWORD(prodkey, "Version", 0x1010001);
4159 CHECK_REG_DWORD(prodkey, "VersionMajor", 1);
4160 CHECK_REG_DWORD(prodkey, "VersionMinor", 1);
4161 CHECK_REG_DWORD(prodkey, "WindowsInstaller", 1);
4162 CHECK_REG_DWORD_TODO(prodkey, "EstimatedSize", get_estimated_size());
4163
4164 RegCloseKey(prodkey);
4165
4166 /* UnpublishFeatures, both features removed */
4167 r = MsiInstallProductA(msifile, "UNPUBLISH_FEATURES=1 REMOVE=feature,montecristo");
4168 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4169 ok(!pf_exists("msitest\\maximus"), "File not deleted\n");
4170 ok(!pf_exists("msitest"), "Directory not deleted\n");
4171
4172 state = MsiQueryProductStateA(prodcode);
4173 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4174
4175 state = MsiQueryFeatureStateA(prodcode, "feature");
4176 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4177
4178 state = MsiQueryFeatureStateA(prodcode, "montecristo");
4179 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4180
4181 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4182 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
4183 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
4184 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4185
4186 res = RegOpenKeyExA(uninstall, prodcode, 0, access, &prodkey);
4187 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %ld\n", res);
4188
4189 /* complete install */
4190 r = MsiInstallProductA(msifile, "FULL=1");
4191 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4192 ok(pf_exists("msitest\\maximus"), "File not installed\n");
4193 ok(pf_exists("msitest"), "File not installed\n");
4194
4195 state = MsiQueryProductStateA(prodcode);
4196 ok(state == INSTALLSTATE_DEFAULT, "Expected INSTALLSTATE_DEFAULT, got %d\n", state);
4197
4198 state = MsiQueryFeatureStateA(prodcode, "feature");
4199 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4200
4201 state = MsiQueryFeatureStateA(prodcode, "montecristo");
4202 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4203
4204 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4205 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
4206 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4207 ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
4208
4209 if (is_64bit)
4210 {
4211 res = RegOpenKeyExA(uninstall_32node, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
4212 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
4213 }
4214 else
4215 {
4216 res = RegOpenKeyExA(uninstall, prodcode, 0, KEY_ALL_ACCESS, &prodkey);
4217 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
4218 }
4219
4220 CHECK_REG_STR(prodkey, "DisplayName", "MSITEST");
4221 CHECK_REG_STR(prodkey, "DisplayVersion", "1.1.1");
4222 CHECK_REG_STR(prodkey, "InstallDate", date);
4223 CHECK_REG_STR(prodkey, "InstallSource", temp);
4224 CHECK_REG_ISTR(prodkey, "ModifyPath", "MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4225 CHECK_REG_STR(prodkey, "Publisher", "Wine");
4226 CHECK_REG_STR(prodkey, "UninstallString", "MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4227 CHECK_REG_STR(prodkey, "AuthorizedCDFPrefix", "");
4228 CHECK_REG_STR(prodkey, "Comments", "");
4229 CHECK_REG_STR(prodkey, "Contact", "");
4230 CHECK_REG_STR(prodkey, "HelpLink", "");
4231 CHECK_REG_STR(prodkey, "HelpTelephone", "");
4232 CHECK_REG_STR(prodkey, "InstallLocation", "");
4233 CHECK_REG_DWORD(prodkey, "NoModify", 1);
4234 CHECK_REG_STR(prodkey, "Readme", "");
4235 CHECK_REG_STR(prodkey, "Size", "");
4236 CHECK_REG_STR(prodkey, "URLInfoAbout", "");
4237 CHECK_REG_STR(prodkey, "URLUpdateInfo", "");
4238 CHECK_REG_DWORD(prodkey, "Language", 1033);
4239 CHECK_REG_DWORD(prodkey, "Version", 0x1010001);
4240 CHECK_REG_DWORD(prodkey, "VersionMajor", 1);
4241 CHECK_REG_DWORD(prodkey, "VersionMinor", 1);
4242 CHECK_REG_DWORD(prodkey, "WindowsInstaller", 1);
4243 CHECK_REG_DWORD_TODO(prodkey, "EstimatedSize", get_estimated_size());
4244
4245 RegCloseKey(prodkey);
4246
4247 /* complete uninstall */
4248 r = MsiInstallProductA(msifile, "FULL=1 REMOVE=ALL");
4249 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
4250 ok(!pf_exists("msitest\\maximus"), "File not deleted\n");
4251 ok(!pf_exists("msitest"), "Directory not deleted\n");
4252
4253 state = MsiQueryProductStateA(prodcode);
4254 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4255
4256 state = MsiQueryFeatureStateA(prodcode, "feature");
4257 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4258
4259 state = MsiQueryFeatureStateA(prodcode, "montecristo");
4260 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4261
4262 r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
4263 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
4264 ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
4265 ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
4266
4267 res = RegOpenKeyExA(uninstall, prodcode, 0, access, &prodkey);
4268 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %ld\n", res);
4269
4270 /* make sure 'Program Files\msitest' is removed */
4272
4273error:
4274 RegCloseKey(uninstall);
4275 RegCloseKey(uninstall_32node);
4277 DeleteFileA("msitest\\maximus");
4278 RemoveDirectoryA("msitest");
4279}
static int state
Definition: maze.c:121
#define SetLastError(x)
Definition: compat.h:752
INSTALLSTATE WINAPI MsiQueryProductStateA(LPCSTR szProduct)
Definition: msi.c:2210
INSTALLSTATE WINAPI MsiQueryFeatureStateA(LPCSTR szProduct, LPCSTR szFeature)
Definition: msi.c:3029
#define CHECK_REG_DWORD_TODO(prodkey, name, expected)
Definition: action.c:2599
#define CHECK_REG_ISTR(prodkey, name, expected)
Definition: action.c:2578
#define CHECK_REG_DWORD(prodkey, name, expected)
Definition: action.c:2596
static const msi_table pp_tables[]
Definition: action.c:2001
static DWORD get_estimated_size(void)
Definition: action.c:2624
static void delete_pfmsitest_files(void)
Definition: action.c:2488
static void get_date_str(LPSTR date)
Definition: action.c:2614
@ INSTALLSTATE_UNKNOWN
Definition: msi.h:42
@ INSTALLSTATE_LOCAL
Definition: msi.h:46
@ INSTALLSTATE_DEFAULT
Definition: msi.h:48
@ MSIINSTALLCONTEXT_MACHINE
Definition: msi.h:200
@ MSIINSTALLCONTEXT_USERUNMANAGED
Definition: msi.h:199
@ MSIINSTALLCONTEXT_USERMANAGED
Definition: msi.h:198
static const BOOL is_64bit
Definition: msipriv.h:44
static calc_node_t temp
Definition: rpn_ieee.c:38
#define win_skip
Definition: test.h:160
int INSTALLSTATE
Definition: winemsi.idl:31
#define ERROR_UNKNOWN_PRODUCT
Definition: winerror.h:963
#define ERROR_UNKNOWN_COMPONENT
Definition: winerror.h:965

Referenced by START_TEST().

◆ test_publish_assemblies()

static void test_publish_assemblies ( void  )
static

Definition at line 6277 of file action.c.

6278{
6279 static const char manifest[] =
6280 "<assemblyIdentity type=\"win32\" name=\"Wine.Win32.Assembly\" "
6281 "version=\"1.0.0.0\" publicKeyToken=\"abcdef0123456789\" "
6282 "processorArchitecture=\"x86\"/>";
6283 static const char manifest_local[] =
6284 "<assemblyIdentity type=\"win32\" name=\"Wine.Win32.Local.Assembly\" "
6285 "version=\"1.0.0.0\" publicKeyToken=\"abcdef0123456789\" "
6286 "processorArchitecture=\"x86\"/>";
6287 static const char classes_path_dotnet[] =
6288 "Installer\\Assemblies\\Global";
6289 static const char classes_path_dotnet_local[] =
6290 "Installer\\Assemblies\\C:|Program Files|msitest|application_dotnet.txt";
6291 static const char classes_path_dotnet_local_wow64[] =
6292 "Installer\\Assemblies\\C:|Program Files (x86)|msitest|application_dotnet.txt";
6293 static const char classes_path_fake_local[] =
6294 "Installer\\Assemblies\\C:|Program Files|msitest|nonexistent.txt";
6295 static const char classes_path_fake_local_wow64[] =
6296 "Installer\\Assemblies\\C:|Program Files (x86)|msitest|nonexistent.txt";
6297 static const char classes_path_win32[] =
6298 "Installer\\Win32Assemblies\\Global";
6299 static const char classes_path_win32_local[] =
6300 "Installer\\Win32Assemblies\\C:|Program Files|msitest|application_win32.txt";
6301 static const char classes_path_win32_local_wow64[] =
6302 "Installer\\Win32Assemblies\\C:|Program Files (x86)|msitest|application_win32.txt";
6303 static const char path_dotnet[] =
6304 "Software\\Microsoft\\Installer\\Assemblies\\Global";
6305 static const char path_dotnet_local[] =
6306 "Software\\Microsoft\\Installer\\Assemblies\\C:|Program Files|msitest|application_dotnet.txt";
6307 static const char path_dotnet_local_wow64[] =
6308 "Software\\Microsoft\\Installer\\Assemblies\\C:|Program Files (x86)|msitest|application_dotnet.txt";
6309 static const char path_fake_local[] =
6310 "Software\\Microsoft\\Installer\\Assemblies\\C:|Program Files|msitest|nonexistent.txt";
6311 static const char path_fake_local_wow64[] =
6312 "Software\\Microsoft\\Installer\\Assemblies\\C:|Program Files (x86)|msitest|nonexistent.txt";
6313 static const char path_win32[] =
6314 "Software\\Microsoft\\Installer\\Win32Assemblies\\Global";
6315 static const char path_win32_local[] =
6316 "Software\\Microsoft\\Installer\\Win32Assemblies\\C:|Program Files|msitest|application_win32.txt";
6317 static const char path_win32_local_wow64[] =
6318 "Software\\Microsoft\\Installer\\Win32Assemblies\\C:|Program Files (x86)|msitest|application_win32.txt";
6319 static const char name_dotnet[] =
6320 "Wine.Dotnet.Assembly,processorArchitecture=\"MSIL\",publicKeyToken=\"abcdef0123456789\","
6321 "version=\"1.0.0.0\",culture=\"neutral\"";
6322 static const char name_dotnet_local[] =
6323 "Wine.Dotnet.Local.Assembly,processorArchitecture=\"MSIL\",publicKeyToken=\"abcdef0123456789\","
6324 "version=\"1.0.0.0\",culture=\"neutral\"";
6325 static const char name_win32[] =
6326 "Wine.Win32.Assembly,processorArchitecture=\"x86\",publicKeyToken=\"abcdef0123456789\","
6327 "type=\"win32\",version=\"1.0.0.0\"";
6328 static const char name_win32_local[] =
6329 "Wine.Win32.Local.Assembly,processorArchitecture=\"x86\",publicKeyToken=\"abcdef0123456789\","
6330 "type=\"win32\",version=\"1.0.0.0\"";
6331 UINT r;
6332 LONG res;
6333 HKEY hkey;
6334 const char *path;
6335 int access;
6336
6337 if (is_process_limited())
6338 {
6339 skip("process is limited\n");
6340 return;
6341 }
6342
6344 create_file("msitest\\win32.txt", 1000);
6345 create_file("msitest\\win32_local.txt", 1000);
6346 create_file("msitest\\dotnet.txt", 1000);
6347 create_file("msitest\\dotnet_local.txt", 1000);
6348 create_file_data("msitest\\manifest.txt", manifest, 0);
6349 create_file_data("msitest\\manifest_local.txt", manifest_local, 0);
6350 create_file("msitest\\application_win32.txt", 1000);
6351 create_file("msitest\\application_dotnet.txt", 1000);
6352 create_file("msitest\\fake_local.txt", 1000);
6354
6356
6359 {
6360 skip("Not enough rights to perform tests\n");
6361 goto done;
6362 }
6363 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6364
6366 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
6367 CHECK_REG_MULTI(hkey, name_dotnet, "rcHQPHq?CA@Uv-XqMI1e>Z'q,T*76M@=YEg6My?~]\0");
6368 RegCloseKey(hkey);
6369
6370 path = (is_wow64 || is_64bit) ? path_dotnet_local_wow64 : path_dotnet_local;
6372 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
6373 CHECK_REG_MULTI(hkey, name_dotnet_local, "rcHQPHq?CA@Uv-XqMI1e>LF,8A?0d.AW@vcZ$Cgox\0");
6374 RegCloseKey(hkey);
6375
6376 res = RegOpenKeyA(HKEY_CURRENT_USER, path_win32, &hkey);
6377 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
6378 CHECK_REG_MULTI(hkey, name_win32, "rcHQPHq?CA@Uv-XqMI1e>}NJjwR'%D9v1p!v{WV(%\0");
6379 RegCloseKey(hkey);
6380
6381 path = (is_wow64 || is_64bit) ? path_win32_local_wow64 : path_win32_local;
6383 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
6384 CHECK_REG_MULTI(hkey, name_win32_local, "rcHQPHq?CA@Uv-XqMI1e>C)Uvlj*53A)u(QQ9=)X!\0");
6385 RegCloseKey(hkey);
6386
6387 /* No registration is done for a local assembly with no matching file */
6388 path = (is_wow64 || is_64bit) ? path_fake_local_wow64 : path_fake_local;
6390 ok(res == ERROR_FILE_NOT_FOUND, "got %ld\n", res);
6391
6392 r = MsiInstallProductA(msifile, "REMOVE=ALL");
6393 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6394
6396 if (res == ERROR_SUCCESS)
6397 {
6399 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %ld\n", res);
6400 RegCloseKey(hkey);
6401 }
6402
6403 path = (is_wow64 || is_64bit) ? path_dotnet_local_wow64 : path_dotnet_local;
6405 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %ld\n", res);
6406
6407 res = RegOpenKeyA(HKEY_CURRENT_USER, path_win32, &hkey);
6408 if (res == ERROR_SUCCESS)
6409 {
6410 res = RegDeleteValueA(hkey, name_win32);
6411 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %ld\n", res);
6412 RegCloseKey(hkey);
6413 }
6414
6415 path = (is_wow64 || is_64bit) ? path_win32_local_wow64 : path_win32_local;
6417 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %ld\n", res);
6418
6419 r = MsiInstallProductA(msifile, "ALLUSERS=1");
6420 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6421
6423 res = RegOpenKeyExA(HKEY_CLASSES_ROOT, classes_path_dotnet, 0, access, &hkey);
6424 if (res == ERROR_FILE_NOT_FOUND && is_wow64) /* Vista WOW64 */
6425 {
6426 trace("Using 64-bit registry view for HKCR\\Installer\n");
6428 res = RegOpenKeyExA(HKEY_CLASSES_ROOT, classes_path_dotnet, 0, access, &hkey);
6429 }
6430 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
6431 CHECK_REG_MULTI(hkey, name_dotnet, "rcHQPHq?CA@Uv-XqMI1e>Z'q,T*76M@=YEg6My?~]\0");
6432 RegCloseKey(hkey);
6433
6434 path = (is_wow64 || is_64bit) ? classes_path_dotnet_local_wow64 : classes_path_dotnet_local;
6436 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
6437 CHECK_REG_MULTI(hkey, name_dotnet_local, "rcHQPHq?CA@Uv-XqMI1e>LF,8A?0d.AW@vcZ$Cgox\0");
6438 RegCloseKey(hkey);
6439
6440 res = RegOpenKeyExA(HKEY_CLASSES_ROOT, classes_path_win32, 0, access, &hkey);
6441 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
6442 CHECK_REG_MULTI(hkey, name_win32, "rcHQPHq?CA@Uv-XqMI1e>}NJjwR'%D9v1p!v{WV(%\0");
6443 RegCloseKey(hkey);
6444
6445 path = (is_wow64 || is_64bit) ? classes_path_win32_local_wow64 : classes_path_win32_local;
6447 ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
6448 CHECK_REG_MULTI(hkey, name_win32_local, "rcHQPHq?CA@Uv-XqMI1e>C)Uvlj*53A)u(QQ9=)X!\0");
6449 RegCloseKey(hkey);
6450
6451 /* No registration is done for a local assembly with no matching file */
6452 path = (is_wow64 || is_64bit) ? classes_path_fake_local_wow64 : classes_path_fake_local;
6454 ok(res == ERROR_FILE_NOT_FOUND, "got %ld\n", res);
6455
6456 r = MsiInstallProductA(msifile, "REMOVE=ALL ALLUSERS=1");
6457 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6458
6459 res = RegOpenKeyA(HKEY_CLASSES_ROOT, classes_path_dotnet, &hkey);
6460 if (res == ERROR_SUCCESS)
6461 {
6463 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %ld\n", res);
6464 RegCloseKey(hkey);
6465 }
6466
6467 path = (is_wow64 || is_64bit) ? classes_path_dotnet_local_wow64 : classes_path_dotnet_local;
6469 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %ld\n", res);
6470
6471 res = RegOpenKeyA(HKEY_CLASSES_ROOT, classes_path_win32, &hkey);
6472 if (res == ERROR_SUCCESS)
6473 {
6474 res = RegDeleteValueA(hkey, name_win32);
6475 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %ld\n", res);
6476 RegCloseKey(hkey);
6477 }
6478
6479 path = (is_wow64 || is_64bit) ? classes_path_win32_local_wow64 : classes_path_win32_local;
6481 ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %ld\n", res);
6482
6483done:
6484 DeleteFileA("msitest\\win32.txt");
6485 DeleteFileA("msitest\\win32_local.txt");
6486 DeleteFileA("msitest\\dotnet.txt");
6487 DeleteFileA("msitest\\dotnet_local.txt");
6488 DeleteFileA("msitest\\manifest.txt");
6489 DeleteFileA("msitest\\manifest_local.txt");
6490 DeleteFileA("msitest\\application_win32.txt");
6491 DeleteFileA("msitest\\application_dotnet.txt");
6492 DeleteFileA("msitest\\fake_local.txt");
6495}
static void create_file_data(LPCSTR name, LPCSTR data, DWORD size)
Definition: asmcache.c:795
#define CHECK_REG_MULTI(key, name, expect)
Definition: action.c:2587
static const msi_table pa_tables[]
Definition: action.c:2345
static const char name_dotnet[]
Definition: custom.c:1635
static const char path_dotnet[]
Definition: custom.c:1634
#define KEY_QUERY_VALUE
Definition: nt_native.h:1016
static const CHAR manifest[]
Definition: v6util.h:39
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10

Referenced by START_TEST().

◆ test_publish_components()

static void test_publish_components ( void  )
static

Definition at line 5743 of file action.c.

5744{
5745 static const char keypath[] =
5746 "Software\\Microsoft\\Installer\\Components\\0CBCFA296AC907244845745CEEB2F8AA";
5747 static const char keypath2[] =
5748 "Software\\Classes\\Installer\\Components\\0CBCFA296AC907244845745CEEB2F8AA";
5749
5750 UINT r;
5751 LONG res;
5752 HKEY key;
5753 BYTE *data;
5754 DWORD size;
5755
5756 if (is_process_limited())
5757 {
5758 skip("process is limited\n");
5759 return;
5760 }
5761
5763 create_file("msitest\\english.txt", 1000);
5765
5767
5770 {
5771 skip("Not enough rights to perform tests\n");
5772 goto error;
5773 }
5774 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5775
5776 size = 0;
5777 r = MsiProvideQualifiedComponentA("{92AFCBC0-9CA6-4270-8454-47C5EE2B8FAA}",
5778 "english.txt", INSTALLMODE_DEFAULT, NULL, &size);
5779 ok(r == ERROR_SUCCESS, "MsiProvideQualifiedComponent returned %d\n", r);
5780
5781 res = RegOpenKeyA(HKEY_CURRENT_USER, keypath, &key);
5782 ok(res == ERROR_SUCCESS, "components key not created %ld\n", res);
5783
5784 res = RegQueryValueExA(key, "english.txt", NULL, NULL, NULL, &size);
5785 ok(res == ERROR_SUCCESS, "value not found %ld\n", res);
5786
5787 data = malloc(size);
5788 res = RegQueryValueExA(key, "english.txt", NULL, NULL, data, &size);
5789 ok(res == ERROR_SUCCESS, "value not found %ld\n", res);
5791
5793 ok(res == ERROR_SUCCESS, "RegDeleteKey failed %ld\n", res);
5794
5795