ReactOS  0.4.15-dev-5112-g22d8c0f
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 <srrestoreptapi.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 GET_PROC(mod, func)
 
#define create_pf(file, is_file)   create_pf_data(file, file, is_file)
 

Functions

static UINT (WINAPI *pMsiQueryComponentStateA)(LPCSTR
 
static INSTALLSTATE (WINAPI *pMsiGetComponentPathExA)(LPCSTR
 
static LONG (WINAPI *pRegDeleteKeyExA)(HKEY
 
static BOOL (WINAPI *pIsWow64Process)(HANDLE
 
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)
 
static void init_functionpointers (void)
 
BOOL is_process_limited (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 BOOL notify_system_change (DWORD event_type, STATEMGRSTATUS *status)
 
static void remove_restore_point (DWORD seq_number)
 
static LONG delete_key (HKEY key, LPCSTR subkey, REGSAM access)
 
static void 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 LPCSTR
 
static MSIINSTALLCONTEXT
 
static INSTALLSTATE *static DWORD
 
static INSTALLSTATE *static LPSTR
 
static INSTALLSTATE *static LPDWORD
 
static REGSAM
 
static PBOOL
 
static STATEMGRSTATUS *static BOOL is_wow64
 
static const BOOL is_64bit = sizeof(void *) > sizeof(int)
 
static const charmsifile = "msitest.msi"
 
static const 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 4063 of file install.c.

◆ FOLDER_THRESHOLD

#define FOLDER_THRESHOLD   900000

Definition at line 2122 of file install.c.

◆ GET_PROC

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

◆ MEDIA_SIZE

#define MEDIA_SIZE   0x7FFFFFFF

Definition at line 2121 of file install.c.

Function Documentation

◆ add_custom_dll()

static void add_custom_dll ( MSIHANDLE  hdb)
static

Definition at line 2676 of file install.c.

2677 {
2678  MSIHANDLE record;
2679  UINT res;
2680 
2681  if (!customdll)
2682  customdll = load_resource("custom.dll");
2683 
2685 
2686  res = run_query(hdb, 0, "CREATE TABLE `Binary` (`Name` CHAR(72) NOT NULL, `Data` OBJECT NOT NULL PRIMARY KEY `Name`)");
2687  ok(res == ERROR_SUCCESS, "failed to create Binary table: %u\n", res);
2688 
2689  record = MsiCreateRecord(1);
2691  ok(res == ERROR_SUCCESS, "failed to add %s to stream: %u\n", customdll, res);
2692 
2693  res = run_query(hdb, record, "INSERT INTO `Binary` (`Name`, `Data`) VALUES ('custom.dll', ?)");
2694  ok(res == ERROR_SUCCESS, "failed to insert into Binary table: %u\n", res);
2695 
2697 }
MSIHANDLE WINAPI MsiCreateRecord(UINT cParams)
Definition: record.c:92
#define ERROR_SUCCESS
Definition: deptool.c:10
UINT WINAPI MsiRecordSetStreamA(MSIHANDLE hRecord, UINT iField, const char *szFilename)
Definition: record.c:724
UINT run_query(MSIHANDLE hdb, MSIHANDLE hrec, const char *query)
Definition: install.c:3653
static const char * customdll
Definition: install.c:72
static char * load_resource(const char *name)
Definition: install.c:2632
unsigned long MSIHANDLE
Definition: winemsi.idl:24
static INT CALLBACK ok_callback(void *context, UINT message_type, MSIHANDLE record)
Definition: install.c:2655
UINT WINAPI MsiCloseHandle(MSIHANDLE handle)
Definition: handle.c:269
#define ok(value,...)
Definition: atltest.h:57
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
GLuint res
Definition: glext.h:9613
UINT WINAPI MsiSetExternalUIRecord(INSTALLUI_HANDLER_RECORD handler, DWORD filter, void *context, INSTALLUI_HANDLER_RECORD *prev)
Definition: msi.c:4155

Referenced by create_database_wordcount().

◆ add_file()

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

Definition at line 2345 of file install.c.

2346 {
2347  char path[MAX_PATH];
2348  char filename[MAX_PATH];
2349 
2351  lstrcatA(path, "\\");
2352  lstrcatA(path, file);
2353 
2355 
2356  return FCIAddFile(hfci, path, filename, FALSE, get_next_cabinet,
2358 }
char CURR_DIR[MAX_PATH]
Definition: install.c:65
const char * filename
Definition: ioapi.h:135
#define FALSE
Definition: types.h:117
static INT_PTR CDECL get_open_info(char *pszName, USHORT *pdate, USHORT *ptime, USHORT *pattribs, int *err, void *pv)
Definition: install.c:2319
static BOOL CDECL get_next_cabinet(PCCAB pccab, ULONG cbPrevCab, void *pv)
Definition: install.c:2136
LPSTR WINAPI lstrcatA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:123
int ZEXPORT compress(Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen)
Definition: compress.c:68
#define MAX_PATH
Definition: compat.h:34
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:100
static LONG CDECL progress(UINT typeStatus, ULONG cb1, ULONG cb2, void *pv)
Definition: install.c:2142
BOOL __cdecl FCIAddFile(HFCI hfci, char *pszSourceFile, char *pszFileName, BOOL fExecute, PFNFCIGETNEXTCABINET pfnfcignc, PFNFCISTATUS pfnfcis, PFNFCIGETOPENINFO pfnfcigoi, TCOMP typeCompress)
Definition: fci.c:1397
Definition: fci.c:126

Referenced by create_cab_file(), and create_cc_test_files().

◆ BOOL()

static BOOL ( WINAPI pIsWow64Process)
static

Referenced by do_register_dll().

◆ check_file_matches()

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

Definition at line 6148 of file install.c.

6149 {
6150  char buffer[200];
6151  HANDLE file;
6152  DWORD size;
6153 
6155  ReadFile(file, buffer, sizeof(buffer), &size, NULL);
6156  ok(size == strlen(text) && !memcmp(buffer, text, size), "got %.*s\n", (int)size, buffer);
6157  CloseHandle(file);
6158 }
DWORD size
Definition: install.c:3757
#define CloseHandle
Definition: compat.h:598
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
const WCHAR * text
Definition: package.c:1799
GLuint buffer
Definition: glext.h:5915
const char * filename
Definition: ioapi.h:135
#define OPEN_EXISTING
Definition: compat.h:634
GLsizeiptr size
Definition: glext.h:5919
const char file[]
Definition: icontest.c:11
unsigned long DWORD
Definition: ntddk_ex.h:95
#define GENERIC_READ
Definition: compat.h:135
#define ok(value,...)
Definition: atltest.h:57
#define ReadFile(a, b, c, d, e)
Definition: compat.h:601
#define NULL
Definition: types.h:112
#define CreateFileA(a, b, c, d, e, f, g)
Definition: compat.h:599
Definition: fci.c:126

Referenced by test_deferred_action().

◆ check_record()

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

Definition at line 2290 of file install.c.

2291 {
2292  CHAR buffer[0x20];
2293  UINT r;
2294  DWORD sz;
2295 
2296  sz = sizeof buffer;
2297  r = MsiRecordGetStringA(rec, field, buffer, &sz);
2298  return (r == ERROR_SUCCESS ) && !strcmp(val, buffer);
2299 }
#define ERROR_SUCCESS
Definition: deptool.c:10
UINT WINAPI MsiRecordGetStringA(MSIHANDLE handle, UINT iField, char *szValue, DWORD *pcchValue)
Definition: record.c:403
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
char CHAR
Definition: xmlstorage.h:175
GLuint buffer
Definition: glext.h:5915
GLuint GLfloat * val
Definition: glext.h:7180
Definition: parser.c:43
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned int UINT
Definition: ndis.h:50
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469

Referenced by test_packagecoltypes().

◆ compare_pf_data()

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

Definition at line 2541 of file install.c.

2542 {
2543  DWORD read;
2544  HANDLE handle;
2545  BOOL ret = FALSE;
2546  char *buffer, path[MAX_PATH];
2547 
2549  lstrcatA(path, "\\");
2551 
2553  if ((buffer = malloc(size)))
2554  {
2556  if (read == size && !memcmp(data, buffer, size)) ret = TRUE;
2557  free(buffer);
2558  }
2560  return ret;
2561 }
#define CloseHandle
Definition: compat.h:598
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
#define TRUE
Definition: types.h:120
char PROG_FILES_DIR[MAX_PATH]
Definition: install.c:66
#define free
Definition: debug_ros.c:5
GLuint buffer
Definition: glext.h:5915
const char * filename
Definition: ioapi.h:135
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
Definition: sock.c:82
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
#define OPEN_EXISTING
Definition: compat.h:634
LPSTR WINAPI lstrcatA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:123
GLsizeiptr size
Definition: glext.h:5919
#define MAX_PATH
Definition: compat.h:34
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:100
int ret
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:137
#define GENERIC_READ
Definition: compat.h:135
#define ReadFile(a, b, c, d, e)
Definition: compat.h:601
#define NULL
Definition: types.h:112
#define malloc
Definition: debug_ros.c:4
#define CreateFileA(a, b, c, d, e, f, g)
Definition: compat.h:599
_CRTIMP int __cdecl read(_In_ int _FileHandle, _Out_writes_bytes_(_MaxCharCount) void *_DstBuf, _In_ unsigned int _MaxCharCount)

Referenced by test_missingcab().

◆ create_cab_file()

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

Definition at line 2373 of file install.c.

2374 {
2375  CCAB cabParams;
2376  LPCSTR ptr;
2377  HFCI hfci;
2378  ERF erf;
2379  BOOL res;
2380 
2381  set_cab_parameters(&cabParams, name, max_size);
2382 
2385  get_temp_file, &cabParams, NULL);
2386 
2387  ok(hfci != NULL, "Failed to create an FCI context\n");
2388 
2389  ptr = files;
2390  while (*ptr)
2391  {
2392  res = add_file(hfci, ptr, tcompTYPE_MSZIP);
2393  ok(res, "Failed to add file: %s\n", ptr);
2394  ptr += lstrlenA(ptr) + 1;
2395  }
2396 
2398  ok(res, "Failed to flush the cabinet\n");
2399 
2400  res = FCIDestroy(hfci);
2401  ok(res, "Failed to destroy the cabinet\n");
2402 }
BOOL __cdecl FCIFlushCabinet(HFCI hfci, BOOL fGetNextCab, PFNFCIGETNEXTCABINET pfnfcignc, PFNFCISTATUS pfnfcis)
Definition: fci.c:1675
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 FCIDestroy(HFCI hfci)
Definition: fci.c:1709
static BOOL add_file(HFCI hfci, const char *file, TCOMP compress)
Definition: install.c:2345
static int CDECL fci_close(INT_PTR hf, int *err, void *pv)
Definition: install.c:2200
Definition: fci.h:144
#define tcompTYPE_MSZIP
Definition: fci.h:65
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
static UINT CDECL fci_read(INT_PTR hf, void *memory, UINT cb, int *err, void *pv)
Definition: install.c:2176
Definition: fci.h:44
static PVOID ptr
Definition: dispmode.c:27
static INT max_size
Definition: history.c:51
const char * LPCSTR
Definition: xmlstorage.h:183
static void *CDECL mem_alloc(ULONG cb)
Definition: install.c:2126
static void set_cab_parameters(PCCAB pCabParams, const CHAR *name, DWORD max_size)
Definition: install.c:2360
static BOOL CDECL get_next_cabinet(PCCAB pccab, ULONG cbPrevCab, void *pv)
Definition: install.c:2136
double __cdecl erf(double)
static UINT CDECL fci_write(INT_PTR hf, void *memory, UINT cb, int *err, void *pv)
Definition: install.c:2188
static INT_PTR CDECL fci_open(char *pszFile, int oflag, int pmode, int *err, void *pv)
Definition: install.c:2153
static void CDECL mem_free(void *memory)
Definition: install.c:2131
int WINAPI lstrlenA(LPCSTR lpString)
Definition: lstring.c:145
static int CDECL fci_delete(char *pszFile, int *err, void *pv)
Definition: install.c:2219
#define ok(value,...)
Definition: atltest.h:57
#define NULL
Definition: types.h:112
static LONG CDECL progress(UINT typeStatus, ULONG cb1, ULONG cb2, void *pv)
Definition: install.c:2142
Definition: name.c:38
GLuint res
Definition: glext.h:9613
static BOOL CDECL get_temp_file(char *pszTempName, int cbTempName, void *pv)
Definition: install.c:2301
static LONG CDECL fci_seek(INT_PTR hf, LONG dist, int seektype, int *err, void *pv)
Definition: install.c:2208
static int CDECL file_placed(PCCAB pccab, char *pszFile, LONG cbFile, BOOL fContinuation, void *pv)
Definition: install.c:2147

Referenced by create_cc_test_files(), create_test_files(), test_adminimage(), test_cabisextracted(), test_caborder(), test_file_in_use_cab(), test_missingcab(), test_mixedmedia(), and test_readonlyfile_cab().

◆ create_cc_test_files()

static void create_cc_test_files ( void  )
static

Definition at line 3054 of file install.c.

3055 {
3056  CCAB cabParams;
3057  HFCI hfci;
3058  ERF erf;
3059  static CHAR cab_context[] = "test%d.cab";
3060  BOOL res;
3061 
3062  create_file("maximus", 500);
3063  create_file("augustus", 50000);
3064  create_file("tiberius", 500);
3065  create_file("caesar", 500);
3066 
3067  set_cab_parameters(&cabParams, "test1.cab", 40000);
3068 
3071  get_temp_file, &cabParams, cab_context);
3072  ok(hfci != NULL, "Failed to create an FCI context\n");
3073 
3074  res = add_file(hfci, "maximus", tcompTYPE_NONE);
3075  ok(res, "Failed to add file maximus\n");
3076 
3077  res = add_file(hfci, "augustus", tcompTYPE_NONE);
3078  ok(res, "Failed to add file augustus\n");
3079 
3080  res = add_file(hfci, "tiberius", tcompTYPE_NONE);
3081  ok(res, "Failed to add file tiberius\n");
3082 
3084  ok(res, "Failed to flush the cabinet\n");
3085 
3086  res = FCIDestroy(hfci);
3087  ok(res, "Failed to destroy the cabinet\n");
3088 
3089  create_cab_file("test3.cab", MEDIA_SIZE, "caesar\0");
3090 
3091  DeleteFileA("maximus");
3092  DeleteFileA("augustus");
3093  DeleteFileA("tiberius");
3094  DeleteFileA("caesar");
3095 }
#define MEDIA_SIZE
Definition: install.c:2121
BOOL __cdecl FCIFlushCabinet(HFCI hfci, BOOL fGetNextCab, PFNFCIGETNEXTCABINET pfnfcignc, PFNFCISTATUS pfnfcis)
Definition: fci.c:1675
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
char CHAR
Definition: xmlstorage.h:175
#define create_file(name, size)
Definition: asmcache.c:813
BOOL __cdecl FCIDestroy(HFCI hfci)
Definition: fci.c:1709
static BOOL add_file(HFCI hfci, const char *file, TCOMP compress)
Definition: install.c:2345
static int CDECL fci_close(INT_PTR hf, int *err, void *pv)
Definition: install.c:2200
Definition: fci.h:144
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
static UINT CDECL fci_read(INT_PTR hf, void *memory, UINT cb, int *err, void *pv)
Definition: install.c:2176
Definition: fci.h:44
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
Definition: delete.c:24
static void *CDECL mem_alloc(ULONG cb)
Definition: install.c:2126
static void set_cab_parameters(PCCAB pCabParams, const CHAR *name, DWORD max_size)
Definition: install.c:2360
static BOOL CDECL get_next_cabinet(PCCAB pccab, ULONG cbPrevCab, void *pv)
Definition: install.c:2136
#define tcompTYPE_NONE
Definition: fci.h:64
double __cdecl erf(double)
static UINT CDECL fci_write(INT_PTR hf, void *memory, UINT cb, int *err, void *pv)
Definition: install.c:2188
static INT_PTR CDECL fci_open(char *pszFile, int oflag, int pmode, int *err, void *pv)
Definition: install.c:2153
static void CDECL mem_free(void *memory)
Definition: install.c:2131
static int CDECL fci_delete(char *pszFile, int *err, void *pv)
Definition: install.c:2219
#define ok(value,...)
Definition: atltest.h:57
#define NULL
Definition: types.h:112
static LONG CDECL progress(UINT typeStatus, ULONG cb1, ULONG cb2, void *pv)
Definition: install.c:2142
GLuint res
Definition: glext.h:9613
static BOOL CDECL get_temp_file(char *pszTempName, int cbTempName, void *pv)
Definition: install.c:2301
static LONG CDECL fci_seek(INT_PTR hf, LONG dist, int seektype, int *err, void *pv)
Definition: install.c:2208
void create_cab_file(const CHAR *name, DWORD max_size, const CHAR *files)
Definition: install.c:2373
static int CDECL file_placed(PCCAB pccab, char *pszFile, LONG cbFile, BOOL fContinuation, void *pv)
Definition: install.c:2147

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 2699 of file install.c.

2701 {
2702  MSIHANDLE db;
2703  UINT r;
2704  WCHAR *nameW;
2705  int j, len;
2706 
2707  len = MultiByteToWideChar( CP_ACP, 0, name, -1, NULL, 0 );
2708  if (!(nameW = malloc( len * sizeof(WCHAR) ))) return;
2709  MultiByteToWideChar( CP_ACP, 0, name, -1, nameW, len );
2710 
2712  ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2713 
2714  /* import the tables into the database */
2715  for (j = 0; j < num_tables; j++)
2716  {
2717  const msi_table *table = &tables[j];
2718 
2719  write_file(table->filename, table->data, (table->size - 1) * sizeof(char));
2720 
2721  r = MsiDatabaseImportA(db, CURR_DIR, table->filename);
2722  ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2723 
2724  DeleteFileA(table->filename);
2725  }
2726 
2727  write_msi_summary_info(db, version, wordcount, template, packagecode);
2728  add_custom_dll(db);
2729 
2730  r = MsiDatabaseCommit(db);
2731  ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
2732 
2733  MsiCloseHandle(db);
2734  free( nameW );
2735 }
#define ERROR_SUCCESS
Definition: deptool.c:10
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define CP_ACP
Definition: compat.h:109
#define free
Definition: debug_ros.c:5
char CURR_DIR[MAX_PATH]
Definition: install.c:65
static const msi_table tables[]
Definition: install.c:1423
static void write_file(const CHAR *filename, const char *data, int data_size)
Definition: install.c:2591
unsigned long MSIHANDLE
Definition: winemsi.idl:24
static const WCHAR version[]
Definition: asmname.c:66
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
Definition: delete.c:24
static void add_custom_dll(MSIHANDLE hdb)
Definition: install.c:2676
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 WCHAR nameW[]
Definition: main.c:46
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MSIDBOPEN_CREATE
Definition: msiquery.h:69
static void write_msi_summary_info(MSIHANDLE db, INT version, INT wordcount, const char *template, const char *packagecode)
Definition: install.c:2601
GLenum GLsizei len
Definition: glext.h:6722
UINT WINAPI MsiCloseHandle(MSIHANDLE handle)
Definition: handle.c:269
BYTE * data
UINT WINAPI MsiDatabaseCommit(MSIHANDLE hdb)
Definition: msiquery.c:963
#define ok(value,...)
Definition: atltest.h:57
UINT WINAPI MsiOpenDatabaseW(LPCWSTR szDBPath, LPCWSTR szPersist, MSIHANDLE *phDB)
Definition: database.c:298
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
#define MultiByteToWideChar
Definition: compat.h:110
Definition: name.c:38
#define malloc
Definition: debug_ros.c:4
UINT WINAPI MsiDatabaseImportA(MSIHANDLE handle, const char *szFolder, const char *szFilename)
Definition: database.c:853

Referenced by test_adminimage(), and test_shared_component().

◆ create_file_data()

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

Definition at line 2460 of file install.c.

2461 {
2462  HANDLE file;
2463  DWORD written;
2464 
2466  if (file == INVALID_HANDLE_VALUE)
2467  return;
2468 
2469  WriteFile(file, data, strlen(data), &written, NULL);
2470 
2471  if (size)
2472  {
2474  SetEndOfFile(file);
2475  }
2476 
2477  CloseHandle(file);
2478 }
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 CloseHandle
Definition: compat.h:598
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
BOOL WINAPI SetEndOfFile(HANDLE hFile)
Definition: fileinfo.c:1004
#define INVALID_HANDLE_VALUE
Definition: compat.h:590
#define FILE_BEGIN
Definition: compat.h:620
#define GENERIC_WRITE
Definition: nt_native.h:90
GLsizeiptr size
Definition: glext.h:5919
const char file[]
Definition: icontest.c:11
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define CREATE_ALWAYS
Definition: disk.h:72
#define NULL
Definition: types.h:112
Definition: name.c:38
#define CreateFileA(a, b, c, d, e, f, g)
Definition: compat.h:599
#define SetFilePointer
Definition: compat.h:602
Definition: fci.c:126

Referenced by create_pf_data().

◆ create_pf_data()

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

Definition at line 4049 of file install.c.

4050 {
4051  CHAR path[MAX_PATH];
4052 
4054  lstrcatA(path, "\\");
4055  lstrcatA(path, file);
4056 
4057  if (is_file)
4058  create_file_data(path, data, 500);
4059  else
4061 }
char PROG_FILES_DIR[MAX_PATH]
Definition: install.c:66
char CHAR
Definition: xmlstorage.h:175
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:2460
LPSTR WINAPI lstrcatA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:123
#define MAX_PATH
Definition: compat.h:34
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:100
#define NULL
Definition: types.h:112
Definition: fci.c:126

Referenced by test_missingcab().

◆ create_test_files()

static void create_test_files ( void  )
static

Definition at line 2480 of file install.c.

2481 {
2482  CreateDirectoryA("msitest", NULL);
2483  create_file("msitest\\one.txt", 100);
2484  CreateDirectoryA("msitest\\first", NULL);
2485  create_file("msitest\\first\\two.txt", 100);
2486  CreateDirectoryA("msitest\\second", NULL);
2487  create_file("msitest\\second\\three.txt", 100);
2488 
2489  create_file("four.txt", 100);
2490  create_file("five.txt", 100);
2491  create_cab_file("msitest.cab", MEDIA_SIZE, "four.txt\0five.txt\0");
2492 
2493  create_file("msitest\\filename", 100);
2494 
2495  DeleteFileA("four.txt");
2496  DeleteFileA("five.txt");
2497 }
#define MEDIA_SIZE
Definition: install.c:2121
#define create_file(name, size)
Definition: asmcache.c:813
BOOL WINAPI CreateDirectoryA(IN LPCSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
Definition: dir.c:37
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
Definition: delete.c:24
#define NULL
Definition: types.h:112
void create_cab_file(const CHAR *name, DWORD max_size, const CHAR *files)
Definition: install.c:2373

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 3097 of file install.c.

3098 {
3099  SHFILEOPSTRUCTA shfl;
3100  CHAR path[MAX_PATH+10];
3101 
3103  lstrcatA(path, "\\*.cab");
3104  path[strlen(path) + 1] = '\0';
3105 
3106  shfl.hwnd = NULL;
3107  shfl.wFunc = FO_DELETE;
3108  shfl.pFrom = path;
3109  shfl.pTo = NULL;
3111 
3112  SHFileOperationA(&shfl);
3113 }
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
GLsizei const GLchar ** path
Definition: glext.h:7234
FILEOP_FLAGS fFlags
Definition: shellapi.h:347
#define FOF_SILENT
Definition: shellapi.h:140
char CHAR
Definition: xmlstorage.h:175
char CURR_DIR[MAX_PATH]
Definition: install.c:65
#define FOF_NOCONFIRMATION
Definition: shellapi.h:142
LPSTR WINAPI lstrcatA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:123
#define FOF_NORECURSION
Definition: shlfileop.c:38
#define FOF_FILESONLY
Definition: shellapi.h:145
#define MAX_PATH
Definition: compat.h:34
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:100
#define NULL
Definition: types.h:112
int WINAPI SHFileOperationA(LPSHFILEOPSTRUCTA lpFileOp)
Definition: shlfileop.cpp:1069
#define FO_DELETE
Definition: shellapi.h:135

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 2527 of file install.c.

2528 {
2529  CHAR path[MAX_PATH];
2530 
2532  lstrcatA(path, "\\");
2533  lstrcatA(path, rel_path);
2534 
2535  if (is_file)
2536  return DeleteFileA(path);
2537  else
2538  return RemoveDirectoryA(path);
2539 }
char CHAR
Definition: xmlstorage.h:175
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
Definition: delete.c:24
LPSTR WINAPI lstrcatA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:123
#define MAX_PATH
Definition: compat.h:34
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:100
char COMMON_FILES_DIR[MAX_PATH]
Definition: install.c:68
BOOL WINAPI RemoveDirectoryA(IN LPCSTR lpPathName)
Definition: dir.c:714

Referenced by test_setdirproperty().

◆ delete_key()

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

Definition at line 2758 of file install.c.

2759 {
2760  if (pRegDeleteKeyExA)
2761  return pRegDeleteKeyExA( key, subkey, access, 0 );
2762  return RegDeleteKeyA( key, subkey );
2763 }
LONG WINAPI RegDeleteKeyA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey)
Definition: reg.c:1222
GLuint GLint GLboolean GLint GLenum access
Definition: glext.h:7866
Definition: copy.c:22

Referenced by test_feature_override(), and test_MsiInstallProduct().

◆ delete_pf()

BOOL delete_pf ( const CHAR rel_path,
BOOL  is_file 
)

Definition at line 2499 of file install.c.

2500 {
2501  CHAR path[MAX_PATH];
2502 
2504  lstrcatA(path, "\\");
2505  lstrcatA(path, rel_path);
2506 
2507  if (is_file)
2508  return DeleteFileA(path);
2509  else
2510  return RemoveDirectoryA(path);
2511 }
char PROG_FILES_DIR[MAX_PATH]
Definition: install.c:66
char CHAR
Definition: xmlstorage.h:175
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
Definition: delete.c:24
LPSTR WINAPI lstrcatA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:123
#define MAX_PATH
Definition: compat.h:34
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:100
BOOL WINAPI RemoveDirectoryA(IN LPCSTR lpPathName)
Definition: dir.c:714

Referenced by delete_pf_files(), test_admin(), test_adminimage(), test_adminprops(), test_cabisextracted(), test_caborder(), test_continuouscabs(), test_currentworkingdir(), test_customaction51(), test_feature_override(), test_file_in_use(), test_file_in_use_cab(), test_installstate(), test_missingcab(), test_missingcomponent(), test_mixedmedia(), test_package_validation(), test_preselected(), test_propcase(), test_readonlyfile(), test_readonlyfile_cab(), test_samesequence(), test_shortcut(), test_sourcedirprop(), test_sourcefolder(), test_sourcepath(), test_transformprop(), test_uiLevelFlags(), test_upgrade_code(), and test_wow64().

◆ delete_pf_files()

static void delete_pf_files ( void  )
static

Definition at line 2576 of file install.c.

2577 {
2578  ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
2579  ok(delete_pf("msitest\\cabout\\new", FALSE), "Directory not created\n");
2580  ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
2581  ok(delete_pf("msitest\\cabout", FALSE), "Directory not created\n");
2582  ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
2583  ok(delete_pf("msitest\\changed", FALSE), "Directory not created\n");
2584  ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
2585  ok(delete_pf("msitest\\first", FALSE), "Directory not created\n");
2586  ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n");
2587  ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
2588  ok(delete_pf("msitest", FALSE), "Directory not created\n");
2589 }
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define ok(value,...)
Definition: atltest.h:57
BOOL delete_pf(const CHAR *rel_path, BOOL is_file)
Definition: install.c:2499

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 2513 of file install.c.

2514 {
2515  CHAR path[MAX_PATH];
2516 
2518  lstrcatA(path, "\\");
2519  lstrcatA(path, rel_path);
2520 
2521  if (is_file)
2522  return DeleteFileA(path);
2523  else
2524  return RemoveDirectoryA(path);
2525 }
char CHAR
Definition: xmlstorage.h:175
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
Definition: delete.c:24
LPSTR WINAPI lstrcatA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:123
#define MAX_PATH
Definition: compat.h:34
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:100
char PROG_FILES_DIR_NATIVE[MAX_PATH]
Definition: install.c:67
BOOL WINAPI RemoveDirectoryA(IN LPCSTR lpPathName)
Definition: dir.c:714

Referenced by test_wow64().

◆ delete_pfmsitest_files()

static void delete_pfmsitest_files ( void  )
static

Definition at line 3631 of file install.c.

3632 {
3633  SHFILEOPSTRUCTA shfl;
3634  CHAR path[MAX_PATH+11];
3635 
3637  lstrcatA(path, "\\msitest\\*");
3638  path[strlen(path) + 1] = '\0';
3639 
3640  shfl.hwnd = NULL;
3641  shfl.wFunc = FO_DELETE;
3642  shfl.pFrom = path;
3643  shfl.pTo = NULL;
3645 
3646  SHFileOperationA(&shfl);
3647 
3649  lstrcatA(path, "\\msitest");
3651 }
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
GLsizei const GLchar ** path
Definition: glext.h:7234
FILEOP_FLAGS fFlags
Definition: shellapi.h:347
#define FOF_SILENT
Definition: shellapi.h:140
char PROG_FILES_DIR[MAX_PATH]
Definition: install.c:66
char CHAR
Definition: xmlstorage.h:175
#define FOF_NOERRORUI
Definition: shellapi.h:148
#define FOF_NOCONFIRMATION
Definition: shellapi.h:142
LPSTR WINAPI lstrcatA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:123
#define FOF_NORECURSION
Definition: shlfileop.c:38
#define FOF_FILESONLY
Definition: shellapi.h:145
#define MAX_PATH
Definition: compat.h:34
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:100
BOOL WINAPI RemoveDirectoryA(IN LPCSTR lpPathName)
Definition: dir.c:714
#define NULL
Definition: types.h:112
int WINAPI SHFileOperationA(LPSHFILEOPSTRUCTA lpFileOp)
Definition: shlfileop.cpp:1069
#define FO_DELETE
Definition: shellapi.h:135

Referenced by test_icon_table().

◆ delete_test_files()

static void delete_test_files ( void  )
static

Definition at line 2563 of file install.c.

2564 {
2565  DeleteFileA("msitest.msi");
2566  DeleteFileA("msitest.cab");
2567  DeleteFileA("msitest\\second\\three.txt");
2568  DeleteFileA("msitest\\first\\two.txt");
2569  DeleteFileA("msitest\\one.txt");
2570  DeleteFileA("msitest\\filename");
2571  RemoveDirectoryA("msitest\\second");
2572  RemoveDirectoryA("msitest\\first");
2573  RemoveDirectoryA("msitest");
2574 }
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
Definition: delete.c:24
BOOL WINAPI RemoveDirectoryA(IN LPCSTR lpPathName)
Definition: dir.c:714

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 2200 of file install.c.

2201 {
2202  HANDLE handle = (HANDLE)hf;
2203  ok(CloseHandle(handle), "Failed to CloseHandle\n");
2204 
2205  return 0;
2206 }
#define CloseHandle
Definition: compat.h:598
PVOID HANDLE
Definition: typedefs.h:73
#define ok(value,...)
Definition: atltest.h:57

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 2219 of file install.c.

2220 {
2221  BOOL ret = DeleteFileA(pszFile);
2222  ok(ret, "Failed to DeleteFile %s\n", pszFile);
2223 
2224  return 0;
2225 }
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
Definition: delete.c:24
int ret
#define ok(value,...)
Definition: atltest.h:57

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 2153 of file install.c.

2154 {
2155  HANDLE handle;
2156  DWORD dwAccess = 0;
2157  DWORD dwShareMode = 0;
2158  DWORD dwCreateDisposition = OPEN_EXISTING;
2159 
2160  dwAccess = GENERIC_READ | GENERIC_WRITE;
2162 
2164  dwCreateDisposition = OPEN_EXISTING;
2165  else
2166  dwCreateDisposition = CREATE_NEW;
2167 
2168  handle = CreateFileA(pszFile, dwAccess, dwShareMode, NULL,
2169  dwCreateDisposition, 0, NULL);
2170 
2171  ok(handle != INVALID_HANDLE_VALUE, "Failed to CreateFile %s\n", pszFile);
2172 
2173  return (INT_PTR)handle;
2174 }
#define INVALID_HANDLE_VALUE
Definition: compat.h:590
#define FILE_SHARE_WRITE
Definition: nt_native.h:681
int32_t INT_PTR
Definition: typedefs.h:64
#define FILE_SHARE_READ
Definition: compat.h:136
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
Definition: sock.c:82
DWORD WINAPI GetFileAttributesA(LPCSTR lpFileName)
Definition: fileinfo.c:636
#define GENERIC_WRITE
Definition: nt_native.h:90
#define OPEN_EXISTING
Definition: compat.h:634
unsigned long DWORD
Definition: ntddk_ex.h:95
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23
#define FILE_SHARE_DELETE
Definition: nt_native.h:682
#define GENERIC_READ
Definition: compat.h:135
#define ok(value,...)
Definition: atltest.h:57
#define NULL
Definition: types.h:112
#define CREATE_NEW
Definition: disk.h:69
#define CreateFileA(a, b, c, d, e, f, g)
Definition: compat.h:599

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 2176 of file install.c.

2177 {
2178  HANDLE handle = (HANDLE)hf;
2179  DWORD dwRead;
2180  BOOL res;
2181 
2182  res = ReadFile(handle, memory, cb, &dwRead, NULL);
2183  ok(res, "Failed to ReadFile\n");
2184 
2185  return dwRead;
2186 }
static char memory[1024 *256]
Definition: process.c:116
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
PVOID HANDLE
Definition: typedefs.h:73
#define ok(value,...)
Definition: atltest.h:57
#define ReadFile(a, b, c, d, e)
Definition: compat.h:601
#define NULL
Definition: types.h:112
static HMODULE MODULEINFO DWORD cb
Definition: module.c:32
GLuint res
Definition: glext.h:9613

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 2208 of file install.c.

2209 {
2210  HANDLE handle = (HANDLE)hf;
2211  DWORD ret;
2212 
2213  ret = SetFilePointer(handle, dist, NULL, seektype);
2214  ok(ret != INVALID_SET_FILE_POINTER, "Failed to SetFilePointer\n");
2215 
2216  return ret;
2217 }
unsigned long DWORD
Definition: ntddk_ex.h:95
PVOID HANDLE
Definition: typedefs.h:73
int ret
#define INVALID_SET_FILE_POINTER
Definition: compat.h:591
#define ok(value,...)
Definition: atltest.h:57
#define NULL
Definition: types.h:112
#define SetFilePointer
Definition: compat.h:602

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 2188 of file install.c.

2189 {
2190  HANDLE handle = (HANDLE)hf;
2191  DWORD dwWritten;
2192  BOOL res;
2193 
2194  res = WriteFile(handle, memory, cb, &dwWritten, NULL);
2195  ok(res, "Failed to WriteFile\n");
2196 
2197  return dwWritten;
2198 }
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: rw.c:24
static char memory[1024 *256]
Definition: process.c:116
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
PVOID HANDLE
Definition: typedefs.h:73
#define ok(value,...)
Definition: atltest.h:57
#define NULL
Definition: types.h:112
static HMODULE MODULEINFO DWORD cb
Definition: module.c:32
GLuint res
Definition: glext.h:9613

Referenced by create_cab_file(), and create_cc_test_files().

◆ file_exists()

BOOL file_exists ( const char file)

Definition at line 3615 of file install.c.

3616 {
3618 }
DWORD WINAPI GetFileAttributesA(LPCSTR lpFileName)
Definition: fileinfo.c:636
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23
Definition: fci.c:126

Referenced by pf_exists(), and test_icon_table().

◆ file_matches()

static BOOL file_matches ( LPSTR  path)
static

Definition at line 3410 of file install.c.

3411 {
3412  CHAR buf[MAX_PATH];
3413  HANDLE file;
3414  DWORD size;
3415 
3417  NULL, OPEN_EXISTING, 0, NULL);
3419  ReadFile(file, buf, 15, &size, NULL);
3420  CloseHandle(file);
3421 
3422  return !lstrcmpA(buf, "msitest\\maximus");
3423 }
DWORD size
Definition: install.c:3757
#define CloseHandle
Definition: compat.h:598
char CHAR
Definition: xmlstorage.h:175
int WINAPI lstrcmpA(LPCSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:18
#define ZeroMemory
Definition: winbase.h:1667
#define FILE_SHARE_WRITE
Definition: nt_native.h:681
#define FILE_SHARE_READ
Definition: compat.h:136
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define OPEN_EXISTING
Definition: compat.h:634
GLsizeiptr size
Definition: glext.h:5919
#define MAX_PATH
Definition: compat.h:34
const char file[]
Definition: icontest.c:11
unsigned long DWORD
Definition: ntddk_ex.h:95
#define GENERIC_READ
Definition: compat.h:135
#define ReadFile(a, b, c, d, e)
Definition: compat.h:601
#define NULL
Definition: types.h:112
#define CreateFileA(a, b, c, d, e, f, g)
Definition: compat.h:599
Definition: fci.c:126

Referenced by test_readonlyfile().

◆ file_matches_data()

static BOOL file_matches_data ( LPCSTR  file,
LPCSTR  data 
)
static

Definition at line 5323 of file install.c.

5324 {
5325  DWORD len, data_len = strlen(data);
5326  HANDLE handle;
5327  char buf[128];
5328 
5330  ok(handle != INVALID_HANDLE_VALUE, "failed to open %s (%lu)\n", file, GetLastError());
5331 
5332  if (ReadFile(handle, buf, sizeof(buf), &len, NULL) && len >= data_len)
5333  {
5335  return !memcmp(buf, data, data_len);
5336  }
5338  return FALSE;
5339 }
#define CloseHandle
Definition: compat.h:598
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define INVALID_HANDLE_VALUE
Definition: compat.h:590
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1040
#define FILE_SHARE_READ
Definition: compat.h:136
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
Definition: sock.c:82
#define FALSE
Definition: types.h:117
#define OPEN_EXISTING
Definition: compat.h:634
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLenum GLsizei len
Definition: glext.h:6722
#define GENERIC_READ
Definition: compat.h:135
#define ok(value,...)
Definition: atltest.h:57
#define ReadFile(a, b, c, d, e)
Definition: compat.h:601
#define NULL
Definition: types.h:112
#define CreateFileA(a, b, c, d, e, f, g)
Definition: compat.h:599
Definition: fci.c:126

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 2147 of file install.c.

2149 {
2150  return 0;
2151 }

Referenced by create_cab_file(), and create_cc_test_files().

◆ generate_transform()

static void generate_transform ( void  )
static

Definition at line 3697 of file install.c.

3698 {
3699  MSIHANDLE hdb1, hdb2;
3700  LPCSTR query;
3701  UINT r;
3702 
3703  /* start with two identical databases */
3705 
3707  ok(r == ERROR_SUCCESS , "Failed to create database\n");
3708 
3709  r = MsiDatabaseCommit(hdb1);
3710  ok(r == ERROR_SUCCESS , "Failed to commit database\n");
3711 
3713  ok(r == ERROR_SUCCESS , "Failed to create database\n");
3714 
3715  query = "INSERT INTO `Property` ( `Property`, `Value` ) VALUES ( 'prop', 'val' )";
3716  r = run_query(hdb1, 0, query);
3717  ok(r == ERROR_SUCCESS, "failed to add property\n");
3718 
3719  /* database needs to be committed */
3720  MsiDatabaseCommit(hdb1);
3721 
3722  r = MsiDatabaseGenerateTransformA(hdb1, hdb2, mstfile, 0, 0);
3723  ok(r == ERROR_SUCCESS, "return code %d, should be ERROR_SUCCESS\n", r);
3724 
3725  r = MsiCreateTransformSummaryInfoA(hdb2, hdb2, mstfile, 0, 0);
3726  todo_wine ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
3727 
3728  MsiCloseHandle(hdb1);
3729  MsiCloseHandle(hdb2);
3730 }
#define MSIDBOPEN_READONLY
Definition: msiquery.h:66
static const WCHAR msifileW[]
Definition: install.c:62
#define ERROR_SUCCESS
Definition: deptool.c:10
static const char * msifile
Definition: install.c:58
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
static const WCHAR msifile2W[]
Definition: install.c:63
#define todo_wine
Definition: custom.c:79
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:1239
UINT run_query(MSIHANDLE hdb, MSIHANDLE hrec, const char *query)
Definition: install.c:3653
UINT WINAPI MsiDatabaseGenerateTransformA(MSIHANDLE hdb, MSIHANDLE hdbref, const char *szTransformFile, int iReserved1, int iReserved2)
Definition: msiquery.c:949
#define FALSE
Definition: types.h:117
unsigned long MSIHANDLE
Definition: winemsi.idl:24
const char * LPCSTR
Definition: xmlstorage.h:183
#define MSIDBOPEN_TRANSACT
Definition: msiquery.h:67
UINT WINAPI MsiCloseHandle(MSIHANDLE handle)
Definition: handle.c:269
UINT WINAPI MsiDatabaseCommit(MSIHANDLE hdb)
Definition: msiquery.c:963
#define ok(value,...)
Definition: atltest.h:57
UINT WINAPI MsiOpenDatabaseW(LPCWSTR szDBPath, LPCWSTR szPersist, MSIHANDLE *phDB)
Definition: database.c:298
unsigned int UINT
Definition: ndis.h:50
static const char * msifile2
Definition: install.c:59
static const char * mstfile
Definition: install.c:60
GLenum query
Definition: glext.h:7781

Referenced by test_transformprop().

◆ generate_transform_manual()

static void generate_transform_manual ( void  )
static

Definition at line 3765 of file install.c.

3766 {
3767  IStorage *stg = NULL;
3768  IStream *stm;
3769  WCHAR name[0x20];
3770  HRESULT r;
3771  DWORD i, count;
3773 
3774  const CLSID CLSID_MsiTransform = { 0xc1082,0,0,{0xc0,0,0,0,0,0,0,0x46}};
3775 
3776  MultiByteToWideChar(CP_ACP, 0, mstfile, -1, name, 0x20);
3777 
3778  r = StgCreateDocfile(name, mode, 0, &stg);
3779  ok(r == S_OK, "failed to create storage\n");
3780  if (!stg)
3781  return;
3782 
3783  r = IStorage_SetClass(stg, &CLSID_MsiTransform);
3784  ok(r == S_OK, "failed to set storage type\n");
3785 
3786  for (i=0; i<ARRAY_SIZE(table_transform_data); i++)
3787  {
3788  r = IStorage_CreateStream(stg, table_transform_data[i].name,
3789  STGM_WRITE | STGM_SHARE_EXCLUSIVE, 0, 0, &stm);
3790  if (FAILED(r))
3791  {
3792  ok(0, "failed to create stream %#lx\n", r);
3793  continue;
3794  }
3795 
3796  r = IStream_Write(stm, table_transform_data[i].data,
3798  if (FAILED(r) || count != table_transform_data[i].size)
3799  ok(0, "failed to write stream\n");
3800  IStream_Release(stm);
3801  }
3802 
3803  IStorage_Release(stg);
3804 
3806 }
#define STGM_SHARE_EXCLUSIVE
Definition: objbase.h:923
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define CP_ACP
Definition: compat.h:109
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define STGM_CREATE
Definition: objbase.h:926
static void set_transform_summary_info(void)
Definition: install.c:3669
#define STGM_WRITE
Definition: objbase.h:918
GLsizeiptr size
Definition: glext.h:5919
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:79
#define STGM_DIRECT
Definition: objbase.h:914
static const struct @1635 table_transform_data[]
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
HRESULT WINAPI StgCreateDocfile(LPCOLESTR pwcsName, DWORD grfMode, DWORD reserved, IStorage **ppstgOpen)
Definition: storage32.c:8636
GLenum mode
Definition: glext.h:6217
#define STGM_READWRITE
Definition: objbase.h:919
#define S_OK
Definition: intsafe.h:52
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 ARRAY_SIZE(a)
Definition: main.h:24
#define ok(value,...)
Definition: atltest.h:57
#define NULL
Definition: types.h:112
#define MultiByteToWideChar
Definition: compat.h:110
Definition: name.c:38
static const char * mstfile
Definition: install.c:60

Referenced by test_transformprop().

◆ get_next_cabinet()

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

Definition at line 2136 of file install.c.

2137 {
2138  sprintf(pccab->szCab, pv, pccab->iCab);
2139  return TRUE;
2140 }
#define TRUE
Definition: types.h:120
int iCab
Definition: fci.h:151
#define sprintf(buf, format,...)
Definition: sprintf.c:55
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 2319 of file install.c.

2321 {
2324  HANDLE handle;
2325  DWORD attrs;
2326  BOOL res;
2327 
2330 
2331  ok(handle != INVALID_HANDLE_VALUE, "Failed to CreateFile %s\n", pszName);
2332 
2334  ok(res, "Expected GetFileInformationByHandle to succeed\n");
2335 
2337  FileTimeToDosDateTime(&filetime, pdate, ptime);
2338 
2339  attrs = GetFileAttributesA(pszName);
2340  ok(attrs != INVALID_FILE_ATTRIBUTES, "Failed to GetFileAttributes\n");
2341 
2342  return (INT_PTR)handle;
2343 }
#define INVALID_HANDLE_VALUE
Definition: compat.h:590
int32_t INT_PTR
Definition: typedefs.h:64
BOOL WINAPI FileTimeToLocalFileTime(IN CONST FILETIME *lpFileTime, OUT LPFILETIME lpLocalFileTime)
Definition: time.c:221
#define FILE_SHARE_READ
Definition: compat.h:136
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
Definition: sock.c:82
unsigned int BOOL
Definition: ntddk_ex.h:94
DWORD WINAPI GetFileAttributesA(LPCSTR lpFileName)
Definition: fileinfo.c:636
#define OPEN_EXISTING
Definition: compat.h:634
BOOL WINAPI GetFileInformationByHandle(HANDLE hFile, LPBY_HANDLE_FILE_INFORMATION lpFileInformation)
Definition: fileinfo.c:458
unsigned long DWORD
Definition: ntddk_ex.h:95
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:137
#define GENERIC_READ
Definition: compat.h:135
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
#define ok(value,...)
Definition: atltest.h:57
#define NULL
Definition: types.h:112
GLuint res
Definition: glext.h:9613
#define CreateFileA(a, b, c, d, e, f, g)
Definition: compat.h:599

Referenced by add_file().

◆ get_pf_file_size()

static DWORD get_pf_file_size ( LPCSTR  file)
static

Definition at line 4657 of file install.c.

4658 {
4659  CHAR path[MAX_PATH];
4660  HANDLE hfile;
4661  DWORD size;
4662 
4664  lstrcatA(path, "\\");
4665  lstrcatA(path, file);
4666 
4668  if (hfile == INVALID_HANDLE_VALUE)
4669  return INVALID_FILE_SIZE;
4670 
4671  size = GetFileSize(hfile, NULL);
4672  CloseHandle(hfile);
4673  return size;
4674 }
DWORD size
Definition: install.c:3757
#define CloseHandle
Definition: compat.h:598
char PROG_FILES_DIR[MAX_PATH]
Definition: install.c:66
char CHAR
Definition: xmlstorage.h:175
#define INVALID_HANDLE_VALUE
Definition: compat.h:590
#define INVALID_FILE_SIZE
Definition: winbase.h:545
#define FILE_SHARE_READ
Definition: compat.h:136
#define OPEN_EXISTING
Definition: compat.h:634
LPSTR WINAPI lstrcatA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:123
GLsizeiptr size
Definition: glext.h:5919
#define MAX_PATH
Definition: compat.h:34
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD WINAPI GetFileSize(HANDLE hFile, LPDWORD lpFileSizeHigh)
Definition: fileinfo.c:331
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:100
#define GENERIC_READ
Definition: compat.h:135
#define NULL
Definition: types.h:112
#define CreateFileA(a, b, c, d, e, f, g)
Definition: compat.h:599
Definition: fci.c:126

Referenced by test_sourcepath().

◆ get_system_dirs()

BOOL get_system_dirs ( void  )

Definition at line 2423 of file install.c.

2424 {
2425  HKEY hkey;
2426  DWORD type, size;
2427 
2428  if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion",
2429  0, KEY_QUERY_VALUE | KEY_WOW64_64KEY, &hkey))
2430  return FALSE;
2431 
2432  size = MAX_PATH;
2433  if (RegQueryValueExA(hkey, "ProgramFilesDir (x86)", 0, &type, (LPBYTE)PROG_FILES_DIR, &size) &&
2434  RegQueryValueExA(hkey, "ProgramFilesDir", 0, &type, (LPBYTE)PROG_FILES_DIR, &size)) {
2435  RegCloseKey(hkey);
2436  return FALSE;
2437  }
2438 
2439  size = MAX_PATH;
2440  if (RegQueryValueExA(hkey, "CommonFilesDir (x86)", 0, &type, (LPBYTE)COMMON_FILES_DIR, &size) &&
2441  RegQueryValueExA(hkey, "CommonFilesDir", 0, &type, (LPBYTE)COMMON_FILES_DIR, &size)) {
2442  RegCloseKey(hkey);
2443  return FALSE;
2444  }
2445 
2446  size = MAX_PATH;
2447  if (RegQueryValueExA(hkey, "ProgramFilesDir", 0, &type, (LPBYTE)PROG_FILES_DIR_NATIVE, &size)) {
2448  RegCloseKey(hkey);
2449  return FALSE;
2450  }
2451 
2452  RegCloseKey(hkey);
2453 
2455  return FALSE;
2456 
2457  return TRUE;
2458 }
DWORD size
Definition: install.c:3757
LONG WINAPI RegQueryValueExA(_In_ HKEY hkeyorg, _In_ LPCSTR name, _In_ LPDWORD reserved, _Out_opt_ LPDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ LPDWORD count)
Definition: reg.c:4027
#define TRUE
Definition: types.h:120
char PROG_FILES_DIR[MAX_PATH]
Definition: install.c:66
LONG WINAPI RegOpenKeyExA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey, _In_ DWORD ulOptions, _In_ REGSAM samDesired, _Out_ PHKEY phkResult)
Definition: reg.c:3321
unsigned char * LPBYTE
Definition: typedefs.h:53
#define FALSE
Definition: types.h:117
#define KEY_WOW64_64KEY
Definition: cmtypes.h:46
GLsizeiptr size
Definition: glext.h:5919
#define MAX_PATH
Definition: compat.h:34
unsigned long DWORD
Definition: ntddk_ex.h:95
char PROG_FILES_DIR_NATIVE[MAX_PATH]
Definition: install.c:67
char COMMON_FILES_DIR[MAX_PATH]
Definition: install.c:68
#define KEY_QUERY_VALUE
Definition: nt_native.h:1016
UINT WINAPI GetWindowsDirectoryA(OUT LPSTR lpBuffer, IN UINT uSize)
Definition: path.c:2337
char WINDOWS_DIR[MAX_PATH]
Definition: install.c:70
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define RegCloseKey(hKey)
Definition: registry.h:47
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

Referenced by START_TEST().

◆ get_temp_file()

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

Definition at line 2301 of file install.c.

2302 {
2303  LPSTR tempname;
2304 
2305  tempname = malloc(MAX_PATH);
2306  GetTempFileNameA(".", "xx", 0, tempname);
2307 
2308  if (tempname && (strlen(tempname) < (unsigned)cbTempName))
2309  {
2310  lstrcpyA(pszTempName, tempname);
2311  free(tempname);
2312  return TRUE;
2313  }
2314 
2315  free(tempname);
2316  return FALSE;
2317 }
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define TRUE
Definition: types.h:120
#define free
Definition: debug_ros.c:5
char * LPSTR
Definition: xmlstorage.h:182
#define FALSE
Definition: types.h:117
#define MAX_PATH
Definition: compat.h:34
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:100
#define malloc
Definition: debug_ros.c:4
UINT WINAPI GetTempFileNameA(IN LPCSTR lpPathName, IN LPCSTR lpPrefixString, IN UINT uUnique, OUT LPSTR lpTempFileName)
Definition: filename.c:26

Referenced by create_cab_file(), and create_cc_test_files().

◆ get_user_dirs()

BOOL get_user_dirs ( void  )

Definition at line 2404 of file install.c.

2405 {
2406  HKEY hkey;
2407  DWORD type, size;
2408 
2410  "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders", &hkey))
2411  return FALSE;
2412 
2413  size = MAX_PATH;
2414  if(RegQueryValueExA(hkey, "AppData", 0, &type, (LPBYTE)APP_DATA_DIR, &size)){
2415  RegCloseKey(hkey);
2416  return FALSE;
2417  }
2418 
2419  RegCloseKey(hkey);
2420  return TRUE;
2421 }
DWORD size
Definition: install.c:3757
LONG WINAPI RegOpenKeyA(HKEY hKey, LPCSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3257
LONG WINAPI RegQueryValueExA(_In_ HKEY hkeyorg, _In_ LPCSTR name, _In_ LPDWORD reserved, _Out_opt_ LPDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ LPDWORD count)
Definition: reg.c:4027
#define TRUE
Definition: types.h:120
#define HKEY_CURRENT_USER
Definition: winreg.h:11
unsigned char * LPBYTE
Definition: typedefs.h:53
#define FALSE
Definition: types.h:117
GLsizeiptr size
Definition: glext.h:5919
char APP_DATA_DIR[MAX_PATH]
Definition: install.c:69
#define MAX_PATH
Definition: compat.h:34
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define RegCloseKey(hKey)
Definition: registry.h:47

Referenced by START_TEST().

◆ init_functionpointers()

static void init_functionpointers ( void  )
static

Definition at line 2227 of file install.c.

2228 {
2229  HMODULE hmsi = GetModuleHandleA("msi.dll");
2230  HMODULE hadvapi32 = GetModuleHandleA("advapi32.dll");
2231  HMODULE hkernel32 = GetModuleHandleA("kernel32.dll");
2232  HMODULE hsrclient = LoadLibraryA("srclient.dll");
2233 
2234 #define GET_PROC(mod, func) \
2235  p ## func = (void*)GetProcAddress(mod, #func); \
2236  if(!p ## func) \
2237  trace("GetProcAddress(%s) failed\n", #func);
2238 
2242 
2243  GET_PROC(hadvapi32, RegDeleteKeyExA)
2247 
2248  GET_PROC(hsrclient, SRRemoveRestorePoint);
2249  GET_PROC(hsrclient, SRSetRestorePointA);
2250 
2251 #undef GET_PROC
2252 }
BOOL WINAPI Wow64RevertWow64FsRedirection(IN PVOID OldValue)
Definition: utils.c:808
INSTALLSTATE WINAPI MsiGetComponentPathExA(LPCSTR product, LPCSTR comp, LPCSTR usersid, MSIINSTALLCONTEXT ctx, LPSTR buf, LPDWORD buflen)
Definition: msi.c:2866
LONG WINAPI RegDeleteKeyExA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey, _In_ REGSAM samDesired, _In_ DWORD Reserved)
Definition: reg.c:1252
static HINSTANCE hkernel32
Definition: process.c:66
UINT WINAPI MsiSourceListEnumSourcesA(const char *szProductCodeOrPatch, const char *szUserSid, MSIINSTALLCONTEXT dwContext, DWORD dwOptions, DWORD dwIndex, char *szSource, DWORD *pcchSource)
Definition: source.c:329
DWORD WINAPI SRRemoveRestorePoint(DWORD dwNumber)
Definition: srclient_main.c:71
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
Definition: loader.c:111
BOOL WINAPI IsWow64Process(IN HANDLE hProcess, OUT PBOOL Wow64Process)
Definition: proc.c:1975
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:812
BOOL WINAPI SRSetRestorePointA(PRESTOREPOINTINFOA pRestorePtSpec, PSTATEMGRSTATUS pSMgrStatus)
Definition: sfc.c:54
#define GET_PROC(mod, func)
UINT WINAPI MsiQueryComponentStateA(LPCSTR szProductCode, LPCSTR szUserSid, MSIINSTALLCONTEXT dwContext, LPCSTR szComponent, INSTALLSTATE *pdwState)
Definition: msi.c:2057
BOOL WINAPI Wow64DisableWow64FsRedirection(IN PVOID *OldValue)
Definition: utils.c:785

Referenced by START_TEST().

◆ INSTALLSTATE()

static INSTALLSTATE ( WINAPI pMsiGetComponentPathExA)
static

◆ is_process_limited()

BOOL is_process_limited ( void  )

Definition at line 2254 of file install.c.

2255 {
2257  PSID Group = NULL;
2258  BOOL IsInGroup;
2259  HANDLE token;
2260 
2262  DOMAIN_ALIAS_RID_ADMINS, 0, 0, 0, 0, 0, 0, &Group) ||
2263  !CheckTokenMembership(NULL, Group, &IsInGroup))
2264  {
2265  trace("Could not check if the current user is an administrator\n");
2266  FreeSid(Group);
2267  return FALSE;
2268  }
2269  FreeSid(Group);
2270 
2271  if (!IsInGroup)
2272  {
2273  /* Only administrators have enough privileges for these tests */
2274  return TRUE;
2275  }
2276 
2278  {
2279  BOOL ret;
2281  DWORD size;
2282 
2284  CloseHandle(token);
2285  return (ret && type == TokenElevationTypeLimited);
2286  }
2287  return FALSE;
2288 }
DWORD size
Definition: install.c:3757
enum _TOKEN_ELEVATION_TYPE TOKEN_ELEVATION_TYPE
#define CloseHandle
Definition: compat.h:598
#define TRUE
Definition: types.h:120
_In_opt_ PSID Group
Definition: rtlfuncs.h:1632
BOOL WINAPI CheckTokenMembership(IN HANDLE ExistingTokenHandle, IN PSID SidToCheck, OUT PBOOL IsMember)
Definition: token.c:21
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
PVOID WINAPI FreeSid(PSID pSid)
Definition: security.c:700
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat token
Definition: glfuncs.h:210
#define SECURITY_NT_AUTHORITY
Definition: setypes.h:554
GLsizeiptr size
Definition: glext.h:5919
#define trace
Definition: atltest.h:70
#define SECURITY_BUILTIN_DOMAIN_RID
Definition: setypes.h:581
#define TOKEN_QUERY
Definition: setypes.h:924
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
static SID_IDENTIFIER_AUTHORITY NtAuthority
Definition: security.c:40
#define GetCurrentProcess()
Definition: compat.h:618
#define NULL
Definition: types.h:112
BOOL WINAPI OpenProcessToken(HANDLE ProcessHandle, DWORD DesiredAccess, PHANDLE TokenHandle)
Definition: security.c:296
BOOL WINAPI GetTokenInformation(HANDLE TokenHandle, TOKEN_INFORMATION_CLASS TokenInformationClass, LPVOID TokenInformation, DWORD TokenInformationLength, PDWORD ReturnLength)
Definition: security.c:413
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define DOMAIN_ALIAS_RID_ADMINS
Definition: setypes.h:652
BOOL WINAPI AllocateAndInitializeSid(PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority, BYTE nSubAuthorityCount, DWORD nSubAuthority0, DWORD nSubAuthority1, DWORD nSubAuthority2, DWORD nSubAuthority3, DWORD nSubAuthority4, DWORD nSubAuthority5, DWORD nSubAuthority6, DWORD nSubAuthority7, PSID *pSid)
Definition: security.c:676

Referenced by 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 2632 of file install.c.

2633 {
2634  static char path[MAX_PATH];
2635  DWORD written;
2636  HANDLE file;
2637  HRSRC res;
2638  void *ptr;
2639 
2640  GetTempFileNameA(".", name, 0, path);
2641 
2643  ok(file != INVALID_HANDLE_VALUE, "file creation failed, at %s, error %lu\n", path, GetLastError());
2644 
2645  res = FindResourceA(NULL, name, "TESTDLL");
2646  ok( res != 0, "couldn't find resource\n" );
2649  ok( written == SizeofResource( GetModuleHandleA(NULL), res ), "couldn't write resource\n" );
2650  CloseHandle( file );
2651 
2652  return path;
2653 }
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 CloseHandle
Definition: compat.h:598
GLsizei const GLchar ** path
Definition: glext.h:7234
HRSRC WINAPI FindResourceA(HMODULE hModule, LPCSTR name, LPCSTR type)
Definition: res.c:155
#define INVALID_HANDLE_VALUE
Definition: compat.h:590
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1040
LPVOID WINAPI LockResource(HGLOBAL handle)
Definition: res.c:550
#define GENERIC_WRITE
Definition: nt_native.h:90
static PVOID ptr
Definition: dispmode.c:27
HGLOBAL WINAPI LoadResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:532
#define MAX_PATH
Definition: compat.h:34
const char file[]
Definition: icontest.c:11
unsigned long DWORD
Definition: ntddk_ex.h:95
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:812
#define GENERIC_READ
Definition: compat.h:135
#define CREATE_ALWAYS
Definition: disk.h:72
#define ok(value,...)
Definition: atltest.h:57
#define NULL
Definition: types.h:112
DWORD WINAPI SizeofResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:568
Definition: name.c:38
GLuint res
Definition: glext.h:9613
#define CreateFileA(a, b, c, d, e, f, g)
Definition: compat.h:599
UINT WINAPI GetTempFileNameA(IN LPCSTR lpPathName, IN LPCSTR lpPrefixString, IN UINT uUnique, OUT LPSTR lpTempFileName)
Definition: filename.c:26
Definition: fci.c:126

Referenced by add_custom_dll().

◆ LONG()

static LONG ( WINAPI pRegDeleteKeyExA)
static

◆ mem_alloc()

static void* CDECL mem_alloc ( ULONG  cb)
static

Definition at line 2126 of file install.c.

2127 {
2128  return malloc(cb);
2129 }
static HMODULE MODULEINFO DWORD cb
Definition: module.c:32
#define malloc
Definition: debug_ros.c:4

Referenced by create_cab_file(), and create_cc_test_files().

◆ mem_free()

static void CDECL mem_free ( void memory)
static

Definition at line 2131 of file install.c.

2132 {
2133  free(memory);
2134 }
#define free
Definition: debug_ros.c:5
static char memory[1024 *256]
Definition: process.c:116

Referenced by create_cab_file(), and create_cc_test_files().

◆ notify_system_change()

static BOOL notify_system_change ( DWORD  event_type,
STATEMGRSTATUS status 
)
static

Definition at line 2737 of file install.c.

2738 {
2739  RESTOREPOINTINFOA spec;
2740 
2741  spec.dwEventType = event_type;
2743  spec.llSequenceNumber = status->llSequenceNumber;
2744  lstrcpyA(spec.szDescription, "msitest restore point");
2745 
2746  return pSRSetRestorePointA(&spec, status);
2747 }
#define APPLICATION_INSTALL
CHAR szDescription[MAX_DESC]
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:100
Definition: ps.c:97

Referenced by START_TEST().

◆ ok_callback()

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

Definition at line 2655 of file install.c.

2656 {
2657  if (message_type == INSTALLMESSAGE_USER)
2658  {
2659  char file[200];
2660  char msg[2000];
2661  DWORD len;
2662 
2663  len = sizeof(file);
2665  len = sizeof(msg);
2667 
2670 
2671  return 1;
2672  }
2673  return 0;
2674 }
return
Definition: dirsup.c:529
UINT WINAPI MsiRecordGetStringA(MSIHANDLE handle, UINT iField, char *szValue, DWORD *pcchValue)
Definition: record.c:403
int WINAPI MsiRecordGetInteger(MSIHANDLE handle, UINT iField)
Definition: record.c:237
#define todo_wine_if(is_todo)
Definition: custom.c:76
const char file[]
Definition: icontest.c:11
unsigned long DWORD
Definition: ntddk_ex.h:95
GLenum GLsizei len
Definition: glext.h:6722
GLdouble s
Definition: gl.h:2039
#define msg(x)
Definition: auth_time.c:54
#define ok_(x1, x2)
Definition: atltest.h:61
Definition: fci.c:126

Referenced by add_custom_dll().

◆ pf_exists()

BOOL pf_exists ( const char file)

Definition at line 3620 of file install.c.

3621 {
3622  CHAR path[MAX_PATH];
3623 
3625  lstrcatA(path, "\\");
3626  lstrcatA(path, file);
3627 
3628  return file_exists(path);
3629 }
BOOL file_exists(const char *file)
Definition: install.c:3615
char PROG_FILES_DIR[MAX_PATH]
Definition: install.c:66
char CHAR
Definition: xmlstorage.h:175
LPSTR WINAPI lstrcatA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:123
#define MAX_PATH
Definition: compat.h:34
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:100
Definition: fci.c:126

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 5257 of file install.c.

5258 {
5259  char *buf, *src, *dst, *buf2, *buf2ptr;
5260  DWORD size;
5261  LONG ret;
5262  BOOL found = FALSE;
5263 
5265  ok(!ret, "RegQueryValueExA failed %ld\n", ret);
5266 
5267  buf = malloc(size + 1);
5268  buf2ptr = buf2 = calloc(1, size + 1);
5269 
5271  buf[size] = 0;
5272  ok(!ret, "RegQueryValueExA failed %ld\n", ret);
5273  if (ret) return;
5274 
5275  for (src = buf; *src; src = dst + strlen(dst) + 1)
5276  {
5278  BOOL fileret;
5279 
5280  dst = src + strlen(src) + 1;
5281 
5282  if (!strstr(src, "msitest"))
5283  {
5284  lstrcpyA(buf2ptr, src);
5285  buf2ptr += strlen(src) + 1;
5286  lstrcpyA(buf2ptr, dst);
5287  buf2ptr += strlen(dst) + 1;
5288  continue;
5289  }
5290 
5291  found = TRUE;
5292 
5293  if (*dst == '!')
5294  {
5296  dst++;
5297  }
5298  if (src[0] == '\\' && src[1] == '?' && src[2] == '?' && src[3] == '\\') src += 4;
5299  if (*dst)
5300  {
5301  if (dst[0] == '\\' && dst[1] == '?' && dst[2] == '?' && dst[3] == '\\') dst += 4;
5302  fileret = MoveFileExA(src, dst, flags);
5303  ok(fileret, "Failed to move file %s -> %s (%lu)\n", src, dst, GetLastError());
5304  }
5305  else
5306  {
5307  fileret = DeleteFileA(src);
5308  ok(fileret || broken(!fileret) /* win2k3 */, "Failed to delete file %s (%lu)\n", src, GetLastError());
5309  }
5310  }
5311 
5312  ok(found, "Expected a 'msitest' entry\n");
5313 
5314  if (*buf2)
5315  RegSetValueExA(hkey, rename_ops, 0, REG_MULTI_SZ, (LPBYTE)buf2, buf2ptr + 1 - buf2);
5316  else
5317  RegDeleteValueA(hkey, rename_ops);
5318 
5319  free(buf);
5320  free(buf2);
5321 }
DWORD size
Definition: install.c:3757
LONG WINAPI RegQueryValueExA(_In_ HKEY hkeyorg, _In_ LPCSTR name, _In_ LPDWORD reserved, _Out_opt_ LPDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ LPDWORD count)
Definition: reg.c:4027
BOOL WINAPI MoveFileExA(IN LPCSTR lpExistingFileName, IN LPCSTR lpNewFileName OPTIONAL, IN DWORD dwFlags)
Definition: move.c:1093
#define MOVEFILE_REPLACE_EXISTING
Definition: filesup.h:28
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define TRUE
Definition: types.h:120
char * strstr(char *String1, char *String2)
Definition: utclib.c:653
#define MOVEFILE_COPY_ALLOWED
Definition: filesup.h:29
#define free
Definition: debug_ros.c:5
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1040
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
unsigned char * LPBYTE
Definition: typedefs.h:53
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
#define REG_MULTI_SZ
Definition: nt_native.h:1501
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
Definition: delete.c:24
GLsizeiptr size
Definition: glext.h:5919
static const char rename_ops[]
Definition: install.c:5255
unsigned long DWORD
Definition: ntddk_ex.h:95
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:100
GLbitfield flags
Definition: glext.h:7161
int ret
GLenum src
Definition: glext.h:6340
#define broken(x)
Definition: _sntprintf.h:21
#define ok(value,...)
Definition: atltest.h:57
LONG WINAPI RegDeleteValueA(HKEY hKey, LPCSTR lpValueName)
Definition: reg.c:2319
GLenum GLenum dst
Definition: glext.h:6340
#define NULL
Definition: types.h:112
#define calloc
Definition: rosglue.h:14
#define malloc
Definition: debug_ros.c:4
LONG WINAPI RegSetValueExA(HKEY hKey, LPCSTR lpValueName, DWORD Reserved, DWORD dwType, CONST BYTE *lpData, DWORD cbData)
Definition: reg.c:4816

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 2142 of file install.c.

2143 {
2144  return 0;
2145 }

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

◆ remove_restore_point()

static void remove_restore_point ( DWORD  seq_number)
static

Definition at line 2749 of file install.c.

2750 {
2751  DWORD res;
2752 
2753  res = pSRRemoveRestorePoint(seq_number);
2754  if (res != ERROR_SUCCESS)
2755  trace("Failed to remove the restore point: %#lx\n", res);
2756 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define trace
Definition: atltest.h:70
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint res
Definition: glext.h:9613

Referenced by START_TEST().

◆ run_query()

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

Definition at line 3653 of file install.c.

3654 {
3655  MSIHANDLE hview = 0;
3656  UINT r;
3657 
3658  r = MsiDatabaseOpenViewA(hdb, query, &hview);
3659  if(r != ERROR_SUCCESS)
3660  return r;
3661 
3662  r = MsiViewExecute(hview, hrec);
3663  if(r == ERROR_SUCCESS)
3664  r = MsiViewClose(hview);
3665  MsiCloseHandle(hview);
3666  return r;
3667 }
UINT WINAPI MsiViewExecute(MSIHANDLE hView, MSIHANDLE hRec)
Definition: msiquery.c:518
#define ERROR_SUCCESS
Definition: deptool.c:10
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
UINT WINAPI MsiViewClose(MSIHANDLE hView)
Definition: msiquery.c:469
UINT WINAPI MsiDatabaseOpenViewA(MSIHANDLE hdb, const char *szQuery, MSIHANDLE *phView)
Definition: msiquery.c:88
unsigned long MSIHANDLE
Definition: winemsi.idl:24
UINT WINAPI MsiCloseHandle(MSIHANDLE handle)
Definition: handle.c:269
unsigned int UINT
Definition: ndis.h:50

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 3987 of file install.c.

3988 {
3989  IStorage *stg;
3990  IStream *stm;
3991  WCHAR fileW[MAX_PATH];
3992  HRESULT hr;
3993  DWORD count;
3995 
3997 
3998  hr = StgOpenStorage(fileW, NULL, mode, NULL, 0, &stg);
3999  ok(hr == S_OK, "Expected S_OK, got %#lx\n", hr);
4000  if (!stg)
4001  return;
4002 
4003  hr = IStorage_CreateStream(stg, L"\x41ca\x4330\x3e71\x44b5\x4233\x45f5\x422c\x4836",
4004  STGM_WRITE | STGM_SHARE_EXCLUSIVE, 0, 0, &stm);
4005  ok(hr == S_OK, "Expected S_OK, got %#lx\n", hr);
4006 
4007  hr = IStream_Write(stm, L"MYPROP=2718 MyProp=42", sizeof(L"MYPROP=2718 MyProp=42"), &count);
4008  ok(hr == S_OK, "Expected S_OK, got %#lx\n", hr);
4009 
4010  IStream_Release(stm);
4011  IStorage_Release(stg);
4012 }
HRESULT hr
Definition: shlfolder.c:183
#define STGM_SHARE_EXCLUSIVE
Definition: objbase.h:923
#define CP_ACP
Definition: compat.h:109
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define L(x)
Definition: ntvdm.h:50
#define STGM_WRITE
Definition: objbase.h:918
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:79
HRESULT WINAPI StgOpenStorage(const OLECHAR *pwcsName, IStorage *pstgPriority, DWORD grfMode, SNB snbExclude, DWORD reserved, IStorage **ppstgOpen)
Definition: storage32.c:8755
#define STGM_DIRECT
Definition: objbase.h:914
#define MAX_PATH
Definition: compat.h:34
unsigned long DWORD
Definition: ntddk_ex.h:95
GLenum mode
Definition: glext.h:6217
#define STGM_READWRITE
Definition: objbase.h:919
#define S_OK
Definition: intsafe.h:52
#define ok(value,...)
Definition: atltest.h:57
#define NULL
Definition: types.h:112
#define MultiByteToWideChar
Definition: compat.h:110
static const WCHAR fileW[]
Definition: url.c:111
Definition: fci.c:126

Referenced by test_adminprops().

◆ set_admin_summary_info()

static void set_admin_summary_info ( const WCHAR name)
static

Definition at line 3920 of file install.c.

3921 {
3922  MSIHANDLE db, summary;
3923  UINT r;
3924 
3926  ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3927 
3928  r = MsiGetSummaryInformationA(db, NULL, 1, &summary);
3929  ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3930 
3932  ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3933 
3934  /* write the summary changes back to the stream */
3935  r = MsiSummaryInfoPersist(summary);
3936  ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3937 
3938  MsiCloseHandle(summary);
3939 
3940  r = MsiDatabaseCommit(db);
3941  ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3942 
3943  MsiCloseHandle(db);
3944 }
Definition: compat.h:2157
#define ERROR_SUCCESS
Definition: deptool.c:10
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define MSIDBOPEN_DIRECT
Definition: msiquery.h:68
unsigned long MSIHANDLE
Definition: winemsi.idl:24
UINT WINAPI MsiSummaryInfoSetPropertyA(MSIHANDLE handle, UINT uiProperty, UINT uiDataType, INT iValue, FILETIME *pftValue, const char *szValue)
Definition: suminfo.c:937
UINT WINAPI MsiCloseHandle(MSIHANDLE handle)
Definition: handle.c:269
UINT WINAPI MsiGetSummaryInformationA(MSIHANDLE hDatabase, const char *szDatabase, UINT uiUpdateCount, MSIHANDLE *pHandle)
Definition: suminfo.c:584
UINT WINAPI MsiDatabaseCommit(MSIHANDLE hdb)
Definition: msiquery.c:963
#define ok(value,...)
Definition: atltest.h:57
UINT WINAPI MsiOpenDatabaseW(LPCWSTR szDBPath, LPCWSTR szPersist, MSIHANDLE *phDB)
Definition: database.c:298
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
UINT WINAPI MsiSummaryInfoPersist(MSIHANDLE handle)
Definition: suminfo.c:1222
#define PID_WORDCOUNT
Definition: suminfo.c:57
Definition: name.c:38

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 2360 of file install.c.

2361 {
2362  ZeroMemory(pCabParams, sizeof(CCAB));
2363 
2364  pCabParams->cb = max_size;
2365  pCabParams->cbFolderThresh = FOLDER_THRESHOLD;
2366  pCabParams->setID = 0xbeef;
2367  pCabParams->iCab = 1;
2368  lstrcpyA(pCabParams->szCabPath, CURR_DIR);
2369  lstrcatA(pCabParams->szCabPath, "\\");
2370  lstrcpyA(pCabParams->szCab, name);
2371 }
ULONG cbFolderThresh
Definition: fci.h:146
#define ZeroMemory
Definition: winbase.h:1667
Definition: fci.h:144
char CURR_DIR[MAX_PATH]
Definition: install.c:65
int iCab
Definition: fci.h:151
char szCab[CB_MAX_CABINET_NAME]
Definition: fci.h:160
static INT max_size
Definition: history.c:51
ULONG cb
Definition: fci.h:145
LPSTR WINAPI lstrcatA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:123
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:100
USHORT setID
Definition: fci.h:157
Definition: name.c:38
char szCabPath[CB_MAX_CAB_PATH]
Definition: fci.h:161
#define FOLDER_THRESHOLD
Definition: install.c:2122

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 3669 of file install.c.

3670 {
3671  UINT r;
3672  MSIHANDLE suminfo = 0;
3673 
3674  /* build summary info */
3676  ok(r == ERROR_SUCCESS , "Failed to open summaryinfo\n");
3677 
3679  ok(r == ERROR_SUCCESS, "Failed to set summary info\n");
3680 
3682  "{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}1.1.1;"
3683  "{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}1.1.1;"
3684  "{4C0EAA15-0264-4E5A-8758-609EF142B92D}");
3685  ok(r == ERROR_SUCCESS , "Failed to set summary info\n");
3686 
3688  ok(r == ERROR_SUCCESS, "Failed to set summary info\n");
3689 
3691  ok(r == ERROR_SUCCESS , "Failed to make summary info persist\n");
3692 
3694  ok(r == ERROR_SUCCESS , "Failed to close suminfo\n");
3695 }
Definition: compat.h:2157
#define ERROR_SUCCESS
Definition: deptool.c:10
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define PID_REVNUMBER
Definition: suminfo.c:51
static const CHAR suminfo[]
Definition: db.c:2206
unsigned long MSIHANDLE
Definition: winemsi.idl:24
#define PID_PAGECOUNT
Definition: suminfo.c:56
UINT WINAPI MsiSummaryInfoSetPropertyA(MSIHANDLE handle, UINT uiProperty, UINT uiDataType, INT iValue, FILETIME *pftValue, const char *szValue)
Definition: suminfo.c:937
#define PID_TITLE
Definition: suminfo.c:44
UINT WINAPI MsiCloseHandle(MSIHANDLE handle)
Definition: handle.c:269
UINT WINAPI MsiGetSummaryInformationA(MSIHANDLE hDatabase, const char *szDatabase, UINT uiUpdateCount, MSIHANDLE *pHandle)
Definition: suminfo.c:584
#define ok(value,...)
Definition: atltest.h:57
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
UINT WINAPI MsiSummaryInfoPersist(MSIHANDLE handle)
Definition: suminfo.c:1222
static const char * mstfile
Definition: install.c:60

Referenced by generate_transform_manual().

◆ START_TEST()

START_TEST ( install  )

Definition at line 6278 of file install.c.

6279 {
6280  DWORD len;
6281  char temp_path[MAX_PATH], prev_path[MAX_PATH], log_file[MAX_PATH];
6283  BOOL ret = FALSE;
6284 
6286  subtest("custom");
6287 
6288  if (pIsWow64Process)
6289  pIsWow64Process(GetCurrentProcess(), &is_wow64);
6290 
6291  GetCurrentDirectoryA(MAX_PATH, prev_path);
6294 
6296  len = lstrlenA(CURR_DIR);
6297 
6298  if(len && (CURR_DIR[len - 1] == '\\'))
6299  CURR_DIR[len - 1] = 0;
6300 
6301  ok(get_system_dirs(), "failed to retrieve system dirs\n");
6302  ok(get_user_dirs(), "failed to retrieve user dirs\n");
6303 
6304  /* Create a restore point ourselves so we circumvent the multitude of restore points
6305  * that would have been created by all the installation and removal tests.
6306  *
6307  * This is not needed on version 5.0 where setting MSIFASTINSTALL prevents the
6308  * creation of restore points.
6309  */
6310  if (pSRSetRestorePointA && !pMsiGetComponentPathExA)
6311  {
6312  memset(&status, 0, sizeof(status));
6314  }
6315 
6316  /* Create only one log file and don't append. We have to pass something
6317  * for the log mode for this to work. The logfile needs to have an absolute
6318  * path otherwise we still end up with some extra logfiles as some tests
6319  * change the current directory.
6320  */
6322  lstrcatA(log_file, "\\msitest.log");
6324 
6325  if (pSRSetRestorePointA) /* test has side-effects on win2k3 that cause failures in following tests */
6330  test_caborder();
6331  test_mixedmedia();
6340  test_admin();
6341  test_adminprops();
6342  test_missingcab();
6347  test_sourcepath();
6350  test_adminimage();
6351  test_propcase();
6352  test_int_widths();
6353  test_shortcut();
6354  test_preselected();
6356  test_file_in_use();
6360  test_icon_table();
6369  test_wow64();
6371 
6373 
6375 
6376  if (pSRSetRestorePointA && !pMsiGetComponentPathExA && ret)
6377  {
6379  if (ret)
6380  remove_restore_point(status.llSequenceNumber);
6381  }
6382 
6383  SetCurrentDirectoryA(prev_path);
6384 }
static void test_currentworkingdir(void)
Definition: install.c:3854
static void test_mixed_package(void)
Definition: install.c:5845
static void test_cabisextracted(void)
Definition: install.c:3567
static void test_propcase(void)
Definition: install.c:4935
static void test_missingcomponent(void)
Definition: install.c:4757
static void test_adminprops(void)
Definition: install.c:4014
static void init_functionpointers(void)
Definition: install.c:2227
static void test_upgrade_code(void)
Definition: install.c:5813
UINT WINAPI MsiEnableLogA(DWORD dwLogMode, const char *szLogFile, DWORD attributes)
Definition: msi.c:1884
static BOOL notify_system_change(DWORD event_type, STATEMGRSTATUS *status)
Definition: install.c:2737
UNICODE_STRING log_file
Definition: btrfs.c:88
static void test_caborder(void)
Definition: install.c:3222
static void test_installstate(void)
Definition: install.c:4271
char CURR_DIR[MAX_PATH]
Definition: install.c:65
static void test_continuouscabs(void)
Definition: install.c:3115
static void test_readonlyfile_cab(void)
Definition: install.c:3473
static const char * customdll
Definition: install.c:72
static void test_sourcefolder(void)
Definition: install.c:4135
static void test_missingcab(void)
Definition: install.c:4065
static void test_customaction51(void)
Definition: install.c:4238
#define FALSE
Definition: types.h:117
static void test_adminimage(void)
Definition: install.c:4864
static void test_int_widths(void)
Definition: install.c:4978
#define END_NESTED_SYSTEM_CHANGE
static void test_installed_prop(void)
Definition: install.c:5143
unsigned int BOOL
Definition: ntddk_ex.h:94
static void test_transformprop(void)
Definition: install.c:3808
static void test_allusers_prop(void)
Definition: install.c:5183
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
Definition: delete.c:24
static void test_wow64(void)
Definition: install.c:6189
static void test_setdirproperty(void)
Definition: install.c:3534
LPSTR WINAPI lstrcatA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:123
#define BEGIN_NESTED_SYSTEM_CHANGE
static void test_feature_tree(void)
Definition: install.c:6119
static STATEMGRSTATUS *static BOOL is_wow64
Definition: install.c:53
static void test_icon_table(void)
Definition: install.c:5540
#define MAX_PATH
Definition: compat.h:34
unsigned long DWORD
Definition: ntddk_ex.h:95
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:100
static void test_readonlyfile(void)
Definition: install.c:3425
static void test_file_in_use_cab(void)
Definition: install.c:5400
static void test_feature_override(void)
Definition: install.c:5463
int ret
static void test_sourcedirprop(void)
Definition: install.c:4812
static void test_preselected(void)
Definition: install.c:5088
static void remove_restore_point(DWORD seq_number)
Definition: install.c:2749
BOOL WINAPI SetCurrentDirectoryA(IN LPCSTR lpPathName)
Definition: path.c:2206
static void test_mixedmedia(void)
Definition: install.c:3308
GLenum GLsizei len
Definition: glext.h:6722
#define GetCurrentProcess()
Definition: compat.h:618
static void test_volume_props(void)
Definition: install.c:5998
static void test_customaction1(void)
Definition: install.c:4181
int WINAPI lstrlenA(LPCSTR lpString)
Definition: lstring.c:145
DWORD WINAPI GetTempPathA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)
Definition: path.c:2054
static void test_samesequence(void)
Definition: install.c:3351
static void test_sourcepath(void)
Definition: install.c:4676
static void test_file_in_use(void)
Definition: install.c:5341
#define ok(value,...)
Definition: atltest.h:57
#define subtest
Definition: test.h:157
static void test_deferred_action(void)
Definition: install.c:6160
DWORD WINAPI GetCurrentDirectoryA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)
Definition: path.c:2146
BOOL get_user_dirs(void)
Definition: install.c:2404
static void test_uiLevelFlags(void)
Definition: install.c:3380
BOOL get_system_dirs(void)
Definition: install.c:2423
static void test_packagecoltypes(void)
Definition: install.c:2999
static void test_MsiSetComponentState(void)
Definition: install.c:2950
static void test_remove_upgrade_code(void)
Definition: install.c:6068
static void test_MsiInstallProduct(void)
Definition: install.c:2765
static void test_source_resolution(void)
Definition: install.c:6249
#define memset(x, y, z)
Definition: compat.h:39
static void test_shared_component(void)
Definition: install.c:6024
static SERVICE_STATUS status
Definition: service.c:31
static void test_admin(void)
Definition: install.c:3946
static void test_shortcut(void)
Definition: install.c:5040
static void test_package_validation(void)
Definition: install.c:5622
char temp_path[MAX_PATH]
Definition: mspatcha.c:123
Definition: ps.c:97

◆ test_admin()

static void test_admin ( void  )
static

Definition at line 3946 of file install.c.

3947 {
3948  UINT r;
3949 
3950  CreateDirectoryA("msitest", NULL);
3951  create_file("msitest\\augustus", 500);
3952 
3955 
3957 
3960  {
3961  skip("Not enough rights to perform tests\n");
3962  goto error;
3963  }
3964  ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3965  ok(!delete_pf("msitest\\augustus", TRUE), "File installed\n");
3966  ok(!delete_pf("msitest", FALSE), "Directory created\n");
3967  ok(!DeleteFileA("c:\\msitest\\augustus"), "File installed\n");
3968  ok(!RemoveDirectoryA("c:\\msitest"), "File installed\n");
3969 
3970  r = MsiInstallProductA(msifile, "ACTION=ADMIN");
3971  todo_wine
3972  ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
3973  ok(!delete_pf("msitest\\augustus", TRUE), "File installed\n");
3974  ok(!delete_pf("msitest", FALSE), "Directory created\n");
3975  todo_wine
3976  {
3977  ok(DeleteFileA("c:\\msitest\\augustus"), "File not installed\n");
3978  ok(RemoveDirectoryA("c:\\msitest"), "File not installed\n");
3979  }
3980 
3981 error:
3983  DeleteFileA("msitest\\augustus");
3984  RemoveDirectoryA("msitest");
3985 }
#define ERROR_INSTALL_PACKAGE_REJECTED
Definition: winerror.h:983
static const WCHAR msifileW[]
Definition: install.c:62
#define ERROR_SUCCESS
Definition: deptool.c:10
static const char * msifile
Definition: install.c:58
#define error(str)
Definition: mkdosfs.c:1605
UINT WINAPI MsiInstallProductA(LPCSTR szPackagePath, LPCSTR szCommandLine)
Definition: msi.c:200
#define TRUE
Definition: types.h:120
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define create_file(name, size)
Definition: asmcache.c:813
#define todo_wine
Definition: custom.c:79
INSTALLUILEVEL WINAPI MsiSetInternalUI(INSTALLUILEVEL dwUILevel, HWND *phWnd)
Definition: msi.c:2284
#define FALSE
Definition: types.h:117
BOOL WINAPI CreateDirectoryA(IN LPCSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
Definition: dir.c:37
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
Definition: delete.c:24
static const msi_table adm_tables[]
Definition: install.c:1724
#define create_database(name, tables, num_tables)
Definition: utils.h:42
#define ARRAY_SIZE(a)
Definition: main.h:24
#define ok(value,...)
Definition: atltest.h:57
BOOL WINAPI RemoveDirectoryA(IN LPCSTR lpPathName)
Definition: dir.c:714
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
#define skip(...)
Definition: atltest.h:64
BOOL delete_pf(const CHAR *rel_path, BOOL is_file)
Definition: install.c:2499
static void set_admin_summary_info(const WCHAR *name)
Definition: install.c:3920

Referenced by START_TEST().

◆ test_adminimage()

static void test_adminimage ( void  )
static

Definition at line 4864 of file install.c.

4865 {
4866  UINT r;
4867 
4868  if (is_process_limited())
4869  {
4870  skip("process is limited\n");
4871  return;
4872  }
4873 
4874  CreateDirectoryA("msitest", NULL);
4875  CreateDirectoryA("msitest\\first", NULL);
4876  CreateDirectoryA("msitest\\second", NULL);
4877  CreateDirectoryA("msitest\\cabout", NULL);
4878  CreateDirectoryA("msitest\\cabout\\new", NULL);
4879  create_file("msitest\\one.txt", 100);
4880  create_file("msitest\\first\\two.txt", 100);
4881  create_file("msitest\\second\\three.txt", 100);
4882  create_file("msitest\\cabout\\four.txt", 100);
4883  create_file("msitest\\cabout\\new\\five.txt", 100);
4884  create_file("msitest\\filename", 100);
4885 
4887  100, msidbSumInfoSourceTypeAdminImage, ";1033",
4888  "{004757CA-5092-49C2-AD20-28E1CE0DF5F2}");
4889 
4891 
4894  {
4895  skip("Not enough rights to perform tests\n");
4896  goto error;
4897  }
4898  ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4899 
4900  delete_pf_files();
4901 
4902  create_file("four.txt", 100);
4903  create_file("five.txt", 100);
4904  create_cab_file("msitest.cab", MEDIA_SIZE, "four.txt\0five.txt\0");
4907  ";1033", "{004757CA-5092-49C2-AD20-28E1CE0DF5F2}");
4908 
4910 
4912  ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4913 
4914  ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
4915  ok(delete_pf("msitest\\cabout\\new", FALSE), "Directory not created\n");
4916  ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
4917  ok(delete_pf("msitest\\cabout", FALSE), "Directory not created\n");
4918  ok(delete_pf("msitest", FALSE), "Directory not created\n");
4919 
4920 error:
4921  DeleteFileA("msifile");
4922  DeleteFileA("msitest\\cabout\\new\\five.txt");
4923  DeleteFileA("msitest\\cabout\\four.txt");
4924  DeleteFileA("msitest\\second\\three.txt");
4925  DeleteFileA("msitest\\first\\two.txt");
4926  DeleteFileA("msitest\\one.txt");
4927  DeleteFileA("msitest\\filename");
4928  RemoveDirectoryA("msitest\\cabout\\new");
4929  RemoveDirectoryA("msitest\\cabout");
4930  RemoveDirectoryA("msitest\\second");
4931  RemoveDirectoryA("msitest\\first");
4932  RemoveDirectoryA("msitest");
4933 }
#define MEDIA_SIZE
Definition: install.c:2121
#define ERROR_INSTALL_PACKAGE_REJECTED
Definition: winerror.h:983
#define ERROR_SUCCESS
Definition: deptool.c:10
static const char * msifile
Definition: install.c:58
#define error(str)
Definition: mkdosfs.c:1605
UINT WINAPI MsiInstallProductA(LPCSTR szPackagePath, LPCSTR szCommandLine)
Definition: msi.c:200
#define TRUE
Definition: types.h:120
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define create_file(name, size)
Definition: asmcache.c:813
INSTALLUILEVEL WINAPI MsiSetInternalUI(INSTALLUILEVEL dwUILevel, HWND *phWnd)
Definition: msi.c:2284
#define FALSE
Definition: types.h:117
static const msi_table ai_tables[]
Definition: install.c:1840
BOOL WINAPI CreateDirectoryA(IN LPCSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
Definition: dir.c:37
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
Definition: delete.c:24
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:2699
static const msi_table ai2_tables[]
Definition: install.c:1852
static void delete_pf_files(void)
Definition: install.c:2576
#define ARRAY_SIZE(a)
Definition: main.h:24
#define ok(value,...)
Definition: atltest.h:57
BOOL WINAPI RemoveDirectoryA(IN LPCSTR lpPathName)
Definition: dir.c:714
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
#define skip(...)
Definition: atltest.h:64
BOOL is_process_limited(void)
Definition: install.c:2254
void create_cab_file(const CHAR *name, DWORD max_size, const CHAR *files)
Definition: install.c:2373
BOOL delete_pf(const CHAR *rel_path, BOOL is_file)
Definition: install.c:2499

Referenced by START_TEST().

◆ test_adminprops()

static void test_adminprops ( void  )
static

Definition at line 4014 of file install.c.

4015 {
4016  UINT r;
4017 
4018  if (is_process_limited())
4019  {
4020  skip("process is limited\n");
4021  return;
4022  }
4023 
4024  CreateDirectoryA("msitest", NULL);
4025  create_file("msitest\\augustus", 500);
4026 
4030 
4032 
4035  {
4036  skip("Not enough rights to perform tests\n");
4037  goto error;
4038  }
4039  ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
4040  ok(delete_pf("msitest\\augustus", TRUE), "File installed\n");
4041  ok(delete_pf("msitest", FALSE), "Directory created\n");
4042 
4043 error:
4045  DeleteFileA("msitest\\augustus");
4046  RemoveDirectoryA("msitest");
4047 }
#define ERROR_INSTALL_PACKAGE_REJECTED
Definition: winerror.h:983
static const WCHAR msifileW[]
Definition: install.c:62
#define ERROR_SUCCESS
Definition: deptool.c:10
static const char * msifile
Definition: install.c:58
#define error(str)
Definition: mkdosfs.c:1605
UINT WINAPI MsiInstallProductA(LPCSTR szPackagePath, LPCSTR szCommandLine)
Definition: msi.c:200
#define TRUE
Definition: types.h:120
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define create_file(name, size)
Definition: asmcache.c:813
INSTALLUILEVEL WINAPI MsiSetInternalUI(INSTALLUILEVEL dwUILevel, HWND *phWnd)
Definition: msi.c:2284
#define FALSE
Definition: types.h:117
BOOL WINAPI CreateDirectoryA(IN LPCSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
Definition: dir.c:37
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
Definition: delete.c:24
#define create_database(name, tables, num_tables)
Definition: utils.h:42
static const msi_table amp_tables[]
Definition: