ReactOS 0.4.16-dev-240-gdb5fa3b
install.c File Reference
#include <stdio.h>
#include <windows.h>
#include <msiquery.h>
#include <msidefs.h>
#include <msi.h>
#include <fci.h>
#include <objidl.h>
#include <shlobj.h>
#include <winsvc.h>
#include <shellapi.h>
#include "wine/test.h"
#include "utils.h"
Include dependency graph for install.c:

Go to the source code of this file.

Classes

struct  sourcepathmap
 

Macros

#define _WIN32_MSI   300
 
#define COBJMACROS
 
#define MEDIA_SIZE   0x7FFFFFFF
 
#define FOLDER_THRESHOLD   900000
 
#define create_pf(file, is_file)   create_pf_data(file, file, is_file)
 

Functions

static void *CDECL mem_alloc (ULONG cb)
 
static void CDECL mem_free (void *memory)
 
static BOOL CDECL get_next_cabinet (PCCAB pccab, ULONG cbPrevCab, void *pv)
 
static LONG CDECL progress (UINT typeStatus, ULONG cb1, ULONG cb2, void *pv)
 
static int CDECL file_placed (PCCAB pccab, char *pszFile, LONG cbFile, BOOL fContinuation, void *pv)
 
static INT_PTR CDECL fci_open (char *pszFile, int oflag, int pmode, int *err, void *pv)
 
static UINT CDECL fci_read (INT_PTR hf, void *memory, UINT cb, int *err, void *pv)
 
static UINT CDECL fci_write (INT_PTR hf, void *memory, UINT cb, int *err, void *pv)
 
static int CDECL fci_close (INT_PTR hf, int *err, void *pv)
 
static LONG CDECL fci_seek (INT_PTR hf, LONG dist, int seektype, int *err, void *pv)
 
static int CDECL fci_delete (char *pszFile, int *err, void *pv)
 
BOOL is_process_elevated (void)
 
static BOOL check_record (MSIHANDLE rec, UINT field, LPCSTR val)
 
static BOOL CDECL get_temp_file (char *pszTempName, int cbTempName, void *pv)
 
static INT_PTR CDECL get_open_info (char *pszName, USHORT *pdate, USHORT *ptime, USHORT *pattribs, int *err, void *pv)
 
static BOOL add_file (HFCI hfci, const char *file, TCOMP compress)
 
static void set_cab_parameters (PCCAB pCabParams, const CHAR *name, DWORD max_size)
 
void create_cab_file (const CHAR *name, DWORD max_size, const CHAR *files)
 
BOOL get_user_dirs (void)
 
BOOL get_system_dirs (void)
 
void create_file_data (LPCSTR name, LPCSTR data, DWORD size)
 
static void create_test_files (void)
 
BOOL delete_pf (const CHAR *rel_path, BOOL is_file)
 
static BOOL delete_pf_native (const CHAR *rel_path, BOOL is_file)
 
static BOOL delete_cf (const CHAR *rel_path, BOOL is_file)
 
static BOOL compare_pf_data (const char *filename, const char *data, DWORD size)
 
static void delete_test_files (void)
 
static void delete_pf_files (void)
 
static void write_file (const CHAR *filename, const char *data, int data_size)
 
static void write_msi_summary_info (MSIHANDLE db, INT version, INT wordcount, const char *template, const char *packagecode)
 
static charload_resource (const char *name)
 
static INT CALLBACK ok_callback (void *context, UINT message_type, MSIHANDLE record)
 
static void add_custom_dll (MSIHANDLE hdb)
 
void create_database_wordcount (const CHAR *name, const msi_table *tables, int num_tables, INT version, INT wordcount, const char *template, const char *packagecode)
 
static void test_MsiInstallProduct (void)
 
static void test_MsiSetComponentState (void)
 
static void test_packagecoltypes (void)
 
static void create_cc_test_files (void)
 
void delete_cab_files (void)
 
static void test_continuouscabs (void)
 
static void test_caborder (void)
 
static void test_mixedmedia (void)
 
static void test_samesequence (void)
 
static void test_uiLevelFlags (void)
 
static BOOL file_matches (LPSTR path)
 
static void test_readonlyfile (void)
 
static void test_readonlyfile_cab (void)
 
static void test_setdirproperty (void)
 
static void test_cabisextracted (void)
 
BOOL file_exists (const char *file)
 
BOOL pf_exists (const char *file)
 
static void delete_pfmsitest_files (void)
 
UINT run_query (MSIHANDLE hdb, MSIHANDLE hrec, const char *query)
 
static void set_transform_summary_info (void)
 
static void generate_transform (void)
 
static void generate_transform_manual (void)
 
static void test_transformprop (void)
 
static void test_currentworkingdir (void)
 
static void set_admin_summary_info (const WCHAR *name)
 
static void test_admin (void)
 
static void set_admin_property_stream (LPCSTR file)
 
static void test_adminprops (void)
 
void create_pf_data (LPCSTR file, LPCSTR data, BOOL is_file)
 
static void test_missingcab (void)
 
static void test_sourcefolder (void)
 
static void test_customaction1 (void)
 
static void test_customaction51 (void)
 
static void test_installstate (void)
 
static DWORD get_pf_file_size (LPCSTR file)
 
static void test_sourcepath (void)
 
static void test_missingcomponent (void)
 
static void test_sourcedirprop (void)
 
static void test_adminimage (void)
 
static void test_propcase (void)
 
static void test_int_widths (void)
 
static void test_shortcut (void)
 
static void test_preselected (void)
 
static void test_installed_prop (void)
 
static void test_allusers_prop (void)
 
static void process_pending_renames (HKEY hkey)
 
static BOOL file_matches_data (LPCSTR file, LPCSTR data)
 
static void test_file_in_use (void)
 
static void test_file_in_use_cab (void)
 
static void test_feature_override (void)
 
static void test_icon_table (void)
 
static void test_package_validation (void)
 
static void test_upgrade_code (void)
 
static void test_mixed_package (void)
 
static void test_volume_props (void)
 
static void test_shared_component (void)
 
static void test_remove_upgrade_code (void)
 
static void test_feature_tree (void)
 
static void check_file_matches (const char *filename, const char *text)
 
static void test_deferred_action (void)
 
static void test_wow64 (void)
 
static void test_source_resolution (void)
 
 START_TEST (install)
 

Variables

static BOOL is_wow64
 
static const BOOL is_64bit = sizeof(void *) > sizeof(int)
 
static const charmsifile = "msitest.msi"
 
static const charmsifile2 = "winetest2.msi"
 
static const charmstfile = "winetest.mst"
 
static const WCHAR msifileW [] = L"msitest.msi"
 
static const WCHAR msifile2W [] = L"msitest2.msi"
 
char CURR_DIR [MAX_PATH]
 
char PROG_FILES_DIR [MAX_PATH]
 
char PROG_FILES_DIR_NATIVE [MAX_PATH]
 
char COMMON_FILES_DIR [MAX_PATH]
 
char APP_DATA_DIR [MAX_PATH]
 
char WINDOWS_DIR [MAX_PATH]
 
static const charcustomdll
 
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 aup_property_dat []
 
static const CHAR aup2_property_dat []
 
static const CHAR icon_property_dat []
 
static const CHAR shortcut_dat []
 
static const CHAR condition_dat []
 
static const CHAR up_property_dat []
 
static const CHAR up2_property_dat []
 
static const CHAR up3_property_dat []
 
static const CHAR registry_dat []
 
static const CHAR cc_component_dat []
 
static const CHAR cc2_component_dat []
 
static const CHAR cc_feature_dat []
 
static const CHAR cc_feature_comp_dat []
 
static const CHAR cc_file_dat []
 
static const CHAR cc2_file_dat []
 
static const CHAR cc_media_dat []
 
static const CHAR cc3_media_dat []
 
static const CHAR co_file_dat []
 
static const CHAR co_media_dat []
 
static const CHAR co2_media_dat []
 
static const CHAR mm_file_dat []
 
static const CHAR mm_media_dat []
 
static const CHAR ss_media_dat []
 
static const CHAR ui_component_dat []
 
static const CHAR ui_install_ui_seq_dat []
 
static const CHAR ui_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 rofc_file_dat []
 
static const CHAR rofc_media_dat []
 
static const CHAR sdp_install_exec_seq_dat []
 
static const CHAR sdp_custom_action_dat []
 
static const CHAR pv_install_exec_seq_dat []
 
static const CHAR cie_component_dat []
 
static const CHAR cie_feature_comp_dat []
 
static const CHAR cie_file_dat []
 
static const CHAR cie_media_dat []
 
static const CHAR ci_component_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 tp_component_dat []
 
static const CHAR cwd_component_dat []
 
static const CHAR adm_component_dat []
 
static const CHAR adm_custom_action_dat []
 
static const CHAR adm_admin_exec_seq_dat []
 
static const CHAR amp_component_dat []
 
static const CHAR rem_install_exec_seq_dat []
 
static const CHAR mc_component_dat []
 
static const CHAR mc_file_dat []
 
static const CHAR mc_media_dat []
 
static const CHAR mc_file_hash_dat []
 
static const CHAR wrv_component_dat []
 
static const CHAR ca1_install_exec_seq_dat []
 
static const CHAR ca1_custom_action_dat []
 
static const CHAR ca1_test_seq_dat []
 
static const CHAR ca1_test2_dat []
 
static const CHAR ca1__validation_dat []
 
static const CHAR ca51_component_dat []
 
static const CHAR ca51_install_exec_seq_dat []
 
static const CHAR ca51_custom_action_dat []
 
static const CHAR is_feature_dat []
 
static const CHAR is_component_dat []
 
static const CHAR is_feature_comp_dat []
 
static const CHAR is_file_dat []
 
static const CHAR is_media_dat []
 
static const CHAR sp_component_dat []
 
static const CHAR sp_directory_dat []
 
static const CHAR mcp_component_dat []
 
static const CHAR mcp_feature_dat []
 
static const CHAR mcp_feature_comp_dat []
 
static const CHAR mcp_file_dat []
 
static const CHAR ai_file_dat []
 
static const CHAR ip_install_exec_seq_dat []
 
static const CHAR ip_custom_action_dat []
 
static const CHAR aup_install_exec_seq_dat []
 
static const CHAR aup2_install_exec_seq_dat []
 
static const CHAR aup3_install_exec_seq_dat []
 
static const CHAR aup_custom_action_dat []
 
static const CHAR fo_file_dat []
 
static const CHAR fo_feature_dat []
 
static const CHAR fo_condition_dat []
 
static const CHAR fo_feature_comp_dat []
 
static const CHAR fo_component_dat []
 
static const CHAR fo_custom_action_dat []
 
static const CHAR fo_install_exec_seq_dat []
 
static const CHAR uc_file_dat []
 
static const CHAR uc_feature_dat []
 
static const CHAR uc_feature_comp_dat []
 
static const CHAR uc_component_dat []
 
static const CHAR uc_property_dat []
 
static const CHAR uc_install_exec_seq_dat []
 
static const char mixed_feature_dat []
 
static const char mixed_feature_comp_dat []
 
static const char mixed_component_dat []
 
static const char mixed_registry_dat []
 
static const char mixed_install_exec_seq_dat []
 
static const char vp_file_dat []
 
static const char vp_feature_dat []
 
static const char vp_feature_comp_dat []
 
static const char vp_component_dat []
 
static const char vp_custom_action_dat []
 
static const char vp_install_exec_seq_dat []
 
static const char shc_property_dat []
 
static const char shc2_property_dat []
 
static const char shc_file_dat []
 
static const char shc_feature_dat []
 
static const char shc_feature_comp_dat []
 
static const char shc_component_dat []
 
static const char shc_custom_action_dat []
 
static const char shc_install_exec_seq_dat []
 
static const char shc2_install_exec_seq_dat []
 
static const char ft_file_dat []
 
static const char ft_comp_dat []
 
static const char ft_feature_dat []
 
static const char ft_feature_comp_dat []
 
static const char ft_condition_dat []
 
static const char ft_custom_action_dat []
 
static const char ft_install_exec_seq_dat []
 
static const char da_custom_action_dat []
 
static const char da_install_exec_seq_dat []
 
static const CHAR x64_directory_dat []
 
static const CHAR sr_install_exec_seq_dat []
 
static const CHAR sr_custom_action_dat []
 
static const CHAR ai2_file_dat []
 
static const CHAR ai2_component_dat []
 
static const CHAR ai2_feature_dat []
 
static const CHAR ai2_feature_comp_dat []
 
static const msi_table tables []
 
static const msi_table sc_tables []
 
static const msi_table ps_tables []
 
static const msi_table up_tables []
 
static const msi_table up2_tables []
 
static const msi_table up3_tables []
 
static const msi_table up4_tables []
 
static const msi_table up5_tables []
 
static const msi_table up6_tables []
 
static const msi_table up7_tables []
 
static const msi_table cc_tables []
 
static const msi_table cc2_tables []
 
static const msi_table cc3_tables []
 
static const msi_table co_tables []
 
static const msi_table co2_tables []
 
static const msi_table mm_tables []
 
static const msi_table ss_tables []
 
static const msi_table ui_tables []
 
static const msi_table rof_tables []
 
static const msi_table rofc_tables []
 
static const msi_table sdp_tables []
 
static const msi_table cie_tables []
 
static const msi_table tp_tables []
 
static const msi_table cwd_tables []
 
static const msi_table adm_tables []
 
static const msi_table amp_tables []
 
static const msi_table mc_tables []
 
static const msi_table sf_tables []
 
static const msi_table ca1_tables []
 
static const msi_table ca51_tables []
 
static const msi_table is_tables []
 
static const msi_table sp_tables []
 
static const msi_table mcp_tables []
 
static const msi_table ai_tables []
 
static const msi_table ai2_tables []
 
static const msi_table pc_tables []
 
static const msi_table ip_tables []
 
static const msi_table aup_tables []
 
static const msi_table aup2_tables []
 
static const msi_table aup3_tables []
 
static const msi_table aup4_tables []
 
static const msi_table fiu_tables []
 
static const msi_table fiuc_tables []
 
static const msi_table fo_tables []
 
static const msi_table icon_base_tables []
 
static const msi_table pv_tables []
 
static const msi_table uc_tables []
 
static const msi_table mixed_tables []
 
static const msi_table vp_tables []
 
static const msi_table shc_tables []
 
static const msi_table shc2_tables []
 
static const msi_table ft_tables []
 
static const msi_table da_tables []
 
static const msi_table x64_tables []
 
static const msi_table sr_tables []
 
static const WCHAR name1 [] = { 0x4840, 0x3f3f, 0x4577, 0x446c, 0x3b6a, 0x45e4, 0x4824, 0 }
 
static const WCHAR name2 [] = { 0x4840, 0x3f3f, 0x4577, 0x446c, 0x3e6a, 0x44b2, 0x482f, 0 }
 
static const WCHAR name3 [] = { 0x4840, 0x4559, 0x44f2, 0x4568, 0x4737, 0 }
 
static const char data1 []
 
static const WCHAR data2 []
 
static const WCHAR data3 []
 
struct {
   LPCWSTR   name
 
   const void *   data
 
   DWORD   size
 
table_transform_data []
 
static const struct sourcepathmap spmap [256]
 
static const char session_manager [] = "System\\CurrentControlSet\\Control\\Session Manager"
 
static const char rename_ops [] = "PendingFileRenameOperations"
 

Macro Definition Documentation

◆ _WIN32_MSI

#define _WIN32_MSI   300

Definition at line 21 of file install.c.

◆ COBJMACROS

#define COBJMACROS

Definition at line 22 of file install.c.

◆ create_pf

#define create_pf (   file,
  is_file 
)    create_pf_data(file, file, is_file)

Definition at line 3969 of file install.c.

◆ FOLDER_THRESHOLD

#define FOLDER_THRESHOLD   900000

Definition at line 2106 of file install.c.

◆ MEDIA_SIZE

#define MEDIA_SIZE   0x7FFFFFFF

Definition at line 2105 of file install.c.

Function Documentation

◆ add_custom_dll()

static void add_custom_dll ( MSIHANDLE  hdb)
static

Definition at line 2610 of file install.c.

2611{
2613 UINT res;
2614
2615 if (!customdll)
2616 customdll = load_resource("custom.dll");
2617
2619
2620 res = run_query(hdb, 0, "CREATE TABLE `Binary` (`Name` CHAR(72) NOT NULL, `Data` OBJECT NOT NULL PRIMARY KEY `Name`)");
2621 ok(res == ERROR_SUCCESS, "failed to create Binary table: %u\n", res);
2622
2625 ok(res == ERROR_SUCCESS, "failed to add %s to stream: %u\n", customdll, res);
2626
2627 res = run_query(hdb, record, "INSERT INTO `Binary` (`Name`, `Data`) VALUES ('custom.dll', ?)");
2628 ok(res == ERROR_SUCCESS, "failed to insert into Binary table: %u\n", res);
2629
2631}
#define ok(value,...)
Definition: atltest.h:57
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
UINT WINAPI MsiCloseHandle(MSIHANDLE handle)
Definition: handle.c:269
UINT WINAPI MsiSetExternalUIRecord(INSTALLUI_HANDLER_RECORD handler, DWORD filter, void *context, INSTALLUI_HANDLER_RECORD *prev)
Definition: msi.c:4149
MSIHANDLE WINAPI MsiCreateRecord(UINT cParams)
Definition: record.c:92
UINT WINAPI MsiRecordSetStreamA(MSIHANDLE hRecord, UINT iField, const char *szFilename)
Definition: record.c:724
GLuint res
Definition: glext.h:9613
UINT run_query(MSIHANDLE hdb, MSIHANDLE hrec, const char *query)
Definition: install.c:3559
static const char * customdll
Definition: install.c:56
static char * load_resource(const char *name)
Definition: install.c:2566
static INT CALLBACK ok_callback(void *context, UINT message_type, MSIHANDLE record)
Definition: install.c:2589
@ INSTALLLOGMODE_USER
Definition: msi.h:134
unsigned int UINT
Definition: ndis.h:50
unsigned long MSIHANDLE
Definition: winemsi.idl:27

Referenced by create_database_wordcount().

◆ add_file()

static BOOL add_file ( HFCI  hfci,
const char file,
TCOMP  compress 
)
static

Definition at line 2279 of file install.c.

2280{
2281 char path[MAX_PATH];
2282 char filename[MAX_PATH];
2283
2285 lstrcatA(path, "\\");
2286 lstrcatA(path, file);
2287
2289
2292}
cd_progress_ptr progress
Definition: cdjpeg.h:152
#define FALSE
Definition: types.h:117
#define MAX_PATH
Definition: compat.h:34
BOOL __cdecl FCIAddFile(HFCI hfci, char *pszSourceFile, char *pszFileName, BOOL fExecute, PFNFCIGETNEXTCABINET pfnfcignc, PFNFCISTATUS pfnfcis, PFNFCIGETOPENINFO pfnfcigoi, TCOMP typeCompress)
Definition: fci.c:1397
const char * filename
Definition: ioapi.h:137
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:100
LPSTR WINAPI lstrcatA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:123
static char CURR_DIR[MAX_PATH]
Definition: install.c:32
static BOOL CDECL get_next_cabinet(PCCAB pccab, ULONG cbPrevCab, void *pv)
Definition: install.c:2120
static INT_PTR CDECL get_open_info(char *pszName, USHORT *pdate, USHORT *ptime, USHORT *pattribs, int *err, void *pv)
Definition: install.c:2253
int ZEXPORT compress(Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen)
Definition: compress.c:68
Definition: fci.c:127

Referenced by create_cab_file(), and create_cc_test_files().

◆ check_file_matches()

static void check_file_matches ( const char filename,
const char text 
)
static

Definition at line 6054 of file install.c.

6055{
6056 char buffer[200];
6057 HANDLE file;
6058 DWORD size;
6059
6061 ReadFile(file, buffer, sizeof(buffer), &size, NULL);
6062 ok(size == strlen(text) && !memcmp(buffer, text, size), "got %.*s\n", (int)size, buffer);
6064}
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define CloseHandle
Definition: compat.h:739
#define OPEN_EXISTING
Definition: compat.h:775
#define ReadFile(a, b, c, d, e)
Definition: compat.h:742
#define CreateFileA(a, b, c, d, e, f, g)
Definition: compat.h:740
#define GENERIC_READ
Definition: compat.h:135
const WCHAR * text
Definition: package.c:1794
unsigned long DWORD
Definition: ntddk_ex.h:95
GLsizeiptr size
Definition: glext.h:5919
GLuint buffer
Definition: glext.h:5915

Referenced by test_deferred_action().

◆ check_record()

static BOOL check_record ( MSIHANDLE  rec,
UINT  field,
LPCSTR  val 
)
static

Definition at line 2224 of file install.c.

2225{
2226 CHAR buffer[0x20];
2227 UINT r;
2228 DWORD sz;
2229
2230 sz = sizeof buffer;
2231 r = MsiRecordGetStringA(rec, field, buffer, &sz);
2232 return (r == ERROR_SUCCESS ) && !strcmp(val, buffer);
2233}
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
UINT WINAPI MsiRecordGetStringA(MSIHANDLE handle, UINT iField, char *szValue, DWORD *pcchValue)
Definition: record.c:403
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLuint GLfloat * val
Definition: glext.h:7180
Definition: parser.c:44
char CHAR
Definition: xmlstorage.h:175

◆ compare_pf_data()

static BOOL compare_pf_data ( const char filename,
const char data,
DWORD  size 
)
static

Definition at line 2475 of file install.c.

2476{
2477 DWORD read;
2478 HANDLE handle;
2479 BOOL ret = FALSE;
2480 char *buffer, path[MAX_PATH];
2481
2483 lstrcatA(path, "\\");
2485
2487 if ((buffer = malloc(size)))
2488 {
2490 if (read == size && !memcmp(data, buffer, size)) ret = TRUE;
2491 free(buffer);
2492 }
2494 return ret;
2495}
#define read
Definition: acwin.h:96
#define free
Definition: debug_ros.c:5
#define malloc
Definition: debug_ros.c:4
#define TRUE
Definition: types.h:120
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:137
unsigned int BOOL
Definition: ntddk_ex.h:94
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
char PROG_FILES_DIR[MAX_PATH]
Definition: install.c:50
int ret

Referenced by test_missingcab().

◆ create_cab_file()

void create_cab_file ( const CHAR name,
DWORD  max_size,
const CHAR files 
)

Definition at line 2307 of file install.c.

2308{
2309 CCAB cabParams;
2310 LPCSTR ptr;
2311 HFCI hfci;
2312 ERF erf;
2313 BOOL res;
2314
2315 set_cab_parameters(&cabParams, name, max_size);
2316
2319 get_temp_file, &cabParams, NULL);
2320
2321 ok(hfci != NULL, "Failed to create an FCI context\n");
2322
2323 ptr = files;
2324 while (*ptr)
2325 {
2326 res = add_file(hfci, ptr, tcompTYPE_MSZIP);
2327 ok(res, "Failed to add file: %s\n", ptr);
2328 ptr += lstrlenA(ptr) + 1;
2329 }
2330
2332 ok(res, "Failed to flush the cabinet\n");
2333
2334 res = FCIDestroy(hfci);
2335 ok(res, "Failed to destroy the cabinet\n");
2336}
static INT max_size
Definition: history.c:51
#define mem_free(ptr, bsize)
Definition: types.h:124
#define mem_alloc(bsize)
Definition: types.h:123
BOOL __cdecl FCIDestroy(HFCI hfci)
Definition: fci.c:1709
HFCI __cdecl FCICreate(PERF perf, PFNFCIFILEPLACED pfnfiledest, PFNFCIALLOC pfnalloc, PFNFCIFREE pfnfree, PFNFCIOPEN pfnopen, PFNFCIREAD pfnread, PFNFCIWRITE pfnwrite, PFNFCICLOSE pfnclose, PFNFCISEEK pfnseek, PFNFCIDELETE pfndelete, PFNFCIGETTEMPFILE pfnfcigtf, PCCAB pccab, void *pv)
Definition: fci.c:998
BOOL __cdecl FCIFlushCabinet(HFCI hfci, BOOL fGetNextCab, PFNFCIGETNEXTCABINET pfnfcignc, PFNFCISTATUS pfnfcis)
Definition: fci.c:1675
#define tcompTYPE_MSZIP
Definition: fci.h:65
int WINAPI lstrlenA(LPCSTR lpString)
Definition: lstring.c:145
double __cdecl erf(double)
static PVOID ptr
Definition: dispmode.c:27
static void set_cab_parameters(PCCAB pCabParams, const CHAR *name, DWORD max_size)
Definition: install.c:2294
static UINT CDECL fci_write(INT_PTR hf, void *memory, UINT cb, int *err, void *pv)
Definition: install.c:2172
static BOOL CDECL get_temp_file(char *pszTempName, int cbTempName, void *pv)
Definition: install.c:2235
static UINT CDECL fci_read(INT_PTR hf, void *memory, UINT cb, int *err, void *pv)
Definition: install.c:2160
static INT_PTR CDECL fci_open(char *pszFile, int oflag, int pmode, int *err, void *pv)
Definition: install.c:2137
static BOOL add_file(HFCI hfci, const char *file, TCOMP compress)
Definition: install.c:2279
static int CDECL fci_delete(char *pszFile, int *err, void *pv)
Definition: install.c:2203
static int CDECL file_placed(PCCAB pccab, char *pszFile, LONG cbFile, BOOL fContinuation, void *pv)
Definition: install.c:2131
static LONG CDECL fci_seek(INT_PTR hf, LONG dist, int seektype, int *err, void *pv)
Definition: install.c:2192
static int CDECL fci_close(INT_PTR hf, int *err, void *pv)
Definition: install.c:2184
Definition: fci.h:144
Definition: fci.h:44
Definition: name.c:39
const char * LPCSTR
Definition: xmlstorage.h:183

◆ create_cc_test_files()

static void create_cc_test_files ( void  )
static

Definition at line 2960 of file install.c.

2961{
2962 CCAB cabParams;
2963 HFCI hfci;
2964 ERF erf;
2965 static CHAR cab_context[] = "test%d.cab";
2966 BOOL res;
2967
2968 create_file("maximus", 500);
2969 create_file("augustus", 50000);
2970 create_file("tiberius", 500);
2971 create_file("caesar", 500);
2972
2973 set_cab_parameters(&cabParams, "test1.cab", 40000);
2974
2977 get_temp_file, &cabParams, cab_context);
2978 ok(hfci != NULL, "Failed to create an FCI context\n");
2979
2980 res = add_file(hfci, "maximus", tcompTYPE_NONE);
2981 ok(res, "Failed to add file maximus\n");
2982
2983 res = add_file(hfci, "augustus", tcompTYPE_NONE);
2984 ok(res, "Failed to add file augustus\n");
2985
2986 res = add_file(hfci, "tiberius", tcompTYPE_NONE);
2987 ok(res, "Failed to add file tiberius\n");
2988
2990 ok(res, "Failed to flush the cabinet\n");
2991
2992 res = FCIDestroy(hfci);
2993 ok(res, "Failed to destroy the cabinet\n");
2994
2995 create_cab_file("test3.cab", MEDIA_SIZE, "caesar\0");
2996
2997 DeleteFileA("maximus");
2998 DeleteFileA("augustus");
2999 DeleteFileA("tiberius");
3000 DeleteFileA("caesar");
3001}
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
Definition: delete.c:24
#define tcompTYPE_NONE
Definition: fci.h:64
static void create_cab_file(void)
Definition: files.c:356
#define create_file(name, size)
Definition: asmcache.c:813
#define MEDIA_SIZE
Definition: install.c:2105

Referenced by test_caborder(), test_continuouscabs(), test_samesequence(), and test_uiLevelFlags().

◆ create_database_wordcount()

void create_database_wordcount ( const CHAR name,
const msi_table tables,
int  num_tables,
INT  version,
INT  wordcount,
const char template,
const char packagecode 
)

Definition at line 2633 of file install.c.

2635{
2636 MSIHANDLE db;
2637 UINT r;
2638 WCHAR *nameW;
2639 int j, len;
2640
2641 len = MultiByteToWideChar( CP_ACP, 0, name, -1, NULL, 0 );
2642 if (!(nameW = malloc( len * sizeof(WCHAR) ))) return;
2644
2646 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2647
2648 /* import the tables into the database */
2649 for (j = 0; j < num_tables; j++)
2650 {
2651 const msi_table *table = &tables[j];
2652
2653 write_file(table->filename, table->data, (table->size - 1) * sizeof(char));
2654
2655 r = MsiDatabaseImportA(db, CURR_DIR, table->filename);
2656 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2657
2658 DeleteFileA(table->filename);
2659 }
2660
2661 write_msi_summary_info(db, version, wordcount, template, packagecode);
2662 add_custom_dll(db);
2663
2664 r = MsiDatabaseCommit(db);
2665 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2666
2667 MsiCloseHandle(db);
2668 free( nameW );
2669}
static const WCHAR nameW[]
Definition: main.c:49
#define CP_ACP
Definition: compat.h:109
#define MultiByteToWideChar
Definition: compat.h:110
static const WCHAR version[]
Definition: asmname.c:66
UINT WINAPI MsiDatabaseImportA(MSIHANDLE handle, const char *szFolder, const char *szFilename)
Definition: database.c:863
UINT WINAPI MsiOpenDatabaseW(LPCWSTR szDBPath, LPCWSTR szPersist, MSIHANDLE *phDB)
Definition: database.c:298
GLenum GLsizei len
Definition: glext.h:6722
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 GLint GLint j
Definition: glfuncs.h:250
static const msi_table tables[]
Definition: install.c:1407
static void write_msi_summary_info(MSIHANDLE db, INT version, INT wordcount, const char *template, const char *packagecode)
Definition: install.c:2535
static void write_file(const CHAR *filename, const char *data, int data_size)
Definition: install.c:2525
static void add_custom_dll(MSIHANDLE hdb)
Definition: install.c:2610
UINT WINAPI MsiDatabaseCommit(MSIHANDLE hdb)
Definition: msiquery.c:962
#define MSIDBOPEN_CREATE
Definition: msiquery.h:69
BYTE * data
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by test_adminimage(), and test_shared_component().

◆ create_file_data()

void create_file_data ( LPCSTR  name,
LPCSTR  data,
DWORD  size 
)

Definition at line 2394 of file install.c.

2395{
2396 HANDLE file;
2397 DWORD written;
2398
2401 return;
2402
2403 WriteFile(file, data, strlen(data), &written, NULL);
2404
2405 if (size)
2406 {
2409 }
2410
2412}
#define FILE_BEGIN
Definition: compat.h:761
#define SetFilePointer
Definition: compat.h:743
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
BOOL WINAPI SetEndOfFile(HANDLE hFile)
Definition: fileinfo.c:1004
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: rw.c:24
#define CREATE_ALWAYS
Definition: disk.h:72
#define GENERIC_WRITE
Definition: nt_native.h:90

Referenced by create_pf_data().

◆ create_pf_data()

void create_pf_data ( LPCSTR  file,
LPCSTR  data,
BOOL  is_file 
)

Definition at line 3955 of file install.c.

3956{
3958
3960 lstrcatA(path, "\\");
3961 lstrcatA(path, file);
3962
3963 if (is_file)
3964 create_file_data(path, data, 500);
3965 else
3967}
BOOL WINAPI CreateDirectoryA(IN LPCSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
Definition: dir.c:37
void create_file_data(LPCSTR name, LPCSTR data, DWORD size)
Definition: install.c:2394

Referenced by test_missingcab().

◆ create_test_files()

static void create_test_files ( void  )
static

Definition at line 2414 of file install.c.

2415{
2416 CreateDirectoryA("msitest", NULL);
2417 create_file("msitest\\one.txt", 100);
2418 CreateDirectoryA("msitest\\first", NULL);
2419 create_file("msitest\\first\\two.txt", 100);
2420 CreateDirectoryA("msitest\\second", NULL);
2421 create_file("msitest\\second\\three.txt", 100);
2422
2423 create_file("four.txt", 100);
2424 create_file("five.txt", 100);
2425 create_cab_file("msitest.cab", MEDIA_SIZE, "four.txt\0five.txt\0");
2426
2427 create_file("msitest\\filename", 100);
2428
2429 DeleteFileA("four.txt");
2430 DeleteFileA("five.txt");
2431}

Referenced by test_allusers_prop(), test_customaction1(), test_feature_override(), test_installed_prop(), test_MsiInstallProduct(), test_preselected(), test_remove_upgrade_code(), test_shortcut(), test_source_resolution(), and test_wow64().

◆ delete_cab_files()

void delete_cab_files ( void  )

Definition at line 3003 of file install.c.

3004{
3005 SHFILEOPSTRUCTA shfl;
3006 CHAR path[MAX_PATH+10];
3007
3009 lstrcatA(path, "\\*.cab");
3010 path[strlen(path) + 1] = '\0';
3011
3012 shfl.hwnd = NULL;
3013 shfl.wFunc = FO_DELETE;
3014 shfl.pFrom = path;
3015 shfl.pTo = NULL;
3017
3018 SHFileOperationA(&shfl);
3019}
#define FO_DELETE
Definition: shellapi.h:138
#define FOF_FILESONLY
Definition: shellapi.h:148
#define FOF_NOCONFIRMATION
Definition: shellapi.h:145
#define FOF_SILENT
Definition: shellapi.h:143
#define FOF_NORECURSION
Definition: shlfileop.c:38
int WINAPI SHFileOperationA(LPSHFILEOPSTRUCTA lpFileOp)
Definition: shlfileop.cpp:1060
FILEOP_FLAGS fFlags
Definition: shellapi.h:349

Referenced by test_cabisextracted(), test_caborder(), test_continuouscabs(), test_file_in_use_cab(), test_lastusedsource(), test_readonlyfile_cab(), test_samesequence(), and test_uiLevelFlags().

◆ delete_cf()

static BOOL delete_cf ( const CHAR rel_path,
BOOL  is_file 
)
static

Definition at line 2461 of file install.c.

2462{
2464
2466 lstrcatA(path, "\\");
2467 lstrcatA(path, rel_path);
2468
2469 if (is_file)
2470 return DeleteFileA(path);
2471 else
2472 return RemoveDirectoryA(path);
2473}
BOOL WINAPI RemoveDirectoryA(IN LPCSTR lpPathName)
Definition: dir.c:714
char COMMON_FILES_DIR[MAX_PATH]
Definition: install.c:52

Referenced by test_setdirproperty().

◆ delete_pf()

BOOL delete_pf ( const CHAR rel_path,
BOOL  is_file 
)

Definition at line 2433 of file install.c.

2434{
2436
2438 lstrcatA(path, "\\");
2439 lstrcatA(path, rel_path);
2440
2441 if (is_file)
2442 return DeleteFileA(path);
2443 else
2444 return RemoveDirectoryA(path);
2445}

Referenced by delete_pf_files(), test_admin(), test_adminimage(), test_adminprops(), test_cabisextracted(), test_caborder(), test_concurrentinstall(), test_continuouscabs(), test_create_remove_shortcut(), test_currentworkingdir(), test_customaction51(), test_delete_services(), test_duplicate_files(), test_feature_override(), test_file_in_use(), test_file_in_use_cab(), test_find_related_products(), test_ini_values(), test_install_remove_odbc(), test_install_services(), test_Installer_InstallProduct(), test_installstate(), test_missingcab(), test_missingcomponent(), test_mixedmedia(), test_move_files(), test_MsiConfigureProductEx(), test_package_validation(), test_preselected(), test_process_components(), test_propcase(), test_publish_components(), test_publish_features(), test_publish_product(), test_readonlyfile(), test_readonlyfile_cab(), test_register_class_info(), test_register_extension_info(), test_register_font(), test_register_mime_info(), test_register_product(), test_register_progid_info(), test_register_typelib(), test_register_user(), test_remove_duplicate_files(), test_remove_existing_products(), test_remove_files(), test_samesequence(), test_self_registration(), test_setpropertyfolder(), test_shortcut(), test_simple_patch(), test_sourcedir_props(), test_sourcedirprop(), test_sourcefolder(), test_sourcepath(), test_start_stop_services(), test_transformprop(), test_uiLevelFlags(), test_upgrade_code(), test_validate_product_id(), and test_wow64().

◆ delete_pf_files()

static void delete_pf_files ( void  )
static

Definition at line 2510 of file install.c.

2511{
2512 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
2513 ok(delete_pf("msitest\\cabout\\new", FALSE), "Directory not created\n");
2514 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
2515 ok(delete_pf("msitest\\cabout", FALSE), "Directory not created\n");
2516 ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
2517 ok(delete_pf("msitest\\changed", FALSE), "Directory not created\n");
2518 ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
2519 ok(delete_pf("msitest\\first", FALSE), "Directory not created\n");
2520 ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
2521 ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
2522 ok(delete_pf("msitest", FALSE), "Directory not created\n");
2523}
BOOL delete_pf(const CHAR *rel_path, BOOL is_file)
Definition: install.c:2433

Referenced by test_adminimage(), test_allusers_prop(), test_installed_prop(), test_MsiInstallProduct(), test_shortcut(), and test_source_resolution().

◆ delete_pf_native()

static BOOL delete_pf_native ( const CHAR rel_path,
BOOL  is_file 
)
static

Definition at line 2447 of file install.c.

2448{
2450
2452 lstrcatA(path, "\\");
2453 lstrcatA(path, rel_path);
2454
2455 if (is_file)
2456 return DeleteFileA(path);
2457 else
2458 return RemoveDirectoryA(path);
2459}
char PROG_FILES_DIR_NATIVE[MAX_PATH]
Definition: install.c:51

Referenced by test_wow64().

◆ delete_pfmsitest_files()

static void delete_pfmsitest_files ( void  )
static

Definition at line 3537 of file install.c.

3538{
3539 SHFILEOPSTRUCTA shfl;
3540 CHAR path[MAX_PATH+11];
3541
3543 lstrcatA(path, "\\msitest\\*");
3544 path[strlen(path) + 1] = '\0';
3545
3546 shfl.hwnd = NULL;
3547 shfl.wFunc = FO_DELETE;
3548 shfl.pFrom = path;
3549 shfl.pTo = NULL;
3551
3552 SHFileOperationA(&shfl);
3553
3555 lstrcatA(path, "\\msitest");
3557}
#define FOF_NOERRORUI
Definition: shellapi.h:151

Referenced by test_icon_table().

◆ delete_test_files()

static void delete_test_files ( void  )
static

Definition at line 2497 of file install.c.

2498{
2499 DeleteFileA("msitest.msi");
2500 DeleteFileA("msitest.cab");
2501 DeleteFileA("msitest\\second\\three.txt");
2502 DeleteFileA("msitest\\first\\two.txt");
2503 DeleteFileA("msitest\\one.txt");
2504 DeleteFileA("msitest\\filename");
2505 RemoveDirectoryA("msitest\\second");
2506 RemoveDirectoryA("msitest\\first");
2507 RemoveDirectoryA("msitest");
2508}

Referenced by test_allusers_prop(), test_customaction1(), test_feature_override(), test_file_in_use(), test_file_in_use_cab(), test_installed_prop(), test_MsiInstallProduct(), test_preselected(), test_shortcut(), test_source_resolution(), and test_wow64().

◆ fci_close()

static int CDECL fci_close ( INT_PTR  hf,
int err,
void pv 
)
static

Definition at line 2184 of file install.c.

2185{
2186 HANDLE handle = (HANDLE)hf;
2187 ok(CloseHandle(handle), "Failed to CloseHandle\n");
2188
2189 return 0;
2190}
PVOID HANDLE
Definition: typedefs.h:73

Referenced by create_cab_file(), and create_cc_test_files().

◆ fci_delete()

static int CDECL fci_delete ( char pszFile,
int err,
void pv 
)
static

Definition at line 2203 of file install.c.

2204{
2205 BOOL ret = DeleteFileA(pszFile);
2206 ok(ret, "Failed to DeleteFile %s\n", pszFile);
2207
2208 return 0;
2209}

Referenced by create_cab_file(), and create_cc_test_files().

◆ fci_open()

static INT_PTR CDECL fci_open ( char pszFile,
int  oflag,
int  pmode,
int err,
void pv 
)
static

Definition at line 2137 of file install.c.

2138{
2139 HANDLE handle;
2140 DWORD dwAccess = 0;
2141 DWORD dwShareMode = 0;
2142 DWORD dwCreateDisposition = OPEN_EXISTING;
2143
2144 dwAccess = GENERIC_READ | GENERIC_WRITE;
2146
2148 dwCreateDisposition = OPEN_EXISTING;
2149 else
2150 dwCreateDisposition = CREATE_NEW;
2151
2152 handle = CreateFileA(pszFile, dwAccess, dwShareMode, NULL,
2153 dwCreateDisposition, 0, NULL);
2154
2155 ok(handle != INVALID_HANDLE_VALUE, "Failed to CreateFile %s\n", pszFile);
2156
2157 return (INT_PTR)handle;
2158}
#define FILE_SHARE_READ
Definition: compat.h:136
DWORD WINAPI GetFileAttributesA(LPCSTR lpFileName)
Definition: fileinfo.c:636
#define CREATE_NEW
Definition: disk.h:69
#define FILE_SHARE_WRITE
Definition: nt_native.h:681
#define FILE_SHARE_DELETE
Definition: nt_native.h:682
int32_t INT_PTR
Definition: typedefs.h:64
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23

Referenced by create_cab_file(), and create_cc_test_files().

◆ fci_read()

static UINT CDECL fci_read ( INT_PTR  hf,
void memory,
UINT  cb,
int err,
void pv 
)
static

Definition at line 2160 of file install.c.

2161{
2162 HANDLE handle = (HANDLE)hf;
2163 DWORD dwRead;
2164 BOOL res;
2165
2166 res = ReadFile(handle, memory, cb, &dwRead, NULL);
2167 ok(res, "Failed to ReadFile\n");
2168
2169 return dwRead;
2170}
static HMODULE MODULEINFO DWORD cb
Definition: module.c:33
static char memory[1024 *256]
Definition: process.c:116

Referenced by create_cab_file(), and create_cc_test_files().

◆ fci_seek()

static LONG CDECL fci_seek ( INT_PTR  hf,
LONG  dist,
int  seektype,
int err,
void pv 
)
static

Definition at line 2192 of file install.c.

2193{
2194 HANDLE handle = (HANDLE)hf;
2195 DWORD ret;
2196
2197 ret = SetFilePointer(handle, dist, NULL, seektype);
2198 ok(ret != INVALID_SET_FILE_POINTER, "Failed to SetFilePointer\n");
2199
2200 return ret;
2201}
#define INVALID_SET_FILE_POINTER
Definition: compat.h:732

Referenced by create_cab_file(), and create_cc_test_files().

◆ fci_write()

static UINT CDECL fci_write ( INT_PTR  hf,
void memory,
UINT  cb,
int err,
void pv 
)
static

Definition at line 2172 of file install.c.

2173{
2174 HANDLE handle = (HANDLE)hf;
2175 DWORD dwWritten;
2176 BOOL res;
2177
2178 res = WriteFile(handle, memory, cb, &dwWritten, NULL);
2179 ok(res, "Failed to WriteFile\n");
2180
2181 return dwWritten;
2182}

Referenced by create_cab_file(), and create_cc_test_files().

◆ file_exists()

BOOL file_exists ( const char file)

Definition at line 3521 of file install.c.

3522{
3524}

Referenced by pf_exists(), and test_icon_table().

◆ file_matches()

static BOOL file_matches ( LPSTR  path)
static

Definition at line 3316 of file install.c.

3317{
3318 CHAR buf[MAX_PATH];
3319 HANDLE file;
3320 DWORD size;
3321
3323 NULL, OPEN_EXISTING, 0, NULL);
3325 ReadFile(file, buf, 15, &size, NULL);
3327
3328 return !lstrcmpA(buf, "msitest\\maximus");
3329}
int WINAPI lstrcmpA(LPCSTR str1, LPCSTR str2)
Definition: locale.c:4195
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define ZeroMemory
Definition: winbase.h:1737

Referenced by test_readonlyfile().

◆ file_matches_data()

static BOOL file_matches_data ( LPCSTR  file,
LPCSTR  data 
)
static

Definition at line 5229 of file install.c.

5230{
5231 DWORD len, data_len = strlen(data);
5232 HANDLE handle;
5233 char buf[128];
5234
5236 ok(handle != INVALID_HANDLE_VALUE, "failed to open %s (%lu)\n", file, GetLastError());
5237
5238 if (ReadFile(handle, buf, sizeof(buf), &len, NULL) && len >= data_len)
5239 {
5241 return !memcmp(buf, data, data_len);
5242 }
5244 return FALSE;
5245}
DWORD WINAPI GetLastError(void)
Definition: except.c:1042

Referenced by test_file_in_use(), and test_file_in_use_cab().

◆ file_placed()

static int CDECL file_placed ( PCCAB  pccab,
char pszFile,
LONG  cbFile,
BOOL  fContinuation,
void pv 
)
static

Definition at line 2131 of file install.c.

2133{
2134 return 0;
2135}

Referenced by create_cab_file(), and create_cc_test_files().

◆ generate_transform()

static void generate_transform ( void  )
static

Definition at line 3603 of file install.c.

3604{
3605 MSIHANDLE hdb1, hdb2;
3606 LPCSTR query;
3607 UINT r;
3608
3609 /* start with two identical databases */
3611
3613 ok(r == ERROR_SUCCESS , "Failed to create database\n");
3614
3615 r = MsiDatabaseCommit(hdb1);
3616 ok(r == ERROR_SUCCESS , "Failed to commit database\n");
3617
3619 ok(r == ERROR_SUCCESS , "Failed to create database\n");
3620
3621 query = "INSERT INTO `Property` ( `Property`, `Value` ) VALUES ( 'prop', 'val' )";
3622 r = run_query(hdb1, 0, query);
3623 ok(r == ERROR_SUCCESS, "failed to add property\n");
3624
3625 /* database needs to be committed */
3626 MsiDatabaseCommit(hdb1);
3627
3628 r = MsiDatabaseGenerateTransformA(hdb1, hdb2, mstfile, 0, 0);
3629 ok(r == ERROR_SUCCESS, "return code %d, should be ERROR_SUCCESS\n", r);
3630
3631 r = MsiCreateTransformSummaryInfoA(hdb2, hdb2, mstfile, 0, 0);
3632 todo_wine ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3633
3634 MsiCloseHandle(hdb1);
3635 MsiCloseHandle(hdb2);
3636}
BOOL WINAPI CopyFileA(IN LPCSTR lpExistingFileName, IN LPCSTR lpNewFileName, IN BOOL bFailIfExists)
Definition: copy.c:404
UINT WINAPI MsiCreateTransformSummaryInfoA(MSIHANDLE db, MSIHANDLE db_ref, const char *transform, int error, int validation)
Definition: suminfo.c:1244
#define todo_wine
Definition: custom.c:89
static const WCHAR msifile2W[]
Definition: install.c:47
static const WCHAR msifileW[]
Definition: install.c:46
static const char * msifile2
Definition: install.c:43
static const char * msifile
Definition: install.c:42
static const char * mstfile
Definition: install.c:44
UINT WINAPI MsiDatabaseGenerateTransformA(MSIHANDLE hdb, MSIHANDLE hdbref, const char *szTransformFile, int iReserved1, int iReserved2)
Definition: msiquery.c:948
#define MSIDBOPEN_TRANSACT
Definition: msiquery.h:67
#define MSIDBOPEN_READONLY
Definition: msiquery.h:66

Referenced by test_transformprop().

◆ generate_transform_manual()

static void generate_transform_manual ( void  )
static

Definition at line 3671 of file install.c.

3672{
3673 IStorage *stg = NULL;
3674 IStream *stm;
3675 WCHAR name[0x20];
3676 HRESULT r;
3677 DWORD i, count;
3679
3680 const CLSID CLSID_MsiTransform = { 0xc1082,0,0,{0xc0,0,0,0,0,0,0,0x46}};
3681
3682 MultiByteToWideChar(CP_ACP, 0, mstfile, -1, name, 0x20);
3683
3684 r = StgCreateDocfile(name, mode, 0, &stg);
3685 ok(r == S_OK, "failed to create storage\n");
3686 if (!stg)
3687 return;
3688
3689 r = IStorage_SetClass(stg, &CLSID_MsiTransform);
3690 ok(r == S_OK, "failed to set storage type\n");
3691
3692 for (i=0; i<ARRAY_SIZE(table_transform_data); i++)
3693 {
3694 r = IStorage_CreateStream(stg, table_transform_data[i].name,
3695 STGM_WRITE | STGM_SHARE_EXCLUSIVE, 0, 0, &stm);
3696 if (FAILED(r))
3697 {
3698 ok(0, "failed to create stream %#lx\n", r);
3699 continue;
3700 }
3701
3702 r = IStream_Write(stm, table_transform_data[i].data,
3705 ok(0, "failed to write stream\n");
3706 IStream_Release(stm);
3707 }
3708
3709 IStorage_Release(stg);
3710
3712}
#define ARRAY_SIZE(A)
Definition: main.h:20
HRESULT WINAPI StgCreateDocfile(LPCOLESTR pwcsName, DWORD grfMode, DWORD reserved, IStorage **ppstgOpen)
Definition: storage32.c:8636
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLenum mode
Definition: glext.h:6217
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 S_OK
Definition: intsafe.h:52
#define FAILED(hr)
Definition: intsafe.h:51
static const struct @1684 table_transform_data[]
static void set_transform_summary_info(void)
Definition: install.c:3575
#define STGM_CREATE
Definition: objbase.h:926
#define STGM_DIRECT
Definition: objbase.h:914
#define STGM_READWRITE
Definition: objbase.h:919
#define STGM_SHARE_EXCLUSIVE
Definition: objbase.h:923
#define STGM_WRITE
Definition: objbase.h:918

Referenced by test_transformprop().

◆ get_next_cabinet()

static BOOL CDECL get_next_cabinet ( PCCAB  pccab,
ULONG  cbPrevCab,
void pv 
)
static

Definition at line 2120 of file install.c.

2121{
2122 sprintf(pccab->szCab, pv, pccab->iCab);
2123 return TRUE;
2124}
#define sprintf(buf, format,...)
Definition: sprintf.c:55
int iCab
Definition: fci.h:151
char szCab[CB_MAX_CABINET_NAME]
Definition: fci.h:160

Referenced by add_file(), create_cab_file(), and create_cc_test_files().

◆ get_open_info()

static INT_PTR CDECL get_open_info ( char pszName,
USHORT pdate,
USHORT ptime,
USHORT pattribs,
int err,
void pv 
)
static

Definition at line 2253 of file install.c.

2255{
2258 HANDLE handle;
2259 DWORD attrs;
2260 BOOL res;
2261
2264
2265 ok(handle != INVALID_HANDLE_VALUE, "Failed to CreateFile %s\n", pszName);
2266
2268 ok(res, "Expected GetFileInformationByHandle to succeed\n");
2269
2271 FileTimeToDosDateTime(&filetime, pdate, ptime);
2272
2273 attrs = GetFileAttributesA(pszName);
2274 ok(attrs != INVALID_FILE_ATTRIBUTES, "Failed to GetFileAttributes\n");
2275
2276 return (INT_PTR)handle;
2277}
BOOL WINAPI GetFileInformationByHandle(HANDLE hFile, LPBY_HANDLE_FILE_INFORMATION lpFileInformation)
Definition: fileinfo.c:458
BOOL WINAPI FileTimeToLocalFileTime(IN CONST FILETIME *lpFileTime, OUT LPFILETIME lpLocalFileTime)
Definition: time.c:221
BOOL WINAPI FileTimeToDosDateTime(IN CONST FILETIME *lpFileTime, OUT LPWORD lpFatDate, OUT LPWORD lpFatTime)
Definition: time.c:37
#define FILE_FLAG_SEQUENTIAL_SCAN
Definition: disk.h:43

Referenced by add_file().

◆ get_pf_file_size()

static DWORD get_pf_file_size ( LPCSTR  file)
static

Definition at line 4563 of file install.c.

4564{
4566 HANDLE hfile;
4567 DWORD size;
4568
4570 lstrcatA(path, "\\");
4571 lstrcatA(path, file);
4572
4574 if (hfile == INVALID_HANDLE_VALUE)
4575 return INVALID_FILE_SIZE;
4576
4577 size = GetFileSize(hfile, NULL);
4578 CloseHandle(hfile);
4579 return size;
4580}
DWORD WINAPI GetFileSize(HANDLE hFile, LPDWORD lpFileSizeHigh)
Definition: fileinfo.c:331
#define INVALID_FILE_SIZE
Definition: winbase.h:574

Referenced by test_sourcepath().

◆ get_system_dirs()

BOOL get_system_dirs ( void  )

Definition at line 2357 of file install.c.

2358{
2359 HKEY hkey;
2360 DWORD type, size;
2361
2362 if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion",
2363 0, KEY_QUERY_VALUE | KEY_WOW64_64KEY, &hkey))
2364 return FALSE;
2365
2366 size = MAX_PATH;
2367 if (RegQueryValueExA(hkey, "ProgramFilesDir (x86)", 0, &type, (LPBYTE)PROG_FILES_DIR, &size) &&
2368 RegQueryValueExA(hkey, "ProgramFilesDir", 0, &type, (LPBYTE)PROG_FILES_DIR, &size)) {
2369 RegCloseKey(hkey);
2370 return FALSE;
2371 }
2372
2373 size = MAX_PATH;
2374 if (RegQueryValueExA(hkey, "CommonFilesDir (x86)", 0, &type, (LPBYTE)COMMON_FILES_DIR, &size) &&
2375 RegQueryValueExA(hkey, "CommonFilesDir", 0, &type, (LPBYTE)COMMON_FILES_DIR, &size)) {
2376 RegCloseKey(hkey);
2377 return FALSE;
2378 }
2379
2380 size = MAX_PATH;
2381 if (RegQueryValueExA(hkey, "ProgramFilesDir", 0, &type, (LPBYTE)PROG_FILES_DIR_NATIVE, &size)) {
2382 RegCloseKey(hkey);
2383 return FALSE;
2384 }
2385
2386 RegCloseKey(hkey);
2387
2389 return FALSE;
2390
2391 return TRUE;
2392}
#define RegCloseKey(hKey)
Definition: registry.h:49
LONG WINAPI RegOpenKeyExA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey, _In_ DWORD ulOptions, _In_ REGSAM samDesired, _Out_ PHKEY phkResult)
Definition: reg.c:3298
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:4009
UINT WINAPI GetWindowsDirectoryA(OUT LPSTR lpBuffer, IN UINT uSize)
Definition: path.c:2337
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
char WINDOWS_DIR[MAX_PATH]
Definition: install.c:54
#define KEY_QUERY_VALUE
Definition: nt_native.h:1016
unsigned char * LPBYTE
Definition: typedefs.h:53
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define KEY_WOW64_64KEY
Definition: cmtypes.h:46

Referenced by START_TEST().

◆ get_temp_file()

static BOOL CDECL get_temp_file ( char pszTempName,
int  cbTempName,
void pv 
)
static

Definition at line 2235 of file install.c.

2236{
2237 LPSTR tempname;
2238
2239 tempname = malloc(MAX_PATH);
2240 GetTempFileNameA(".", "xx", 0, tempname);
2241
2242 if (tempname && (strlen(tempname) < (unsigned)cbTempName))
2243 {
2244 lstrcpyA(pszTempName, tempname);
2245 free(tempname);
2246 return TRUE;
2247 }
2248
2249 free(tempname);
2250 return FALSE;
2251}
UINT WINAPI GetTempFileNameA(IN LPCSTR lpPathName, IN LPCSTR lpPrefixString, IN UINT uUnique, OUT LPSTR lpTempFileName)
Definition: filename.c:26
char * LPSTR
Definition: xmlstorage.h:182

Referenced by create_cab_file(), and create_cc_test_files().

◆ get_user_dirs()

BOOL get_user_dirs ( void  )

Definition at line 2338 of file install.c.

2339{
2340 HKEY hkey;
2341 DWORD type, size;
2342
2344 "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders", &hkey))
2345 return FALSE;
2346
2347 size = MAX_PATH;
2348 if(RegQueryValueExA(hkey, "AppData", 0, &type, (LPBYTE)APP_DATA_DIR, &size)){
2349 RegCloseKey(hkey);
2350 return FALSE;
2351 }
2352
2353 RegCloseKey(hkey);
2354 return TRUE;
2355}
LONG WINAPI RegOpenKeyA(HKEY hKey, LPCSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3234
char APP_DATA_DIR[MAX_PATH]
Definition: install.c:53
#define HKEY_CURRENT_USER
Definition: winreg.h:11

Referenced by START_TEST().

◆ is_process_elevated()

BOOL is_process_elevated ( void  )

Definition at line 2211 of file install.c.

2212{
2213 HANDLE token;
2215 DWORD size;
2216 BOOL ret;
2217
2221 return (ret && type == TokenElevationTypeFull);
2222}
BOOL WINAPI GetTokenInformation(HANDLE TokenHandle, TOKEN_INFORMATION_CLASS TokenInformationClass, LPVOID TokenInformation, DWORD TokenInformationLength, PDWORD ReturnLength)
Definition: security.c:411
BOOL WINAPI OpenProcessToken(HANDLE ProcessHandle, DWORD DesiredAccess, PHANDLE TokenHandle)
Definition: security.c:294
#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
enum _TOKEN_ELEVATION_TYPE TOKEN_ELEVATION_TYPE
@ TokenElevationTypeDefault
Definition: winnt_old.h:2515
@ TokenElevationTypeFull
Definition: winnt_old.h:2516
#define TOKEN_QUERY
Definition: setypes.h:928
@ TokenElevationType
Definition: setypes.h:983

Referenced by START_TEST(), test_adminimage(), test_adminprops(), test_allusers_prop(), test_cabisextracted(), test_continuouscabs(), test_currentworkingdir(), test_customaction51(), test_feature_override(), test_feature_tree(), test_file_in_use(), test_file_in_use_cab(), test_icon_table(), test_installed_prop(), test_installstate(), test_missingcab(), test_missingcomponent(), test_mixed_package(), test_mixedmedia(), test_MsiInstallProduct(), test_package_validation(), test_preselected(), test_propcase(), test_readonlyfile(), test_readonlyfile_cab(), test_remove_upgrade_code(), test_setdirproperty(), test_shared_component(), test_shortcut(), test_source_resolution(), test_sourcedirprop(), test_sourcefolder(), test_transformprop(), test_upgrade_code(), test_volume_props(), and test_wow64().

◆ load_resource()

static char * load_resource ( const char name)
static

Definition at line 2566 of file install.c.

2567{
2568 static char path[MAX_PATH];
2569 DWORD written;
2570 HANDLE file;
2571 HRSRC res;
2572 void *ptr;
2573
2574 GetTempFileNameA(".", name, 0, path);
2575
2577 ok(file != INVALID_HANDLE_VALUE, "file creation failed, at %s, error %lu\n", path, GetLastError());
2578
2579 res = FindResourceA(NULL, name, "TESTDLL");
2580 ok( res != 0, "couldn't find resource\n" );
2583 ok( written == SizeofResource( GetModuleHandleA(NULL), res ), "couldn't write resource\n" );
2584 CloseHandle( file );
2585
2586 return path;
2587}
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

Referenced by add_custom_dll().

◆ mem_alloc()

static void *CDECL mem_alloc ( ULONG  cb)
static

Definition at line 2110 of file install.c.

2111{
2112 return malloc(cb);
2113}

◆ mem_free()

static void CDECL mem_free ( void memory)
static

Definition at line 2115 of file install.c.

2116{
2117 free(memory);
2118}

◆ ok_callback()

static INT CALLBACK ok_callback ( void context,
UINT  message_type,
MSIHANDLE  record 
)
static

Definition at line 2589 of file install.c.

2590{
2591 if (message_type == INSTALLMESSAGE_USER)
2592 {
2593 char file[200];
2594 char msg[2000];
2595 DWORD len;
2596
2597 len = sizeof(file);
2599 len = sizeof(msg);
2601
2604
2605 return 1;
2606 }
2607 return 0;
2608}
#define ok_(x1, x2)
Definition: atltest.h:61
#define msg(x)
Definition: auth_time.c:54
return
Definition: dirsup.c:529
int WINAPI MsiRecordGetInteger(MSIHANDLE handle, UINT iField)
Definition: record.c:237
GLdouble s
Definition: gl.h:2039
#define todo_wine_if(is_todo)
Definition: custom.c:86
@ INSTALLMESSAGE_USER
Definition: msi.h:97

Referenced by add_custom_dll().

◆ pf_exists()

BOOL pf_exists ( const char file)

Definition at line 3526 of file install.c.

3527{
3529
3531 lstrcatA(path, "\\");
3532 lstrcatA(path, file);
3533
3534 return file_exists(path);
3535}
BOOL file_exists(const char *file)
Definition: install.c:3521

Referenced by test_feature_override(), test_missingcomponent(), test_shared_component(), and test_upgrade_code().

◆ process_pending_renames()

static void process_pending_renames ( HKEY  hkey)
static

Definition at line 5163 of file install.c.

5164{
5165 char *buf, *src, *dst, *buf2, *buf2ptr;
5166 DWORD size;
5167 LONG ret;
5168 BOOL found = FALSE;
5169
5171 ok(!ret, "RegQueryValueExA failed %ld\n", ret);
5172
5173 buf = malloc(size + 1);
5174 buf2ptr = buf2 = calloc(1, size + 1);
5175
5177 buf[size] = 0;
5178 ok(!ret, "RegQueryValueExA failed %ld\n", ret);
5179 if (ret) return;
5180
5181 for (src = buf; *src; src = dst + strlen(dst) + 1)
5182 {
5184 BOOL fileret;
5185
5186 dst = src + strlen(src) + 1;
5187
5188 if (!strstr(src, "msitest"))
5189 {
5190 lstrcpyA(buf2ptr, src);
5191 buf2ptr += strlen(src) + 1;
5192 lstrcpyA(buf2ptr, dst);
5193 buf2ptr += strlen(dst) + 1;
5194 continue;
5195 }
5196
5197 found = TRUE;
5198
5199 if (*dst == '!')
5200 {
5202 dst++;
5203 }
5204 if (src[0] == '\\' && src[1] == '?' && src[2] == '?' && src[3] == '\\') src += 4;
5205 if (*dst)
5206 {
5207 if (dst[0] == '\\' && dst[1] == '?' && dst[2] == '?' && dst[3] == '\\') dst += 4;
5208 fileret = MoveFileExA(src, dst, flags);
5209 ok(fileret, "Failed to move file %s -> %s (%lu)\n", src, dst, GetLastError());
5210 }
5211 else
5212 {
5213 fileret = DeleteFileA(src);
5214 ok(fileret, "Failed to delete file %s (%lu)\n", src, GetLastError());
5215 }
5216 }
5217
5218 ok(found, "Expected a 'msitest' entry\n");
5219
5220 if (*buf2)
5221 RegSetValueExA(hkey, rename_ops, 0, REG_MULTI_SZ, (LPBYTE)buf2, buf2ptr + 1 - buf2);
5222 else
5224
5225 free(buf);
5226 free(buf2);
5227}
char * strstr(char *String1, char *String2)
Definition: utclib.c:653
LONG WINAPI RegSetValueExA(HKEY hKey, LPCSTR lpValueName, DWORD Reserved, DWORD dwType, CONST BYTE *lpData, DWORD cbData)
Definition: reg.c:4799
LONG WINAPI RegDeleteValueA(HKEY hKey, LPCSTR lpValueName)
Definition: reg.c:2287
BOOL WINAPI MoveFileExA(IN LPCSTR lpExistingFileName, IN LPCSTR lpNewFileName OPTIONAL, IN DWORD dwFlags)
Definition: move.c:1153
#define MOVEFILE_REPLACE_EXISTING
Definition: filesup.h:28
#define MOVEFILE_COPY_ALLOWED
Definition: filesup.h:29
GLenum src
Definition: glext.h:6340
GLenum GLenum dst
Definition: glext.h:6340
GLbitfield flags
Definition: glext.h:7161
static const char rename_ops[]
Definition: install.c:5161
#define REG_MULTI_SZ
Definition: nt_native.h:1501
long LONG
Definition: pedump.c:60
#define calloc
Definition: rosglue.h:14

Referenced by test_file_in_use(), and test_file_in_use_cab().

◆ progress()

static LONG CDECL progress ( UINT  typeStatus,
ULONG  cb1,
ULONG  cb2,
void pv 
)
static

Definition at line 2126 of file install.c.

2127{
2128 return 0;
2129}

◆ run_query()

UINT run_query ( MSIHANDLE  hdb,
MSIHANDLE  hrec,
const char query 
)

Definition at line 3559 of file install.c.

3560{
3561 MSIHANDLE hview = 0;
3562 UINT r;
3563
3564 r = MsiDatabaseOpenViewA(hdb, query, &hview);
3565 if(r != ERROR_SUCCESS)
3566 return r;
3567
3568 r = MsiViewExecute(hview, hrec);
3569 if(r == ERROR_SUCCESS)
3570 r = MsiViewClose(hview);
3571 MsiCloseHandle(hview);
3572 return r;
3573}
UINT WINAPI MsiViewClose(MSIHANDLE hView)
Definition: msiquery.c:469
UINT WINAPI MsiViewExecute(MSIHANDLE hView, MSIHANDLE hRec)
Definition: msiquery.c:518
UINT WINAPI MsiDatabaseOpenViewA(MSIHANDLE hdb, const char *szQuery, MSIHANDLE *phView)
Definition: msiquery.c:88

Referenced by add_custom_dll(), generate_transform(), test_customaction1(), and test_icon_table().

◆ set_admin_property_stream()

static void set_admin_property_stream ( LPCSTR  file)
static

Definition at line 3893 of file install.c.

3894{
3895 IStorage *stg;
3896 IStream *stm;
3898 HRESULT hr;
3899 DWORD count;
3901
3903
3904 hr = StgOpenStorage(fileW, NULL, mode, NULL, 0, &stg);
3905 ok(hr == S_OK, "Expected S_OK, got %#lx\n", hr);
3906 if (!stg)
3907 return;
3908
3909 hr = IStorage_CreateStream(stg, L"\x41ca\x4330\x3e71\x44b5\x4233\x45f5\x422c\x4836",
3910 STGM_WRITE | STGM_SHARE_EXCLUSIVE, 0, 0, &stm);
3911 ok(hr == S_OK, "Expected S_OK, got %#lx\n", hr);
3912
3913 hr = IStream_Write(stm, L"MYPROP=2718 MyProp=42", sizeof(L"MYPROP=2718 MyProp=42"), &count);
3914 ok(hr == S_OK, "Expected S_OK, got %#lx\n", hr);
3915
3916 IStream_Release(stm);
3917 IStorage_Release(stg);
3918}
HRESULT WINAPI StgOpenStorage(const OLECHAR *pwcsName, IStorage *pstgPriority, DWORD grfMode, SNB snbExclude, DWORD reserved, IStorage **ppstgOpen)
Definition: storage32.c:8755
static const WCHAR fileW[]
Definition: url.c:111
#define L(x)
Definition: ntvdm.h:50
HRESULT hr
Definition: shlfolder.c:183

Referenced by test_adminprops().

◆ set_admin_summary_info()

static void set_admin_summary_info ( const WCHAR name)
static

Definition at line 3826 of file install.c.

3827{
3828 MSIHANDLE db, summary;
3829 UINT r;
3830
3832 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3833
3834 r = MsiGetSummaryInformationA(db, NULL, 1, &summary);
3835 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3836
3838 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3839
3840 /* write the summary changes back to the stream */
3841 r = MsiSummaryInfoPersist(summary);
3842 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3843
3844 MsiCloseHandle(summary);
3845
3846 r = MsiDatabaseCommit(db);
3847 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3848
3849 MsiCloseHandle(db);
3850}
@ VT_I4
Definition: compat.h:2298
UINT WINAPI MsiSummaryInfoSetPropertyA(MSIHANDLE handle, UINT uiProperty, UINT uiDataType, INT iValue, FILETIME *pftValue, const char *szValue)
Definition: suminfo.c:942
UINT WINAPI MsiGetSummaryInformationA(MSIHANDLE hDatabase, const char *szDatabase, UINT uiUpdateCount, MSIHANDLE *pHandle)
Definition: suminfo.c:589
UINT WINAPI MsiSummaryInfoPersist(MSIHANDLE handle)
Definition: suminfo.c:1227
#define PID_WORDCOUNT
Definition: suminfo.c:57
#define MSIDBOPEN_DIRECT
Definition: msiquery.h:68

Referenced by test_admin(), and test_adminprops().

◆ set_cab_parameters()

static void set_cab_parameters ( PCCAB  pCabParams,
const CHAR name,
DWORD  max_size 
)
static

Definition at line 2294 of file install.c.

2295{
2296 ZeroMemory(pCabParams, sizeof(CCAB));
2297
2298 pCabParams->cb = max_size;
2299 pCabParams->cbFolderThresh = FOLDER_THRESHOLD;
2300 pCabParams->setID = 0xbeef;
2301 pCabParams->iCab = 1;
2302 lstrcpyA(pCabParams->szCabPath, CURR_DIR);
2303 lstrcatA(pCabParams->szCabPath, "\\");
2304 lstrcpyA(pCabParams->szCab, name);
2305}
#define FOLDER_THRESHOLD
Definition: install.c:2106
ULONG cbFolderThresh
Definition: fci.h:146
USHORT setID
Definition: fci.h:157
char szCabPath[CB_MAX_CAB_PATH]
Definition: fci.h:161
ULONG cb
Definition: fci.h:145

Referenced by create_cab_file(), and create_cc_test_files().

◆ set_transform_summary_info()

static void set_transform_summary_info ( void  )
static

Definition at line 3575 of file install.c.

3576{
3577 UINT r;
3578 MSIHANDLE suminfo = 0;
3579
3580 /* build summary info */
3582 ok(r == ERROR_SUCCESS , "Failed to open summaryinfo\n");
3583
3585 ok(r == ERROR_SUCCESS, "Failed to set summary info\n");
3586
3588 "{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}1.1.1;"
3589 "{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}1.1.1;"
3590 "{4C0EAA15-0264-4E5A-8758-609EF142B92D}");
3591 ok(r == ERROR_SUCCESS , "Failed to set summary info\n");
3592
3594 ok(r == ERROR_SUCCESS, "Failed to set summary info\n");
3595
3597 ok(r == ERROR_SUCCESS , "Failed to make summary info persist\n");
3598
3600 ok(r == ERROR_SUCCESS , "Failed to close suminfo\n");
3601}
static const CHAR suminfo[]
Definition: db.c:2166
@ VT_LPSTR
Definition: compat.h:2324
#define PID_PAGECOUNT
Definition: suminfo.c:56
#define PID_TITLE
Definition: suminfo.c:44
#define PID_REVNUMBER
Definition: suminfo.c:51

Referenced by generate_transform_manual().

◆ START_TEST()

START_TEST ( install  )

Definition at line 6184 of file install.c.

6185{
6186 DWORD len;
6187 char temp_path[MAX_PATH], prev_path[MAX_PATH], log_file[MAX_PATH];
6188
6190
6191 subtest("custom");
6192
6194
6195 GetCurrentDirectoryA(MAX_PATH, prev_path);
6198
6201
6202 if(len && (CURR_DIR[len - 1] == '\\'))
6203 CURR_DIR[len - 1] = 0;
6204
6205 ok(get_system_dirs(), "failed to retrieve system dirs\n");
6206 ok(get_user_dirs(), "failed to retrieve user dirs\n");
6207
6208 /* Create only one log file and don't append. We have to pass something
6209 * for the log mode for this to work. The logfile needs to have an absolute
6210 * path otherwise we still end up with some extra logfiles as some tests
6211 * change the current directory.
6212 */
6214 lstrcatA(log_file, "\\msitest.log");
6216
6221 test_caborder();
6231 test_admin();
6242 test_propcase();
6244 test_shortcut();
6260 test_wow64();
6262
6265 SetCurrentDirectoryA(prev_path);
6266}
#define IsWow64Process
Definition: compat.h:760
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:1882
UNICODE_STRING log_file
Definition: btrfs.c:89
void restart_as_admin_elevated(void)
Definition: action.c:6478
static void test_volume_props(void)
Definition: install.c:5904
static void test_shared_component(void)
Definition: install.c:5930
static void test_sourcedirprop(void)
Definition: install.c:4718
static void test_packagecoltypes(void)
Definition: install.c:2905
static void test_upgrade_code(void)
Definition: install.c:5719
static void test_continuouscabs(void)
Definition: install.c:3021
static void test_sourcepath(void)
Definition: install.c:4582
static void test_propcase(void)
Definition: install.c:4841
static void test_remove_upgrade_code(void)
Definition: install.c:5974
static void test_int_widths(void)
Definition: install.c:4884
static void test_admin(void)
Definition: install.c:3852
static void test_icon_table(void)
Definition: install.c:5446
static void test_uiLevelFlags(void)
Definition: install.c:3286
static void test_installed_prop(void)
Definition: install.c:5049
static void test_setdirproperty(void)
Definition: install.c:3440
static void test_allusers_prop(void)
Definition: install.c:5089
static void test_customaction1(void)
Definition: install.c:4087
BOOL get_user_dirs(void)
Definition: install.c:2338
static void test_preselected(void)
Definition: install.c:4994
static void test_file_in_use(void)
Definition: install.c:5247
static void test_wow64(void)
Definition: install.c:6095
static BOOL is_wow64
Definition: install.c:39
BOOL get_system_dirs(void)
Definition: install.c:2357
static void test_feature_tree(void)
Definition: install.c:6025
static void test_MsiSetComponentState(void)
Definition: install.c:2856
static void test_adminprops(void)
Definition: install.c:3920
static void test_currentworkingdir(void)
Definition: install.c:3760
static void test_adminimage(void)
Definition: install.c:4770
static void test_deferred_action(void)
Definition: install.c:6066
static void test_samesequence(void)
Definition: install.c:3257
static void test_MsiInstallProduct(void)
Definition: install.c:2671
static void test_transformprop(void)
Definition: install.c:3714
BOOL is_process_elevated(void)
Definition: install.c:2211
static void test_readonlyfile_cab(void)
Definition: install.c:3379
static void test_package_validation(void)
Definition: install.c:5528
static void test_sourcefolder(void)
Definition: install.c:4041
static void test_file_in_use_cab(void)
Definition: install.c:5306
static void test_cabisextracted(void)
Definition: install.c:3473
static void test_mixedmedia(void)
Definition: install.c:3214
static void test_feature_override(void)
Definition: install.c:5369
static void test_installstate(void)
Definition: install.c:4177
static void test_shortcut(void)
Definition: install.c:4946
static void test_caborder(void)
Definition: install.c:3128
static void test_customaction51(void)
Definition: install.c:4144
static void test_readonlyfile(void)
Definition: install.c:3331
static void test_missingcomponent(void)
Definition: install.c:4663
static void test_mixed_package(void)
Definition: install.c:5751
static void test_source_resolution(void)
Definition: install.c:6155
static void test_missingcab(void)
Definition: install.c:3971
@ INSTALLLOGMODE_FATALEXIT
Definition: msi.h:131
char temp_path[MAX_PATH]
Definition: mspatcha.c:123
#define subtest
Definition: test.h:160

◆ test_admin()

static void test_admin ( void  )
static

Definition at line 3852 of file install.c.

3853{
3854 UINT r;
3855
3856 CreateDirectoryA("msitest", NULL);
3857 create_file("msitest\\augustus", 500);
3858
3861
3863
3866 {
3867 skip("Not enough rights to perform tests\n");
3868 goto error;
3869 }
3870 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3871 ok(!delete_pf("msitest\\augustus", TRUE), "File installed\n");
3872 ok(!delete_pf("msitest", FALSE), "Directory created\n");
3873 ok(!DeleteFileA("c:\\msitest\\augustus"), "File installed\n");
3874 ok(!RemoveDirectoryA("c:\\msitest"), "File installed\n");
3875
3876 r = MsiInstallProductA(msifile, "ACTION=ADMIN");
3877 todo_wine
3878 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3879 ok(!delete_pf("msitest\\augustus", TRUE), "File installed\n");
3880 ok(!delete_pf("msitest", FALSE), "Directory created\n");
3881 todo_wine
3882 {
3883 ok(DeleteFileA("c:\\msitest\\augustus"), "File not installed\n");
3884 ok(RemoveDirectoryA("c:\\msitest"), "File not installed\n");
3885 }
3886
3887error:
3889 DeleteFileA("msitest\\augustus");
3890 RemoveDirectoryA("msitest");
3891}
#define skip(...)
Definition: atltest.h:64
UINT WINAPI MsiInstallProductA(LPCSTR szPackagePath, LPCSTR szCommandLine)
Definition: msi.c:198
INSTALLUILEVEL WINAPI MsiSetInternalUI(INSTALLUILEVEL dwUILevel, HWND *phWnd)
Definition: msi.c:2281
#define error(str)
Definition: mkdosfs.c:1605
static void set_admin_summary_info(const WCHAR *name)
Definition: install.c:3826
static const msi_table adm_tables[]
Definition: install.c:1708
#define create_database(name, tables, num_tables)
Definition: utils.h:42
@ INSTALLUILEVEL_NONE
Definition: msi.h:66
#define ERROR_INSTALL_PACKAGE_REJECTED
Definition: winerror.h:983

Referenced by START_TEST().

◆ test_adminimage()

static void test_adminimage ( void  )
static

Definition at line 4770 of file install.c.

4771{
4772 UINT r;
4773
4774 if (!is_process_elevated())
4775 {
4776 skip("process is limited\n");
4777 return;
4778 }
4779
4780 CreateDirectoryA("msitest", NULL);
4781 CreateDirectoryA("msitest\\first", NULL);
4782 CreateDirectoryA("msitest\\second", NULL);
4783 CreateDirectoryA("msitest\\cabout", NULL);
4784 CreateDirectoryA("msitest\\cabout\\new", NULL);
4785 create_file("msitest\\one.txt", 100);
4786 create_file("msitest\\first\\two.txt", 100);
4787 create_file("msitest\\second\\three.txt", 100);
4788 create_file("msitest\\cabout\\four.txt", 100);
4789 create_file("msitest\\cabout\\new\\five.txt", 100);
4790 create_file("msitest\\filename", 100);
4791
4794 "{004757CA-5092-49C2-AD20-28E1CE0DF5F2}");
4795
4797
4800 {
4801 skip("Not enough rights to perform tests\n");
4802 goto error;
4803 }
4804 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4805
4807
4808 create_file("four.txt", 100);
4809 create_file("five.txt", 100);
4810 create_cab_file("msitest.cab", MEDIA_SIZE, "four.txt\0five.txt\0");
4813 ";1033", "{004757CA-5092-49C2-AD20-28E1CE0DF5F2}");
4814
4816
4818 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4819
4820 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
4821 ok(delete_pf("msitest\\cabout\\new", FALSE), "Directory not created\n");
4822 ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
4823 ok(delete_pf("msitest\\cabout", FALSE), "Directory not created\n");
4824 ok(delete_pf("msitest", FALSE), "Directory not created\n");
4825
4826error:
4827 DeleteFileA("msifile");
4828 DeleteFileA("msitest\\cabout\\new\\five.txt");
4829 DeleteFileA("msitest\\cabout\\four.txt");
4830 DeleteFileA("msitest\\second\\three.txt");
4831 DeleteFileA("msitest\\first\\two.txt");
4832 DeleteFileA("msitest\\one.txt");
4833 DeleteFileA("msitest\\filename");
4834 RemoveDirectoryA("msitest\\cabout\\new");
4835 RemoveDirectoryA("msitest\\cabout");
4836 RemoveDirectoryA("msitest\\second");
4837 RemoveDirectoryA("msitest\\first");
4838 RemoveDirectoryA("msitest");
4839}
static void delete_pf_files(void)
Definition: install.c:2510
static const msi_table ai2_tables[]
Definition: install.c:1836
static const msi_table ai_tables[]
Definition: install.c:1824
void create_database_wordcount(const CHAR *name, const msi_table *tables, int num_tables, INT version, INT wordcount, const char *template, const char *packagecode)
Definition: install.c:2633
@ msidbSumInfoSourceTypeAdminImage
Definition: msidefs.h:223
@ msidbSumInfoSourceTypeCompressed
Definition: msidefs.h:222

Referenced by START_TEST().

◆ test_adminprops()

static void test_adminprops ( void  )
static

Definition at line 3920 of file install.c.

3921{
3922 UINT r;
3923
3924 if (!is_process_elevated())
3925 {
3926 skip("process is limited\n");
3927 return;
3928 }
3929
3930 CreateDirectoryA("msitest", NULL);
3931 create_file("msitest\\augustus", 500);
3932
3936
3938
3941 {
3942 skip("Not enough rights to perform tests\n");
3943 goto error;
3944 }
3945 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3946 ok(delete_pf("msitest\\augustus", TRUE), "File installed\n");
3947 ok(delete_pf("msitest", FALSE), "Directory created\n");
3948
3949error:
3951 DeleteFileA("msitest\\augustus");
3952 RemoveDirectoryA("msitest");
3953}
static const msi_table amp_tables[]
Definition: install.c:1722
static void set_admin_property_stream(LPCSTR file)
Definition: install.c:3893

Referenced by START_TEST().

◆ test_allusers_prop()

static void test_allusers_prop ( void  )
static

Definition at line 5089 of file install.c.

5090{
5091 UINT r;
5092
5093 if (!is_process_elevated())
5094 {
5095 skip("process is limited\n");
5096 return;
5097 }
5098
5101
5103
5104 /* ALLUSERS property unset */
5105 r = MsiInstallProductA(msifile, "FULL=1");
5107 {
5108 skip("Not enough rights to perform tests\n");
5109 goto error;
5110 }
5111 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5112
5114
5115 r = MsiInstallProductA(msifile, "REMOVE=ALL");
5116 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5117
5119
5122
5123 /* ALLUSERS property set to 1 */
5124 r = MsiInstallProductA(msifile, "FULL=1");
5125 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5126
5128
5129 r = MsiInstallProductA(msifile, "REMOVE=ALL");
5130 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5131
5133
5136
5137 /* ALLUSERS property set to 2 */
5138 r = MsiInstallProductA(msifile, "FULL=1");
5139 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5140
5142
5143 r = MsiInstallProductA(msifile, "REMOVE=ALL");
5144 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5145
5147
5150
5151 /* ALLUSERS property set to 2, conditioned on ALLUSERS = 1 */
5152 r = MsiInstallProductA(msifile, "FULL=1");
5153 ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n", r);
5154
5155error:
5158}
static const msi_table aup2_tables[]
Definition: install.c:1886
static void delete_test_files(void)
Definition: install.c:2497
static const msi_table aup4_tables[]
Definition: install.c:1912
static void create_test_files(void)
Definition: install.c:2414
static const msi_table aup3_tables[]
Definition: install.c:1899
static const msi_table aup_tables[]
Definition: install.c:1873
#define ERROR_INSTALL_FAILURE
Definition: winerror.h:961

Referenced by START_TEST().

◆ test_cabisextracted()

static void test_cabisextracted ( void  )
static

Definition at line 3473 of file install.c.

3474{
3475 UINT r;
3476
3477 if (!is_process_elevated())
3478 {
3479 skip("process is limited\n");
3480 return;
3481 }
3482
3483 CreateDirectoryA("msitest", NULL);
3484 create_file("msitest\\gaius", 500);
3485 create_file("maximus", 500);
3486 create_file("augustus", 500);
3487 create_file("caesar", 500);
3488
3489 create_cab_file("test1.cab", MEDIA_SIZE, "maximus\0");
3490 create_cab_file("test2.cab", MEDIA_SIZE, "augustus\0");
3491 create_cab_file("test3.cab", MEDIA_SIZE, "caesar\0");
3492
3494
3496
3499 {
3500 skip("Not enough rights to perform tests\n");
3501 goto error;
3502 }
3503 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3504 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
3505 ok(delete_pf("msitest\\augustus", TRUE), "File not installed\n");
3506 ok(delete_pf("msitest\\caesar", TRUE), "File not installed\n");
3507 ok(delete_pf("msitest\\gaius", TRUE), "File not installed\n");
3508 ok(delete_pf("msitest", FALSE), "Directory not created\n");
3509
3510error:
3511 /* Delete the files in the temp (current) folder */
3514 DeleteFileA("maximus");
3515 DeleteFileA("augustus");
3516 DeleteFileA("caesar");
3517 DeleteFileA("msitest\\gaius");
3518 RemoveDirectoryA("msitest");
3519}
static const msi_table cie_tables[]
Definition: install.c:1672
void delete_cab_files(void)
Definition: install.c:3003

Referenced by START_TEST().

◆ test_caborder()

static void test_caborder ( void  )
static

Definition at line 3128 of file install.c.

3129{
3130 UINT r;
3131
3132 create_file("imperator", 100);
3133 create_file("maximus", 500);
3134 create_file("augustus", 50000);
3135 create_file("caesar", 500);
3136
3138
3140
3141 create_cab_file("test1.cab", MEDIA_SIZE, "maximus\0");
3142 create_cab_file("test2.cab", MEDIA_SIZE, "augustus\0");
3143 create_cab_file("test3.cab", MEDIA_SIZE, "caesar\0");
3144
3147 {
3148 skip("Not enough rights to perform tests\n");
3149 goto error;
3150 }
3151 ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n", r);
3152 ok(!delete_pf("msitest\\augustus", TRUE), "File is installed\n");
3153 ok(!delete_pf("msitest\\caesar", TRUE), "File is installed\n");
3154 todo_wine
3155 {
3156 ok(!delete_pf("msitest\\maximus", TRUE), "File is installed\n");
3157 ok(!delete_pf("msitest", FALSE), "Directory is created\n");
3158 }
3159
3161
3162 create_cab_file("test1.cab", MEDIA_SIZE, "imperator\0");
3163 create_cab_file("test2.cab", MEDIA_SIZE, "maximus\0augustus\0");
3164 create_cab_file("test3.cab", MEDIA_SIZE, "caesar\0");
3165
3167 ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n", r);
3168 ok(!delete_pf("msitest\\maximus", TRUE), "File is installed\n");
3169 ok(!delete_pf("msitest\\augustus", TRUE), "File is installed\n");
3170 ok(!delete_pf("msitest\\caesar", TRUE), "File is installed\n");
3171 ok(!delete_pf("msitest", FALSE), "Directory is created\n");
3172
3175
3178
3180 ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n", r);
3181 ok(!delete_pf("msitest\\caesar", TRUE), "File is installed\n");
3182 ok(!delete_pf("msitest", FALSE), "Directory is created\n");
3183 todo_wine
3184 {
3185 ok(!delete_pf("msitest\\augustus", TRUE), "File is installed\n");
3186 ok(!delete_pf("msitest\\maximus", TRUE), "File is installed\n");
3187 }
3188
3191
3194
3196 ok(!delete_pf("msitest\\caesar", TRUE), "File is installed\n");
3197 ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n", r);
3198 todo_wine
3199 {
3200 ok(!delete_pf("msitest\\augustus", TRUE), "File is installed\n");
3201 ok(!delete_pf("msitest\\maximus", TRUE), "File is installed\n");
3202 ok(!delete_pf("msitest", FALSE), "Directory is created\n");
3203 }
3204
3205error:
3207 DeleteFileA("imperator");
3208 DeleteFileA("maximus");
3209 DeleteFileA("augustus");
3210 DeleteFileA("caesar");
3212}
static const msi_table cc_tables[]
Definition: install.c:1537
static void create_cc_test_files(void)
Definition: install.c:2960
static const msi_table co_tables[]
Definition: install.c:1573
static const msi_table co2_tables[]
Definition: install.c:1585

Referenced by START_TEST().

◆ test_continuouscabs()

static void test_continuouscabs ( void  )
static

Definition at line 3021 of file install.c.

3022{
3023 UINT r;
3024
3025 if (!is_process_elevated())
3026 {
3027 skip("process is limited\n");
3028 return;
3029 }
3030
3033
3035
3038 {
3039 skip("Not enough rights to perform tests\n");
3040 goto error;
3041 }
3042 else
3043 {
3044 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3045 ok(delete_pf("msitest\\augustus", TRUE), "File not installed\n");
3046 ok(delete_pf("msitest\\caesar", TRUE), "File not installed\n");
3047 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
3048 ok(delete_pf("msitest", FALSE), "Directory not created\n");
3049 }
3050
3053
3056
3058
3061 {
3062 skip("Not enough rights to perform tests\n");
3063 }
3064 else
3065 {
3066 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3067 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
3068 ok(!delete_pf("msitest\\augustus", TRUE), "File installed\n");
3069 ok(delete_pf("msitest\\tiberius", TRUE), "File not installed\n");
3070 ok(delete_pf("msitest\\caesar", TRUE), "File not installed\n");
3071 ok(delete_pf("msitest", FALSE), "Directory not created\n");
3072 }
3073
3076
3077 /* Tests to show that only msi cab filename is taken in case of mismatch with the one given by previous cab */
3078
3079 /* Filename from cab is right and the one from msi is wrong */
3082
3084
3087 {
3088 skip("Not enough rights to perform tests\n");
3089 }
3090 else
3091 {
3092 ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n", r);
3093 todo_wine ok(!delete_pf("msitest\\augustus", TRUE), "File installed\n");
3094 ok(!delete_pf("msitest\\caesar", TRUE), "File installed\n");
3095 todo_wine ok(!delete_pf("msitest\\maximus", TRUE), "File installed\n");
3096 todo_wine ok(!delete_pf("msitest", FALSE), "Directory created\n");
3097 }
3098
3101
3102 /* Filename from msi is right and the one from cab is wrong */
3104 ok(MoveFileA("test2.cab", "test2_.cab"), "Cannot rename test2.cab to test2_.cab\n");
3106
3108
3111 {
3112 skip("Not enough rights to perform tests\n");
3113 }
3114 else
3115 {
3116 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3117 ok(delete_pf("msitest\\augustus", TRUE), "File not installed\n");
3118 ok(delete_pf("msitest\\caesar", TRUE), "File not installed\n");
3119 ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
3120 ok(delete_pf("msitest", FALSE), "Directory not created\n");
3121 }
3122
3123error:
3126}
BOOL WINAPI MoveFileA(IN LPCSTR lpExistingFileName, IN LPCSTR lpNewFileName)
Definition: move.c:1137
static const msi_table cc3_tables[]
Definition: install.c:1561
static const msi_table cc2_tables[]
Definition: install.c:1549

Referenced by START_TEST().

◆ test_currentworkingdir()

static void test_currentworkingdir ( void  )
static

Definition at line 3760 of file install.c.

3761{
3762 UINT r;
3764 LPSTR ptr;
3765
3766 if (!is_process_elevated())
3767 {
3768 skip("process is limited\n");
3769 return;
3770 }
3771
3772 CreateDirectoryA("msitest", NULL);
3773 create_file("msitest\\augustus", 500);
3774
3776
3778
3779 CreateDirectoryA("diffdir", NULL);
3780 SetCurrentDirectoryA("diffdir");
3781
3782 sprintf(path, "..\\%s", msifile);
3784 todo_wine
3785 {
3786 ok(r == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %u\n", r);
3787 ok(!delete_pf("msitest\\augustus", TRUE), "File installed\n");
3788 ok(!delete_pf("msitest", FALSE), "Directory created\n");
3789 }
3790
3791 sprintf(path, "%s\\%s", CURR_DIR, msifile);
3794 {
3795 skip("Not enough rights to perform tests\n");
3796 goto error;
3797 }
3798 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3799 ok(delete_pf("msitest\\augustus", TRUE), "File not installed\n");
3800 ok(delete_pf("msitest", FALSE), "Directory not created\n");
3801
3803 drive[2] = '\\';
3804 drive[3] = '\0';
3806
3808 if (path[lstrlenA(path) - 1] != '\\') lstrcatA(path, "\\");
3810 ptr = strchr(path, ':');
3811 ptr +=2;
3812
3814 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3815 ok(delete_pf("msitest\\augustus", TRUE), "File not installed\n");
3816 ok(delete_pf("msitest", FALSE), "Directory not created\n");
3817
3818error:
3821 DeleteFileA("msitest\\augustus");
3822 RemoveDirectoryA("msitest");
3823 RemoveDirectoryA("diffdir");
3824}
char * strchr(const char *String, int ch)
Definition: utclib.c:501
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
static const msi_table cwd_tables[]
Definition: install.c:1696

Referenced by START_TEST().

◆ test_customaction1()

static void test_customaction1 ( void  )
static

Definition at line 4087 of file install.c.

4088{
4089 MSIHANDLE hdb, record;
4090 UINT r;
4091
4094
4095 /* create a test table */
4097 run_query(hdb, 0, "CREATE TABLE `Test` (`Name` CHAR(10), `Number` INTEGER, `Data` OBJECT PRIMARY KEY `Name`)");
4098 create_file("unus", 10);
4099 create_file("duo", 10);
4101 MsiRecordSetStreamA(record, 1, "unus");
4102 run_query(hdb, record, "INSERT INTO `Test` (`Name`, `Number`, `Data`) VALUES ('one', 1, ?)");
4103 MsiRecordSetStreamA(record, 1, "duo");
4104 run_query(hdb, record, "INSERT INTO `Test` (`Name`, `Number`, `Data`) VALUES ('two', 2, ?)");
4105 MsiDatabaseCommit(hdb);
4106 MsiCloseHandle(hdb);
4107
4109
4110 r = MsiInstallProductA(msifile, "MAIN_TEST=1");
4111 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4112
4113 /* Test return values */
4114 r = MsiInstallProductA(msifile, "TEST_RETVAL=0");
4115 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4116
4117 r = MsiInstallProductA(msifile, "TEST_RETVAL=1626"); /* ERROR_FUNCTION_NOT_CALLED */
4118 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4119
4120 r = MsiInstallProductA(msifile, "TEST_RETVAL=1602");
4121 ok(r == ERROR_INSTALL_USEREXIT, "Expected ERROR_INSTALL_USEREXIT, got %u\n", r);
4122
4123 r = MsiInstallProductA(msifile, "TEST_RETVAL=259"); /* ERROR_NO_MORE_ITEMS */
4124 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4125
4126 /* any other error maps to ERROR_INSTALL_FAILURE */
4127 r = MsiInstallProductA(msifile, "TEST_RETVAL=1");
4128 ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n", r);
4129
4130 /* Custom actions execute in the same process, but they don't retain state */
4131 r = MsiInstallProductA(msifile, "TEST_PROCESS=1");
4132 ok(!r, "got %u\n", r);
4133
4134 /* test asynchronous actions (msidbCustomActionTypeAsync) */
4135 r = MsiInstallProductA(msifile, "TEST_ASYNC=1");
4136 ok(!r, "got %u\n", r);
4137
4140 DeleteFileA("unus");
4141 DeleteFileA("duo");
4142}
static const msi_table ca1_tables[]
Definition: install.c:1759
#define ERROR_INSTALL_USEREXIT
Definition: winerror.h:960

Referenced by START_TEST().

◆ test_customaction51()

static void test_customaction51 ( void  )
static

Definition at line 4144 of file install.c.

4145{
4146 UINT r;
4147
4148 if (!is_process_elevated())
4149 {
4150 skip("process is limited\n");
4151 return;
4152 }
4153
4154 CreateDirectoryA("msitest", NULL);
4155 create_file("msitest\\augustus", 500);
4156
4158
4160
4163 {
4164 skip("Not enough rights to perform tests\n");
4165 goto error;
4166 }
4167 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4168 ok(delete_pf("msitest\\augustus", TRUE), "File installed\n");
4169 ok(delete_pf("msitest", FALSE), "Directory created\n");
4170
4171error:
4173 DeleteFileA("msitest\\augustus");
4174 RemoveDirectoryA("msitest");
4175}
static const msi_table ca51_tables[]
Definition: install.c:1775

Referenced by START_TEST().

◆ test_deferred_action()

static void test_deferred_action ( void  )
static

Definition at line 6066 of file install.c.

6067{
6068 char path[200], file[200], buffer[211];
6069 UINT r;
6070
6071 GetTempPathA(sizeof(path), path);
6072 GetTempFileNameA(path, "da", 0, file);
6073 sprintf(buffer, "TESTPATH=\"%s\"", file);
6074
6076
6078
6081 {
6082 skip("Not enough rights to perform tests\n");
6083 goto error;
6084 }
6085 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
6086
6087 check_file_matches(file, "onetwo");
6088
6089 ok(DeleteFileA(file), "Directory not created\n");
6090
6091error:
6093}
static const msi_table da_tables[]
Definition: install.c:2064
static void check_file_matches(const char *filename, const char *text)
Definition: install.c:6054

Referenced by START_TEST().

◆ test_feature_override()

static void test_feature_override ( void  )
static

Definition at line 5369 of file install.c.

5370{
5371 UINT r;
5373
5374 if (!is_process_elevated())
5375 {
5376 skip("process is limited\n");
5377 return;
5378 }
5379
5381 create_file("msitest\\override.txt", 1000);
5382 create_file("msitest\\preselected.txt", 1000);
5383 create_file("msitest\\notpreselected.txt", 1000);
5385
5386 if (is_wow64)
5388
5390
5391 r = MsiInstallProductA(msifile, "ADDLOCAL=override");
5393 {
5394 skip("Not enough rights to perform tests\n");
5395 goto error;
5396 }
5397 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5398
5399 ok(pf_exists("msitest\\override.txt"), "file not installed\n");
5400 ok(!pf_exists("msitest\\preselected.txt"), "file installed\n");
5401 ok(!pf_exists("msitest\\notpreselected.txt"), "file installed\n");
5402
5403 r = MsiInstallProductA(msifile, "REMOVE=ALL");
5404 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5405
5406 ok(!delete_pf("msitest\\override.txt", TRUE), "file not removed\n");
5407
5408 r = MsiInstallProductA(msifile, "preselect=1");
5409 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5410
5411 ok(pf_exists("msitest\\override.txt"), "file not installed\n");
5412 ok(pf_exists("msitest\\preselected.txt"), "file not installed\n");
5413 ok(!pf_exists("msitest\\notpreselected.txt"), "file installed\n");
5414
5415 r = MsiInstallProductA(msifile, "REMOVE=ALL");
5416 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5417
5418 ok(!delete_pf("msitest\\override.txt", TRUE), "file not removed\n");
5419 ok(!delete_pf("msitest\\preselected.txt", TRUE), "file not removed\n");
5420 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
5421
5423 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5424
5425 ok(pf_exists("msitest\\override.txt"), "file not installed\n");
5426 ok(pf_exists("msitest\\preselected.txt"), "file not installed\n");
5427 ok(!pf_exists("msitest\\notpreselected.txt"), "file installed\n");
5428
5429 r = MsiInstallProductA(msifile, "REMOVE=ALL");
5430 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5431
5432 ok(!delete_pf("msitest\\override.txt", TRUE), "file not removed\n");
5433 ok(!delete_pf("msitest\\preselected.txt", TRUE), "file not removed\n");
5434 ok(!delete_pf("msitest", FALSE), "directory not removed\n");
5435
5436 RegDeleteKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\msitest", access, 0);
5437
5438error:
5439 DeleteFileA("msitest\\override.txt");
5440 DeleteFileA("msitest\\preselected.txt");
5441 DeleteFileA("msitest\\notpreselected.txt");
5444}
LONG WINAPI RegDeleteKeyExA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey, _In_ REGSAM samDesired, _In_ DWORD Reserved)
Definition: reg.c:1254
GLuint GLint GLboolean GLint GLenum access
Definition: glext.h:7866
BOOL pf_exists(const char *file)
Definition: install.c:3526
static const msi_table fo_tables[]
Definition: install.c:1949
#define KEY_ALL_ACCESS
Definition: nt_native.h:1041
ACCESS_MASK REGSAM
Definition: winreg.h:69

Referenced by START_TEST().

◆ test_feature_tree()

static void test_feature_tree ( void  )
static

Definition at line 6025 of file install.c.

6026{
6027 UINT r;
6028
6029 if (!is_process_elevated())
6030 {
6031 skip( "process is limited\n" );
6032 return;
6033 }
6034
6035 create_file( "msitest\\featuretree.txt", 1000 );
6037
6039
6040 r = MsiInstallProductA( msifile, "INSTALLTYPE=\"0\"" );
6041 ok( r == ERROR_INSTALL_FAILURE, "got %u\n", r );
6042
6043 r = MsiInstallProductA( msifile, "INSTALLTYPE=\"1\"" );
6044 ok( r == ERROR_SUCCESS, "got %u\n", r );
6045
6046 r = MsiInstallProductA( msifile, "REMOVE=ALL" );
6047 ok( r == ERROR_SUCCESS, "got %u\n", r );
6048
6049 DeleteFileA( "msitest\\featuretree.txt" );
6050 RemoveDirectoryA( "msitest" );
6052}
static const msi_table ft_tables[]
Definition: install.c:2050

Referenced by START_TEST().

◆ test_file_in_use()

static void test_file_in_use ( void  )
static

Definition at line 5247 of file install.c.

5248{
5249 UINT r;
5250 HANDLE file;
5251 HKEY hkey;
5252 char path[MAX_PATH];
5253
5254 if (!is_process_elevated())
5255 {
5256 skip("process is limited\n");
5257 return;
5258 }
5259
5261
5262 CreateDirectoryA("msitest", NULL);
5263 create_file("msitest\\maximus", 500);
5265
5267
5269 lstrcatA(path, "\\msitest");
5271
5272 lstrcatA(path, "\\maximus");
5274
5275 r = MsiInstallProductA(msifile, "REBOOT=ReallySuppress FULL=1");
5277 {
5278 skip("Not enough rights to perform tests\n");
5279 goto error;
5280 }
5281 ok(r == ERROR_SUCCESS_REBOOT_REQUIRED, "Expected ERROR_SUCCESS_REBOOT_REQUIRED got %u\n", r);
5282 ok(!file_matches_data(path, "msitest\\maximus"), "Expected file not to match\n");
5284 ok(!file_matches_data(path, "msitest\\maximus"), "Expected file not to match\n");
5285
5287 RegCloseKey(hkey);
5288
5289 ok(file_matches_data(path, "msitest\\maximus"), "Expected file to match\n");
5290 ok(delete_pf("msitest\\maximus", TRUE), "File not present\n");
5291 ok(delete_pf("msitest", FALSE), "Directory not present or not empty\n");
5292
5293 r = MsiInstallProductA(msifile, "REMOVE=ALL FULL=1");
5294 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5295
5296error:
5297 RegCloseKey(hkey);
5298
5299 delete_pf("msitest\\maximus", TRUE);
5300 delete_pf("msitest", FALSE);
5301 DeleteFileA("msitest\\maximus");
5304}
static const msi_table fiu_tables[]
Definition: install.c:1925
static void process_pending_renames(HKEY hkey)
Definition: install.c:5163
static BOOL file_matches_data(LPCSTR file, LPCSTR data)
Definition: install.c:5229
static const char session_manager[]
Definition: install.c:5160
#define ERROR_SUCCESS_REBOOT_REQUIRED
Definition: winerror.h:1215

Referenced by START_TEST().

◆ test_file_in_use_cab()

static void test_file_in_use_cab ( void  )
static

Definition at line 5306 of file install.c.

5307{
5308 UINT r;
5309 HANDLE file;
5310 HKEY hkey;
5311 char path[MAX_PATH];
5312
5313 if (!is_process_elevated())
5314 {
5315 skip("process is limited\n");
5316 return;
5317 }
5318
5320
5321 CreateDirectoryA("msitest", NULL);
5322 create_file("maximus", 500);
5323 create_cab_file("test1.cab", MEDIA_SIZE, "maximus\0");
5324 DeleteFileA("maximus");
5325
5327
5329
5331 lstrcatA(path, "\\msitest");
5333
5334 lstrcatA(path, "\\maximus");
5336
5337 r = MsiInstallProductA(msifile, "REBOOT=ReallySuppress FULL=1");
5339 {
5340 skip("Not enough rights to perform tests\n");
5341 goto error;
5342 }
5343 ok(r == ERROR_SUCCESS_REBOOT_REQUIRED, "Expected ERROR_SUCCESS_REBOOT_REQUIRED got %u\n", r);
5344 ok(!file_matches_data(path, "maximus"), "Expected file not to match\n");
5346 ok(!file_matches_data(path, "maximus"), "Expected file not to match\n");
5347
5349 RegCloseKey(hkey);
5350
5351 ok(file_matches_data(path, "maximus"), "Expected file to match\n");
5352 ok(delete_pf("msitest\\maximus", TRUE), "File not present\n");
5353 ok(delete_pf("msitest", FALSE), "Directory not present or not empty\n");
5354
5355 r = MsiInstallProductA(msifile, "REMOVE=ALL FULL=1");
5356 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5357
5358error:
5359 RegCloseKey(hkey);
5360
5361 delete_pf("msitest\\maximus", TRUE);
5362 delete_pf("msitest", FALSE);
5363 DeleteFileA("msitest\\maximus");
5367}
static const msi_table fiuc_tables[]
Definition: install.c:1937

Referenced by START_TEST().

◆ test_icon_table()

static void test_icon_table ( void  )
static

Definition at line 5446 of file install.c.

5447{
5448 MSIHANDLE hdb = 0, record;
5449 LPCSTR query;
5450 UINT res;
5452 static const char prodcode[] = "{7DF88A49-996F-4EC8-A022-BF956F9B2CBB}";
5453
5454 if (!is_process_elevated())
5455 {
5456 skip("process is limited\n");
5457 return;
5458 }
5459
5461
5463
5465 ok(res == ERROR_SUCCESS, "failed to open db: %d\n", res);
5466
5467 query = "CREATE TABLE `Icon` (`Name` CHAR(72) NOT NULL, `Data` OBJECT NOT NULL PRIMARY KEY `Name`)";
5468 res = run_query( hdb, 0, query );
5469 ok(res == ERROR_SUCCESS, "Can't create Icon table: %d\n", res);
5470
5471 create_file("icon.ico", 100);
5473 res = MsiRecordSetStreamA(record, 1, "icon.ico");
5474 ok(res == ERROR_SUCCESS, "Failed to add stream data to record: %d\n", res);
5475
5476 query = "INSERT INTO `Icon` (`Name`, `Data`) VALUES ('testicon', ?)";
5477 res = run_query(hdb, record, query);
5478 ok(res == ERROR_SUCCESS, "Insert into Icon table failed: %d\n", res);
5479
5481 ok(res == ERROR_SUCCESS, "Failed to close record handle: %d\n", res);
5482 DeleteFileA("icon.ico");
5483 res = MsiDatabaseCommit(hdb);
5484 ok(res == ERROR_SUCCESS, "Failed to commit database: %d\n", res);
5485 res = MsiCloseHandle(hdb);
5486 ok(res == ERROR_SUCCESS, "Failed to close database: %d\n", res);
5487
5488 /* per-user */
5489 res = MsiInstallProductA(msifile, "PUBLISH_PRODUCT=1");
5491 {
5492 skip("Not enough rights to perform tests\n");
5494 return;
5495 }
5496 ok(res == ERROR_SUCCESS, "Failed to do per-user install: %d\n", res);
5497
5499 lstrcatA(path, "\\");
5500 lstrcatA(path, "Microsoft\\Installer\\");
5501 lstrcatA(path, prodcode);
5502 lstrcatA(path, "\\testicon");
5503 ok(file_exists(path), "Per-user icon file isn't where it's expected (%s)\n", path);
5504
5505 res = MsiInstallProductA(msifile, "REMOVE=ALL FULL=1");
5506 ok(res == ERROR_SUCCESS, "Failed to uninstall per-user\n");
5507 ok(!file_exists(path), "Per-user icon file not removed (%s)\n", path);
5508
5509 /* system-wide */
5510 res = MsiInstallProductA(msifile, "PUBLISH_PRODUCT=1 ALLUSERS=1");
5511 ok(res == ERROR_SUCCESS, "Failed to system-wide install: %d\n", res);
5512
5514 lstrcatA(path, "\\");
5515 lstrcatA(path, "Installer\\");
5516 lstrcatA(path, prodcode);
5517 lstrcatA(path, "\\testicon");
5518 ok(file_exists(path), "System-wide icon file isn't where it's expected (%s)\n", path);
5519
5520 res = MsiInstallProductA(msifile, "REMOVE=ALL FULL=1");
5521 ok(res == ERROR_SUCCESS, "Failed to uninstall system-wide\n");
5522 ok(!file_exists(path), "System-wide icon file not removed (%s)\n", path);
5523
5526}
static const msi_table icon_base_tables[]
Definition: install.c:1963
static void delete_pfmsitest_files(void)
Definition: install.c:3537

Referenced by START_TEST().

◆ test_installed_prop()

static void test_installed_prop ( void  )
static

Definition at line 5049 of file install.c.

5050{
5051 static const char prodcode[] = "{7df88a48-996f-4ec8-a022-bf956f9b2cbb}";
5052 UINT r;
5053
5054 if (!is_process_elevated())
5055 {
5056 skip("process is limited\n");
5057 return;
5058 }
5059
5062
5064
5065 r = MsiInstallProductA(msifile, "FULL=1");
5067 {
5068 skip("Not enough rights to perform tests\n");
5069 goto error;
5070 }
5071 ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
5072
5073 r = MsiInstallProductA(msifile, "FULL=1");
5074 ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n", r);
5075
5077 ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n", r);
5078
5080
5081 r = MsiInstallProductA(msifile, "REMOVE=ALL");
5082