212 new_path[
len - 1] = 0;
224 if (!(slash =
wcsrchr( new_path,
'\\' )))
229 len = slash - new_path;
236 new_path[
len] =
'\\';
282 hash.dwFileHashInfoSize =
sizeof(
hash);
321 TRACE(
"overwriting %s (new version %s old version %u.%u.%u.%u)\n",
329 TRACE(
"keeping %s (new version %s old version %u.%u.%u.%u)\n",
342 TRACE(
"overwriting %s (new version %s old version %s)\n",
348 TRACE(
"keeping %s (new version %s old version %s)\n",
361 if (
file->hash.dwFileHashInfoSize)
420 TRACE(
"overwriting existing file\n");
428 TRACE(
"Overwriting existing file: %d\n", gle);
432 WCHAR *tmpfileW, *pathW, *
p;
435 TRACE(
"file in use, scheduling rename operation\n");
458 WARN(
"failed to schedule rename operation: %d)\n", gle);
470 const WCHAR *install_path;
490 if (
file->disk_id == disk_id &&
517 *attrs =
file->Attributes;
534 if (
file->IsCompressed)
return NULL;
596 if (
file->Sequence >
mi->last_sequence ||
mi->is_continuous ||
597 (
file->IsCompressed && !
mi->is_extracted))
603 data.package = package;
615 if (!
file->IsCompressed)
621 if (!is_global_assembly)
654 ERR(
"Failed to install assembly\n");
694 TRACE(
"file %s component %s not installed or disabled\n",
743 while ((IAssemblyEnum_GetNextAssembly( iter,
NULL, &
name, 0 ) ==
S_OK))
753 hr = IAssemblyName_GetDisplayName(
name, displayname, &
len, 0 );
768 IAssemblyName_Release(
name );
776 IAssemblyName_Release(
name );
780 IAssemblyEnum_Release( iter );
790 TRACE(
"%p\n", package);
797 TRACE(
"extracting files\n");
826 data.package = package;
839 TRACE(
"applying patches\n");
845 if (!patch->
path)
continue;
862 ERR(
"Failed to install patched assembly\n");
873#define is_dot_dir(x) ((x[0] == '.') && ((x[1] == 0) || ((x[1] == '.') && (x[2] == 0))))
891 WARN(
"Source or dest is directory, not moving\n");
923 DWORD dirlen, pathlen;
926 dirlen =
ptr - wildcard + 1;
974 new->destname =
new->sourcename;
1085 LPCWSTR sourcename, component;
1099 TRACE(
"component not scheduled for installation %s\n",
debugstr_w(component));
1144 destname =
strdupW(sourcename);
1145 else if ((
p =
wcsrchr(sourcedir,
'\\')))
1148 destname =
strdupW(sourcedir);
1260 FIXME(
"Unable to get destination folder, try AppSearch properties\n");
1292 TRACE(
"component not scheduled for installation %s\n",
debugstr_w(component));
1299 ERR(
"Unable to get file key\n");
1313 WARN(
"Unable to get duplicate filename\n");
1320 WARN(
"failed to copy file %s -> %s (%lu)\n",
1323 FIXME(
"We should track these duplicate files as well\n");
1370 TRACE(
"component not scheduled for removal %s\n",
debugstr_w(component));
1377 ERR(
"Unable to get file key\n");
1391 WARN(
"Unable to get duplicate filename\n");
1474 TRACE(
"Skipping removal due to install mode\n");
1477 if (comp->assembly && !comp->assembly->application)
1483 TRACE(
"permanent component, not removing file\n");
1490 WARN(
"directory property has no value\n");
1573 comp =
file->Component;
1585 TRACE(
"permanent component, not removing file\n");
1594 TRACE(
"newer version detected, not removing file\n");
1627 TRACE(
"permanent component, not removing directory\n");
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
static WCHAR * strdupW(const WCHAR *src)
void user(int argc, const char *argv[])
static void list_remove(struct list_entry *entry)
static int list_empty(struct list_entry *head)
static void list_add_head(struct list_entry *head, struct list_entry *entry)
static void list_init(struct list_entry *head)
#define INVALID_HANDLE_VALUE
#define FILE_ATTRIBUTE_NORMAL
#define ERROR_ACCESS_DENIED
static const WCHAR version[]
BOOL WINAPI CopyFileW(IN LPCWSTR lpExistingFileName, IN LPCWSTR lpNewFileName, IN BOOL bFailIfExists)
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
BOOL WINAPI CreateDirectoryW(IN LPCWSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
BOOL WINAPI RemoveDirectoryW(IN LPCWSTR lpPathName)
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
BOOL WINAPI SetFileAttributesW(LPCWSTR lpFileName, DWORD dwFileAttributes)
DWORD WINAPI GetFileSize(HANDLE hFile, LPDWORD lpFileSizeHigh)
HANDLE WINAPI FindFirstFileW(IN LPCWSTR lpFileName, OUT LPWIN32_FIND_DATAW lpFindFileData)
BOOL WINAPI FindClose(HANDLE hFindFile)
BOOL WINAPI FindNextFileW(IN HANDLE hFindFile, OUT LPWIN32_FIND_DATAW lpFindFileData)
BOOL WINAPI MoveFileExW(IN LPCWSTR lpExistingFileName, IN LPCWSTR lpNewFileName OPTIONAL, IN DWORD dwFlags)
INSTALLSTATE msi_get_component_action(MSIPACKAGE *package, MSICOMPONENT *comp)
int msi_compare_file_versions(VS_FIXEDFILEINFO *fi, const WCHAR *version)
BOOL msi_is_global_assembly(MSICOMPONENT *comp)
UINT msi_set_sourcedir_props(MSIPACKAGE *package, BOOL replace)
MSIFOLDER * msi_get_loaded_folder(MSIPACKAGE *package, const WCHAR *dir)
int msi_compare_font_versions(const WCHAR *ver1, const WCHAR *ver2)
void msi_ui_progress(MSIPACKAGE *package, int a, int b, int c, int d)
MSICOMPONENT * msi_get_loaded_component(MSIPACKAGE *package, const WCHAR *Component)
WCHAR *WINAPIV msi_build_directory_name(DWORD count,...)
MSIFILE * msi_get_loaded_file(MSIPACKAGE *package, const WCHAR *key)
UINT msi_schedule_action(MSIPACKAGE *package, UINT script, const WCHAR *action)
WCHAR * msi_create_temp_file(MSIDATABASE *db)
static BOOL is_registered_patch_media(MSIPACKAGE *package, UINT disk_id)
BOOL msi_set_file_attributes(MSIPACKAGE *package, const WCHAR *filename, DWORD attrs)
BOOL msi_create_full_path(MSIPACKAGE *package, const WCHAR *path)
BOOL msi_remove_directory(MSIPACKAGE *package, const WCHAR *path)
HANDLE msi_create_file(MSIPACKAGE *package, const WCHAR *filename, DWORD access, DWORD sharing, DWORD creation, DWORD flags)
static WCHAR * get_duplicate_filename(MSIPACKAGE *package, MSIRECORD *row, const WCHAR *file_key, const WCHAR *src)
DWORD msi_get_file_version_info(MSIPACKAGE *package, const WCHAR *path, DWORD buflen, BYTE *buffer)
UINT ACTION_InstallFiles(MSIPACKAGE *package)
UINT ACTION_RemoveFiles(MSIPACKAGE *package)
static MSIFILE * find_file(MSIPACKAGE *package, UINT disk_id, const WCHAR *filename)
static UINT ITERATE_MoveFiles(MSIRECORD *rec, LPVOID param)
BOOL msi_delete_file(MSIPACKAGE *package, const WCHAR *filename)
HANDLE msi_find_first_file(MSIPACKAGE *package, const WCHAR *filename, WIN32_FIND_DATAW *data)
static void free_file_entry(FILE_LIST *file)
static UINT patch_assembly(MSIPACKAGE *package, MSIASSEMBLY *assembly, MSIFILEPATCH *patch)
static void free_list(FILE_LIST *list)
static UINT ITERATE_RemoveDuplicateFiles(MSIRECORD *row, LPVOID param)
WCHAR * msi_resolve_file_source(MSIPACKAGE *package, MSIFILE *file)
void msi_reduce_to_long_filename(WCHAR *filename)
static UINT patch_file(MSIPACKAGE *package, MSIFILEPATCH *patch)
static BOOL msi_apply_filepatch(MSIPACKAGE *package, const WCHAR *patch, const WCHAR *old, const WCHAR *new)
static BOOL move_files_wildcard(MSIPACKAGE *package, const WCHAR *source, WCHAR *dest, int options)
static BOOL verify_comp_for_removal(MSICOMPONENT *comp, UINT install_mode)
static void msi_file_update_ui(MSIPACKAGE *package, MSIFILE *f, const WCHAR *action)
static UINT ITERATE_DuplicateFiles(MSIRECORD *row, LPVOID param)
static UINT copy_file(MSIPACKAGE *package, MSIFILE *file, WCHAR *source)
BOOL msi_move_file(MSIPACKAGE *package, const WCHAR *from, const WCHAR *to, DWORD flags)
static WCHAR * wildcard_to_file(const WCHAR *wildcard, const WCHAR *filename)
VS_FIXEDFILEINFO * msi_get_disk_file_version(MSIPACKAGE *package, const WCHAR *filename)
static UINT ITERATE_RemoveFiles(MSIRECORD *row, LPVOID param)
static MSIFILEPATCH * find_filepatch(MSIPACKAGE *package, UINT disk_id, const WCHAR *key)
UINT ACTION_PatchFiles(MSIPACKAGE *package)
static BOOL installfiles_cb(MSIPACKAGE *package, LPCWSTR filename, DWORD action, LPWSTR *path, DWORD *attrs, PVOID user)
DWORD msi_get_file_attributes(MSIPACKAGE *package, const WCHAR *path)
BOOL msi_find_next_file(MSIPACKAGE *package, HANDLE handle, WIN32_FIND_DATAW *data)
static UINT create_directory(MSIPACKAGE *package, const WCHAR *dir)
static BOOL msi_create_directory(MSIPACKAGE *package, const WCHAR *path)
static void schedule_install_files(MSIPACKAGE *package)
static BOOL file_hash_matches(MSIPACKAGE *package, MSIFILE *file)
static BOOL msi_copy_file(MSIPACKAGE *package, const WCHAR *src, const WCHAR *dst, BOOL fail_if_exists)
UINT ACTION_DuplicateFiles(MSIPACKAGE *package)
static BOOL add_wildcard(FILE_LIST *files, const WCHAR *source, WCHAR *dest)
static BOOL is_obsoleted_by_patch(MSIPACKAGE *package, MSIFILE *file)
DWORD msi_get_disk_file_size(MSIPACKAGE *package, const WCHAR *filename)
UINT ACTION_MoveFiles(MSIPACKAGE *package)
static BOOL patchfiles_cb(MSIPACKAGE *package, LPCWSTR file, DWORD action, LPWSTR *path, DWORD *attrs, PVOID user)
static UINT copy_install_file(MSIPACKAGE *package, MSIFILE *file, LPWSTR source)
static void remove_folder(MSIFOLDER *folder)
static msi_file_state calculate_install_state(MSIPACKAGE *package, MSIFILE *file)
static BOOL move_file(MSIPACKAGE *package, const WCHAR *source, const WCHAR *dest, int options)
UINT ACTION_RemoveDuplicateFiles(MSIPACKAGE *package)
WCHAR * msi_get_font_file_version(MSIPACKAGE *package, const WCHAR *filename)
int msiobj_release(MSIOBJECTHDR *info)
WCHAR * msi_resolve_source_folder(MSIPACKAGE *package, const WCHAR *name, MSIFOLDER **folder)
const WCHAR * msi_get_target_folder(MSIPACKAGE *package, const WCHAR *name)
UINT msi_get_filehash(MSIPACKAGE *package, const WCHAR *path, MSIFILEHASHINFO *hash)
BOOL WINAPI GetFileVersionInfoW(LPCWSTR filename, DWORD handle, DWORD datasize, LPVOID data)
BOOL WINAPI VerQueryValueW(LPCVOID pBlock, LPCWSTR lpSubBlock, LPVOID *lplpBuffer, PUINT puLen)
DWORD WINAPI GetFileVersionInfoSizeW(LPCWSTR filename, LPDWORD handle)
struct png_info_def *typedef unsigned char **typedef struct png_info_def *typedef struct png_info_def *typedef struct png_info_def *typedef unsigned char ** row
UINT WINAPI GetTempFileNameW(IN LPCWSTR lpPathName, IN LPCWSTR lpPrefixString, IN UINT uUnique, OUT LPWSTR lpTempFileName)
#define MOVEFILE_REPLACE_EXISTING
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLdouble GLdouble GLdouble r
GLuint GLint GLboolean GLint GLenum access
_Check_return_ _CRTIMP FILE *__cdecl tmpfile(void)
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
#define memcpy(s1, s2, n)
#define memmove(s1, s2, n)
#define ERROR_ALREADY_EXISTS
static ULONG POBJECT_ATTRIBUTES PIO_STATUS_BLOCK ULONG sharing
UINT msi_uninstall_assembly(MSIPACKAGE *package, MSICOMPONENT *comp)
IAssemblyEnum * msi_create_assembly_enum(MSIPACKAGE *package, const WCHAR *displayname)
WCHAR * msi_get_assembly_path(MSIPACKAGE *package, const WCHAR *displayname)
UINT msi_install_assembly(MSIPACKAGE *package, MSICOMPONENT *comp)
@ INSTALLMESSAGE_ACTIONDATA
@ msidbComponentAttributesNeverOverwrite
@ msidbComponentAttributesPermanent
@ msidbComponentAttributesSourceOnly
@ msidbMoveFileOptionsMove
@ msidbPatchAttributesNonVital
@ msidbFileAttributesPatchAdded
@ msidbRemoveFileInstallModeOnBoth
@ msidbRemoveFileInstallModeOnInstall
@ msidbRemoveFileInstallModeOnRemove
#define MSI_INITIAL_MEDIA_TRANSFORM_DISKID
static void * msi_realloc(void *mem, size_t len) __WINE_ALLOC_SIZE(2)
static void * msi_alloc_zero(size_t len) __WINE_ALLOC_SIZE(1)
UINT MSI_IterateRecords(MSIQUERY *, LPDWORD, record_func, LPVOID) DECLSPEC_HIDDEN
UINT MSI_RecordGetStringW(MSIRECORD *, UINT, LPWSTR, LPDWORD) DECLSPEC_HIDDEN
static void msi_free(void *mem)
int MSI_RecordGetInteger(MSIRECORD *, UINT) DECLSPEC_HIDDEN
UINT MSI_RecordSetInteger(MSIRECORD *, UINT, int) DECLSPEC_HIDDEN
#define MSICABEXTRACT_BEGINEXTRACT
const WCHAR * MSI_RecordGetString(const MSIRECORD *, UINT) DECLSPEC_HIDDEN
@ FOLDER_STATE_UNINITIALIZED
INT MSI_ProcessMessage(MSIPACKAGE *, INSTALLMESSAGE, MSIRECORD *) DECLSPEC_HIDDEN
static void * msi_alloc(size_t len) __WINE_ALLOC_SIZE(1)
MSIRECORD * MSI_CreateRecord(UINT) DECLSPEC_HIDDEN
static void msi_revert_fs_redirection(MSIPACKAGE *package)
static void msi_disable_fs_redirection(MSIPACKAGE *package)
int msi_get_property_int(MSIDATABASE *package, LPCWSTR prop, int def) DECLSPEC_HIDDEN
LPWSTR msi_dup_property(MSIDATABASE *db, LPCWSTR prop) DECLSPEC_HIDDEN
BOOL MSI_RecordIsNull(MSIRECORD *, UINT) DECLSPEC_HIDDEN
#define MSICABEXTRACT_FILEEXTRACTED
enum _msi_file_state msi_file_state
UINT MSI_DatabaseOpenViewW(MSIDATABASE *, LPCWSTR, MSIQUERY **) DECLSPEC_HIDDEN
UINT MSI_RecordSetStringW(MSIRECORD *, UINT, LPCWSTR) DECLSPEC_HIDDEN
BOOL WINAPI ApplyPatchToFileW(LPCWSTR patch_file, LPCWSTR old_file, LPCWSTR new_file, ULONG apply_flags)
#define FILE_ATTRIBUTE_DIRECTORY
#define PathAddBackslashW
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
__WINE_SERVER_LIST_INLINE void list_add_before(struct list *elem, struct list *to_add)
__WINE_SERVER_LIST_INLINE void list_add_after(struct list *elem, struct list *to_add)
unsigned char need_reboot_at_end
#define new(TYPE, numElems)
#define INVALID_FILE_ATTRIBUTES
DWORD WINAPI GetLastError(void)
#define INVALID_FILE_SIZE
#define MOVEFILE_DELAY_UNTIL_REBOOT
#define ERROR_INSTALL_FAILURE
#define ERROR_SHARING_VIOLATION
#define E_NOT_SUFFICIENT_BUFFER
#define ERROR_PATH_NOT_FOUND
#define ERROR_FUNCTION_FAILED
#define ERROR_USER_MAPPED_FILE