ReactOS 0.4.16-dev-282-g4d0a26d
msipriv.h File Reference
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "fdi.h"
#include "msi.h"
#include "msiquery.h"
#include "msidefs.h"
#include "objbase.h"
#include "objidl.h"
#include "fusion.h"
#include "winnls.h"
#include "winver.h"
#include "wine/list.h"
#include "wine/debug.h"
#include "msiserver.h"
#include "winemsi_s.h"
Include dependency graph for msipriv.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  tagMSIOBJECTHDR
 
struct  tagMSISTREAM
 
struct  tagMSITRANSFORM
 
struct  tagMSIDATABASE
 
struct  tagMSIQUERY
 
struct  tagMSIFIELD
 
struct  tagMSIRECORD
 
struct  tagMSISOURCELISTINFO
 
struct  tagMSIMEDIADISK
 
struct  tagMSIMEDIAINFO
 
struct  tagMSICABINETSTREAM
 
struct  tagMSIPATCHINFO
 
struct  tagMSIBINARY
 
struct  _column_info
 
struct  tagMSIVIEWOPS
 
struct  tagMSIVIEW
 
struct  tagMSIPACKAGE
 
struct  tagMSIPREVIEW
 
struct  tagMSISUMMARYINFO
 
struct  tagMSIFEATURE
 
struct  tagMSIASSEMBLY
 
struct  tagMSICOMPONENT
 
struct  tagComponentList
 
struct  tagFeatureList
 
struct  tagMSIFOLDER
 
struct  tagFolderList
 
struct  tagMSIFILE
 
struct  tagMSIFILEPATCH
 
struct  tagMSIAPPID
 
struct  tagMSICLASS
 
struct  tagMSIEXTENSION
 
struct  tagMSIPROGID
 
struct  tagMSIVERB
 
struct  tagMSIMIME
 
struct  awstring
 
struct  awcstring
 
struct  MSICABDATA
 

Macros

#define MSI_DATASIZEMASK   0x00ff
 
#define MSITYPE_VALID   0x0100
 
#define MSITYPE_LOCALIZABLE   0x200
 
#define MSITYPE_STRING   0x0800
 
#define MSITYPE_NULLABLE   0x1000
 
#define MSITYPE_KEY   0x2000
 
#define MSITYPE_TEMPORARY   0x4000
 
#define MSITYPE_UNKNOWN   0x8000
 
#define MAX_STREAM_NAME_LEN   62
 
#define LONG_STR_BYTES   3
 
#define INSTALLUILEVEL_MASK   0x0007
 
#define MSITYPE_IS_BINARY(type)   (((type) & ~MSITYPE_NULLABLE) == (MSITYPE_STRING|MSITYPE_VALID))
 
#define MSI_INITIAL_MEDIA_TRANSFORM_OFFSET   10000
 
#define MSI_INITIAL_MEDIA_TRANSFORM_DISKID   32000
 
#define MSI_OPEN_READONLY   0
 
#define MSI_OPEN_TRANSACT   1
 
#define MSI_OPEN_DIRECT   2
 
#define MSI_OPEN_CREATE   3
 
#define MSI_OPEN_CREATEDIRECT   4
 
#define MSI_OPEN_PATCHFILE   32
 
#define MSI_MAX_PROPS   20
 
#define SEQUENCE_UI   0x1
 
#define SEQUENCE_EXEC   0x2
 
#define MSIHANDLETYPE_ANY   0
 
#define MSIHANDLETYPE_DATABASE   1
 
#define MSIHANDLETYPE_SUMMARYINFO   2
 
#define MSIHANDLETYPE_VIEW   3
 
#define MSIHANDLETYPE_RECORD   4
 
#define MSIHANDLETYPE_PACKAGE   5
 
#define MSIHANDLETYPE_PREVIEW   6
 
#define MSI_MAJORVERSION   4
 
#define MSI_MINORVERSION   5
 
#define MSI_BUILDNUMBER   6001
 
#define GUID_SIZE   39
 
#define SQUASHED_GUID_SIZE   33
 
#define MSIHANDLE_MAGIC   0x4d434923
 
#define WINE_OPENPACKAGEFLAGS_RECACHE   0x80000000
 
#define MSICABEXTRACT_BEGINEXTRACT   0x01
 
#define MSICABEXTRACT_FILEEXTRACTED   0x02
 

Typedefs

typedef struct tagMSITABLE MSITABLE
 
typedef struct string_table string_table
 
typedef struct tagMSIOBJECTHDR MSIOBJECTHDR
 
typedef VOID(* msihandledestructor) (MSIOBJECTHDR *)
 
typedef struct tagMSISTREAM MSISTREAM
 
typedef struct tagMSITRANSFORM MSITRANSFORM
 
typedef struct tagMSIDATABASE MSIDATABASE
 
typedef struct tagMSIVIEW MSIVIEW
 
typedef struct tagMSIQUERY MSIQUERY
 
typedef struct tagMSIFIELD MSIFIELD
 
typedef struct tagMSIRECORD MSIRECORD
 
typedef struct tagMSISOURCELISTINFO MSISOURCELISTINFO
 
typedef struct tagMSIMEDIADISK MSIMEDIADISK
 
typedef struct tagMSIMEDIAINFO MSIMEDIAINFO
 
typedef struct tagMSICABINETSTREAM MSICABINETSTREAM
 
typedef struct tagMSIPATCHINFO MSIPATCHINFO
 
typedef struct tagMSIBINARY MSIBINARY
 
typedef struct _column_info column_info
 
typedef const struct tagMSICOLUMNHASHENTRY * MSIITERHANDLE
 
typedef struct tagMSIVIEWOPS MSIVIEWOPS
 
typedef struct msi_dialog_tag msi_dialog
 
typedef struct tagMSIPACKAGE MSIPACKAGE
 
typedef struct tagMSIPREVIEW MSIPREVIEW
 
typedef struct tagMSISUMMARYINFO MSISUMMARYINFO
 
typedef struct tagMSIFEATURE MSIFEATURE
 
typedef struct tagMSIASSEMBLY MSIASSEMBLY
 
typedef struct tagMSICOMPONENT MSICOMPONENT
 
typedef struct tagComponentList ComponentList
 
typedef struct tagFeatureList FeatureList
 
typedef struct tagMSIFOLDER MSIFOLDER
 
typedef struct tagFolderList FolderList
 
typedef enum _msi_file_state msi_file_state
 
typedef struct tagMSIFILE MSIFILE
 
typedef struct tagMSIFILEPATCH MSIFILEPATCH
 
typedef struct tagMSIAPPID MSIAPPID
 
typedef struct tagMSIPROGID MSIPROGID
 
typedef struct tagMSICLASS MSICLASS
 
typedef struct tagMSIMIME MSIMIME
 
typedef struct tagMSIEXTENSION MSIEXTENSION
 
typedef struct tagMSIVERB MSIVERB
 
typedef UINT(* record_func) (MSIRECORD *, LPVOID)
 
typedef BOOL(* PMSICABEXTRACTCB) (MSIPACKAGE *, LPCWSTR, DWORD, LPWSTR *, DWORD *, PVOID)
 
typedef enum tid_t tid_t
 

Enumerations

enum  platform {
  PLATFORM_UNRECOGNIZED , PLATFORM_INTEL , PLATFORM_INTEL64 , PLATFORM_X64 ,
  PLATFORM_ARM , PLATFORM_ARM64
}
 
enum  clr_version {
  CLR_VERSION_V10 , CLR_VERSION_V11 , CLR_VERSION_V20 , CLR_VERSION_V40 ,
  CLR_VERSION_MAX
}
 
enum  script {
  SCRIPT_NONE = -1 , SCRIPT_INSTALL = 0 , SCRIPT_COMMIT = 1 , SCRIPT_ROLLBACK = 2 ,
  SCRIPT_MAX = 3
}
 
enum  folder_state {
  FOLDER_STATE_UNINITIALIZED , FOLDER_STATE_EXISTS , FOLDER_STATE_CREATED , FOLDER_STATE_CREATED_PERSISTENT ,
  FOLDER_STATE_REMOVED
}
 
enum  _msi_file_state {
  msifs_invalid , msifs_missing , msifs_overwrite , msifs_present ,
  msifs_installed , msifs_skipped , msifs_hashmatch
}
 
enum  tid_t {
  LAST_tid , LAST_tid , Database_tid , Installer_tid ,
  Record_tid , Session_tid , StringList_tid , SummaryInfo_tid ,
  View_tid , LAST_tid , NULL_tid , IXMLDOMAttribute_tid ,
  IXMLDOMCDATASection_tid , IXMLDOMComment_tid , IXMLDOMDocument_tid , IXMLDOMDocument2_tid ,
  IXMLDOMDocument3_tid , IXMLDOMDocumentFragment_tid , IXMLDOMDocumentType_tid , IXMLDOMElement_tid ,
  IXMLDOMEntityReference_tid , IXMLDOMImplementation_tid , IXMLDOMNamedNodeMap_tid , IXMLDOMNode_tid ,
  IXMLDOMNodeList_tid , IXMLDOMParseError2_tid , IXMLDOMProcessingInstruction_tid , IXMLDOMSchemaCollection_tid ,
  IXMLDOMSchemaCollection2_tid , IXMLDOMSelection_tid , IXMLDOMText_tid , IXMLElement_tid ,
  IXMLDocument_tid , IXMLHTTPRequest_tid , IXSLProcessor_tid , IXSLTemplate_tid ,
  IVBSAXAttributes_tid , IVBSAXContentHandler_tid , IVBSAXDeclHandler_tid , IVBSAXDTDHandler_tid ,
  IVBSAXEntityResolver_tid , IVBSAXErrorHandler_tid , IVBSAXLexicalHandler_tid , IVBSAXLocator_tid ,
  IVBSAXXMLFilter_tid , IVBSAXXMLReader_tid , IMXAttributes_tid , IMXReaderControl_tid ,
  IMXWriter_tid , IVBMXNamespaceManager_tid , IServerXMLHTTPRequest_tid , LAST_tid ,
  NULL_tid , ITextDocument_tid , ITextRange_tid , ITextSelection_tid ,
  ITextFont_tid , ITextPara_tid , LAST_tid , NULL_tid ,
  IDictionary_tid , IDrive_tid , IDriveCollection_tid , IFile_tid ,
  IFileCollection_tid , IFileSystem3_tid , IFolder_tid , IFolderCollection_tid ,
  ITextStream_tid , LAST_tid , NULL_tid , IWshCollection_tid ,
  IWshEnvironment_tid , IWshExec_tid , IWshShell3_tid , IWshShortcut_tid ,
  LAST_tid
}
 

Functions

UINT msi_strcpy_to_awstring (const WCHAR *, int, awstring *, DWORD *)
 
MSIHANDLE msi_get_remote (MSIHANDLE handle)
 
LONG WINAPI rpc_filter (EXCEPTION_POINTERS *eptr)
 
voidmsihandle2msiinfo (MSIHANDLE handle, UINT type)
 
MSIHANDLE alloc_msihandle (MSIOBJECTHDR *)
 
MSIHANDLE alloc_msi_remote_handle (MSIHANDLE remote)
 
voidalloc_msiobject (UINT type, UINT size, msihandledestructor destroy)
 
void msiobj_addref (MSIOBJECTHDR *)
 
int msiobj_release (MSIOBJECTHDR *)
 
void msiobj_lock (MSIOBJECTHDR *)
 
void msiobj_unlock (MSIOBJECTHDR *)
 
void msi_free_handle_table (void)
 
void free_cached_tables (MSIDATABASE *db)
 
UINT MSI_CommitTables (MSIDATABASE *db)
 
UINT msi_commit_streams (MSIDATABASE *db)
 
BOOL msi_add_string (string_table *st, const WCHAR *data, int len, BOOL persistent)
 
UINT msi_string2id (const string_table *st, const WCHAR *data, int len, UINT *id)
 
VOID msi_destroy_stringtable (string_table *st)
 
const WCHARmsi_string_lookup (const string_table *st, UINT id, int *len)
 
HRESULT msi_init_string_table (IStorage *stg)
 
string_tablemsi_load_string_table (IStorage *stg, UINT *bytes_per_strref)
 
UINT msi_save_string_table (const string_table *st, IStorage *storage, UINT *bytes_per_strref)
 
UINT msi_get_string_table_codepage (const string_table *st)
 
UINT msi_set_string_table_codepage (string_table *st, UINT codepage)
 
WCHARmsi_strdupW (const WCHAR *value, int len)
 
BOOL TABLE_Exists (MSIDATABASE *db, LPCWSTR name)
 
MSICONDITION MSI_DatabaseIsTablePersistent (MSIDATABASE *db, LPCWSTR table)
 
UINT read_stream_data (IStorage *stg, LPCWSTR stname, BOOL table, BYTE **pdata, UINT *psz)
 
UINT write_stream_data (IStorage *stg, LPCWSTR stname, LPCVOID data, UINT sz, BOOL bTable)
 
UINT msi_table_apply_transform (MSIDATABASE *db, IStorage *stg, int err_cond)
 
UINT MSI_DatabaseApplyTransformW (MSIDATABASE *db, LPCWSTR szTransformFile, int iErrorCond)
 
void append_storage_to_db (MSIDATABASE *db, IStorage *stg)
 
UINT msi_apply_transforms (MSIPACKAGE *package)
 
UINT msi_check_patch_applicable (MSIPACKAGE *package, MSISUMMARYINFO *si)
 
UINT msi_apply_patches (MSIPACKAGE *package)
 
UINT msi_apply_registered_patch (MSIPACKAGE *package, LPCWSTR patch_code)
 
void msi_free_patchinfo (MSIPATCHINFO *patch)
 
UINT msi_patch_assembly (MSIPACKAGE *, MSIASSEMBLY *, MSIFILEPATCH *)
 
UINT MSI_InstallPackage (MSIPACKAGE *, LPCWSTR, LPCWSTR)
 
INT ACTION_ShowDialog (MSIPACKAGE *, LPCWSTR)
 
INT ACTION_DialogBox (MSIPACKAGE *, LPCWSTR)
 
UINT ACTION_ForceReboot (MSIPACKAGE *package)
 
UINT MSI_Sequence (MSIPACKAGE *package, LPCWSTR szTable)
 
UINT MSI_SetFeatureStates (MSIPACKAGE *package)
 
UINT msi_parse_command_line (MSIPACKAGE *package, LPCWSTR szCommandLine, BOOL preserve_case)
 
const WCHARmsi_get_command_line_option (const WCHAR *cmd, const WCHAR *option, UINT *len)
 
UINT msi_schedule_action (MSIPACKAGE *package, UINT script, const WCHAR *action)
 
INSTALLSTATE msi_get_component_action (MSIPACKAGE *package, MSICOMPONENT *comp)
 
INSTALLSTATE msi_get_feature_action (MSIPACKAGE *package, MSIFEATURE *feature)
 
UINT msi_load_all_components (MSIPACKAGE *package)
 
UINT msi_load_all_features (MSIPACKAGE *package)
 
UINT msi_validate_product_id (MSIPACKAGE *package)
 
void MSI_CloseRecord (MSIOBJECTHDR *)
 
UINT MSI_RecordSetIStream (MSIRECORD *, UINT, IStream *)
 
UINT MSI_RecordGetIStream (MSIRECORD *, UINT, IStream **)
 
const WCHARMSI_RecordGetString (const MSIRECORD *, UINT)
 
MSIRECORDMSI_CreateRecord (UINT)
 
UINT MSI_RecordSetInteger (MSIRECORD *, UINT, int)
 
UINT MSI_RecordSetStringW (MSIRECORD *, UINT, LPCWSTR)
 
BOOL MSI_RecordIsNull (MSIRECORD *, UINT)
 
UINT MSI_RecordGetStringW (MSIRECORD *, UINT, LPWSTR, LPDWORD)
 
UINT MSI_RecordGetStringA (MSIRECORD *, UINT, LPSTR, LPDWORD)
 
int MSI_RecordGetInteger (MSIRECORD *, UINT)
 
UINT MSI_RecordReadStream (MSIRECORD *, UINT, char *, LPDWORD)
 
UINT MSI_RecordSetStream (MSIRECORD *, UINT, IStream *)
 
UINT MSI_RecordGetFieldCount (const MSIRECORD *rec)
 
UINT MSI_RecordStreamToFile (MSIRECORD *, UINT, LPCWSTR)
 
UINT MSI_RecordSetStreamFromFileW (MSIRECORD *, UINT, LPCWSTR)
 
UINT MSI_RecordCopyField (MSIRECORD *, UINT, MSIRECORD *, UINT)
 
MSIRECORDMSI_CloneRecord (MSIRECORD *)
 
BOOL MSI_RecordsAreEqual (MSIRECORD *, MSIRECORD *)
 
BOOL MSI_RecordsAreFieldsEqual (MSIRECORD *a, MSIRECORD *b, UINT field)
 
UINT msi_record_set_string (MSIRECORD *, UINT, const WCHAR *, int)
 
const WCHARmsi_record_get_string (const MSIRECORD *, UINT, int *)
 
void dump_record (MSIRECORD *)
 
UINT unmarshal_record (const struct wire_record *in, MSIHANDLE *out)
 
struct wire_recordmarshal_record (MSIHANDLE handle)
 
void free_remote_record (struct wire_record *rec)
 
UINT copy_remote_record (const struct wire_record *rec, MSIHANDLE handle)
 
void enum_stream_names (IStorage *stg)
 
WCHARencode_streamname (BOOL is_table, const WCHAR *in)
 
BOOL decode_streamname (LPCWSTR in, LPWSTR out)
 
UINT msi_get_stream (MSIDATABASE *, const WCHAR *, IStream **)
 
UINT MSI_OpenDatabaseW (LPCWSTR, LPCWSTR, MSIDATABASE **)
 
UINT MSI_DatabaseOpenViewW (MSIDATABASE *, LPCWSTR, MSIQUERY **)
 
UINT WINAPIV MSI_OpenQuery (MSIDATABASE *, MSIQUERY **, LPCWSTR,...)
 
UINT MSI_IterateRecords (MSIQUERY *, LPDWORD, record_func, LPVOID)
 
MSIRECORD *WINAPIV MSI_QueryGetRecord (MSIDATABASE *db, LPCWSTR query,...)
 
UINT MSI_DatabaseGetPrimaryKeys (MSIDATABASE *, LPCWSTR, MSIRECORD **)
 
UINT MSI_ViewExecute (MSIQUERY *, MSIRECORD *)
 
UINT MSI_ViewFetch (MSIQUERY *, MSIRECORD **)
 
UINT MSI_ViewClose (MSIQUERY *)
 
UINT MSI_ViewGetColumnInfo (MSIQUERY *, MSICOLINFO, MSIRECORD **)
 
UINT MSI_ViewModify (MSIQUERY *, MSIMODIFY, MSIRECORD *)
 
UINT VIEW_find_column (MSIVIEW *, LPCWSTR, LPCWSTR, UINT *)
 
UINT msi_view_get_row (MSIDATABASE *, MSIVIEW *, UINT, MSIRECORD **)
 
UINT MSI_SetInstallLevel (MSIPACKAGE *package, int iInstallLevel)
 
MSIPACKAGEMSI_CreatePackage (MSIDATABASE *)
 
UINT MSI_OpenPackageW (LPCWSTR szPackage, DWORD dwOptions, MSIPACKAGE **pPackage)
 
UINT MSI_SetTargetPathW (MSIPACKAGE *, LPCWSTR, LPCWSTR)
 
INT MSI_ProcessMessageVerbatim (MSIPACKAGE *, INSTALLMESSAGE, MSIRECORD *)
 
INT MSI_ProcessMessage (MSIPACKAGE *, INSTALLMESSAGE, MSIRECORD *)
 
MSICONDITION MSI_EvaluateConditionW (MSIPACKAGE *, LPCWSTR)
 
UINT MSI_GetComponentStateW (MSIPACKAGE *, LPCWSTR, INSTALLSTATE *, INSTALLSTATE *)
 
UINT MSI_GetFeatureStateW (MSIPACKAGE *, LPCWSTR, INSTALLSTATE *, INSTALLSTATE *)
 
UINT MSI_SetFeatureStateW (MSIPACKAGE *, LPCWSTR, INSTALLSTATE)
 
UINT msi_download_file (LPCWSTR szUrl, LPWSTR filename)
 
UINT msi_package_add_info (MSIPACKAGE *, DWORD, DWORD, LPCWSTR, LPWSTR)
 
UINT msi_package_add_media_disk (MSIPACKAGE *, DWORD, DWORD, DWORD, LPWSTR, LPWSTR)
 
UINT msi_clone_properties (MSIDATABASE *)
 
UINT msi_set_context (MSIPACKAGE *)
 
void msi_adjust_privilege_properties (MSIPACKAGE *)
 
UINT MSI_GetFeatureCost (MSIPACKAGE *, MSIFEATURE *, MSICOSTTREE, INSTALLSTATE, LPINT)
 
UINT MSI_FormatRecordW (MSIPACKAGE *, MSIRECORD *, LPWSTR, LPDWORD)
 
BOOL unsquash_guid (LPCWSTR in, LPWSTR out)
 
BOOL squash_guid (LPCWSTR in, LPWSTR out)
 
BOOL encode_base85_guid (GUID *, LPWSTR)
 
BOOL decode_base85_guid (LPCWSTR, GUID *)
 
UINT MSIREG_OpenUninstallKey (const WCHAR *, enum platform, HKEY *, BOOL)
 
UINT MSIREG_DeleteUninstallKey (const WCHAR *, enum platform)
 
UINT MSIREG_OpenProductKey (LPCWSTR szProduct, LPCWSTR szUserSid, MSIINSTALLCONTEXT context, HKEY *key, BOOL create)
 
UINT MSIREG_OpenFeaturesKey (LPCWSTR szProduct, LPCWSTR szUserSid, MSIINSTALLCONTEXT context, HKEY *key, BOOL create)
 
UINT MSIREG_OpenUserPatchesKey (LPCWSTR szPatch, HKEY *key, BOOL create)
 
UINT MSIREG_OpenUserDataFeaturesKey (LPCWSTR szProduct, LPCWSTR szUserSid, MSIINSTALLCONTEXT context, HKEY *key, BOOL create)
 
UINT MSIREG_OpenUserComponentsKey (LPCWSTR szComponent, HKEY *key, BOOL create)
 
UINT MSIREG_OpenUserDataComponentKey (LPCWSTR szComponent, LPCWSTR szUserSid, HKEY *key, BOOL create)
 
UINT MSIREG_OpenPatchesKey (LPCWSTR szPatch, HKEY *key, BOOL create)
 
UINT MSIREG_OpenUserDataProductKey (LPCWSTR szProduct, MSIINSTALLCONTEXT dwContext, LPCWSTR szUserSid, HKEY *key, BOOL create)
 
UINT MSIREG_OpenUserDataPatchKey (LPCWSTR szPatch, MSIINSTALLCONTEXT dwContext, HKEY *key, BOOL create)
 
UINT MSIREG_OpenUserDataProductPatchesKey (LPCWSTR product, MSIINSTALLCONTEXT context, HKEY *key, BOOL create)
 
UINT MSIREG_OpenInstallProps (LPCWSTR szProduct, MSIINSTALLCONTEXT dwContext, LPCWSTR szUserSid, HKEY *key, BOOL create)
 
UINT MSIREG_OpenUpgradeCodesKey (LPCWSTR szProduct, HKEY *key, BOOL create)
 
UINT MSIREG_OpenUserUpgradeCodesKey (LPCWSTR szProduct, HKEY *key, BOOL create)
 
UINT MSIREG_DeleteProductKey (LPCWSTR szProduct)
 
UINT MSIREG_DeleteUserProductKey (LPCWSTR szProduct)
 
UINT MSIREG_DeleteUserDataPatchKey (LPCWSTR patch, MSIINSTALLCONTEXT context)
 
UINT MSIREG_DeleteUserDataProductKey (LPCWSTR, MSIINSTALLCONTEXT)
 
UINT MSIREG_DeleteUserFeaturesKey (LPCWSTR szProduct)
 
UINT MSIREG_DeleteUserDataComponentKey (LPCWSTR szComponent, LPCWSTR szUserSid)
 
UINT MSIREG_DeleteUserUpgradeCodesKey (LPCWSTR szUpgradeCode)
 
UINT MSIREG_DeleteUpgradeCodesKey (const WCHAR *)
 
UINT MSIREG_DeleteClassesUpgradeCodesKey (LPCWSTR szUpgradeCode)
 
UINT MSIREG_OpenClassesUpgradeCodesKey (LPCWSTR szUpgradeCode, HKEY *key, BOOL create)
 
UINT MSIREG_DeleteLocalClassesProductKey (LPCWSTR szProductCode)
 
UINT MSIREG_DeleteLocalClassesFeaturesKey (LPCWSTR szProductCode)
 
UINT msi_locate_product (LPCWSTR szProduct, MSIINSTALLCONTEXT *context)
 
WCHARmsi_reg_get_val_str (HKEY hkey, const WCHAR *name)
 
BOOL msi_reg_get_val_dword (HKEY hkey, LPCWSTR name, DWORD *val)
 
DWORD msi_version_str_to_dword (LPCWSTR p)
 
void msi_parse_version_string (LPCWSTR, PDWORD, PDWORD)
 
int msi_compare_file_versions (VS_FIXEDFILEINFO *, const WCHAR *)
 
int msi_compare_font_versions (const WCHAR *, const WCHAR *)
 
LONG msi_reg_set_val_str (HKEY hkey, LPCWSTR name, LPCWSTR value)
 
LONG msi_reg_set_val_multi_str (HKEY hkey, LPCWSTR name, LPCWSTR value)
 
LONG msi_reg_set_val_dword (HKEY hkey, LPCWSTR name, DWORD val)
 
LONG msi_reg_set_subkey_val (HKEY hkey, LPCWSTR path, LPCWSTR name, LPCWSTR val)
 
void msi_dialog_check_messages (HANDLE)
 
void msi_dialog_destroy (msi_dialog *)
 
void msi_dialog_unregister_class (void)
 
UINT msi_get_suminfo (IStorage *stg, UINT uiUpdateCount, MSISUMMARYINFO **si)
 
UINT msi_get_db_suminfo (MSIDATABASE *db, UINT uiUpdateCount, MSISUMMARYINFO **si)
 
WCHARmsi_suminfo_dup_string (MSISUMMARYINFO *si, UINT property)
 
INT msi_suminfo_get_int32 (MSISUMMARYINFO *si, UINT uiProperty)
 
WCHARmsi_get_suminfo_product (IStorage *stg)
 
UINT msi_add_suminfo (MSIDATABASE *db, LPWSTR **records, int num_records, int num_columns)
 
UINT msi_export_suminfo (MSIDATABASE *db, HANDLE handle)
 
UINT msi_load_suminfo_properties (MSIPACKAGE *package)
 
UINT WINAPI MsiCreateAndVerifyInstallerDirectory (DWORD)
 
UINT WINAPI MsiDecomposeDescriptorW (LPCWSTR, LPWSTR, LPWSTR, LPWSTR, LPDWORD)
 
UINT WINAPI MsiDecomposeDescriptorA (LPCSTR, LPSTR, LPSTR, LPSTR, LPDWORD)
 
LANGID WINAPI MsiLoadStringW (MSIHANDLE, UINT, LPWSTR, int, LANGID)
 
LANGID WINAPI MsiLoadStringA (MSIHANDLE, UINT, LPSTR, int, LANGID)
 
UINT ACTION_PerformAction (MSIPACKAGE *package, const WCHAR *action)
 
void ACTION_FinishCustomActions (const MSIPACKAGE *package)
 
UINT ACTION_CustomAction (MSIPACKAGE *package, const WCHAR *action)
 
void custom_stop_server (HANDLE process, HANDLE pipe)
 
UINT ACTION_AppSearch (MSIPACKAGE *package)
 
UINT ACTION_CCPSearch (MSIPACKAGE *package)
 
UINT ACTION_FindRelatedProducts (MSIPACKAGE *package)
 
UINT ACTION_InstallFiles (MSIPACKAGE *package)
 
UINT ACTION_PatchFiles (MSIPACKAGE *package)
 
UINT ACTION_RemoveFiles (MSIPACKAGE *package)
 
UINT ACTION_MoveFiles (MSIPACKAGE *package)
 
UINT ACTION_DuplicateFiles (MSIPACKAGE *package)
 
UINT ACTION_RemoveDuplicateFiles (MSIPACKAGE *package)
 
UINT ACTION_RegisterClassInfo (MSIPACKAGE *package)
 
UINT ACTION_RegisterProgIdInfo (MSIPACKAGE *package)
 
UINT ACTION_RegisterExtensionInfo (MSIPACKAGE *package)
 
UINT ACTION_RegisterMIMEInfo (MSIPACKAGE *package)
 
UINT ACTION_RegisterFonts (MSIPACKAGE *package)
 
UINT ACTION_UnregisterClassInfo (MSIPACKAGE *package)
 
UINT ACTION_UnregisterExtensionInfo (MSIPACKAGE *package)
 
UINT ACTION_UnregisterFonts (MSIPACKAGE *package)
 
UINT ACTION_UnregisterMIMEInfo (MSIPACKAGE *package)
 
UINT ACTION_UnregisterProgIdInfo (MSIPACKAGE *package)
 
UINT ACTION_MsiPublishAssemblies (MSIPACKAGE *package)
 
UINT ACTION_MsiUnpublishAssemblies (MSIPACKAGE *package)
 
DWORD deformat_string (MSIPACKAGE *package, LPCWSTR ptr, WCHAR **data)
 
WCHARmsi_dup_record_field (MSIRECORD *row, INT index)
 
WCHARmsi_dup_property (MSIDATABASE *db, const WCHAR *prop)
 
UINT msi_set_property (MSIDATABASE *, const WCHAR *, const WCHAR *, int)
 
UINT msi_get_property (MSIDATABASE *, LPCWSTR, LPWSTR, LPDWORD)
 
int msi_get_property_int (MSIDATABASE *package, LPCWSTR prop, int def)
 
WCHARmsi_resolve_source_folder (MSIPACKAGE *package, const WCHAR *name, MSIFOLDER **folder)
 
void msi_resolve_target_folder (MSIPACKAGE *package, const WCHAR *name, BOOL load_prop)
 
WCHARmsi_normalize_path (const WCHAR *)
 
WCHARmsi_resolve_file_source (MSIPACKAGE *package, MSIFILE *file)
 
const WCHARmsi_get_target_folder (MSIPACKAGE *package, const WCHAR *name)
 
void msi_reset_source_folders (MSIPACKAGE *package)
 
MSICOMPONENTmsi_get_loaded_component (MSIPACKAGE *package, const WCHAR *Component)
 
MSIFEATUREmsi_get_loaded_feature (MSIPACKAGE *package, const WCHAR *Feature)
 
MSIFILEmsi_get_loaded_file (MSIPACKAGE *package, const WCHAR *file)
 
MSIFOLDERmsi_get_loaded_folder (MSIPACKAGE *package, const WCHAR *dir)
 
WCHARmsi_create_temp_file (MSIDATABASE *db)
 
void msi_free_action_script (MSIPACKAGE *package, UINT script)
 
WCHARmsi_build_icon_path (MSIPACKAGE *, const WCHAR *)
 
WCHAR *WINAPIV msi_build_directory_name (DWORD,...)
 
void msi_reduce_to_long_filename (WCHAR *)
 
WCHARmsi_create_component_advertise_string (MSIPACKAGE *, MSICOMPONENT *, const WCHAR *)
 
void ACTION_UpdateComponentStates (MSIPACKAGE *package, MSIFEATURE *feature)
 
UINT msi_register_unique_action (MSIPACKAGE *, const WCHAR *)
 
BOOL msi_action_is_unique (const MSIPACKAGE *, const WCHAR *)
 
UINT msi_set_last_used_source (LPCWSTR product, LPCWSTR usersid, MSIINSTALLCONTEXT context, DWORD options, LPCWSTR value)
 
UINT msi_create_empty_local_file (LPWSTR path, LPCWSTR suffix)
 
UINT msi_set_sourcedir_props (MSIPACKAGE *package, BOOL replace)
 
MSIASSEMBLYmsi_load_assembly (MSIPACKAGE *, MSICOMPONENT *)
 
UINT msi_install_assembly (MSIPACKAGE *, MSICOMPONENT *)
 
UINT msi_uninstall_assembly (MSIPACKAGE *, MSICOMPONENT *)
 
void msi_destroy_assembly_caches (MSIPACKAGE *)
 
BOOL msi_is_global_assembly (MSICOMPONENT *)
 
IAssemblyEnummsi_create_assembly_enum (MSIPACKAGE *, const WCHAR *)
 
WCHARmsi_get_assembly_path (MSIPACKAGE *, const WCHAR *)
 
WCHAR ** msi_split_string (const WCHAR *, WCHAR)
 
UINT msi_set_original_database_property (MSIDATABASE *, const WCHAR *)
 
WCHARmsi_get_error_message (MSIDATABASE *, int)
 
UINT msi_strncpyWtoA (const WCHAR *str, int len, char *buf, DWORD *sz, BOOL remote)
 
UINT msi_strncpyW (const WCHAR *str, int len, WCHAR *buf, DWORD *sz)
 
WCHARmsi_get_package_code (MSIDATABASE *db)
 
static void msi_disable_fs_redirection (MSIPACKAGE *package)
 
static void msi_revert_fs_redirection (MSIPACKAGE *package)
 
BOOL msi_get_temp_file_name (MSIPACKAGE *, const WCHAR *, const WCHAR *, WCHAR *)
 
HANDLE msi_create_file (MSIPACKAGE *, const WCHAR *, DWORD, DWORD, DWORD, DWORD)
 
BOOL msi_delete_file (MSIPACKAGE *, const WCHAR *)
 
BOOL msi_remove_directory (MSIPACKAGE *, const WCHAR *)
 
DWORD msi_get_file_attributes (MSIPACKAGE *, const WCHAR *)
 
BOOL msi_set_file_attributes (MSIPACKAGE *, const WCHAR *, DWORD)
 
HANDLE msi_find_first_file (MSIPACKAGE *, const WCHAR *, WIN32_FIND_DATAW *)
 
BOOL msi_find_next_file (MSIPACKAGE *, HANDLE, WIN32_FIND_DATAW *)
 
BOOL msi_move_file (MSIPACKAGE *, const WCHAR *, const WCHAR *, DWORD)
 
DWORD msi_get_file_version_info (MSIPACKAGE *, const WCHAR *, DWORD, BYTE *)
 
BOOL msi_create_full_path (MSIPACKAGE *, const WCHAR *)
 
DWORD msi_get_disk_file_size (MSIPACKAGE *, const WCHAR *)
 
VS_FIXEDFILEINFOmsi_get_disk_file_version (MSIPACKAGE *, const WCHAR *)
 
UINT msi_get_filehash (MSIPACKAGE *, const WCHAR *, MSIFILEHASHINFO *)
 
WCHARmsi_get_font_file_version (MSIPACKAGE *, const WCHAR *)
 
UINT ready_media (MSIPACKAGE *package, BOOL compressed, MSIMEDIAINFO *mi)
 
UINT msi_load_media_info (MSIPACKAGE *package, UINT Sequence, MSIMEDIAINFO *mi)
 
void msi_free_media_info (MSIMEDIAINFO *mi)
 
BOOL msi_cabextract (MSIPACKAGE *package, MSIMEDIAINFO *mi, LPVOID data)
 
UINT msi_add_cabinet_stream (MSIPACKAGE *, UINT, IStorage *, const WCHAR *)
 
void msi_event_fire (MSIPACKAGE *, const WCHAR *, MSIRECORD *)
 
void msi_event_cleanup_all_subscriptions (MSIPACKAGE *)
 
HRESULT create_msiserver (IUnknown *pOuter, LPVOID *ppObj)
 
HRESULT create_session (MSIHANDLE msiHandle, IDispatch *pInstaller, IDispatch **pDispatch)
 
HRESULT get_typeinfo (tid_t tid, ITypeInfo **ti)
 
void release_typelib (void)
 
DWORD call_script (MSIHANDLE hPackage, INT type, LPCWSTR script, LPCWSTR function, LPCWSTR action)
 
void msi_ui_progress (MSIPACKAGE *, int, int, int, int)
 
static charstrdupWtoA (LPCWSTR str)
 
static LPWSTR strdupAtoW (LPCSTR str)
 
static charstrdupWtoU (LPCWSTR str)
 
static LPWSTR strdupUtoW (LPCSTR str)
 
static int cost_from_size (int size)
 

Variables

static const BOOL is_64bit = sizeof(void *) > sizeof(int)
 
BOOL is_wow64
 
INSTALLUILEVEL gUILevel
 
HWND gUIhwnd
 
INSTALLUI_HANDLERA gUIHandlerA
 
INSTALLUI_HANDLERW gUIHandlerW
 
INSTALLUI_HANDLER_RECORD gUIHandlerRecord
 
DWORD gUIFilter
 
DWORD gUIFilterRecord
 
LPVOID gUIContext
 
LPVOID gUIContextRecord
 
WCHARgszLogFile
 
HINSTANCE msi_hInstance
 

Macro Definition Documentation

◆ GUID_SIZE

#define GUID_SIZE   39

Definition at line 733 of file msipriv.h.

◆ INSTALLUILEVEL_MASK

#define INSTALLUILEVEL_MASK   0x0007

Definition at line 60 of file msipriv.h.

◆ LONG_STR_BYTES

#define LONG_STR_BYTES   3

Definition at line 57 of file msipriv.h.

◆ MAX_STREAM_NAME_LEN

#define MAX_STREAM_NAME_LEN   62

Definition at line 56 of file msipriv.h.

◆ MSI_BUILDNUMBER

#define MSI_BUILDNUMBER   6001

Definition at line 731 of file msipriv.h.

◆ MSI_DATASIZEMASK

#define MSI_DATASIZEMASK   0x00ff

Definition at line 47 of file msipriv.h.

◆ MSI_INITIAL_MEDIA_TRANSFORM_DISKID

#define MSI_INITIAL_MEDIA_TRANSFORM_DISKID   32000

Definition at line 84 of file msipriv.h.

◆ MSI_INITIAL_MEDIA_TRANSFORM_OFFSET

#define MSI_INITIAL_MEDIA_TRANSFORM_OFFSET   10000

Definition at line 83 of file msipriv.h.

◆ MSI_MAJORVERSION

#define MSI_MAJORVERSION   4

Definition at line 729 of file msipriv.h.

◆ MSI_MAX_PROPS

#define MSI_MAX_PROPS   20

Definition at line 482 of file msipriv.h.

◆ MSI_MINORVERSION

#define MSI_MINORVERSION   5

Definition at line 730 of file msipriv.h.

◆ MSI_OPEN_CREATE

#define MSI_OPEN_CREATE   3

Definition at line 102 of file msipriv.h.

◆ MSI_OPEN_CREATEDIRECT

#define MSI_OPEN_CREATEDIRECT   4

Definition at line 103 of file msipriv.h.

◆ MSI_OPEN_DIRECT

#define MSI_OPEN_DIRECT   2

Definition at line 101 of file msipriv.h.

◆ MSI_OPEN_PATCHFILE

#define MSI_OPEN_PATCHFILE   32

Definition at line 104 of file msipriv.h.

◆ MSI_OPEN_READONLY

#define MSI_OPEN_READONLY   0

Definition at line 99 of file msipriv.h.

◆ MSI_OPEN_TRANSACT

#define MSI_OPEN_TRANSACT   1

Definition at line 100 of file msipriv.h.

◆ MSICABEXTRACT_BEGINEXTRACT

#define MSICABEXTRACT_BEGINEXTRACT   0x01

Definition at line 1101 of file msipriv.h.

◆ MSICABEXTRACT_FILEEXTRACTED

#define MSICABEXTRACT_FILEEXTRACTED   0x02

Definition at line 1102 of file msipriv.h.

◆ MSIHANDLE_MAGIC

#define MSIHANDLE_MAGIC   0x4d434923

Definition at line 736 of file msipriv.h.

◆ MSIHANDLETYPE_ANY

#define MSIHANDLETYPE_ANY   0

Definition at line 721 of file msipriv.h.

◆ MSIHANDLETYPE_DATABASE

#define MSIHANDLETYPE_DATABASE   1

Definition at line 722 of file msipriv.h.

◆ MSIHANDLETYPE_PACKAGE

#define MSIHANDLETYPE_PACKAGE   5

Definition at line 726 of file msipriv.h.

◆ MSIHANDLETYPE_PREVIEW

#define MSIHANDLETYPE_PREVIEW   6

Definition at line 727 of file msipriv.h.

◆ MSIHANDLETYPE_RECORD

#define MSIHANDLETYPE_RECORD   4

Definition at line 725 of file msipriv.h.

◆ MSIHANDLETYPE_SUMMARYINFO

#define MSIHANDLETYPE_SUMMARYINFO   2

Definition at line 723 of file msipriv.h.

◆ MSIHANDLETYPE_VIEW

#define MSIHANDLETYPE_VIEW   3

Definition at line 724 of file msipriv.h.

◆ MSITYPE_IS_BINARY

#define MSITYPE_IS_BINARY (   type)    (((type) & ~MSITYPE_NULLABLE) == (MSITYPE_STRING|MSITYPE_VALID))

Definition at line 62 of file msipriv.h.

◆ MSITYPE_KEY

#define MSITYPE_KEY   0x2000

Definition at line 52 of file msipriv.h.

◆ MSITYPE_LOCALIZABLE

#define MSITYPE_LOCALIZABLE   0x200

Definition at line 49 of file msipriv.h.

◆ MSITYPE_NULLABLE

#define MSITYPE_NULLABLE   0x1000

Definition at line 51 of file msipriv.h.

◆ MSITYPE_STRING

#define MSITYPE_STRING   0x0800

Definition at line 50 of file msipriv.h.

◆ MSITYPE_TEMPORARY

#define MSITYPE_TEMPORARY   0x4000

Definition at line 53 of file msipriv.h.

◆ MSITYPE_UNKNOWN

#define MSITYPE_UNKNOWN   0x8000

Definition at line 54 of file msipriv.h.

◆ MSITYPE_VALID

#define MSITYPE_VALID   0x0100

Definition at line 48 of file msipriv.h.

◆ SEQUENCE_EXEC

#define SEQUENCE_EXEC   0x2

Definition at line 719 of file msipriv.h.

◆ SEQUENCE_UI

#define SEQUENCE_UI   0x1

Definition at line 718 of file msipriv.h.

◆ SQUASHED_GUID_SIZE

#define SQUASHED_GUID_SIZE   33

Definition at line 734 of file msipriv.h.

◆ WINE_OPENPACKAGEFLAGS_RECACHE

#define WINE_OPENPACKAGEFLAGS_RECACHE   0x80000000

Definition at line 884 of file msipriv.h.

Typedef Documentation

◆ column_info

◆ ComponentList

◆ FeatureList

◆ FolderList

◆ msi_dialog

Definition at line 361 of file msipriv.h.

◆ msi_file_state

◆ MSIAPPID

◆ MSIASSEMBLY

◆ MSIBINARY

◆ MSICABINETSTREAM

◆ MSICLASS

◆ MSICOMPONENT

◆ MSIDATABASE

◆ MSIEXTENSION

◆ MSIFEATURE

◆ MSIFIELD

◆ MSIFILE

◆ MSIFILEPATCH

◆ MSIFOLDER

◆ msihandledestructor

typedef VOID(* msihandledestructor) (MSIOBJECTHDR *)

Definition at line 73 of file msipriv.h.

◆ MSIITERHANDLE

typedef const struct tagMSICOLUMNHASHENTRY* MSIITERHANDLE

Definition at line 229 of file msipriv.h.

◆ MSIMEDIADISK

◆ MSIMEDIAINFO

◆ MSIMIME

Definition at line 670 of file msipriv.h.

◆ MSIOBJECTHDR

Definition at line 71 of file msipriv.h.

◆ MSIPACKAGE

◆ MSIPATCHINFO

◆ MSIPREVIEW

◆ MSIPROGID

Definition at line 647 of file msipriv.h.

◆ MSIQUERY

◆ MSIRECORD

◆ MSISOURCELISTINFO

◆ MSISTREAM

◆ MSISUMMARYINFO

◆ MSITABLE

Definition at line 65 of file msipriv.h.

◆ MSITRANSFORM

◆ MSIVERB

◆ MSIVIEW

Definition at line 125 of file msipriv.h.

◆ MSIVIEWOPS

◆ PMSICABEXTRACTCB

typedef BOOL(* PMSICABEXTRACTCB) (MSIPACKAGE *, LPCWSTR, DWORD, LPWSTR *, DWORD *, PVOID)

Definition at line 1099 of file msipriv.h.

◆ record_func

typedef UINT(* record_func) (MSIRECORD *, LPVOID)

Definition at line 866 of file msipriv.h.

◆ string_table

Definition at line 68 of file msipriv.h.

◆ tid_t

typedef enum tid_t tid_t

Enumeration Type Documentation

◆ _msi_file_state

Enumerator
msifs_invalid 
msifs_missing 
msifs_overwrite 
msifs_present 
msifs_installed 
msifs_skipped 
msifs_hashmatch 

Definition at line 593 of file msipriv.h.

593 {
enum _msi_file_state msi_file_state
@ msifs_missing
Definition: msipriv.h:595
@ msifs_skipped
Definition: msipriv.h:599
@ msifs_installed
Definition: msipriv.h:598
@ msifs_invalid
Definition: msipriv.h:594
@ msifs_present
Definition: msipriv.h:597
@ msifs_hashmatch
Definition: msipriv.h:600
@ msifs_overwrite
Definition: msipriv.h:596

◆ clr_version

Enumerator
CLR_VERSION_V10 
CLR_VERSION_V11 
CLR_VERSION_V20 
CLR_VERSION_V40 
CLR_VERSION_MAX 

Definition at line 373 of file msipriv.h.

374{
380};
@ CLR_VERSION_V20
Definition: msipriv.h:377
@ CLR_VERSION_MAX
Definition: msipriv.h:379
@ CLR_VERSION_V40
Definition: msipriv.h:378
@ CLR_VERSION_V11
Definition: msipriv.h:376
@ CLR_VERSION_V10
Definition: msipriv.h:375

◆ folder_state

Enumerator
FOLDER_STATE_UNINITIALIZED 
FOLDER_STATE_EXISTS 
FOLDER_STATE_CREATED 
FOLDER_STATE_CREATED_PERSISTENT 
FOLDER_STATE_REMOVED 

Definition at line 563 of file msipriv.h.

564{
570};
@ FOLDER_STATE_UNINITIALIZED
Definition: msipriv.h:565
@ FOLDER_STATE_EXISTS
Definition: msipriv.h:566
@ FOLDER_STATE_REMOVED
Definition: msipriv.h:569
@ FOLDER_STATE_CREATED
Definition: msipriv.h:567
@ FOLDER_STATE_CREATED_PERSISTENT
Definition: msipriv.h:568

◆ platform

Enumerator
PLATFORM_UNRECOGNIZED 
PLATFORM_INTEL 
PLATFORM_INTEL64 
PLATFORM_X64 
PLATFORM_ARM 
PLATFORM_ARM64 

Definition at line 363 of file msipriv.h.

364{
371};
@ PLATFORM_X64
Definition: msipriv.h:368
@ PLATFORM_UNRECOGNIZED
Definition: msipriv.h:365
@ PLATFORM_INTEL64
Definition: msipriv.h:367
@ PLATFORM_INTEL
Definition: msipriv.h:366
@ PLATFORM_ARM
Definition: msipriv.h:369
@ PLATFORM_ARM64
Definition: msipriv.h:370

◆ script

Enumerator
SCRIPT_NONE 
SCRIPT_INSTALL 
SCRIPT_COMMIT 
SCRIPT_ROLLBACK 
SCRIPT_MAX 

Definition at line 382 of file msipriv.h.

383{
384 SCRIPT_NONE = -1,
385 SCRIPT_INSTALL = 0,
386 SCRIPT_COMMIT = 1,
387 SCRIPT_ROLLBACK = 2,
388 SCRIPT_MAX = 3
389};
@ SCRIPT_INSTALL
Definition: msipriv.h:385
@ SCRIPT_ROLLBACK
Definition: msipriv.h:387
@ SCRIPT_NONE
Definition: msipriv.h:384
@ SCRIPT_COMMIT
Definition: msipriv.h:386
@ SCRIPT_MAX
Definition: msipriv.h:388

◆ tid_t

Enumerator
LAST_tid 
LAST_tid 
Database_tid 
Installer_tid 
Record_tid 
Session_tid 
StringList_tid 
SummaryInfo_tid 
View_tid 
LAST_tid 
NULL_tid 
IXMLDOMAttribute_tid 
IXMLDOMCDATASection_tid 
IXMLDOMComment_tid 
IXMLDOMDocument_tid 
IXMLDOMDocument2_tid 
IXMLDOMDocument3_tid 
IXMLDOMDocumentFragment_tid 
IXMLDOMDocumentType_tid 
IXMLDOMElement_tid 
IXMLDOMEntityReference_tid 
IXMLDOMImplementation_tid 
IXMLDOMNamedNodeMap_tid 
IXMLDOMNode_tid 
IXMLDOMNodeList_tid 
IXMLDOMParseError2_tid 
IXMLDOMProcessingInstruction_tid 
IXMLDOMSchemaCollection_tid 
IXMLDOMSchemaCollection2_tid 
IXMLDOMSelection_tid 
IXMLDOMText_tid 
IXMLElement_tid 
IXMLDocument_tid 
IXMLHTTPRequest_tid 
IXSLProcessor_tid 
IXSLTemplate_tid 
IVBSAXAttributes_tid 
IVBSAXContentHandler_tid 
IVBSAXDeclHandler_tid 
IVBSAXDTDHandler_tid 
IVBSAXEntityResolver_tid 
IVBSAXErrorHandler_tid 
IVBSAXLexicalHandler_tid 
IVBSAXLocator_tid 
IVBSAXXMLFilter_tid 
IVBSAXXMLReader_tid 
IMXAttributes_tid 
IMXReaderControl_tid 
IMXWriter_tid 
IVBMXNamespaceManager_tid 
IServerXMLHTTPRequest_tid 
LAST_tid 
NULL_tid 
ITextDocument_tid 
ITextRange_tid 
ITextSelection_tid 
ITextFont_tid 
ITextPara_tid 
LAST_tid 
NULL_tid 
IDictionary_tid 
IDrive_tid 
IDriveCollection_tid 
IFile_tid 
IFileCollection_tid 
IFileSystem3_tid 
IFolder_tid 
IFolderCollection_tid 
ITextStream_tid 
LAST_tid 
NULL_tid 
IWshCollection_tid 
IWshEnvironment_tid 
IWshExec_tid 
IWshShell3_tid 
IWshShortcut_tid 
LAST_tid 

Definition at line 1124 of file msipriv.h.

1124 {
1127 Record_tid,
1131 View_tid,
1132 LAST_tid
1133} tid_t;
tid_t
Definition: msipriv.h:1124
@ View_tid
Definition: msipriv.h:1131
@ Session_tid
Definition: msipriv.h:1128
@ Database_tid
Definition: msipriv.h:1125
@ LAST_tid
Definition: msipriv.h:1132
@ SummaryInfo_tid
Definition: msipriv.h:1130
@ StringList_tid
Definition: msipriv.h:1129
@ Record_tid
Definition: msipriv.h:1127
@ Installer_tid
Definition: msipriv.h:1126

Function Documentation

◆ ACTION_AppSearch()

UINT ACTION_AppSearch ( MSIPACKAGE package)

Definition at line 1078 of file appsearch.c.

1079{
1080 MSIQUERY *view;
1081 UINT r;
1082
1083 if (msi_action_is_unique(package, L"AppSearch"))
1084 {
1085 TRACE("Skipping AppSearch action: already done in UI sequence\n");
1086 return ERROR_SUCCESS;
1087 }
1088 else
1089 msi_register_unique_action(package, L"AppSearch");
1090
1091 r = MSI_OpenQuery( package->db, &view, L"SELECT * FROM `AppSearch`" );
1092 if (r != ERROR_SUCCESS)
1093 return ERROR_SUCCESS;
1094
1096 msiobj_release( &view->hdr );
1097 return r;
1098}
static UINT ITERATE_AppSearch(MSIRECORD *row, LPVOID param)
Definition: appsearch.c:1043
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
UINT msi_register_unique_action(MSIPACKAGE *package, const WCHAR *action)
Definition: custom.c:113
BOOL msi_action_is_unique(const MSIPACKAGE *package, const WCHAR *action)
Definition: custom.c:131
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:241
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
UINT WINAPIV MSI_OpenQuery(MSIDATABASE *, MSIQUERY **, LPCWSTR,...)
Definition: msiquery.c:138
UINT MSI_IterateRecords(MSIQUERY *, LPDWORD, record_func, LPVOID)
Definition: msiquery.c:163
unsigned int UINT
Definition: ndis.h:50
#define L(x)
Definition: ntvdm.h:50
#define TRACE(s)
Definition: solgame.cpp:4
MSIDATABASE * db
Definition: msipriv.h:394

◆ ACTION_CCPSearch()

UINT ACTION_CCPSearch ( MSIPACKAGE package)

Definition at line 1125 of file appsearch.c.

1126{
1127 MSIQUERY *view;
1128 UINT r;
1129
1130 if (msi_action_is_unique(package, L"CCPSearch"))
1131 {
1132 TRACE("Skipping AppSearch action: already done in UI sequence\n");
1133 return ERROR_SUCCESS;
1134 }
1135 else
1136 msi_register_unique_action(package, L"CCPSearch");
1137
1138 r = MSI_OpenQuery(package->db, &view, L"SELECT * FROM `CCPSearch`");
1139 if (r != ERROR_SUCCESS)
1140 return ERROR_SUCCESS;
1141
1143 msiobj_release(&view->hdr);
1144 return r;
1145}
static UINT ITERATE_CCPSearch(MSIRECORD *row, LPVOID param)
Definition: appsearch.c:1100

◆ ACTION_CustomAction()

UINT ACTION_CustomAction ( MSIPACKAGE package,
const WCHAR action 
)

Definition at line 1485 of file custom.c.

1486{
1487 UINT rc = ERROR_SUCCESS;
1488 MSIRECORD *row;
1489 UINT type;
1490 const WCHAR *source, *target, *ptr, *deferred_data = NULL;
1491 WCHAR *deformated = NULL;
1492 int len;
1493
1494 /* deferred action: [properties]Action */
1495 if ((ptr = wcsrchr(action, ']')))
1496 {
1497 deferred_data = action;
1498 action = ptr + 1;
1499 }
1500
1501 row = MSI_QueryGetRecord( package->db, L"SELECT * FROM `CustomAction` WHERE `Action` = '%s'", action );
1502 if (!row)
1504
1508
1509 TRACE("Handling custom action %s (%x %s %s)\n",debugstr_w(action),type,
1511
1512 /* handle some of the deferred actions */
1514 FIXME("msidbCustomActionTypeTSAware not handled\n");
1515
1517 {
1519 WARN("msidbCustomActionTypeNoImpersonate not handled\n");
1520
1521 if (!action_type_matches_script(type, package->script))
1522 {
1523 rc = defer_custom_action( package, action, type );
1524 goto end;
1525 }
1526 else
1527 {
1528 LPWSTR actiondata = msi_dup_property( package->db, action );
1529
1531 package->scheduled_action_running = TRUE;
1532
1534 package->commit_action_running = TRUE;
1535
1537 package->rollback_action_running = TRUE;
1538
1539 if (deferred_data)
1540 set_deferred_action_props(package, deferred_data);
1541 else if (actiondata)
1542 msi_set_property( package->db, L"CustomActionData", actiondata, -1 );
1543 else
1544 msi_set_property( package->db, L"CustomActionData", L"", -1 );
1545
1546 free(actiondata);
1547 }
1548 }
1550 {
1551 rc = ERROR_SUCCESS;
1552 goto end;
1553 }
1554
1555 switch (type & CUSTOM_ACTION_TYPE_MASK)
1556 {
1557 case 1: /* DLL file stored in a Binary table stream */
1558 rc = HANDLE_CustomType1( package, source, target, type, action );
1559 break;
1560 case 2: /* EXE file stored in a Binary table stream */
1561 rc = HANDLE_CustomType2( package, source, target, type, action );
1562 break;
1563 case 5:
1564 case 6: /* JScript/VBScript file stored in a Binary table stream */
1565 rc = HANDLE_CustomType5_6( package, source, target, type, action );
1566 break;
1567 case 7: /* Concurrent install from substorage */
1568 deformat_string( package, target, &deformated );
1569 rc = HANDLE_CustomType7( package, source, target, type, action );
1570 free( deformated );
1571 break;
1572 case 17:
1573 rc = HANDLE_CustomType17( package, source, target, type, action );
1574 break;
1575 case 18: /* EXE file installed with package */
1576 rc = HANDLE_CustomType18( package, source, target, type, action );
1577 break;
1578 case 19: /* Error that halts install */
1579 rc = HANDLE_CustomType19( package, source, target, type, action );
1580 break;
1581 case 21: /* JScript/VBScript file installed with the product */
1582 case 22:
1583 rc = HANDLE_CustomType21_22( package, source, target, type, action );
1584 break;
1585 case 23: /* Installs another package in the source tree */
1586 deformat_string( package, target, &deformated );
1587 rc = HANDLE_CustomType23( package, source, deformated, type, action );
1588 free( deformated );
1589 break;
1590 case 34: /* EXE to be run in specified directory */
1591 rc = HANDLE_CustomType34( package, source, target, type, action );
1592 break;
1593 case 35: /* Directory set with formatted text */
1594 deformat_string( package, target, &deformated );
1595 MSI_SetTargetPathW( package, source, deformated );
1596 free( deformated );
1597 break;
1598 case 37: /* JScript/VBScript text stored in target column */
1599 case 38:
1600 rc = HANDLE_CustomType37_38( package, source, target, type, action );
1601 break;
1602 case 50: /* EXE file specified by a property value */
1603 rc = HANDLE_CustomType50( package, source, target, type, action );
1604 break;
1605 case 51: /* Property set with formatted text */
1606 if (!source) break;
1607 len = deformat_string( package, target, &deformated );
1608 rc = msi_set_property( package->db, source, deformated, len );
1609 if (rc == ERROR_SUCCESS && !wcscmp( source, L"SourceDir" )) msi_reset_source_folders( package );
1610 free( deformated );
1611 break;
1612 case 53: /* JScript/VBScript text specified by a property value */
1613 case 54:
1614 rc = HANDLE_CustomType53_54( package, source, target, type, action );
1615 break;
1616 default:
1617 FIXME( "unhandled action type %u (%s %s)\n", type & CUSTOM_ACTION_TYPE_MASK, debugstr_w(source),
1618 debugstr_w(target) );
1619 }
1620
1621end:
1623 package->commit_action_running = FALSE;
1624 package->rollback_action_running = FALSE;
1625 msiobj_release(&row->hdr);
1626 return rc;
1627}
#define FIXME(fmt,...)
Definition: precomp.h:53
#define WARN(fmt,...)
Definition: precomp.h:61
#define free
Definition: debug_ros.c:5
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define wcsrchr
Definition: compat.h:16
const WCHAR * action
Definition: action.c:7509
static UINT HANDLE_CustomType1(MSIPACKAGE *package, const WCHAR *source, const WCHAR *target, INT type, const WCHAR *action)
Definition: custom.c:862
static UINT defer_custom_action(MSIPACKAGE *package, const WCHAR *action, UINT type)
Definition: custom.c:1448
static UINT HANDLE_CustomType7(MSIPACKAGE *package, const WCHAR *source, const WCHAR *target, INT type, const WCHAR *action)
Definition: custom.c:1147
#define CUSTOM_ACTION_TYPE_MASK
Definition: custom.c:51
static UINT HANDLE_CustomType37_38(MSIPACKAGE *package, const WCHAR *source, const WCHAR *target, INT type, const WCHAR *action)
Definition: custom.c:1296
static BOOL check_execution_scheduling_options(MSIPACKAGE *package, LPCWSTR action, UINT options)
Definition: custom.c:142
static UINT HANDLE_CustomType21_22(MSIPACKAGE *package, const WCHAR *source, const WCHAR *target, INT type, const WCHAR *action)
Definition: custom.c:1355
static UINT HANDLE_CustomType23(MSIPACKAGE *package, const WCHAR *source, const WCHAR *target, INT type, const WCHAR *action)
Definition: custom.c:1066
static UINT HANDLE_CustomType17(MSIPACKAGE *package, const WCHAR *source, const WCHAR *target, INT type, const WCHAR *action)
Definition: custom.c:975
static UINT HANDLE_CustomType2(MSIPACKAGE *package, const WCHAR *source, const WCHAR *target, INT type, const WCHAR *action)
Definition: custom.c:956
static void set_deferred_action_props(MSIPACKAGE *package, const WCHAR *deferred_data)
Definition: custom.c:199
static BOOL action_type_matches_script(UINT type, UINT script)
Definition: custom.c:1430
static UINT HANDLE_CustomType34(MSIPACKAGE *package, const WCHAR *source, const WCHAR *target, INT type, const WCHAR *action)
Definition: custom.c:1199
static UINT HANDLE_CustomType5_6(MSIPACKAGE *package, const WCHAR *source, const WCHAR *target, INT type, const WCHAR *action)
Definition: custom.c:1307
static UINT HANDLE_CustomType18(MSIPACKAGE *package, const WCHAR *source, const WCHAR *target, INT type, const WCHAR *action)
Definition: custom.c:1006
static UINT HANDLE_CustomType50(MSIPACKAGE *package, const WCHAR *source, const WCHAR *target, INT type, const WCHAR *action)
Definition: custom.c:1181
static UINT HANDLE_CustomType53_54(MSIPACKAGE *package, const WCHAR *source, const WCHAR *target, INT type, const WCHAR *action)
Definition: custom.c:1414
static UINT HANDLE_CustomType19(MSIPACKAGE *package, const WCHAR *source, const WCHAR *target, INT type, const WCHAR *action)
Definition: custom.c:1024
DWORD deformat_string(MSIPACKAGE *package, const WCHAR *fmt, WCHAR **data)
Definition: format.c:1016
UINT MSI_SetTargetPathW(MSIPACKAGE *package, LPCWSTR szFolder, LPCWSTR szFolderPath)
Definition: install.c:564
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
Definition: typeof.h:78
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLuint GLuint end
Definition: gl.h:1545
GLenum GLsizei len
Definition: glext.h:6722
GLenum target
Definition: glext.h:7315
#define debugstr_w
Definition: kernel32.h:32
static PVOID ptr
Definition: dispmode.c:27
@ msidbCustomActionTypeCommit
Definition: msidefs.h:137
@ msidbCustomActionTypeNoImpersonate
Definition: msidefs.h:139
@ msidbCustomActionTypeTSAware
Definition: msidefs.h:140
@ msidbCustomActionTypeRollback
Definition: msidefs.h:136
@ msidbCustomActionTypeInScript
Definition: msidefs.h:134
int MSI_RecordGetInteger(MSIRECORD *, UINT)
Definition: record.c:213
void msi_reset_source_folders(MSIPACKAGE *package)
Definition: package.c:2089
const WCHAR * MSI_RecordGetString(const MSIRECORD *, UINT)
Definition: record.c:433
UINT msi_set_property(MSIDATABASE *, const WCHAR *, const WCHAR *, int)
Definition: package.c:2100
MSIRECORD *WINAPIV MSI_QueryGetRecord(MSIDATABASE *db, LPCWSTR query,...)
Definition: msiquery.c:201
WCHAR * msi_dup_property(MSIDATABASE *db, const WCHAR *prop)
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
unsigned char commit_action_running
Definition: msipriv.h:467
unsigned char rollback_action_running
Definition: msipriv.h:468
enum script script
Definition: msipriv.h:432
unsigned char scheduled_action_running
Definition: msipriv.h:466
#define ERROR_FUNCTION_NOT_CALLED
Definition: winerror.h:984
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by ACTION_HandleCustomAction().

◆ ACTION_DialogBox()

INT ACTION_DialogBox ( MSIPACKAGE ,
LPCWSTR   
)

◆ ACTION_DuplicateFiles()

UINT ACTION_DuplicateFiles ( MSIPACKAGE package)

Definition at line 1315 of file files.c.

1316{
1317 MSIQUERY *view;
1318 UINT rc;
1319
1320 if (package->script == SCRIPT_NONE)
1321 return msi_schedule_action(package, SCRIPT_INSTALL, L"DuplicateFiles");
1322
1323 rc = MSI_DatabaseOpenViewW(package->db, L"SELECT * FROM `DuplicateFile`", &view);
1324 if (rc != ERROR_SUCCESS)
1325 return ERROR_SUCCESS;
1326
1328 msiobj_release(&view->hdr);
1329 return rc;
1330}
UINT msi_schedule_action(MSIPACKAGE *package, UINT script, const WCHAR *action)
Definition: custom.c:90
static UINT ITERATE_DuplicateFiles(MSIRECORD *row, LPVOID param)
Definition: files.c:1254
UINT MSI_DatabaseOpenViewW(MSIDATABASE *, LPCWSTR, MSIQUERY **)

◆ ACTION_FindRelatedProducts()

UINT ACTION_FindRelatedProducts ( MSIPACKAGE package)

Definition at line 217 of file upgrade.c.

218{
219 MSIQUERY *view;
220 UINT rc;
221
222 if (msi_get_property_int(package->db, L"Installed", 0))
223 {
224 TRACE("Skipping FindRelatedProducts action: product already installed\n");
225 return ERROR_SUCCESS;
226 }
227 if (msi_action_is_unique(package, L"FindRelatedProducts"))
228 {
229 TRACE("Skipping FindRelatedProducts action: already done in UI sequence\n");
230 return ERROR_SUCCESS;
231 }
232 else
233 msi_register_unique_action(package, L"FindRelatedProducts");
234
235 rc = MSI_DatabaseOpenViewW(package->db, L"SELECT * FROM `Upgrade`", &view);
236 if (rc != ERROR_SUCCESS)
237 return ERROR_SUCCESS;
238
240 msiobj_release(&view->hdr);
241 return rc;
242}
int msi_get_property_int(MSIDATABASE *package, LPCWSTR prop, int def)
Definition: package.c:2305
static UINT ITERATE_FindRelatedProducts(MSIRECORD *rec, LPVOID param)
Definition: upgrade.c:115

◆ ACTION_FinishCustomActions()

void ACTION_FinishCustomActions ( const MSIPACKAGE package)

Definition at line 1629 of file custom.c.

1630{
1631 struct list *item;
1632 HANDLE *wait_handles;
1633 unsigned int handle_count, i;
1635
1636 while ((item = list_head( &package->RunningActions )))
1637 {
1639
1640 list_remove( &action->entry );
1641
1642 TRACE("waiting for %s\n", debugstr_w( action->name ) );
1644
1645 CloseHandle( action->handle );
1646 free( action->name );
1647 free( action );
1648 }
1649
1651
1652 handle_count = list_count( &pending_custom_actions );
1653 wait_handles = malloc( handle_count * sizeof(HANDLE) );
1654
1655 handle_count = 0;
1657 {
1658 if (info->package == package )
1659 {
1660 if (DuplicateHandle(GetCurrentProcess(), info->handle, GetCurrentProcess(), &wait_handles[handle_count], SYNCHRONIZE, FALSE, 0))
1661 handle_count++;
1662 }
1663 }
1664
1666
1667 for (i = 0; i < handle_count; i++)
1668 {
1669 msi_dialog_check_messages( wait_handles[i] );
1670 CloseHandle( wait_handles[i] );
1671 }
1672 free( wait_handles );
1673
1676 {
1677 if (info->package == package)
1679 }
1681}
static void list_remove(struct list_entry *entry)
Definition: list.h:90
Definition: list.h:37
#define malloc
Definition: debug_ros.c:4
#define CloseHandle
Definition: compat.h:739
#define GetCurrentProcess()
Definition: compat.h:759
BOOL WINAPI DuplicateHandle(IN HANDLE hSourceProcessHandle, IN HANDLE hSourceHandle, IN HANDLE hTargetProcessHandle, OUT LPHANDLE lpTargetHandle, IN DWORD dwDesiredAccess, IN BOOL bInheritHandle, IN DWORD dwOptions)
Definition: handle.c:149
static struct list pending_custom_actions
Definition: custom.c:73
static CRITICAL_SECTION custom_action_cs
Definition: custom.c:63
static void free_custom_action_data(custom_action_info *info)
Definition: custom.c:396
void msi_dialog_check_messages(HANDLE handle)
Definition: dialog.c:3987
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
const char cursor[]
Definition: icontest.c:13
uint32_t entry
Definition: isohybrid.c:63
static ATOM item
Definition: dde.c:856
#define SYNCHRONIZE
Definition: nt_native.h:61
__WINE_SERVER_LIST_INLINE unsigned int list_count(const struct list *list)
Definition: list.h:155
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
Definition: list.h:204
Definition: list.h:15
struct list RunningActions
Definition: msipriv.h:440
#define LIST_ENTRY(type)
Definition: queue.h:175
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)

Referenced by MSI_InstallPackage().

◆ ACTION_ForceReboot()

UINT ACTION_ForceReboot ( MSIPACKAGE package)

Definition at line 5219 of file action.c.

5220{
5221 WCHAR buffer[256], sysdir[MAX_PATH], squashed_pc[SQUASHED_GUID_SIZE];
5222 HKEY hkey;
5223
5224 squash_guid( package->ProductCode, squashed_pc );
5225
5226 GetSystemDirectoryW(sysdir, ARRAY_SIZE(sysdir));
5227 RegCreateKeyW(HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce", &hkey);
5228 swprintf(buffer, ARRAY_SIZE(buffer), L"%s\\MsiExec.exe /@ \"%s\"", sysdir, squashed_pc);
5229
5230 msi_reg_set_val_str( hkey, squashed_pc, buffer );
5231 RegCloseKey(hkey);
5232
5233 TRACE("Reboot command %s\n",debugstr_w(buffer));
5234
5235 RegCreateKeyW(HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\RunOnceEntries",
5236 &hkey);
5237 swprintf( buffer, ARRAY_SIZE(buffer), L"/I \"%s\" AFTERREBOOT=1 RUNONCEENTRY=\"%s\"", package->ProductCode,
5238 squashed_pc );
5239
5240 msi_reg_set_val_str( hkey, squashed_pc, buffer );
5241 RegCloseKey(hkey);
5242
5243 return ERROR_INSTALL_SUSPEND;
5244}
#define ARRAY_SIZE(A)
Definition: main.h:20
#define RegCloseKey(hKey)
Definition: registry.h:49
LONG WINAPI RegCreateKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:1201
#define MAX_PATH
Definition: compat.h:34
UINT WINAPI GetSystemDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2313
#define swprintf
Definition: precomp.h:40
GLuint buffer
Definition: glext.h:5915
BOOL squash_guid(LPCWSTR in, LPWSTR out)
Definition: registry.c:74
LONG msi_reg_set_val_str(HKEY hkey, LPCWSTR name, LPCWSTR value)
Definition: registry.c:209
#define SQUASHED_GUID_SIZE
Definition: msipriv.h:734
LPWSTR ProductCode
Definition: msipriv.h:448
#define ERROR_INSTALL_SUSPEND
Definition: winerror.h:962
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

Referenced by custom_get_thread_return(), and ITERATE_Actions().

◆ ACTION_InstallFiles()

UINT ACTION_InstallFiles ( MSIPACKAGE package)

Definition at line 564 of file files.c.

565{
567 UINT rc = ERROR_SUCCESS;
568 MSIFILE *file;
569
571
572 if (package->script == SCRIPT_NONE)
573 return msi_schedule_action(package, SCRIPT_INSTALL, L"InstallFiles");
574
575 schedule_install_files(package);
576 mi = calloc(1, sizeof(MSIMEDIAINFO));
577
579 {
580 BOOL is_global_assembly = msi_is_global_assembly( file->Component );
581
582 file_update_ui( package, file, L"InstallFiles" );
583
584 rc = msi_load_media_info( package, file->Sequence, mi );
585 if (rc != ERROR_SUCCESS)
586 {
587 ERR("Unable to load media info for %s (%u)\n", debugstr_w(file->File), rc);
589 goto done;
590 }
591
592 if (file->state != msifs_hashmatch &&
593 file->state != msifs_skipped &&
594 (file->state != msifs_present || !msi_get_property_int( package->db, L"Installed", 0 )) &&
595 (rc = ready_media( package, file->IsCompressed, mi )))
596 {
597 ERR("Failed to ready media for %s\n", debugstr_w(file->File));
598 goto done;
599 }
600
601 if (file->state != msifs_missing && !mi->is_continuous && file->state != msifs_overwrite)
602 continue;
603
604 if (file->Sequence > mi->last_sequence || mi->is_continuous ||
605 (file->IsCompressed && !mi->is_extracted))
606 {
609
610 data.mi = mi;
611 data.package = package;
613 data.user = &cursor;
614
615 if (file->IsCompressed && !msi_cabextract(package, mi, &data))
616 {
617 ERR("Failed to extract cabinet: %s\n", debugstr_w(mi->cabinet));
619 goto done;
620 }
621 }
622
623 if (!file->IsCompressed)
624 {
626
627 TRACE("copying %s to %s\n", debugstr_w(source), debugstr_w(file->TargetPath));
628
629 if (!is_global_assembly)
630 {
631 create_folder(package, file->Component->Directory);
632 }
633 rc = copy_install_file(package, file, source);
634 if (rc != ERROR_SUCCESS)
635 {
636 ERR("Failed to copy %s to %s (%u)\n", debugstr_w(source), debugstr_w(file->TargetPath), rc);
638 free(source);
639 goto done;
640 }
641 if (!is_global_assembly) file->state = msifs_installed;
642 free(source);
643 }
644 else if (!is_global_assembly && file->state != msifs_installed &&
645 !(file->Attributes & msidbFileAttributesPatchAdded))
646 {
647 ERR("compressed file wasn't installed (%s)\n", debugstr_w(file->File));
649 goto done;
650 }
651 }
652
653done:
655 return rc;
656}
#define ERR(fmt,...)
Definition: precomp.h:57
BOOL msi_is_global_assembly(MSICOMPONENT *comp)
Definition: action.c:2036
UINT msi_set_sourcedir_props(MSIPACKAGE *package, BOOL replace)
Definition: action.c:352
WCHAR * msi_resolve_file_source(MSIPACKAGE *package, MSIFILE *file)
Definition: files.c:536
static BOOL installfiles_cb(MSIPACKAGE *package, LPCWSTR filename, DWORD action, LPWSTR *path, DWORD *attrs, PVOID user)
Definition: files.c:505
static void schedule_install_files(MSIPACKAGE *package)
Definition: files.c:387
static UINT copy_install_file(MSIPACKAGE *package, MSIFILE *file, LPWSTR source)
Definition: files.c:416
static void file_update_ui(MSIPACKAGE *package, MSIFILE *f, const WCHAR *action)
Definition: files.c:251
static UINT create_folder(MSIPACKAGE *package, const WCHAR *dir)
Definition: files.c:475
UINT ready_media(MSIPACKAGE *package, BOOL compressed, MSIMEDIAINFO *mi)
Definition: media.c:838
void msi_free_media_info(MSIMEDIAINFO *mi)
Definition: media.c:649
BOOL msi_cabextract(MSIPACKAGE *package, MSIMEDIAINFO *mi, LPVOID data)
Definition: media.c:640
UINT msi_load_media_info(MSIPACKAGE *package, UINT Sequence, MSIMEDIAINFO *mi)
Definition: media.c:677
unsigned int BOOL
Definition: ntddk_ex.h:94
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
@ msidbFileAttributesPatchAdded
Definition: msidefs.h:37
#define calloc
Definition: rosglue.h:14
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
Definition: fci.c:127
struct list files
Definition: msipriv.h:403
static MONITORINFO mi
Definition: win.c:7338
#define ERROR_INSTALL_FAILURE
Definition: winerror.h:961
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985

◆ ACTION_MoveFiles()

UINT ACTION_MoveFiles ( MSIPACKAGE package)

Definition at line 1185 of file files.c.

1186{
1187 MSIQUERY *view;
1188 UINT rc;
1189
1190 if (package->script == SCRIPT_NONE)
1191 return msi_schedule_action(package, SCRIPT_INSTALL, L"MoveFiles");
1192
1193 rc = MSI_DatabaseOpenViewW(package->db, L"SELECT * FROM `MoveFile`", &view);
1194 if (rc != ERROR_SUCCESS)
1195 return ERROR_SUCCESS;
1196
1198 msiobj_release(&view->hdr);
1199 return rc;
1200}
static UINT ITERATE_MoveFiles(MSIRECORD *rec, LPVOID param)
Definition: files.c:1059

◆ ACTION_MsiPublishAssemblies()

UINT ACTION_MsiPublishAssemblies ( MSIPACKAGE package)

Definition at line 542 of file assembly.c.

543{
544 MSICOMPONENT *comp;
545
546 if (package->script == SCRIPT_NONE)
547 return msi_schedule_action(package, SCRIPT_INSTALL, L"MsiPublishAssemblies");
548
550 {
551 LONG res;
552 HKEY hkey;
553 GUID guid;
554 DWORD size;
555 WCHAR buffer[43];
556 MSIRECORD *uirow;
558 BOOL win32;
559
560 if (!assembly || !comp->ComponentId) continue;
561
562 comp->Action = msi_get_component_action( package, comp );
563 if (comp->Action != INSTALLSTATE_LOCAL)
564 {
565 TRACE("component not scheduled for installation %s\n", debugstr_w(comp->Component));
566 continue;
567 }
568 TRACE("publishing %s\n", debugstr_w(comp->Component));
569
570 CLSIDFromString( package->ProductCode, &guid );
572 buffer[20] = '>';
575 buffer[42] = 0;
576
577 win32 = assembly->attributes & msidbAssemblyAttributesWin32;
578 if (assembly->application)
579 {
580 MSIFILE *file = msi_get_loaded_file( package, assembly->application );
581 if (!file)
582 {
583 WARN("no matching file %s for local assembly\n", debugstr_w(assembly->application));
584 continue;
585 }
586 if ((res = open_local_assembly_key( package->Context, win32, file->TargetPath, &hkey )))
587 {
588 WARN( "failed to open local assembly key %ld\n", res );
590 }
591 }
592 else
593 {
594 if ((res = open_global_assembly_key( package->Context, win32, &hkey )))
595 {
596 WARN( "failed to open global assembly key %ld\n", res );
598 }
599 }
600 size = sizeof(buffer);
601 if ((res = RegSetValueExW( hkey, assembly->display_name, 0, REG_MULTI_SZ, (const BYTE *)buffer, size )))
602 {
603 WARN( "failed to set assembly value %ld\n", res );
604 }
605 RegCloseKey( hkey );
606
607 uirow = MSI_CreateRecord( 2 );
608 MSI_RecordSetStringW( uirow, 2, assembly->display_name );
610 msiobj_release( &uirow->hdr );
611 }
612 return ERROR_SUCCESS;
613}
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
Definition: reg.c:4882
INSTALLSTATE msi_get_component_action(MSIPACKAGE *package, MSICOMPONENT *comp)
Definition: action.c:609
MSIFILE * msi_get_loaded_file(MSIPACKAGE *package, const WCHAR *key)
Definition: action.c:572
HRESULT WINAPI CLSIDFromString(LPCOLESTR idstr, LPCLSID id)
Definition: compobj.c:2338
unsigned long DWORD
Definition: ntddk_ex.h:95
GLsizeiptr size
Definition: glext.h:5919
GLuint res
Definition: glext.h:9613
const GUID * guid
static LONG open_local_assembly_key(UINT context, BOOL win32, const WCHAR *filename, HKEY *hkey)
Definition: assembly.c:482
static LONG open_global_assembly_key(UINT context, BOOL win32, HKEY *hkey)
Definition: assembly.c:522
@ INSTALLMESSAGE_ACTIONDATA
Definition: msi.h:103
@ INSTALLSTATE_LOCAL
Definition: msi.h:46
@ msidbAssemblyAttributesWin32
Definition: msidefs.h:216
BOOL encode_base85_guid(GUID *, LPWSTR)
Definition: registry.c:165
INT MSI_ProcessMessage(MSIPACKAGE *, INSTALLMESSAGE, MSIRECORD *)
Definition: package.c:1909
UINT MSI_RecordSetStringW(MSIRECORD *, UINT, LPCWSTR)
Definition: record.c:597
MSIRECORD * MSI_CreateRecord(UINT)
Definition: record.c:76
#define REG_MULTI_SZ
Definition: nt_native.h:1501
long LONG
Definition: pedump.c:60
LPWSTR Component
Definition: msipriv.h:524
INSTALLSTATE Action
Definition: msipriv.h:532
LPWSTR ComponentId
Definition: msipriv.h:525
MSIASSEMBLY * assembly
Definition: msipriv.h:540
struct list components
Definition: msipriv.h:401
MSIINSTALLCONTEXT Context
Definition: msipriv.h:459
MSIOBJECTHDR hdr
Definition: msipriv.h:151
unsigned char BYTE
Definition: xxhash.c:193

◆ ACTION_MsiUnpublishAssemblies()

UINT ACTION_MsiUnpublishAssemblies ( MSIPACKAGE package)

Definition at line 615 of file assembly.c.

616{
617 MSICOMPONENT *comp;
618
619 if (package->script == SCRIPT_NONE)
620 return msi_schedule_action(package, SCRIPT_INSTALL, L"MsiUnpublishAssemblies");
621
623 {
624 LONG res;
625 MSIRECORD *uirow;
627 BOOL win32;
628
629 if (!assembly || !comp->ComponentId) continue;
630
631 comp->Action = msi_get_component_action( package, comp );
632 if (comp->Action != INSTALLSTATE_ABSENT)
633 {
634 TRACE("component not scheduled for removal %s\n", debugstr_w(comp->Component));
635 continue;
636 }
637 TRACE("unpublishing %s\n", debugstr_w(comp->Component));
638
639 win32 = assembly->attributes & msidbAssemblyAttributesWin32;
640 if (assembly->application)
641 {
642 MSIFILE *file = msi_get_loaded_file( package, assembly->application );
643 if (!file)
644 {
645 WARN("no matching file %s for local assembly\n", debugstr_w(assembly->application));
646 continue;
647 }
648 if ((res = delete_local_assembly_key( package->Context, win32, file->TargetPath )))
649 WARN( "failed to delete local assembly key %ld\n", res );
650 }
651 else
652 {
653 HKEY hkey;
654 if ((res = open_global_assembly_key( package->Context, win32, &hkey )))
655 WARN( "failed to delete global assembly key %ld\n", res );
656 else
657 {
658 if ((res = RegDeleteValueW( hkey, assembly->display_name )))
659 WARN( "failed to delete global assembly value %ld\n", res );
660 RegCloseKey( hkey );
661 }
662 }
663
664 uirow = MSI_CreateRecord( 2 );
665 MSI_RecordSetStringW( uirow, 2, assembly->display_name );
667 msiobj_release( &uirow->hdr );
668 }
669 return ERROR_SUCCESS;
670}
LONG WINAPI RegDeleteValueW(HKEY hKey, LPCWSTR lpValueName)
Definition: reg.c:2330
static LONG delete_local_assembly_key(UINT context, BOOL win32, const WCHAR *filename)
Definition: assembly.c:502
@ INSTALLSTATE_ABSENT
Definition: msi.h:45

◆ ACTION_PatchFiles()

UINT ACTION_PatchFiles ( MSIPACKAGE package)

Definition at line 776 of file files.c.

777{
778 MSIFILEPATCH *patch;
780 UINT rc = ERROR_SUCCESS;
781
782 TRACE("%p\n", package);
783
784 if (package->script == SCRIPT_NONE)
785 return msi_schedule_action(package, SCRIPT_INSTALL, L"PatchFiles");
786
787 mi = calloc( 1, sizeof(MSIMEDIAINFO) );
788
789 TRACE("extracting files\n");
790
792 {
793 MSIFILE *file = patch->File;
794 MSICOMPONENT *comp = file->Component;
795
796 rc = msi_load_media_info( package, patch->Sequence, mi );
797 if (rc != ERROR_SUCCESS)
798 {
799 ERR("Unable to load media info for %s (%u)\n", debugstr_w(file->File), rc);
801 goto done;
802 }
803 comp->Action = msi_get_component_action( package, comp );
804 if (!comp->Enabled || comp->Action != INSTALLSTATE_LOCAL) continue;
805
806 if (!patch->extracted)
807 {
809 MSIFILEPATCH *cursor = patch;
810
811 rc = ready_media( package, TRUE, mi );
812 if (rc != ERROR_SUCCESS)
813 {
814 ERR("Failed to ready media for %s\n", debugstr_w(file->File));
815 goto done;
816 }
817 data.mi = mi;
818 data.package = package;
819 data.cb = patchfiles_cb;
820 data.user = &cursor;
821
822 if (!msi_cabextract( package, mi, &data ))
823 {
824 ERR("Failed to extract cabinet: %s\n", debugstr_w(mi->cabinet));
826 goto done;
827 }
828 }
829 }
830
831 TRACE("applying patches\n");
832
834 {
835 MSICOMPONENT *comp = patch->File->Component;
836
837 if (msi_is_global_assembly( comp ) || !patch->path) continue;
838
839 rc = patch_file( package, patch );
840 if (rc && !(patch->Attributes & msidbPatchAttributesNonVital))
841 {
842 ERR("Failed to apply patch to file: %s\n", debugstr_w(patch->File->File));
843 break;
844 }
845 }
846
847done:
849 return rc;
850}
static UINT patch_file(MSIPACKAGE *package, MSIFILEPATCH *patch)
Definition: files.c:704
static BOOL patchfiles_cb(MSIPACKAGE *package, LPCWSTR file, DWORD action, LPWSTR *path, DWORD *attrs, PVOID user)
Definition: files.c:670
@ msidbPatchAttributesNonVital
Definition: msidefs.h:43
MSIFILE * File
Definition: msipriv.h:626
BOOL extracted
Definition: msipriv.h:630
WCHAR * path
Definition: msipriv.h:632
LPWSTR File
Definition: msipriv.h:606
MSICOMPONENT * Component
Definition: msipriv.h:607
struct list filepatches
Definition: msipriv.h:404

◆ ACTION_PerformAction()

UINT ACTION_PerformAction ( MSIPACKAGE package,
const WCHAR action 
)

Definition at line 7640 of file action.c.

7641{
7642 UINT rc;
7643
7644 TRACE("Performing action (%s)\n", debugstr_w(action));
7645
7646 package->action_progress_increment = 0;
7647 rc = ACTION_HandleStandardAction(package, action);
7648
7649 if (rc == ERROR_FUNCTION_NOT_CALLED)
7650 rc = ACTION_HandleCustomAction(package, action);
7651
7652 if (rc == ERROR_FUNCTION_NOT_CALLED)
7653 WARN("unhandled msi action %s\n", debugstr_w(action));
7654
7655 return rc;
7656}
static UINT ACTION_HandleStandardAction(MSIPACKAGE *package, LPCWSTR action)
Definition: action.c:7597
static UINT ACTION_HandleCustomAction(MSIPACKAGE *package, LPCWSTR action)
Definition: action.c:512
UINT action_progress_increment
Definition: msipriv.h:413

Referenced by ACTION_ExecuteAction(), ACTION_PerformActionSequence(), event_do_action(), execute_script(), ITERATE_Actions(), MSI_InstallPackage(), MsiCollectUserInfoA(), MsiCollectUserInfoW(), MsiConfigureFeatureW(), and MsiDoActionW().

◆ ACTION_RegisterClassInfo()

UINT ACTION_RegisterClassInfo ( MSIPACKAGE package)

Definition at line 690 of file classes.c.

691{
693 MSIRECORD *uirow;
694 HKEY hkey, hkey2, hkey3;
695 MSICLASS *cls;
696 UINT r;
697
698 if (package->script == SCRIPT_NONE)
699 return msi_schedule_action( package, SCRIPT_INSTALL, L"RegisterClassInfo" );
700
701 r = load_classes_and_such( package );
702 if (r != ERROR_SUCCESS)
703 return r;
704
705 if (package->platform == PLATFORM_INTEL)
707 else
709
710 if (RegCreateKeyExW( HKEY_CLASSES_ROOT, L"CLSID", 0, NULL, 0, access, NULL, &hkey, NULL ))
712
713 LIST_FOR_EACH_ENTRY( cls, &package->classes, MSICLASS, entry )
714 {
715 MSICOMPONENT *comp;
716 MSIFILE *file;
717 DWORD size;
718 LPWSTR argument;
720
721 comp = cls->Component;
722 if ( !comp )
723 continue;
724
725 if (!comp->Enabled)
726 {
727 TRACE("component is disabled\n");
728 continue;
729 }
730
731 feature = cls->Feature;
732 if (!feature)
733 continue;
734
735 feature->Action = msi_get_feature_action( package, feature );
736 if (feature->Action != INSTALLSTATE_LOCAL &&
738 {
739 TRACE("feature %s not scheduled for installation, skipping registration of class %s\n",
740 debugstr_w(feature->Feature), debugstr_w(cls->clsid));
741 continue;
742 }
743
744 if (!comp->KeyPath || !(file = msi_get_loaded_file( package, comp->KeyPath )))
745 {
746 TRACE("COM server not provided, skipping class %s\n", debugstr_w(cls->clsid));
747 continue;
748 }
749 TRACE("Registering class %s (%p)\n", debugstr_w(cls->clsid), cls);
750
752
753 RegCreateKeyW( hkey, cls->clsid, &hkey2 );
754
755 if (cls->Description)
756 msi_reg_set_val_str( hkey2, NULL, cls->Description );
757
758 RegCreateKeyW( hkey2, cls->Context, &hkey3 );
759
760 /*
761 * FIXME: Implement install on demand (advertised components).
762 *
763 * ole32.dll should call msi.MsiProvideComponentFromDescriptor()
764 * when it needs an InProcServer that doesn't exist.
765 * The component advertise string should be in the "InProcServer" value.
766 */
767 size = lstrlenW( file->TargetPath )+1;
768 if (cls->Argument)
769 size += lstrlenW(cls->Argument)+1;
770
771 argument = malloc( size * sizeof(WCHAR) );
772 lstrcpyW( argument, file->TargetPath );
773
774 if (cls->Argument)
775 {
776 lstrcatW( argument, L" " );
777 lstrcatW( argument, cls->Argument );
778 }
779
780 msi_reg_set_val_str( hkey3, NULL, argument );
781 free(argument);
782
783 RegCloseKey(hkey3);
784
785 if (cls->ProgID || cls->ProgIDText)
786 {
788
789 if (cls->ProgID)
790 progid = cls->ProgID->ProgID;
791 else
792 progid = cls->ProgIDText;
793
794 msi_reg_set_subkey_val( hkey2, L"ProgID", NULL, progid );
795
796 if (cls->ProgID && cls->ProgID->VersionInd)
797 {
798 msi_reg_set_subkey_val( hkey2, L"VersionIndependentProgID", NULL,
799 cls->ProgID->VersionInd->ProgID );
800 }
801 }
802
803 if (cls->AppID)
804 {
805 MSIAPPID *appid = cls->AppID;
806 msi_reg_set_val_str( hkey2, L"AppID", appid->AppID );
808 }
809
810 if (cls->IconPath)
811 msi_reg_set_subkey_val( hkey2, L"DefaultIcon", NULL, cls->IconPath );
812
813 if (cls->DefInprocHandler)
814 msi_reg_set_subkey_val( hkey2, L"InprocHandler", NULL, cls->DefInprocHandler );
815
816 if (cls->DefInprocHandler32)
817 msi_reg_set_subkey_val( hkey2, L"InprocHandler32", NULL, cls->DefInprocHandler32 );
818 RegCloseKey(hkey2);
819
820 /* if there is a FileTypeMask, register the FileType */
821 if (cls->FileTypeMask)
822 {
823 LPWSTR ptr, ptr2;
824 LPWSTR keyname;
825 INT index = 0;
826 ptr = cls->FileTypeMask;
827 while (ptr && *ptr)
828 {
829 ptr2 = wcschr(ptr,';');
830 if (ptr2)
831 *ptr2 = 0;
832 keyname = malloc( sizeof(L"FileType\\%s\\%d") + (wcslen(cls->clsid) + 3) * sizeof(WCHAR) );
833 swprintf( keyname, lstrlenW(L"FileType\\%s\\%d") + lstrlenW(cls->clsid) + 4,
834 L"FileType\\%s\\%d", cls->clsid, index );
835
837 free( keyname );
838
839 if (ptr2)
840 ptr = ptr2+1;
841 else
842 ptr = NULL;
843
844 index ++;
845 }
846 }
847
848 uirow = MSI_CreateRecord(1);
849 MSI_RecordSetStringW( uirow, 1, cls->clsid );
851 msiobj_release(&uirow->hdr);
852 }
853 RegCloseKey(hkey);
854 return ERROR_SUCCESS;
855}
LONG WINAPI RegCreateKeyExW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey, _In_ DWORD Reserved, _In_opt_ LPWSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_opt_ LPDWORD lpdwDisposition)
Definition: reg.c:1096
#define wcschr
Definition: compat.h:17
#define lstrcpyW
Definition: compat.h:749
#define lstrlenW
Definition: compat.h:750
INSTALLSTATE msi_get_feature_action(MSIPACKAGE *package, MSIFEATURE *feature)
Definition: action.c:625
#define progid(str)
Definition: exdisp.idl:31
GLuint index
Definition: glext.h:6031
GLuint GLint GLboolean GLint GLenum access
Definition: glext.h:7866
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:274
char * appid
Definition: mkisofs.c:161
INTERNETFEATURELIST feature
Definition: misc.c:1719
static UINT load_classes_and_such(MSIPACKAGE *package)
Definition: classes.c:631
static UINT register_appid(const MSIAPPID *appid, LPCWSTR app)
Definition: classes.c:659
@ INSTALLSTATE_ADVERTISED
Definition: msi.h:44
LONG msi_reg_set_subkey_val(HKEY hkey, LPCWSTR path, LPCWSTR name, LPCWSTR val)
Definition: registry.c:230
#define KEY_ALL_ACCESS
Definition: nt_native.h:1041
LPWSTR clsid
Definition: msipriv.h:652
LPWSTR IconPath
Definition: msipriv.h:660
LPWSTR Argument
Definition: msipriv.h:663
LPWSTR ProgIDText
Definition: msipriv.h:656
INSTALLSTATE action
Definition: msipriv.h:667
LPWSTR DefInprocHandler
Definition: msipriv.h:661
MSIAPPID * AppID
Definition: msipriv.h:658
LPWSTR FileTypeMask
Definition: msipriv.h:659
LPWSTR Description
Definition: msipriv.h:657
LPWSTR DefInprocHandler32
Definition: msipriv.h:662
LPWSTR Context
Definition: msipriv.h:653
MSICOMPONENT * Component
Definition: msipriv.h:654
MSIFEATURE * Feature
Definition: msipriv.h:664
MSIPROGID * ProgID
Definition: msipriv.h:655
LPWSTR KeyPath
Definition: msipriv.h:529
struct list classes
Definition: msipriv.h:426
enum platform platform
Definition: msipriv.h:396
LPWSTR ProgID
Definition: msipriv.h:689
MSIPROGID * VersionInd
Definition: msipriv.h:696
int32_t INT
Definition: typedefs.h:58
ACCESS_MASK REGSAM
Definition: winreg.h:69
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10
#define KEY_WOW64_32KEY
Definition: cmtypes.h:45
#define KEY_WOW64_64KEY
Definition: cmtypes.h:46
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185

◆ ACTION_RegisterExtensionInfo()

UINT ACTION_RegisterExtensionInfo ( MSIPACKAGE package)

Definition at line 1196 of file classes.c.

1197{
1198 HKEY hkey = NULL;
1200 MSIRECORD *uirow;
1201 BOOL install_on_demand = TRUE;
1202 LONG res;
1203 UINT r;
1204
1205 if (package->script == SCRIPT_NONE)
1206 return msi_schedule_action( package, SCRIPT_INSTALL, L"RegisterExtensionInfo" );
1207
1208 r = load_classes_and_such( package );
1209 if (r != ERROR_SUCCESS)
1210 return r;
1211
1212 /* We need to set install_on_demand based on if the shell handles advertised
1213 * shortcuts and the like. Because Mike McCormack is working on this i am
1214 * going to default to TRUE
1215 */
1216
1218 {
1219 LPWSTR extension;
1221
1222 if (!ext->Component)
1223 continue;
1224
1225 if (!ext->Component->Enabled)
1226 {
1227 TRACE("component is disabled\n");
1228 continue;
1229 }
1230
1231 feature = ext->Feature;
1232 if (!feature)
1233 continue;
1234
1235 /*
1236 * yes. MSDN says that these are based on _Feature_ not on
1237 * Component. So verify the feature is to be installed
1238 */
1239 feature->Action = msi_get_feature_action( package, feature );
1240 if (feature->Action != INSTALLSTATE_LOCAL &&
1241 !(install_on_demand && feature->Action == INSTALLSTATE_ADVERTISED))
1242 {
1243 TRACE("feature %s not scheduled for installation, skipping registration of extension %s\n",
1244 debugstr_w(feature->Feature), debugstr_w(ext->Extension));
1245 continue;
1246 }
1247 TRACE("Registering extension %s (%p)\n", debugstr_w(ext->Extension), ext);
1248
1249 ext->action = INSTALLSTATE_LOCAL;
1250
1251 extension = malloc( (wcslen( ext->Extension ) + 2) * sizeof(WCHAR) );
1252 if (extension)
1253 {
1254 extension[0] = '.';
1255 lstrcpyW( extension + 1, ext->Extension );
1256 res = RegCreateKeyW( HKEY_CLASSES_ROOT, extension, &hkey );
1257 free( extension );
1258 if (res != ERROR_SUCCESS)
1259 WARN("failed to create extension key %ld\n", res);
1260 }
1261
1262 if (ext->Mime)
1263 msi_reg_set_val_str( hkey, L"Content Type", ext->Mime->ContentType );
1264
1265 if (ext->ProgID || ext->ProgIDText)
1266 {
1267 HKEY hkey2;
1268 LPWSTR newkey;
1270 MSIVERB *verb;
1271 INT Sequence = MSI_NULL_INTEGER;
1272
1273 if (ext->ProgID)
1274 progid = ext->ProgID->ProgID;
1275 else
1276 progid = ext->ProgIDText;
1277
1279
1280 newkey = malloc( wcslen(progid) * sizeof(WCHAR) + sizeof(L"\\ShellNew") );
1281
1282 lstrcpyW(newkey, progid);
1283 lstrcatW(newkey, L"\\ShellNew");
1284 RegCreateKeyW(hkey, newkey, &hkey2);
1285 RegCloseKey(hkey2);
1286
1287 free(newkey);
1288
1289 /* do all the verbs */
1290 LIST_FOR_EACH_ENTRY( verb, &ext->verbs, MSIVERB, entry )
1291 {
1292 register_verb( package, progid, ext->Component,
1293 ext, verb, &Sequence);
1294 }
1295 }
1296
1297 RegCloseKey(hkey);
1298
1299 uirow = MSI_CreateRecord(1);
1300 MSI_RecordSetStringW( uirow, 1, ext->Extension );
1302 msiobj_release(&uirow->hdr);
1303 }
1304 return ERROR_SUCCESS;
1305}
static const WCHAR *const ext[]
Definition: module.c:53
static UINT register_verb(MSIPACKAGE *package, LPCWSTR progid, MSICOMPONENT *component, const MSIEXTENSION *extension, MSIVERB *verb, INT *Sequence)
Definition: classes.c:1124
#define MSI_NULL_INTEGER
Definition: msiquery.h:32
struct list extensions
Definition: msipriv.h:427

◆ ACTION_RegisterFonts()

UINT ACTION_RegisterFonts ( MSIPACKAGE package)

Definition at line 279 of file font.c.

280{
281 MSIQUERY *view;
282 UINT rc;
283
284 if (package->script == SCRIPT_NONE)
285 return msi_schedule_action(package, SCRIPT_INSTALL, L"RegisterFonts");
286
287 rc = MSI_DatabaseOpenViewW(package->db, L"SELECT * FROM `Font`", &view);
288 if (rc != ERROR_SUCCESS)
289 return ERROR_SUCCESS;
290
292 msiobj_release(&view->hdr);
293 return rc;
294}
static UINT ITERATE_RegisterFonts(MSIRECORD *row, LPVOID param)
Definition: font.c:215

◆ ACTION_RegisterMIMEInfo()

UINT ACTION_RegisterMIMEInfo ( MSIPACKAGE package)

Definition at line 1392 of file classes.c.

1393{
1394 MSIRECORD *uirow;
1395 MSIMIME *mt;
1396 UINT r;
1397
1398 if (package->script == SCRIPT_NONE)
1399 return msi_schedule_action( package, SCRIPT_INSTALL, L"RegisterMIMEInfo" );
1400
1401 r = load_classes_and_such( package );
1402 if (r != ERROR_SUCCESS)
1403 return r;
1404
1405 LIST_FOR_EACH_ENTRY( mt, &package->mimes, MSIMIME, entry )
1406 {
1407 LPWSTR extension = NULL, key;
1408
1409 /*
1410 * check if the MIME is to be installed. Either as requested by an
1411 * extension or Class
1412 */
1413 if ((!mt->Class || mt->Class->action != INSTALLSTATE_LOCAL) &&
1414 (!mt->Extension || mt->Extension->action != INSTALLSTATE_LOCAL))
1415 {
1416 TRACE("MIME %s not scheduled to be installed\n", debugstr_w(mt->ContentType));
1417 continue;
1418 }
1419
1420 TRACE("Registering MIME type %s\n", debugstr_w(mt->ContentType));
1421
1422 if (mt->Extension) extension = malloc( (wcslen( mt->Extension->Extension ) + 2) * sizeof(WCHAR) );
1423 key = malloc( sizeof( L"MIME\\Database\\Content Type\\" ) +
1424 wcslen( mt->ContentType ) * sizeof(WCHAR) );
1425
1426 if (extension && key)
1427 {
1428 extension[0] = '.';
1429 lstrcpyW( extension + 1, mt->Extension->Extension );
1430
1431 lstrcpyW( key, L"MIME\\Database\\Content Type\\" );
1432 lstrcatW( key, mt->ContentType );
1433 msi_reg_set_subkey_val( HKEY_CLASSES_ROOT, key, L"Extension", extension );
1434
1435 if (mt->clsid)
1437 }
1438 free( extension );
1439 free( key );
1440
1441 uirow = MSI_CreateRecord( 2 );
1442 MSI_RecordSetStringW( uirow, 1, mt->ContentType );
1443 MSI_RecordSetStringW( uirow, 2, mt->suffix );
1445 msiobj_release( &uirow->hdr );
1446 }
1447 return ERROR_SUCCESS;
1448}
Definition: copy.c:22
INSTALLSTATE action
Definition: msipriv.h:682
LPWSTR Extension
Definition: msipriv.h:675
MSIEXTENSION * Extension
Definition: msipriv.h:712
LPWSTR ContentType
Definition: msipriv.h:711
LPWSTR clsid
Definition: msipriv.h:714
MSICLASS * Class
Definition: msipriv.h:715
LPWSTR suffix
Definition: msipriv.h:713
struct list mimes
Definition: msipriv.h:429

◆ ACTION_RegisterProgIdInfo()

UINT ACTION_RegisterProgIdInfo ( MSIPACKAGE package)

Definition at line 1026 of file classes.c.

1027{
1029 MSIRECORD *uirow;
1030 UINT r;
1031
1032 if (package->script == SCRIPT_NONE)
1033 return msi_schedule_action( package, SCRIPT_INSTALL, L"RegisterProgIdInfo" );
1034
1035 r = load_classes_and_such( package );
1036 if (r != ERROR_SUCCESS)
1037 return r;
1038
1040 {
1042 {
1043 TRACE("progid %s not scheduled to be installed\n", debugstr_w(progid->ProgID));
1044 continue;
1045 }
1046 TRACE("Registering progid %s\n", debugstr_w(progid->ProgID));
1047
1049
1050 uirow = MSI_CreateRecord( 1 );
1051 MSI_RecordSetStringW( uirow, 1, progid->ProgID );
1053 msiobj_release( &uirow->hdr );
1054 }
1055 return ERROR_SUCCESS;
1056}
static BOOL has_class_installed(const MSIPROGID *progid)
Definition: classes.c:1008
static BOOL has_one_extension_installed(const MSIPACKAGE *package, const MSIPROGID *progid)
Definition: classes.c:1015
static UINT register_progid(const MSIPROGID *progid)
Definition: classes.c:964
struct list progids
Definition: msipriv.h:428

◆ ACTION_RemoveDuplicateFiles()

UINT ACTION_RemoveDuplicateFiles ( MSIPACKAGE package)

Definition at line 1390 of file files.c.

1391{
1392 MSIQUERY *view;
1393 UINT rc;
1394
1395 if (package->script == SCRIPT_NONE)
1396 return msi_schedule_action(package, SCRIPT_INSTALL, L"RemoveDuplicateFiles");
1397
1398 rc = MSI_DatabaseOpenViewW( package->db, L"SELECT * FROM `DuplicateFile`", &view );
1399 if (rc != ERROR_SUCCESS)
1400 return ERROR_SUCCESS;
1401
1403 msiobj_release( &view->hdr );
1404 return rc;
1405}
static UINT ITERATE_RemoveDuplicateFiles(MSIRECORD *row, LPVOID param)
Definition: files.c:1332

◆ ACTION_RemoveFiles()

UINT ACTION_RemoveFiles ( MSIPACKAGE package)

Definition at line 1528 of file files.c.

1529{
1530 MSIQUERY *view;
1531 MSICOMPONENT *comp;
1532 MSIFILE *file;
1533 UINT r;
1534
1535 if (package->script == SCRIPT_NONE)
1536 return msi_schedule_action(package, SCRIPT_INSTALL, L"RemoveFiles");
1537
1538 r = MSI_DatabaseOpenViewW(package->db, L"SELECT * FROM `RemoveFile`", &view);
1539 if (r == ERROR_SUCCESS)
1540 {
1542 msiobj_release(&view->hdr);
1543 if (r != ERROR_SUCCESS)
1544 return r;
1545 }
1546
1548 {
1549 MSIRECORD *uirow;
1550 VS_FIXEDFILEINFO *ver;
1551
1552 comp = file->Component;
1553 file_update_ui( package, file, L"RemoveFiles" );
1554
1555 comp->Action = msi_get_component_action( package, comp );
1557 continue;
1558
1559 if (comp->assembly && !comp->assembly->application)
1560 continue;
1561
1563 {
1564 TRACE("permanent component, not removing file\n");
1565 continue;
1566 }
1567
1568 if (file->Version)
1569 {
1570 ver = msi_get_disk_file_version( package, file->TargetPath );
1571 if (ver && msi_compare_file_versions( ver, file->Version ) > 0)
1572 {
1573 TRACE("newer version detected, not removing file\n");
1574 free( ver );
1575 continue;
1576 }
1577 free( ver );
1578 }
1579
1580 if (file->state == msifs_installed)
1581 WARN("removing installed file %s\n", debugstr_w(file->TargetPath));
1582
1583 TRACE("removing %s\n", debugstr_w(file->File) );
1584
1585 msi_set_file_attributes( package, file->TargetPath, FILE_ATTRIBUTE_NORMAL );
1586 if (!msi_delete_file( package, file->TargetPath ))
1587 {
1588 WARN( "failed to delete %s (%lu)\n", debugstr_w(file->TargetPath), GetLastError() );
1589 }
1590 file->state = msifs_missing;
1591
1592 uirow = MSI_CreateRecord( 9 );
1593 MSI_RecordSetStringW( uirow, 1, file->FileName );
1594 MSI_RecordSetStringW( uirow, 9, comp->Directory );
1596 msiobj_release( &uirow->hdr );
1597 }
1598
1600 {
1601 comp->Action = msi_get_component_action( package, comp );
1602 if (comp->Action != INSTALLSTATE_ABSENT) continue;
1603
1605 {
1606 TRACE("permanent component, not removing directory\n");
1607 continue;
1608 }
1609 if (comp->assembly && !comp->assembly->application)
1610 msi_uninstall_assembly( package, comp );
1611 else
1612 {
1613 MSIFOLDER *folder = msi_get_loaded_folder( package, comp->Directory );
1614 if (folder) remove_folder( folder );
1615 }
1616 }
1617 return ERROR_SUCCESS;
1618}
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:137
int msi_compare_file_versions(VS_FIXEDFILEINFO *fi, const WCHAR *version)
Definition: action.c:1929
MSIFOLDER * msi_get_loaded_folder(MSIPACKAGE *package, const WCHAR *dir)
Definition: action.c:583
BOOL msi_set_file_attributes(MSIPACKAGE *package, const WCHAR *filename, DWORD attrs)
Definition: files.c:106
BOOL msi_delete_file(MSIPACKAGE *package, const WCHAR *filename)
Definition: files.c:79
VS_FIXEDFILEINFO * msi_get_disk_file_version(MSIPACKAGE *package, const WCHAR *filename)
Definition: files.c:170
static UINT ITERATE_RemoveFiles(MSIRECORD *row, LPVOID param)
Definition: files.c:1431
static void remove_folder(MSIFOLDER *folder)
Definition: files.c:1514
UINT msi_uninstall_assembly(MSIPACKAGE *package, MSICOMPONENT *comp)
Definition: assembly.c:402
@ INSTALLSTATE_SOURCE
Definition: msi.h:47
@ msidbComponentAttributesPermanent
Definition: msidefs.h:164
Definition: fci.c:116
LPWSTR application
Definition: msipriv.h:514
INSTALLSTATE Installed
Definition: msipriv.h:530
LPWSTR Directory
Definition: msipriv.h:526
DWORD WINAPI GetLastError(void)
Definition: except.c:1042

◆ ACTION_ShowDialog()

INT ACTION_ShowDialog ( MSIPACKAGE ,
LPCWSTR   
)

◆ ACTION_UnregisterClassInfo()

UINT ACTION_UnregisterClassInfo ( MSIPACKAGE package)

Definition at line 857 of file classes.c.

858{
860 MSIRECORD *uirow;
861 MSICLASS *cls;
862 HKEY hkey, hkey2;
863 UINT r;
864
865 if (package->script == SCRIPT_NONE)
866 return msi_schedule_action( package, SCRIPT_INSTALL, L"UnregisterClassInfo" );
867
868 r = load_classes_and_such( package );
869 if (r != ERROR_SUCCESS)
870 return r;
871
872 if (package->platform == PLATFORM_INTEL)
874 else
876
877 if (RegCreateKeyExW( HKEY_CLASSES_ROOT, L"CLSID", 0, NULL, 0, access, NULL, &hkey, NULL ))
879
880 LIST_FOR_EACH_ENTRY( cls, &package->classes, MSICLASS, entry )
881 {
883 MSICOMPONENT *comp;
885 LONG res;
886
887 comp = cls->Component;
888 if (!comp)
889 continue;
890
891 if (!comp->Enabled)
892 {
893 TRACE("component is disabled\n");
894 continue;
895 }
896
897 feature = cls->Feature;
898 if (!feature)
899 continue;
900
901 feature->Action = msi_get_feature_action( package, feature );
902 if (feature->Action != INSTALLSTATE_ABSENT)
903 {
904 TRACE("feature %s not scheduled for removal, skipping unregistration of class %s\n",
905 debugstr_w(feature->Feature), debugstr_w(cls->clsid));
906 continue;
907 }
908 TRACE("Unregistering class %s (%p)\n", debugstr_w(cls->clsid), cls);
909
911
912 res = RegDeleteTreeW( hkey, cls->clsid );
913 if (res != ERROR_SUCCESS)
914 WARN("failed to delete class key %ld\n", res);
915
916 if (cls->AppID)
917 {
918 res = RegOpenKeyW( HKEY_CLASSES_ROOT, L"AppID", &hkey2 );
919 if (res == ERROR_SUCCESS)
920 {
921 res = RegDeleteKeyW( hkey2, cls->AppID->AppID );
922 if (res != ERROR_SUCCESS)
923 WARN("failed to delete appid key %ld\n", res);
924 RegCloseKey( hkey2 );
925 }
926 }
927 if (cls->FileTypeMask)
928 {
929 filetype = malloc( sizeof( L"FileType\\" ) + wcslen( cls->clsid ) * sizeof(WCHAR) );
930 if (filetype)
931 {
932 lstrcpyW( filetype, L"FileType\\" );
933 lstrcatW( filetype, cls->clsid );
935 free( filetype );
936
937 if (res != ERROR_SUCCESS)
938 WARN("failed to delete file type %ld\n", res);
939 }
940 }
941
942 uirow = MSI_CreateRecord( 1 );
943 MSI_RecordSetStringW( uirow, 1, cls->clsid );
945 msiobj_release( &uirow->hdr );
946 }
947 RegCloseKey( hkey );
948 return ERROR_SUCCESS;
949}
LSTATUS WINAPI RegDeleteTreeW(_In_ HKEY, _In_opt_ LPCWSTR)
LONG WINAPI RegOpenKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3268
LONG WINAPI RegDeleteKeyW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey)
Definition: reg.c:1239
LOCAL char * filetype(int t)
Definition: tree.c:114
LPWSTR AppID
Definition: msipriv.h:638

◆ ACTION_UnregisterExtensionInfo()

UINT ACTION_UnregisterExtensionInfo ( MSIPACKAGE package)

Definition at line 1307 of file classes.c.

1308{
1310 MSIRECORD *uirow;
1311 LONG res;
1312 UINT r;
1313
1314 if (package->script == SCRIPT_NONE)
1315 return msi_schedule_action( package, SCRIPT_INSTALL, L"UnregisterExtensionInfo" );
1316
1317 r = load_classes_and_such( package );
1318 if (r != ERROR_SUCCESS)
1319 return r;
1320
1322 {
1323 LPWSTR extension;
1325
1326 if (!ext->Component)
1327 continue;
1328
1329 if (!ext->Component->Enabled)
1330 {
1331 TRACE("component is disabled\n");
1332 continue;
1333 }
1334
1335 feature = ext->Feature;
1336 if (!feature)
1337 continue;
1338
1339 feature->Action = msi_get_feature_action( package, feature );
1340 if (feature->Action != INSTALLSTATE_ABSENT)
1341 {
1342 TRACE("feature %s not scheduled for removal, skipping unregistration of extension %s\n",
1343 debugstr_w(feature->Feature), debugstr_w(ext->Extension));
1344 continue;
1345 }
1346 TRACE("Unregistering extension %s\n", debugstr_w(ext->Extension));
1347
1348 ext->action = INSTALLSTATE_ABSENT;
1349
1350 extension = malloc( (wcslen( ext->Extension ) + 2) * sizeof(WCHAR) );
1351 if (extension)
1352 {
1353 extension[0] = '.';
1354 lstrcpyW( extension + 1, ext->Extension );
1355 res = RegDeleteTreeW( HKEY_CLASSES_ROOT, extension );
1356 free( extension );
1357 if (res != ERROR_SUCCESS)
1358 WARN("failed to delete extension key %ld\n", res);
1359 }
1360
1361 if (ext->ProgID || ext->ProgIDText)
1362 {
1364 LPWSTR progid_shell;
1365
1366 if (ext->ProgID)
1367 progid = ext->ProgID->ProgID;
1368 else
1369 progid = ext->ProgIDText;
1370
1371 progid_shell = malloc( wcslen( progid ) * sizeof(WCHAR) + sizeof( L"\\shell" ) );
1372 if (progid_shell)
1373 {
1374 lstrcpyW( progid_shell, progid );
1375 lstrcatW( progid_shell, L"\\shell" );
1376 res = RegDeleteTreeW( HKEY_CLASSES_ROOT, progid_shell );
1377 free( progid_shell );
1378 if (res != ERROR_SUCCESS)
1379 WARN("failed to delete shell key %ld\n", res);
1381 }
1382 }
1383
1384 uirow = MSI_CreateRecord( 1 );
1385 MSI_RecordSetStringW( uirow, 1, ext->Extension );
1387 msiobj_release( &uirow->hdr );
1388 }
1389 return ERROR_SUCCESS;
1390}

◆ ACTION_UnregisterFonts()

UINT ACTION_UnregisterFonts ( MSIPACKAGE package)

Definition at line 360 of file font.c.

361{
362 MSIQUERY *view;
363 UINT r;
364
365 if (package->script == SCRIPT_NONE)
366 return msi_schedule_action(package, SCRIPT_INSTALL, L"UnregisterFonts");
367
368 r = MSI_DatabaseOpenViewW( package->db, L"SELECT * FROM `Font`", &view );
369 if (r != ERROR_SUCCESS)
370 return ERROR_SUCCESS;
371
373 msiobj_release( &view->hdr );
374 return r;
375}
static UINT ITERATE_UnregisterFonts(MSIRECORD *row, LPVOID param)
Definition: font.c:296

◆ ACTION_UnregisterMIMEInfo()

UINT ACTION_UnregisterMIMEInfo ( MSIPACKAGE package)

Definition at line 1450 of file classes.c.

1451{
1452 MSIRECORD *uirow;
1453 MSIMIME *mime;
1454 UINT r;
1455
1456 if (package->script == SCRIPT_NONE)
1457 return msi_schedule_action( package, SCRIPT_INSTALL, L"UnregisterMIMEInfo" );
1458
1459 r = load_classes_and_such( package );
1460 if (r != ERROR_SUCCESS)
1461 return r;
1462
1464 {
1465 LONG res;
1466 LPWSTR mime_key;
1467
1468 if ((!mime->Class || mime->Class->action != INSTALLSTATE_ABSENT) &&
1469 (!mime->Extension || mime->Extension->action != INSTALLSTATE_ABSENT))
1470 {
1471 TRACE("MIME %s not scheduled to be removed\n", debugstr_w(mime->ContentType));
1472 continue;
1473 }
1474
1475 TRACE("Unregistering MIME type %s\n", debugstr_w(mime->ContentType));
1476
1477 mime_key = malloc( sizeof( L"MIME\\Database\\Content Type\\" ) +
1478 wcslen( mime->ContentType ) * sizeof(WCHAR) );
1479 if (mime_key)
1480 {
1481 lstrcpyW( mime_key, L"MIME\\Database\\Content Type\\" );
1482 lstrcatW( mime_key, mime->ContentType );
1483 res = RegDeleteKeyW( HKEY_CLASSES_ROOT, mime_key );
1484 if (res != ERROR_SUCCESS)
1485 WARN("failed to delete MIME key %ld\n", res);
1486 free( mime_key );
1487 }
1488
1489 uirow = MSI_CreateRecord( 2 );
1490 MSI_RecordSetStringW( uirow, 1, mime->ContentType );
1491 MSI_RecordSetStringW( uirow, 2, mime->suffix );
1493 msiobj_release( &uirow->hdr );
1494 }
1495 return ERROR_SUCCESS;
1496}
const WCHAR * mime
Definition: mimefilter.c:512

◆ ACTION_UnregisterProgIdInfo()

UINT ACTION_UnregisterProgIdInfo ( MSIPACKAGE package)

Definition at line 1088 of file classes.c.

1089{
1091 MSIRECORD *uirow;
1092 LONG res;
1093 UINT r;
1094
1095 if (package->script == SCRIPT_NONE)
1096 return msi_schedule_action( package, SCRIPT_INSTALL, L"UnregisterProgIdInfo" );
1097
1098 r = load_classes_and_such( package );
1099 if (r != ERROR_SUCCESS)
1100 return r;
1101
1103 {
1104 if (!has_class_removed( progid ) ||
1105 (has_extensions( package, progid ) && !has_all_extensions_removed( package, progid )))
1106 {
1107 TRACE("progid %s not scheduled to be removed\n", debugstr_w(progid->ProgID));
1108 continue;
1109 }
1110 TRACE("Unregistering progid %s\n", debugstr_w(progid->ProgID));
1111
1113 if (res != ERROR_SUCCESS)
1114 TRACE("failed to delete progid key %ld\n", res);
1115
1116 uirow = MSI_CreateRecord( 1 );
1117 MSI_RecordSetStringW( uirow, 1, progid->ProgID );
1119 msiobj_release( &uirow->hdr );
1120 }
1121 return ERROR_SUCCESS;
1122}
static BOOL has_extensions(const MSIPACKAGE *package, const MSIPROGID *progid)
Definition: classes.c:1065
static BOOL has_all_extensions_removed(const MSIPACKAGE *package, const MSIPROGID *progid)
Definition: classes.c:1075
static BOOL has_class_removed(const MSIPROGID *progid)
Definition: classes.c:1058

◆ ACTION_UpdateComponentStates()

void ACTION_UpdateComponentStates ( MSIPACKAGE package,
MSIFEATURE feature 
)

Definition at line 833 of file install.c.

834{
835 INSTALLSTATE newstate;
836 ComponentList *cl;
837
838 newstate = feature->ActionRequest;
839 if (newstate == INSTALLSTATE_ABSENT) newstate = INSTALLSTATE_UNKNOWN;
840
842 {
843 MSICOMPONENT *component = cl->component;
844
845 if (!component->Enabled) continue;
846
847 TRACE("Modifying (%d): Component %s (Installed %d, Action %d, Request %d)\n",
848 newstate, debugstr_w(component->Component), component->Installed,
849 component->Action, component->ActionRequest);
850
851 if (newstate == INSTALLSTATE_LOCAL)
852 {
853 component->Action = INSTALLSTATE_LOCAL;
855 }
856 else
857 {
858 ComponentList *clist;
859 MSIFEATURE *f;
860
861 component->hasLocalFeature = FALSE;
862
863 component->Action = newstate;
864 component->ActionRequest = newstate;
865 /* if any other feature wants it local we need to set it local */
867 {
868 if ( f->ActionRequest != INSTALLSTATE_LOCAL &&
869 f->ActionRequest != INSTALLSTATE_SOURCE )
870 {
871 continue;
872 }
873 LIST_FOR_EACH_ENTRY(clist, &f->Components, ComponentList, entry)
874 {
875 if (clist->component == component &&
876 (f->ActionRequest == INSTALLSTATE_LOCAL ||
877 f->ActionRequest == INSTALLSTATE_SOURCE))
878 {
879 TRACE("Saved by %s\n", debugstr_w(f->Feature));
880 component->hasLocalFeature = TRUE;
881
883 {
884 if (f->Attributes & msidbFeatureAttributesFavorSource)
885 {
886 component->Action = INSTALLSTATE_SOURCE;
888 }
889 else
890 {
891 component->Action = INSTALLSTATE_LOCAL;
893 }
894 }
896 {
897 component->Action = INSTALLSTATE_SOURCE;
899 }
900 else
901 {
902 component->Action = INSTALLSTATE_LOCAL;
904 }
905 }
906 }
907 }
908 }
909 TRACE("Result (%d): Component %s (Installed %d, Action %d, Request %d)\n",
910 newstate, debugstr_w(component->Component), component->Installed,
911 component->Action, component->ActionRequest);
912 }
913}
GLfloat f
Definition: glext.h:7540
#define f
Definition: ke_i.h:83
@ INSTALLSTATE_UNKNOWN
Definition: msi.h:42
@ msidbComponentAttributesOptional
Definition: msidefs.h:161
@ msidbComponentAttributesSourceOnly
Definition: msidefs.h:160
@ msidbFeatureAttributesFavorSource
Definition: msidefs.h:149
MSICOMPONENT * component
Definition: msipriv.h:554
unsigned int hasLocalFeature
Definition: msipriv.h:545
INSTALLSTATE ActionRequest
Definition: msipriv.h:531
struct list features
Definition: msipriv.h:402
int INSTALLSTATE
Definition: winemsi.idl:31

Referenced by MSI_SetFeatureStateW(), and seltree_update_feature_installstate().

◆ alloc_msi_remote_handle()

MSIHANDLE alloc_msi_remote_handle ( MSIHANDLE  remote)

Definition at line 135 of file handle.c.

136{
137 struct handle_info *entry;
139
141
143 if (ret)
144 {
145 entry = &handle_table[ ret - 1 ];
146 entry->u.rem = remote;
147 entry->dwThreadId = GetCurrentThreadId();
148 entry->remote = TRUE;
149 }
150
152
153 TRACE( "%lu -> %lu\n", remote, ret );
154
155 return ret;
156}
static MSIHANDLE alloc_handle_table_entry(void)
Definition: handle.c:80
static CRITICAL_SECTION handle_cs
Definition: handle.c:38
BOOL remote
Definition: handle.c:60
int ret
DWORD WINAPI GetCurrentThreadId(void)
Definition: thread.c:459
unsigned long MSIHANDLE
Definition: winemsi.idl:27

Referenced by __wine_msi_call_dll_function(), MsiDatabaseOpenViewW(), MsiGetActiveDatabase(), and MsiGetSummaryInformationW().

◆ alloc_msihandle()

MSIHANDLE alloc_msihandle ( MSIOBJECTHDR obj)

Definition at line 111 of file handle.c.

112{
113 struct handle_info *entry;
115
117
119 if (ret)
120 {
121 entry = &handle_table[ ret - 1 ];
123 entry->u.obj = obj;
124 entry->dwThreadId = GetCurrentThreadId();
125 entry->remote = FALSE;
126 }
127
129
130 TRACE( "%p -> %lu\n", obj, ret );
131
132 return ret;
133}
void msiobj_addref(MSIOBJECTHDR *info)
Definition: handle.c:217
MSIOBJECTHDR * obj
Definition: handle.c:62

Referenced by ACTION_CallScript(), MSI_ProcessMessageVerbatim(), MsiCreateRecord(), MsiDatabaseGetPrimaryKeysW(), MsiDatabaseOpenViewW(), MsiEnableUIPreview(), MsiGetActiveDatabase(), MsiGetSummaryInformationW(), MsiOpenDatabaseW(), MsiOpenPackageExW(), MsiOpenProductW(), MsiViewFetch(), MsiViewGetColumnInfo(), and s_remote_GetActionInfo().

◆ alloc_msiobject()

void * alloc_msiobject ( UINT  type,
UINT  size,
msihandledestructor  destroy 
)

Definition at line 201 of file handle.c.

202{
204
205 info = calloc( 1, size );
206 if( info )
207 {
208 info->magic = MSIHANDLE_MAGIC;
209 info->type = type;
210 info->refcount = 1;
211 info->destructor = destroy;
212 }
213
214 return info;
215}
void destroy(_Tp *__pointer)
Definition: _construct.h:278
#define MSIHANDLE_MAGIC
Definition: msipriv.h:736

Referenced by create_suminfo(), MSI_CreateRecord(), MSI_DatabaseOpenViewW(), MSI_EnableUIPreview(), and MSI_OpenDatabaseW().

◆ append_storage_to_db()

void append_storage_to_db ( MSIDATABASE db,
IStorage stg 
)

Definition at line 76 of file database.c.

77{
79
80 t = malloc( sizeof *t );
81 t->stg = stg;
82 IStorage_AddRef( stg );
83 list_add_head( &db->transforms, &t->entry );
84}
static void list_add_head(struct list_entry *head, struct list_entry *entry)
Definition: list.h:76
GLdouble GLdouble t
Definition: gl.h:2047
struct list transforms
Definition: msipriv.h:119

Referenced by msi_table_apply_transform().

◆ call_script()

DWORD call_script ( MSIHANDLE  hPackage,
INT  type,
LPCWSTR  script,
LPCWSTR  function,
LPCWSTR  action 
)

Definition at line 289 of file script.c.

290{
291 HRESULT hr;
292 IActiveScript *pActiveScript = NULL;
293 IActiveScriptParse *pActiveScriptParse = NULL;
294 struct script_site *scriptsite;
295 IDispatch *pDispatch = NULL;
296 DISPPARAMS dispparamsNoArgs = {NULL, NULL, 0, 0};
297 DISPID dispid;
298 CLSID clsid;
299 VARIANT var;
301
303
304 /* Create MsiActiveScriptSite object */
305 hr = create_activescriptsite(&scriptsite);
306 if (hr != S_OK) goto done;
307
308 /* Create an installer object */
309 hr = create_msiserver(NULL, (void**)&scriptsite->installer);
310 if (hr != S_OK) goto done;
311
312 /* Create a session object */
313 hr = create_session(hPackage, scriptsite->installer, &scriptsite->session);
314 if (hr != S_OK) goto done;
315
316 /* Create the scripting engine */
319 hr = CLSIDFromProgID(L"JScript", &clsid);
321 hr = CLSIDFromProgID(L"VBScript", &clsid);
322 else {
323 ERR("Unknown script type %d\n", type);
324 goto done;
325 }
326 if (FAILED(hr)) {
327 ERR("Could not find CLSID for Windows Script\n");
328 goto done;
329 }
330 hr = CoCreateInstance(&clsid, NULL, CLSCTX_INPROC_SERVER, &IID_IActiveScript, (void **)&pActiveScript);
331 if (FAILED(hr)) {
332 ERR("Could not instantiate class for Windows Script\n");
333 goto done;
334 }
335
336 hr = IActiveScript_QueryInterface(pActiveScript, &IID_IActiveScriptParse, (void **)&pActiveScriptParse);
337 if (FAILED(hr)) goto done;
338
339 hr = IActiveScript_SetScriptSite(pActiveScript, &scriptsite->IActiveScriptSite_iface);
340 if (FAILED(hr)) goto done;
341
342 hr = IActiveScriptParse_InitNew(pActiveScriptParse);
343 if (FAILED(hr)) goto done;
344
345 hr = IActiveScript_AddNamedItem(pActiveScript, L"Session", SCRIPTITEM_GLOBALMEMBERS|SCRIPTITEM_ISVISIBLE);
346 if (FAILED(hr)) goto done;
347
348 hr = IActiveScriptParse_ParseScriptText(pActiveScriptParse, script, NULL, NULL, NULL, 0, 0, 0L, NULL, NULL);
349 if (FAILED(hr)) goto done;
350
351 hr = IActiveScript_SetScriptState(pActiveScript, SCRIPTSTATE_CONNECTED);
352 if (FAILED(hr)) goto done;
353
354 /* Call a function if necessary through the IDispatch interface */
355 if (function && function[0]) {
356 TRACE("Calling function %s\n", debugstr_w(function));
357
358 hr = IActiveScript_GetScriptDispatch(pActiveScript, NULL, &pDispatch);
359 if (FAILED(hr)) goto done;
360
361 hr = IDispatch_GetIDsOfNames(pDispatch, &IID_NULL, (WCHAR **)&function, 1,LOCALE_USER_DEFAULT, &dispid);
362 if (FAILED(hr)) goto done;
363
364 hr = IDispatch_Invoke(pDispatch, dispid, &IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &dispparamsNoArgs, &var, NULL, NULL);
365 if (FAILED(hr)) goto done;
366
367 hr = VariantChangeType(&var, &var, 0, VT_I4);
368 if (FAILED(hr)) goto done;
369
371
373 } else {
374 /* If no function to be called, MSI behavior is to succeed */
376 }
377
378done:
379
380 if (pDispatch) IDispatch_Release(pDispatch);
381 if (pActiveScript) IActiveScript_Release(pActiveScript);
382 if (pActiveScriptParse) IActiveScriptParse_Release(pActiveScriptParse);
383 if (scriptsite)
384 {
385 if (scriptsite->session) IDispatch_Release(scriptsite->session);
386 if (scriptsite->installer) IDispatch_Release(scriptsite->installer);
387 IActiveScriptSite_Release(&scriptsite->IActiveScriptSite_iface);
388 }
389 CoUninitialize(); /* must call even if CoInitialize failed */
390 return ret;
391}
@ SCRIPTSTATE_CONNECTED
Definition: activscp.idl:59
@ VT_I4
Definition: compat.h:2298
#define IActiveScriptParse_ParseScriptText
Definition: script.c:41
HRESULT create_session(MSIHANDLE msiHandle, IDispatch *installer, IDispatch **disp)
Definition: automation.c:2442
HRESULT create_msiserver(IUnknown *outer, void **ppObj)
Definition: automation.c:2423
#define IActiveScriptParse_InitNew
Definition: script.c:47
#define IActiveScriptParse_Release
Definition: script.c:46
static HRESULT create_activescriptsite(struct script_site **obj)
Definition: script.c:250
static UINT map_return_value(LONG val)
Definition: script.c:272
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
HRESULT WINAPI DECLSPEC_HOTPATCH CLSIDFromProgID(LPCOLESTR progid, LPCLSID clsid)
Definition: compobj.c:2602
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
Definition: compobj.c:1964
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: compobj.c:2067
#define S_OK
Definition: intsafe.h:52
#define FAILED(hr)
Definition: intsafe.h:51
const char * var
Definition: shader.c:5666
static VARIANTARG static DISPID
Definition: ordinal.c:52
REFCLSID clsid
Definition: msctf.c:82
@ msidbCustomActionTypeJScript
Definition: msidefs.h:119
@ msidbCustomActionTypeVBScript
Definition: msidefs.h:120
script
Definition: msipriv.h:383
struct stdole::DISPPARAMS DISPPARAMS
#define LOCALE_USER_DEFAULT
#define DISPATCH_METHOD
Definition: oleauto.h:1006
#define V_I4(A)
Definition: oleauto.h:247
#define IID_NULL
Definition: guiddef.h:98
HRESULT hr
Definition: shlfolder.c:183
IDispatch * session
Definition: script.c:59
IActiveScriptSite IActiveScriptSite_iface
Definition: script.c:57
IDispatch * installer
Definition: script.c:58
HRESULT WINAPI DECLSPEC_HOTPATCH VariantChangeType(VARIANTARG *pvargDest, VARIANTARG *pvargSrc, USHORT wFlags, VARTYPE vt)
Definition: variant.c:962
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:648

Referenced by ACTION_CallScript().

◆ copy_remote_record()

UINT copy_remote_record ( const struct wire_record rec,
MSIHANDLE  handle 
)

Definition at line 1052 of file record.c.

1053{
1054 MSIRECORD *rec;
1055 unsigned int i;
1057
1059 return ERROR_INVALID_HANDLE;
1060
1061 rec->cookie = in->cookie;
1062 for (i = 0; i <= in->count; i++)
1063 {
1064 switch (in->fields[i].type)
1065 {
1066 case MSIFIELD_NULL:
1067 MSI_FreeField(&rec->fields[i]);
1068 rec->fields[i].type = MSIFIELD_NULL;
1069 break;
1070 case MSIFIELD_INT:
1071 r = MSI_RecordSetInteger(rec, i, in->fields[i].u.iVal);
1072 break;
1073 case MSIFIELD_WSTR:
1074 r = MSI_RecordSetStringW(rec, i, in->fields[i].u.szwVal);
1075 break;
1076 case MSIFIELD_STREAM:
1077 r = MSI_RecordSetIStream(rec, i, in->fields[i].u.stream);
1078 break;
1079 default:
1080 ERR("invalid field type %d\n", in->fields[i].type);
1081 break;
1082 }
1083
1084 if (r)
1085 {
1086 msiobj_release(&rec->hdr);
1087 return r;
1088 }
1089 }
1090
1091 msiobj_release(&rec->hdr);
1092 return ERROR_SUCCESS;
1093}
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
void * msihandle2msiinfo(MSIHANDLE handle, UINT type)
Definition: handle.c:158
UINT MSI_RecordSetStringW(MSIRECORD *rec, UINT iField, LPCWSTR szValue)
Definition: record.c:597
#define MSIFIELD_STREAM
Definition: record.c:47
UINT MSI_RecordSetInteger(MSIRECORD *rec, UINT iField, int iVal)
Definition: record.c:280
#define MSIFIELD_INT
Definition: record.c:45
#define MSIFIELD_WSTR
Definition: record.c:46
UINT MSI_RecordSetIStream(MSIRECORD *rec, UINT iField, IStream *stm)
Definition: record.c:836
#define MSIFIELD_NULL
Definition: record.c:44
static void MSI_FreeField(MSIFIELD *field)
Definition: record.c:49
GLuint in
Definition: glext.h:9616
#define MSIHANDLETYPE_RECORD
Definition: msipriv.h:725
static FILE * out
Definition: regtests2xml.c:44
UINT type
Definition: msipriv.h:139
MSIFIELD fields[1]
Definition: msipriv.h:154
UINT64 cookie
Definition: msipriv.h:153

Referenced by MsiViewModify(), and unmarshal_record().

◆ cost_from_size()

static int cost_from_size ( int  size)
inlinestatic

Definition at line 1198 of file msipriv.h.

1199{
1200 /* Cost is size rounded up to the nearest 4096 bytes,
1201 * expressed in units of 512 bytes. */
1202 return ((size + 4095) & ~4095) / 512;
1203}

Referenced by calculate_file_cost(), and MsiEnumComponentCostsW().

◆ create_msiserver()

HRESULT create_msiserver ( IUnknown pOuter,
LPVOID ppObj 
)

◆ create_session()

HRESULT create_session ( MSIHANDLE  msiHandle,
IDispatch pInstaller,
IDispatch **  pDispatch 
)

Definition at line 2442 of file automation.c.

2443{
2444 struct session_object *session;
2445
2446 session = malloc(sizeof(*session));
2447 if (!session) return E_OUTOFMEMORY;
2448
2449 init_automation_object(&session->autoobj, msiHandle, Session_tid);
2450
2451 session->installer = installer;
2452 *disp = &session->autoobj.IDispatch_iface;
2453
2454 return S_OK;
2455}
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
static void init_automation_object(struct automation_object *This, MSIHANDLE msiHandle, tid_t tid)
Definition: automation.c:545
IDispatch * installer
Definition: automation.c:179

Referenced by call_script(), and InstallerImpl_OpenPackage().

◆ custom_stop_server()

void custom_stop_server ( HANDLE  process,
HANDLE  pipe 
)

Definition at line 682 of file custom.c.

683{
684 DWORD size;
685
686 WriteFile(pipe, &GUID_NULL, sizeof(GUID_NULL), &size, NULL);
689 CloseHandle(pipe);
690}
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 INFINITE
Definition: serial.h:102
#define GUID_NULL
Definition: ks.h:106
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82

Referenced by MSI_FreePackage().

◆ decode_base85_guid()

BOOL decode_base85_guid ( LPCWSTR  str,
GUID guid 
)

Definition at line 132 of file registry.c.

133{
134 DWORD i, val = 0, base = 1, *p;
135
136 if (!str)
137 return FALSE;
138
139 p = (DWORD*) guid;
140 for( i=0; i<20; i++ )
141 {
142 if( (i%5) == 0 )
143 {
144 val = 0;
145 base = 1;
146 }
147 val += table_dec85[str[i]] * base;
148 if( str[i] >= 0x80 )
149 return FALSE;
150 if( table_dec85[str[i]] == 0xff )
151 return FALSE;
152 if( (i%5) == 4 )
153 p[i/5] = val;
154 base *= 85;
155 }
156 return TRUE;
157}
static const unsigned char table_dec85[0x80]
Definition: registry.c:110
GLuint GLfloat * val
Definition: glext.h:7180
GLfloat GLfloat p
Definition: glext.h:8902
const WCHAR * str

Referenced by MSI_ProvideQualifiedComponentEx(), MsiDecomposeDescriptorW(), and query_feature_state().

◆ decode_streamname()

BOOL decode_streamname ( LPCWSTR  in,
LPWSTR  out 
)

Definition at line 180 of file table.c.

181{
182 WCHAR ch;
183 DWORD count = 0;
184
185 while ( (ch = *in++) )
186 {
187 if( (ch >= 0x3800 ) && (ch < 0x4840 ) )
188 {
189 if( ch >= 0x4800 )
190 ch = mime2utf(ch-0x4800);
191 else
192 {
193 ch -= 0x3800;
194 *out++ = mime2utf(ch&0x3f);
195 count++;
196 ch = mime2utf((ch>>6)&0x3f);
197 }
198 }
199 *out++ = ch;
200 count++;
201 }
202 *out = 0;
203 return count;
204}
static int mime2utf(int x)
Definition: table.c:167
GLuint GLuint GLsizei count
Definition: gl.h:1545

Referenced by enum_stream_names(), load_streams(), and msi_table_apply_transform().

◆ deformat_string()

DWORD deformat_string ( MSIPACKAGE package,
LPCWSTR  ptr,
WCHAR **  data 
)

◆ dump_record()

void dump_record ( MSIRECORD rec)

Definition at line 1028 of file record.c.

1029{
1030 int i;
1031 if (!rec)
1032 {
1033 TRACE("(null)\n");
1034 return;
1035 }
1036
1037 TRACE("[");
1038 for (i = 0; i <= rec->count; i++)
1039 {
1040 switch(rec->fields[i].type)
1041 {
1042 case MSIFIELD_NULL: TRACE("(null)"); break;
1043 case MSIFIELD_INT: TRACE("%d", rec->fields[i].u.iVal); break;
1044 case MSIFIELD_WSTR: TRACE("%s", debugstr_w(rec->fields[i].u.szwVal)); break;
1045 case MSIFIELD_STREAM: TRACE("%p", rec->fields[i].u.stream); break;
1046 }
1047 if (i < rec->count) TRACE(", ");
1048 }
1049 TRACE("]\n");
1050}
INT iVal
Definition: msipriv.h:142
IStream * stream
Definition: msipriv.h:144
LPWSTR szwVal
Definition: msipriv.h:143
union tagMSIFIELD::@500 u
UINT count
Definition: msipriv.h:152

Referenced by MSI_FormatRecordW(), MSI_ProcessMessageVerbatim(), and table_load_transform().

◆ encode_base85_guid()

BOOL encode_base85_guid ( GUID guid,
LPWSTR  str 
)

Definition at line 165 of file registry.c.

166{
167 unsigned int x, *p, i;
168
169 p = (unsigned int*) guid;
170 for( i=0; i<4; i++ )
171 {
172 x = p[i];
173 *str++ = table_enc85[x%85];
174 x = x/85;
175 *str++ = table_enc85[x%85];
176 x = x/85;
177 *str++ = table_enc85[x%85];
178 x = x/85;
179 *str++ = table_enc85[x%85];
180 x = x/85;
181 *str++ = table_enc85[x%85];
182 }
183 *str = 0;
184
185 return TRUE;
186}
static const char table_enc85[]
Definition: registry.c:121
GLint GLint GLint GLint GLint x
Definition: gl.h:1548

Referenced by ACTION_MsiPublishAssemblies(), ACTION_PublishFeatures(), and msi_create_component_advertise_string().

◆ encode_streamname()

WCHAR * encode_streamname ( BOOL  is_table,
const WCHAR in 
)

◆ enum_stream_names()

void enum_stream_names ( IStorage stg)

Definition at line 206 of file table.c.

207{
208 IEnumSTATSTG *stgenum = NULL;
209 HRESULT r;
210 STATSTG stat;
211 ULONG n, count;
212 WCHAR name[0x40];
213
214 r = IStorage_EnumElements( stg, 0, NULL, 0, &stgenum );
215 if( FAILED( r ) )
216 return;
217
218 n = 0;
219 while( 1 )
220 {
221 count = 0;
222 r = IEnumSTATSTG_Next( stgenum, 1, &stat, &count );
223 if( FAILED( r ) || !count )
224 break;
225 decode_streamname( stat.pwcsName, name );
226 TRACE( "stream %2lu -> %s %s\n", n, debugstr_w(stat.pwcsName), debugstr_w(name) );
227 CoTaskMemFree( stat.pwcsName );
228 n++;
229 }
230
231 IEnumSTATSTG_Release( stgenum );
232}
#define stat
Definition: acwin.h:99
BOOL decode_streamname(LPCWSTR in, LPWSTR out)
Definition: table.c:180
GLdouble n
Definition: glext.h:7729
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:442
Definition: name.c:39
Definition: stat.h:55
uint32_t ULONG
Definition: typedefs.h:59

Referenced by MSI_DatabaseApplyTransformW(), and MSI_OpenDatabaseW().

◆ free_cached_tables()

void free_cached_tables ( MSIDATABASE db)

Definition at line 472 of file table.c.

473{
474 while( !list_empty( &db->tables ) )
475 {
477
478 list_remove( &t->entry );
479 free_table( t );
480 }
481}
static int list_empty(struct list_entry *head)
Definition: list.h:58
static void free_table(MSITABLE *table)
Definition: table.c:364
struct list tables
Definition: msipriv.h:118

Referenced by MSI_CloseDatabase().

◆ free_remote_record()

void free_remote_record ( struct wire_record rec)

Definition at line 1149 of file record.c.

1150{
1151 int i;
1152
1153 for (i = 0; i <= rec->count; i++)
1154 {
1155 if (rec->fields[i].type == MSIFIELD_WSTR)
1156 midl_user_free(rec->fields[i].u.szwVal);
1157 else if (rec->fields[i].type == MSIFIELD_STREAM)
1158 IStream_Release(rec->fields[i].u.stream);
1159 }
1160
1161 midl_user_free(rec);
1162}
#define midl_user_free
Definition: rpc.h:45
unsigned int count
Definition: winemsi.idl:57
struct wire_field fields[]
Definition: winemsi.idl:59

Referenced by MsiDatabaseGetPrimaryKeysW(), MsiViewFetch(), MsiViewGetColumnInfo(), and MsiViewModify().

◆ get_typeinfo()

HRESULT get_typeinfo ( tid_t  tid,
ITypeInfo **  ti 
)

Definition at line 61 of file ieframe_main.c.

62{
64
65 if(!typelib)
67 if(!typelib)
68 return hres;
69
70 if(!typeinfos[tid]) {
71 ITypeInfo *ti;
72
73 hres = ITypeLib_GetTypeInfoOfGuid(typelib, tid_ids[tid], &ti);
74 if(FAILED(hres)) {
75 ERR("GetTypeInfoOfGuid(%s) failed: %08x\n", debugstr_guid(tid_ids[tid]), hres);
76 return hres;
77 }
78
80 ITypeInfo_Release(ti);
81 }
82
84 return S_OK;
85}
static HRESULT load_typelib(void)
Definition: ieframe_main.c:45
static REFIID tid_ids[]
Definition: ieframe_main.c:37
static ITypeInfo * typeinfos[LAST_tid]
Definition: ieframe_main.c:35
#define InterlockedCompareExchangePointer
Definition: interlocked.h:129
#define debugstr_guid
Definition: kernel32.h:35
HRESULT hres
Definition: protocol.c:465
static TfClientId tid

◆ marshal_record()

struct wire_record * marshal_record ( MSIHANDLE  handle)

Definition at line 1109 of file record.c.

1110{
1111 struct wire_record *ret;
1112 unsigned int i;
1113 MSIRECORD *rec;
1114
1116 return NULL;
1117
1118 ret = midl_user_allocate(sizeof(*ret) + rec->count * sizeof(ret->fields[0]));
1119 ret->count = rec->count;
1120 ret->cookie = rec->cookie;
1121
1122 for (i = 0; i <= rec->count; i++)
1123 {
1124 switch (rec->fields[i].type)
1125 {
1126 case MSIFIELD_NULL:
1127 break;
1128 case MSIFIELD_INT:
1129 ret->fields[i].u.iVal = rec->fields[i].u.iVal;
1130 break;
1131 case MSIFIELD_WSTR:
1132 ret->fields[i].u.szwVal = wcsdup(rec->fields[i].u.szwVal);
1133 break;
1134 case MSIFIELD_STREAM:
1135 IStream_AddRef(rec->fields[i].u.stream);
1136 ret->fields[i].u.stream = rec->fields[i].u.stream;
1137 break;
1138 default:
1139 ERR("invalid field type %d\n", rec->fields[i].type);
1140 break;
1141 }
1142 ret->fields[i].type = rec->fields[i].type;
1143 }
1144
1145 msiobj_release(&rec->hdr);
1146 return ret;
1147}
_Check_return_ _CRTIMP wchar_t *__cdecl wcsdup(_In_z_ const wchar_t *_Str)
#define midl_user_allocate
Definition: rpc.h:44

Referenced by s_remote_DatabaseGetPrimaryKeys(), s_remote_ViewFetch(), s_remote_ViewGetColumnInfo(), and s_remote_ViewModify().

◆ msi_action_is_unique()

BOOL msi_action_is_unique ( const MSIPACKAGE package,
const WCHAR action 
)

Definition at line 131 of file custom.c.

132{
133 UINT i;
134
135 for (i = 0; i < package->unique_actions_count; i++)
136 {
137 if (!wcscmp( package->unique_actions[i], action )) return TRUE;
138 }
139 return FALSE;
140}
int unique_actions_count
Definition: msipriv.h:436
LPWSTR * unique_actions
Definition: msipriv.h:435

Referenced by ACTION_AppSearch(), ACTION_CCPSearch(), ACTION_FindRelatedProducts(), and check_execution_scheduling_options().

◆ msi_add_cabinet_stream()

UINT msi_add_cabinet_stream ( MSIPACKAGE package,
UINT  disk_id,
IStorage storage,
const WCHAR name 
)

Definition at line 923 of file media.c.

924{
925 MSICABINETSTREAM *cab, *item;
926
927 TRACE("%p, %u, %p, %s\n", package, disk_id, storage, debugstr_w(name));
928
930 {
931 if (item->disk_id == disk_id)
932 {
933 TRACE("duplicate disk id %u\n", disk_id);
935 }
936 }
937 if (!(cab = malloc( sizeof(*cab) ))) return ERROR_OUTOFMEMORY;
938 if (!(cab->stream = malloc( (wcslen( name ) + 1) * sizeof(WCHAR) )))
939 {
940 free( cab );
941 return ERROR_OUTOFMEMORY;
942 }
943 lstrcpyW( cab->stream, name );
944 cab->disk_id = disk_id;
945 cab->storage = storage;
946 IStorage_AddRef( storage );
947 list_add_tail( &package->cabinet_streams, &cab->entry );
948
949 return ERROR_SUCCESS;
950}
static void list_add_tail(struct list_entry *head, struct list_entry *entry)
Definition: list.h:83
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13
struct list entry
Definition: msipriv.h:192
IStorage * storage
Definition: msipriv.h:194
struct list cabinet_streams
Definition: msipriv.h:408

Referenced by load_media(), and patch_add_media().

◆ msi_add_string()

BOOL msi_add_string ( string_table st,
const WCHAR data,
int  len,
BOOL  persistent 
)

Definition at line 303 of file string.c.

304{
305 UINT n;
306 LPWSTR str;
307
308 if( !data )
309 return 0;
310
311 if (len < 0) len = lstrlenW( data );
312
313 if( !data[0] && !len )
314 return 0;
315
316 if (msi_string2id( st, data, len, &n) == ERROR_SUCCESS )
317 {
318 if (persistent)
319 st->strings[n].persistent_refcount++;
320 else
321 st->strings[n].nonpersistent_refcount++;
322 return n;
323 }
324
325 n = st_find_free_entry( st );
326 if( n == -1 )
327 return -1;
328
329 /* allocate a new string */
330 TRACE( "%s, n = %d len = %d\n", debugstr_wn(data, len), n, len );
331
332 str = malloc( (len + 1) * sizeof(WCHAR) );
333 if( !str )
334 return -1;
335 memcpy( str, data, len*sizeof(WCHAR) );
336 str[len] = 0;
337
338 set_st_entry( st, n, str, len, 1, persistent );
339 return n;
340}
UINT msi_string2id(const string_table *st, const WCHAR *str, int len, UINT *id)
Definition: string.c:400
static int st_find_free_entry(string_table *st)
Definition: string.c:122
static void set_st_entry(string_table *st, UINT n, WCHAR *str, int len, USHORT refcount, BOOL persistent)
Definition: string.c:208
#define debugstr_wn
Definition: kernel32.h:33
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
struct msistring * strings
Definition: string.c:57

Referenced by add_storages_to_table(), append_stream(), msi_create_table(), STORAGES_set_row(), STREAMS_set_row(), TABLE_add_column(), TABLE_set_row(), and TABLE_set_string().

◆ msi_add_suminfo()

UINT msi_add_suminfo ( MSIDATABASE db,
LPWSTR **  records,
int  num_records,
int  num_columns 
)

Definition at line 1078 of file suminfo.c.

1079{
1080 UINT r;
1081 int i, j;
1082 MSISUMMARYINFO *si;
1083
1084 r = msi_get_suminfo( db->storage, num_records * (num_columns / 2), &si );
1085 if (r != ERROR_SUCCESS)
1086 {
1087 if (!(si = create_suminfo( db->storage, num_records * (num_columns / 2) )))
1088 return ERROR_OUTOFMEMORY;
1089 r = ERROR_SUCCESS;
1090 }
1091
1092 for (i = 0; i < num_records; i++)
1093 {
1094 for (j = 0; j < num_columns; j += 2)
1095 {
1096 UINT pid;
1097 INT int_value = 0;
1098 FILETIME ft_value;
1099 awcstring str_value;
1100
1101 r = parse_prop( records[i][j], records[i][j + 1], &pid, &int_value, &ft_value, &str_value );
1102 if (r != ERROR_SUCCESS)
1103 goto end;
1104
1105 r = set_prop( si, pid, get_type(pid), int_value, &ft_value, &str_value );
1106 if (r != ERROR_SUCCESS)
1107 goto end;
1108 }
1109 }
1110
1111end:
1112 if (r == ERROR_SUCCESS)
1113 r = suminfo_persist( si );
1114
1115 msiobj_release( &si->hdr );
1116 return r;
1117}
UINT msi_get_suminfo(IStorage *stg, UINT uiUpdateCount, MSISUMMARYINFO **ret)
Definition: suminfo.c:462
static UINT parse_prop(LPCWSTR prop, LPCWSTR value, UINT *pid, INT *int_value, FILETIME *ft_value, awcstring *str_value)
Definition: suminfo.c:1029
static UINT suminfo_persist(MSISUMMARYINFO *si)
Definition: suminfo.c:972
static MSISUMMARYINFO * create_suminfo(IStorage *stg, UINT update_count)
Definition: suminfo.c:448
static UINT set_prop(MSISUMMARYINFO *si, UINT uiProperty, UINT type, INT iValue, FILETIME *pftValue, awcstring *str)
Definition: suminfo.c:842
static UINT get_type(UINT uiProperty)
Definition: suminfo.c:118
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
IStorage * storage
Definition: msipriv.h:109
MSIOBJECTHDR hdr
Definition: msipriv.h:486
_In_ ULONG_PTR _In_ ULONG _Out_ ULONG_PTR * pid
Definition: winddi.h:3837

Referenced by MSI_DatabaseImport().

◆ msi_adjust_privilege_properties()

void msi_adjust_privilege_properties ( MSIPACKAGE package)

Definition at line 964 of file package.c.

965{
966 /* FIXME: this should depend on the user's privileges */
967 if (msi_get_property_int( package->db, L"ALLUSERS", 0 ) == 2)
968 {
969 TRACE("resetting ALLUSERS property from 2 to 1\n");
970 msi_set_property( package->db, L"ALLUSERS", L"1", -1 );
971 }
972 msi_set_property( package->db, L"AdminUser", L"1", -1 );
973 msi_set_property( package->db, L"Privileged", L"1", -1 );
974 msi_set_property( package->db, L"MsiRunningElevated", L"1", -1 );
975}
UINT msi_set_property(MSIDATABASE *db, const WCHAR *name, const WCHAR *value, int len)
Definition: package.c:2100
int msi_get_property_int(MSIDATABASE *db, LPCWSTR prop, int def)
Definition: package.c:2305

Referenced by MSI_CreatePackage(), MSI_InstallPackage(), and MSI_OpenPackageW().

◆ msi_apply_patches()

UINT msi_apply_patches ( MSIPACKAGE package)

Definition at line 932 of file patch.c.

933{
934 LPWSTR patch_list, *patches;
936
937 patch_list = msi_dup_property( package->db, L"PATCH" );
938
939 TRACE("patches to be applied: %s\n", debugstr_w(patch_list));
940
941 patches = msi_split_string( patch_list, ';' );
942 for (i = 0; patches && patches[i] && r == ERROR_SUCCESS; i++)
943 r = apply_patch_package( package, patches[i] );
944
945 free( patches );
946 free( patch_list );
947 return r;
948}
WCHAR ** msi_split_string(const WCHAR *str, WCHAR sep)
Definition: action.c:304
static UINT apply_patch_package(MSIPACKAGE *package, const WCHAR *file)
Definition: patch.c:875

Referenced by MSI_InstallPackage().

◆ msi_apply_registered_patch()

UINT msi_apply_registered_patch ( MSIPACKAGE package,
LPCWSTR  patch_code 
)

Definition at line 990 of file patch.c.

991{
992 UINT r;
993 DWORD len;
995 MSIDATABASE *patch_db;
996 MSIPATCHINFO *patch_info;
997 MSISUMMARYINFO *si;
998
999 TRACE("%p, %s\n", package, debugstr_w(patch_code));
1000
1002 r = MsiGetPatchInfoExW( patch_code, package->ProductCode, NULL, package->Context,
1004 if (r != ERROR_SUCCESS)
1005 {
1006 ERR("failed to get patch filename %u\n", r);
1007 return r;
1008 }
1010 if (r != ERROR_SUCCESS)
1011 {
1012 ERR("failed to open patch database %s\n", debugstr_w( patch_file ));
1013 return r;
1014 }
1015 r = msi_get_suminfo( patch_db->storage, 0, &si );
1016 if (r != ERROR_SUCCESS)
1017 {
1018 msiobj_release( &patch_db->hdr );
1019 return r;
1020 }
1021 r = parse_patch_summary( si, &patch_info );
1022 msiobj_release( &si->hdr );
1023 if (r != ERROR_SUCCESS)
1024 {
1025 ERR("failed to parse patch summary %u\n", r);
1026 msiobj_release( &patch_db->hdr );
1027 return r;
1028 }
1029 patch_info->registered = TRUE;
1030 patch_info->localfile = wcsdup( patch_file );
1031 if (!patch_info->localfile)
1032 {
1033 msiobj_release( &patch_db->hdr );
1034 msi_free_patchinfo( patch_info );
1035 return ERROR_OUTOFMEMORY;
1036 }
1037 r = apply_patch_db( package, patch_db, patch_info );
1038 msiobj_release( &patch_db->hdr );
1039 if (r != ERROR_SUCCESS)
1040 {
1041 ERR("failed to apply patch %u\n", r);
1042 msi_free_patchinfo( patch_info );
1043 }
1044 return r;
1045}
UINT MSI_OpenDatabaseW(LPCWSTR szDBPath, LPCWSTR szPersist, MSIDATABASE **pdb)
Definition: database.c:140
UINT WINAPI MsiGetPatchInfoExW(LPCWSTR szPatchCode, LPCWSTR szProductCode, LPCWSTR szUserSid, MSIINSTALLCONTEXT dwContext, LPCWSTR szProperty, LPWSTR lpValue, DWORD *pcchValue)
Definition: msi.c:1657
static UINT parse_patch_summary(MSISUMMARYINFO *si, MSIPATCHINFO **patch)
Definition: patch.c:318
static UINT apply_patch_db(MSIPACKAGE *package, MSIDATABASE *patch_db, MSIPATCHINFO *patch)
Definition: patch.c:834
void msi_free_patchinfo(MSIPATCHINFO *patch)
Definition: patch.c:865
static const WCHAR INSTALLPROPERTY_LOCALPACKAGEW[]
Definition: msi.h:343
UINT msi_get_suminfo(IStorage *stg, UINT uiUpdateCount, MSISUMMARYINFO **si)
Definition: suminfo.c:462
#define MSIDBOPEN_PATCHFILE
Definition: msiquery.h:79
#define MSIDBOPEN_READONLY
Definition: msiquery.h:66
MSIOBJECTHDR hdr
Definition: msipriv.h:108
BOOL registered
Definition: msipriv.h:209
LPWSTR localfile
Definition: msipriv.h:205

Referenced by MSI_OpenPackageW().

◆ msi_apply_transforms()

UINT msi_apply_transforms ( MSIPACKAGE package)

Definition at line 950 of file patch.c.

951{
952 LPWSTR xform_list, *xforms;
954
955 xform_list = msi_dup_property( package->db, L"TRANSFORMS" );
956 xforms = msi_split_string( xform_list, ';' );
957
958 for (i = 0; xforms && xforms[i] && r == ERROR_SUCCESS; i++)
959 {
960 if (xforms[i][0] == ':')
961 r = apply_substorage_transform( package, package->db, xforms[i] );
962 else
963 {
965
966 if (!PathIsRelativeW( xforms[i] )) transform = xforms[i];
967 else
968 {
969 WCHAR *p = wcsrchr( package->PackagePath, '\\' );
970 DWORD len = p - package->PackagePath + 1;
971
972 if (!(transform = malloc( (len + wcslen( xforms[i] ) + 1) * sizeof(WCHAR)) ))
973 {
974 free( xforms );
975 free( xform_list );
976 return ERROR_OUTOFMEMORY;
977 }
978 memcpy( transform, package->PackagePath, len * sizeof(WCHAR) );
979 memcpy( transform + len, xforms[i], (lstrlenW( xforms[i] ) + 1) * sizeof(WCHAR) );
980 }
981 r = MSI_DatabaseApplyTransformW( package->db, transform, 0 );
982 if (transform != xforms[i]) free( transform );
983 }
984 }
985 free( xforms );
986 free( xform_list );
987 return r;
988}
static UINT apply_substorage_transform(MSIPACKAGE *package, MSIDATABASE *patch_db, LPCWSTR name)
Definition: patch.c:259
BOOL WINAPI PathIsRelativeW(LPCWSTR lpszPath)
Definition: path.c:1579
GLuint GLenum GLenum transform
Definition: glext.h:9407
UINT MSI_DatabaseApplyTransformW(MSIDATABASE *db, LPCWSTR szTransformFile, int iErrorCond)
LPWSTR PackagePath
Definition: msipriv.h:447

Referenced by MSI_InstallPackage().

◆ msi_build_directory_name()

WCHAR *WINAPIV msi_build_directory_name ( DWORD  count,
  ... 
)

Definition at line 2007 of file action.c.

2008{
2009 DWORD sz = 1, i;
2010 WCHAR *dir;
2011 va_list va;
2012
2013 va_start( va, count );
2014 for (i = 0; i < count; i++)
2015 {
2016 const WCHAR *str = va_arg( va, const WCHAR * );
2017 if (str) sz += lstrlenW( str ) + 1;
2018 }
2019 va_end( va );
2020
2021 dir = malloc( sz * sizeof(WCHAR) );
2022 dir[0] = 0;
2023
2024 va_start( va, count );
2025 for (i = 0; i < count; i++)
2026 {
2027 const WCHAR *str = va_arg( va, const WCHAR * );
2028 if (!str) continue;
2029 lstrcatW( dir, str );
2030 if ( i + 1 != count && dir[0] && dir[lstrlenW( dir ) - 1] != '\\') lstrcatW( dir, L"\\" );
2031 }
2032 va_end( va );
2033 return dir;
2034}
char * va_list
Definition: acmsvcex.h:78
#define va_end(ap)
Definition: acmsvcex.h:90
#define va_start(ap, A)
Definition: acmsvcex.h:91
#define va_arg(ap, T)
Definition: acmsvcex.h:89
unsigned int dir
Definition: maze.c:112

Referenced by get_duplicate_filename(), get_ini_file_name(), get_link_file(), ITERATE_InstallODBCDriver(), msi_build_icon_path(), msi_resolve_file_source(), msi_resolve_source_folder(), msi_resolve_target_folder(), MSI_SetTargetPathW(), register_verb(), and set_target_path().

◆ msi_build_icon_path()

WCHAR * msi_build_icon_path ( MSIPACKAGE package,
const WCHAR icon_name 
)

Definition at line 3713 of file action.c.

3714{
3715 WCHAR *folder, *dest, *path;
3716
3717 if (package->Context == MSIINSTALLCONTEXT_MACHINE)
3718 folder = msi_dup_property( package->db, L"WindowsFolder" );
3719 else
3720 {
3721 WCHAR *appdata = msi_dup_property( package->db, L"AppDataFolder" );
3722 folder = msi_build_directory_name( 2, appdata, L"Microsoft\\" );
3723 free( appdata );
3724 }
3725 dest = msi_build_directory_name( 3, folder, L"Installer\\", package->ProductCode );
3726 msi_create_full_path( package, dest );
3727 path = msi_build_directory_name( 2, dest, icon_name );
3728 free( folder );
3729 free( dest );
3730 return path;
3731}
WCHAR *WINAPIV msi_build_directory_name(DWORD count,...)
Definition: action.c:2007
BOOL msi_create_full_path(MSIPACKAGE *package, const WCHAR *path)
Definition: files.c:211
static char * dest
Definition: rtl.c:135
@ MSIINSTALLCONTEXT_MACHINE
Definition: msi.h:200
static const char appdata[]
Definition: shdocvw.c:39

Referenced by ITERATE_CreateShortcuts(), ITERATE_PublishIcon(), ITERATE_UnpublishIcon(), load_class(), load_progid(), and publish_product_properties().

◆ msi_cabextract()

BOOL msi_cabextract ( MSIPACKAGE package,
MSIMEDIAINFO mi,
LPVOID  data 
)

Definition at line 640 of file media.c.

641{
642 if (mi->cabinet[0] == '#')
643 {
644 return extract_cabinet_stream( package, mi, data );
645 }
646 return extract_cabinet( package, mi, data );
647}
static BOOL extract_cabinet(MSIPACKAGE *package, MSIMEDIAINFO *mi, LPVOID data)
Definition: media.c:567
static BOOL extract_cabinet_stream(MSIPACKAGE *package, MSIMEDIAINFO *mi, LPVOID data)
Definition: media.c:607

Referenced by ACTION_InstallFiles(), and ACTION_PatchFiles().

◆ msi_check_patch_applicable()

UINT msi_check_patch_applicable ( MSIPACKAGE package,
MSISUMMARYINFO si 
)

Definition at line 294 of file patch.c.

295{
296 LPWSTR guid_list, *guids, product_code;
298
299 product_code = msi_dup_property( package->db, L"ProductCode" );
300 if (!product_code)
301 {
302 /* FIXME: the property ProductCode should be written into the DB somewhere */
303 ERR("no product code to check\n");
304 return ERROR_SUCCESS;
305 }
307 guids = msi_split_string( guid_list, ';' );
308 for (i = 0; guids[i] && ret != ERROR_SUCCESS; i++)
309 {
310 if (!wcscmp( guids[i], product_code )) ret = ERROR_SUCCESS;
311 }
312 free( guids );
313 free( guid_list );
314 free( product_code );
315 return ret;
316}
#define PID_TEMPLATE
Definition: suminfo.c:49
static const GUID * guid_list[]
Definition: metadata.c:2260
WCHAR * msi_suminfo_dup_string(MSISUMMARYINFO *si, UINT property)
Definition: suminfo.c:701

Referenced by apply_patch_package(), and MSI_ApplicablePatchW().

◆ msi_clone_properties()

UINT msi_clone_properties ( MSIDATABASE db)

Definition at line 381 of file package.c.

382{
383 MSIQUERY *view_select;
384 UINT rc;
385
386 rc = MSI_DatabaseOpenViewW( db, L"SELECT * FROM `Property`", &view_select );
387 if (rc != ERROR_SUCCESS)
388 return rc;
389
390 rc = MSI_ViewExecute( view_select, 0 );
391 if (rc != ERROR_SUCCESS)
392 {
393 MSI_ViewClose( view_select );
394 msiobj_release( &view_select->hdr );
395 return rc;
396 }
397
398 while (1)
399 {
400 MSIQUERY *view_insert, *view_update;
401 MSIRECORD *rec_select;
402
403 rc = MSI_ViewFetch( view_select, &rec_select );
404 if (rc != ERROR_SUCCESS)
405 break;
406
407 rc = MSI_DatabaseOpenViewW( db, L"INSERT INTO `_Property` (`_Property`,`Value`) VALUES (?,?)", &view_insert );
408 if (rc != ERROR_SUCCESS)
409 {
410 msiobj_release( &rec_select->hdr );
411 continue;
412 }
413
414 rc = MSI_ViewExecute( view_insert, rec_select );
415 MSI_ViewClose( view_insert );
416 msiobj_release( &view_insert->hdr );
417 if (rc != ERROR_SUCCESS)
418 {
419 MSIRECORD *rec_update;
420
421 TRACE("insert failed, trying update\n");
422
423 rc = MSI_DatabaseOpenViewW( db, L"UPDATE `_Property` SET `Value` = ? WHERE `_Property` = ?", &view_update );
424 if (rc != ERROR_SUCCESS)
425 {
426 WARN("open view failed %u\n", rc);
427 msiobj_release( &rec_select->hdr );
428 continue;
429 }
430
431 rec_update = MSI_CreateRecord( 2 );
432 MSI_RecordCopyField( rec_select, 1, rec_update, 2 );
433 MSI_RecordCopyField( rec_select, 2, rec_update, 1 );
434 rc = MSI_ViewExecute( view_update, rec_update );
435 if (rc != ERROR_SUCCESS)
436 WARN("update failed %u\n", rc);
437
438 MSI_ViewClose( view_update );
439 msiobj_release( &view_update->hdr );
440 msiobj_release( &rec_update->hdr );
441 }
442
443 msiobj_release( &rec_select->hdr );
444 }
445
446 MSI_ViewClose( view_select );
447 msiobj_release( &view_select->hdr );
448 return rc;
449}
UINT MSI_ViewExecute(MSIQUERY *, MSIRECORD *)
Definition: msiquery.c:502
UINT MSI_ViewClose(MSIQUERY *)
Definition: msiquery.c:454
UINT MSI_RecordCopyField(MSIRECORD *, UINT, MSIRECORD *, UINT)
Definition: record.c:166
UINT MSI_ViewFetch(MSIQUERY *, MSIRECORD **)
Definition: msiquery.c:377
MSIOBJECTHDR hdr
Definition: msipriv.h:129

Referenced by MSI_CreatePackage(), and msi_table_apply_transform().

◆ MSI_CloneRecord()

MSIRECORD * MSI_CloneRecord ( MSIRECORD rec)

Definition at line 921 of file record.c.

922{
923 MSIRECORD *clone;
924 UINT r, i, count;
925
927 clone = MSI_CreateRecord(count);
928 if (!clone)
929 return NULL;
930
931 for (i = 0; i <= count; i++)
932 {
933 if (rec->fields[i].type == MSIFIELD_STREAM)
934 {
935 if (FAILED(IStream_Clone(rec->fields[i].u.stream,
936 &clone->fields[i].u.stream)))
937 {
938 msiobj_release(&clone->hdr);
939 return NULL;
940 }
941 clone->fields[i].type = MSIFIELD_STREAM;
942 }
943 else
944 {
945 r = MSI_RecordCopyField(rec, i, clone, i);
946 if (r != ERROR_SUCCESS)
947 {
948 msiobj_release(&clone->hdr);
949 return NULL;
950 }
951 }
952 }
953
954 return clone;
955}
UINT MSI_RecordCopyField(MSIRECORD *in_rec, UINT in_n, MSIRECORD *out_rec, UINT out_n)
Definition: record.c:166
MSIRECORD * MSI_CreateRecord(UINT cParams)
Definition: record.c:76
UINT MSI_RecordGetFieldCount(const MSIRECORD *rec)
Definition: record.c:108

Referenced by iterate_properties(), merge_diff_row(), and MSI_FormatRecordW().

◆ MSI_CloseRecord()

void MSI_CloseRecord ( MSIOBJECTHDR arg)

Definition at line 67 of file record.c.

68{
69 MSIRECORD *rec = (MSIRECORD *) arg;
70 UINT i;
71
72 for( i=0; i<=rec->count; i++ )
73 MSI_FreeField( &rec->fields[i] );
74}

Referenced by MSI_CreateRecord(), and refresh_record().

◆ msi_commit_streams()

UINT msi_commit_streams ( MSIDATABASE db)

Definition at line 607 of file streams.c.

608{
609 UINT i;
610 const WCHAR *name;
611 WCHAR *encname;
613 HRESULT hr;
614
615 TRACE("got %u streams\n", db->num_streams);
616
617 for (i = 0; i < db->num_streams; i++)
618 {
620 if (!wcscmp( name, L"\5SummaryInformation" )) continue;
621
622 if (!(encname = encode_streamname( FALSE, name ))) return ERROR_OUTOFMEMORY;
623 TRACE("saving stream %s as %s\n", debugstr_w(name), debugstr_w(encname));
624
625 hr = IStorage_CreateStream( db->storage, encname, STGM_WRITE|STGM_SHARE_EXCLUSIVE, 0, 0, &stream );
626 if (SUCCEEDED( hr ))
627 {
629 if (FAILED( hr ))
630 {
631 ERR( "failed to write stream %s (hr = %#lx)\n", debugstr_w(encname), hr );
632 free( encname );
633 IStream_Release( stream );
635 }
636 hr = IStream_Commit( stream, 0 );
637 IStream_Release( stream );
638 if (FAILED( hr ))
639 {
640 ERR( "failed to commit stream %s (hr = %#lx)\n", debugstr_w(encname), hr );
641 free( encname );
643 }
644 }
645 else if (hr != STG_E_FILEALREADYEXISTS)
646 {
647 ERR( "failed to create stream %s (hr = %#lx)\n", debugstr_w(encname), hr );
648 free( encname );
650 }
651 free( encname );
652 }
653
654 return ERROR_SUCCESS;
655}
#define SUCCEEDED(hr)
Definition: intsafe.h:50
WCHAR * encode_streamname(BOOL is_table, const WCHAR *in)
const WCHAR * msi_string_lookup(const string_table *st, UINT id, int *len)
Definition: string.c:343
#define STGM_SHARE_EXCLUSIVE
Definition: objbase.h:923
#define STGM_WRITE
Definition: objbase.h:918
static HRESULT write_stream(IStream *dst, IStream *src)
Definition: streams.c:562
Definition: parse.h:23
MSISTREAM * streams
Definition: msipriv.h:120
UINT num_streams
Definition: msipriv.h:121
string_table * strings
Definition: msipriv.h:110
UINT str_index
Definition: msipriv.h:88
IStream * stream
Definition: msipriv.h:89
#define STG_E_FILEALREADYEXISTS
Definition: winerror.h:2579

Referenced by MsiDatabaseCommit().

◆ MSI_CommitTables()

UINT MSI_CommitTables ( MSIDATABASE db)

Definition at line 2886 of file table.c.

2887{
2888 UINT r, bytes_per_strref;
2889 HRESULT hr;
2890 MSITABLE *table = NULL;
2891
2892 TRACE("%p\n",db);
2893
2894 r = msi_save_string_table( db->strings, db->storage, &bytes_per_strref );
2895 if( r != ERROR_SUCCESS )
2896 {
2897 WARN("failed to save string table r=%08x\n",r);
2898 return r;
2899 }
2900
2902 {
2903 r = save_table( db, table, bytes_per_strref );
2904 if( r != ERROR_SUCCESS )
2905 {
2906 WARN("failed to save table %s (r=%08x)\n",
2907 debugstr_w(table->name), r);
2908 return r;
2909 }
2910 }
2911
2912 hr = IStorage_Commit( db->storage, 0 );
2913 if (FAILED( hr ))
2914 {
2915 WARN( "failed to commit changes %#lx\n", hr );
2917 }
2918 return r;
2919}
static UINT save_table(MSIDATABASE *db, const MSITABLE *t, UINT bytes_per_strref)
Definition: table.c:860
UINT msi_save_string_table(const string_table *st, IStorage *storage, UINT *bytes_per_strref)
Definition: string.c:564
const WCHAR * name

Referenced by MsiDatabaseCommit().

◆ msi_compare_file_versions()

int msi_compare_file_versions ( VS_FIXEDFILEINFO fi,
const WCHAR version 
)

Definition at line 1929 of file action.c.

1930{
1931 DWORD ms, ls;
1932
1934
1935 if (fi->dwFileVersionMS > ms) return 1;
1936 else if (fi->dwFileVersionMS < ms) return -1;
1937 else if (fi->dwFileVersionLS > ls) return 1;
1938 else if (fi->dwFileVersionLS < ls) return -1;
1939 return 0;
1940}
void msi_parse_version_string(LPCWSTR verStr, PDWORD ms, PDWORD ls)
Definition: appsearch.c:52
void ls(int argc, const char *argv[])
Definition: cmds.c:1136
static const WCHAR version[]
Definition: asmname.c:66
DWORD dwFileVersionLS
Definition: compat.h:903
DWORD dwFileVersionMS
Definition: compat.h:902

Referenced by ACTION_RemoveFiles(), calculate_file_cost(), and calculate_install_state().

◆ msi_compare_font_versions()

int msi_compare_font_versions ( const WCHAR ver1,
const WCHAR ver2 
)

Definition at line 1942 of file action.c.

1943{
1944 DWORD ms1, ms2;
1945
1946 msi_parse_version_string( ver1, &ms1, NULL );
1947 msi_parse_version_string( ver2, &ms2, NULL );
1948
1949 if (ms1 > ms2) return 1;
1950 else if (ms1 < ms2) return -1;
1951 return 0;
1952}

Referenced by calculate_file_cost(), and calculate_install_state().

◆ msi_create_assembly_enum()

IAssemblyEnum * msi_create_assembly_enum ( MSIPACKAGE package,
const WCHAR displayname 
)

Definition at line 244 of file assembly.c.

245{
246 HRESULT hr;
249 WCHAR *str;
250 DWORD len = 0;
251
252 if (!init_assembly_caches( package ) || !package->pCreateAssemblyNameObject || !package->pCreateAssemblyEnum)
253 return NULL;
254
255 hr = package->pCreateAssemblyNameObject( &name, displayname, CANOF_PARSE_DISPLAY_NAME, NULL );
256 if (FAILED( hr )) return NULL;
257
258 hr = IAssemblyName_GetName( name, &len, NULL );
259 if (hr != E_NOT_SUFFICIENT_BUFFER || !(str = malloc( len * sizeof(WCHAR) )))
260 {
261 IAssemblyName_Release( name );
262 return NULL;
263 }
264
265 hr = IAssemblyName_GetName( name, &len, str );
266 IAssemblyName_Release( name );
267 if (FAILED( hr ))
268 {
269 free( str );
270 return NULL;
271 }
272
273 hr = package->pCreateAssemblyNameObject( &name, str, 0, NULL );
274 free( str );
275 if (FAILED( hr )) return NULL;
276
277 hr = package->pCreateAssemblyEnum( &ret, NULL, name, ASM_CACHE_GAC, NULL );
278 IAssemblyName_Release( name );
279 if (FAILED( hr )) return NULL;
280
281 return ret;
282}
@ ASM_CACHE_GAC
Definition: fusion.idl:29
static BOOL init_assembly_caches(MSIPACKAGE *package)
Definition: assembly.c:54
#define E_NOT_SUFFICIENT_BUFFER
Definition: winerror.h:2345
@ CANOF_PARSE_DISPLAY_NAME
Definition: winsxs.idl:193

Referenced by msi_patch_assembly().

◆ msi_create_component_advertise_string()

WCHAR * msi_create_component_advertise_string ( MSIPACKAGE package,
MSICOMPONENT component,
const WCHAR feature 
)

Definition at line 5505 of file action.c.

5506{
5507 WCHAR productid_85[21], component_85[21], *ret;
5508 GUID clsid;
5509 DWORD sz;
5510
5511 /* > is used if there is a component GUID and < if not. */
5512
5513 productid_85[0] = 0;
5514 component_85[0] = 0;
5515 CLSIDFromString( package->ProductCode, &clsid );
5516
5517 encode_base85_guid( &clsid, productid_85 );
5518 if (component)
5519 {
5520 CLSIDFromString( component->ComponentId, &clsid );
5521 encode_base85_guid( &clsid, component_85 );
5522 }
5523
5524 TRACE("product=%s feature=%s component=%s\n", debugstr_w(productid_85), debugstr_w(feature),
5525 debugstr_w(component_85));
5526
5527 sz = 20 + lstrlenW( feature ) + 20 + 3;
5528 ret = calloc( 1, sz * sizeof(WCHAR) );
5529 if (ret) swprintf( ret, sz, L"%s%s%c%s", productid_85, feature, component ? '>' : '<', component_85 );
5530 return ret;
5531}

Referenced by ITERATE_PublishComponent(), and register_verb().

◆ msi_create_empty_local_file()

UINT msi_create_empty_local_file ( LPWSTR  path,
LPCWSTR  suffix 
)

Definition at line 1062 of file package.c.

1063{
1064 DWORD time, len, i, offset;
1065 HANDLE handle;
1066
1067 time = GetTickCount();
1069 lstrcatW( path, L"\\Installer\\" );
1071
1072 len = lstrlenW(path);
1073 for (i = 0; i < 0x10000; i++)
1074 {
1075 offset = swprintf( path + len, MAX_PATH - len, L"%x", (time + i) & 0xffff );
1076 memcpy( path + len + offset, suffix, (lstrlenW( suffix ) + 1) * sizeof(WCHAR) );
1080 {
1082 break;
1083 }
1086 return ERROR_FUNCTION_FAILED;
1087 }
1088
1089 return ERROR_SUCCESS;
1090}
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define CreateFileW
Definition: compat.h:741
BOOL WINAPI CreateDirectoryW(IN LPCWSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
Definition: dir.c:90
UINT WINAPI GetWindowsDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2352
DWORD WINAPI GetTickCount(VOID)
Definition: time.c:455
GLintptr offset
Definition: glext.h:5920
__u16 time
Definition: mkdosfs.c:8
#define CREATE_NEW
Definition: disk.h:69
#define GENERIC_WRITE
Definition: nt_native.h:90
#define ERROR_SHARING_VIOLATION
Definition: winerror.h:135
#define ERROR_FILE_EXISTS
Definition: winerror.h:165

Referenced by apply_patch_package(), and MSI_OpenPackageW().

◆ msi_create_file()

HANDLE msi_create_file ( MSIPACKAGE package,
const WCHAR filename,
DWORD  access,
DWORD  sharing,
DWORD  creation,
DWORD  flags 
)

Definition at line 60 of file files.c.

62{
67 return handle;
68}
GLbitfield flags
Definition: glext.h:7161
const char * filename
Definition: ioapi.h:137
static ULONG POBJECT_ATTRIBUTES PIO_STATUS_BLOCK ULONG sharing
Definition: pipe.c:70
static void msi_revert_fs_redirection(MSIPACKAGE *package)
Definition: msipriv.h:1076
static void msi_disable_fs_redirection(MSIPACKAGE *package)
Definition: msipriv.h:1072

Referenced by cabinet_copy_file(), HANDLE_CustomType21_22(), ITERATE_PublishIcon(), load_ttf_name_id(), msi_get_disk_file_size(), and msi_get_filehash().

◆ msi_create_full_path()

BOOL msi_create_full_path ( MSIPACKAGE package,
const WCHAR path 
)

Definition at line 211 of file files.c.

212{
213 BOOL ret = TRUE;
214 WCHAR *new_path;
215 int len;
216
217 if (!(new_path = malloc( (wcslen( path ) + 1) * sizeof(WCHAR) ))) return FALSE;
218 lstrcpyW( new_path, path );
219
220 while ((len = lstrlenW( new_path )) && new_path[len - 1] == '\\')
221 new_path[len - 1] = 0;
222
223 while (!create_directory( package, new_path ))
224 {
225 WCHAR *slash;
227 if (last_error == ERROR_ALREADY_EXISTS) break;
229 {
230 ret = FALSE;
231 break;
232 }
233 if (!(slash = wcsrchr( new_path, '\\' )))
234 {
235 ret = FALSE;
236 break;
237 }
238 len = slash - new_path;
239 new_path[len] = 0;
240 if (!msi_create_full_path( package, new_path ))
241 {
242 ret = FALSE;
243 break;
244 }
245 new_path[len] = '\\';
246 }
247 free( new_path );
248 return ret;
249}
static BOOL create_directory(MSIPACKAGE *package, const WCHAR *path)
Definition: files.c:88
#define ERROR_ALREADY_EXISTS
Definition: disk.h:80
#define ERROR_PATH_NOT_FOUND
Definition: winerror.h:106

Referenced by create_folder(), get_duplicate_filename(), get_link_file(), ITERATE_CreateFolders(), ITERATE_MoveFiles(), msi_build_icon_path(), and msi_create_full_path().

◆ msi_create_temp_file()

WCHAR * msi_create_temp_file ( MSIDATABASE db)

Definition at line 215 of file custom.c.

216{
217 WCHAR *ret;
218
219 if (!db->tempfolder)
220 {
221 WCHAR tmp[MAX_PATH];
222 DWORD len = ARRAY_SIZE( tmp );
223
224 if (msi_get_property( db, L"TempFolder", tmp, &len ) ||
226 {
227 GetTempPathW( MAX_PATH, tmp );
228 }
229 if (!(db->tempfolder = wcsdup( tmp ))) return NULL;
230 }
231
232 if ((ret = malloc( (wcslen( db->tempfolder ) + 20) * sizeof(WCHAR) )))
233 {
234 if (!GetTempFileNameW( db->tempfolder, L"msi", 0, ret ))
235 {
236 free( ret );
237 return NULL;
238 }
239 }
240
241 return ret;
242}
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
Definition: fileinfo.c:652
DWORD WINAPI GetTempPathW(IN DWORD count, OUT LPWSTR path)
Definition: path.c:2080
UINT WINAPI GetTempFileNameW(IN LPCWSTR lpPathName, IN LPCWSTR lpPrefixString, IN UINT uUnique, OUT LPWSTR lpTempFileName)
Definition: filename.c:84
UINT msi_get_property(MSIDATABASE *, LPCWSTR, LPWSTR, LPDWORD)
Definition: package.c:2250
#define FILE_ATTRIBUTE_DIRECTORY
Definition: nt_native.h:705
LPWSTR tempfolder
Definition: msipriv.h:114

Referenced by create_temp_binary(), HANDLE_CustomType7(), load_image(), patch_file(), and patchfiles_cb().

◆ MSI_CreatePackage()

MSIPACKAGE * MSI_CreatePackage ( MSIDATABASE db)

Definition at line 977 of file package.c.

978{
979 MSIPACKAGE *package;
980 WCHAR uilevel[11];
981 int len;
982 UINT r;
983
984 TRACE("%p\n", db);
985
986 package = alloc_package();
987 if (package)
988 {
989 msiobj_addref( &db->hdr );
990 package->db = db;
991
992 package->LastAction = NULL;
993 package->LastActionTemplate = NULL;
995 package->WordCount = 0;
996 package->PackagePath = wcsdup( db->path );
997
999 msi_clone_properties( package->db );
1001
1002 package->ProductCode = msi_dup_property( package->db, L"ProductCode" );
1003
1004 set_installer_properties( package );
1005
1006 package->ui_level = gUILevel;
1007 len = swprintf( uilevel, ARRAY_SIZE(uilevel), L"%u", gUILevel & INSTALLUILEVEL_MASK );
1008 msi_set_property( package->db, L"UILevel", uilevel, len );
1009
1010 r = msi_load_suminfo_properties( package );
1011 if (r != ERROR_SUCCESS)
1012 {
1013 msiobj_release( &package->hdr );
1014 return NULL;
1015 }
1016
1018 load_admin_properties( package );
1019
1020 package->log_file = INVALID_HANDLE_VALUE;
1021 package->script = SCRIPT_NONE;
1022 }
1023 return package;
1024}
static VOID set_installer_properties(MSIPACKAGE *package)
Definition: package.c:631
static UINT create_temp_property_table(MSIPACKAGE *package)
Definition: package.c:365
static UINT load_admin_properties(MSIPACKAGE *package)
Definition: package.c:949
INSTALLUILEVEL gUILevel
Definition: msi_main.c:41
@ msidbSumInfoSourceTypeAdminImage
Definition: msidefs.h:223
#define INSTALLUILEVEL_MASK
Definition: msipriv.h:60
UINT msi_clone_properties(MSIDATABASE *)
Definition: package.c:381
UINT msi_load_suminfo_properties(MSIPACKAGE *package)
Definition: suminfo.c:1267
void msi_adjust_privilege_properties(MSIPACKAGE *)
Definition: package.c:964
LPWSTR path
Definition: msipriv.h:112
UINT WordCount
Definition: msipriv.h:458
LPWSTR LastAction
Definition: msipriv.h:410
MSIOBJECTHDR hdr
Definition: msipriv.h:393
INSTALLUILEVEL ui_level
Definition: msipriv.h:452
HANDLE log_file
Definition: msipriv.h:414
LPWSTR LastActionTemplate
Definition: msipriv.h:411
UINT LastActionResult
Definition: msipriv.h:412

◆ MSI_CreateRecord()

MSIRECORD * MSI_CreateRecord ( UINT  cParams)

Definition at line 76 of file record.c.

77{
78 MSIRECORD *rec;
79
80 TRACE("%d\n", cParams);
81
82 if( cParams>65535 )
83 return NULL;
84
87 if( rec )
88 rec->count = cParams;
89 return rec;
90}
void * alloc_msiobject(UINT type, UINT size, msihandledestructor destroy)
Definition: handle.c:201
void MSI_CloseRecord(MSIOBJECTHDR *arg)
Definition: record.c:67
const char * fields[10]
Definition: parser.c:313
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255

Referenced by ACTION_AllocateRegistrySpace(), ACTION_ExecuteAction(), ACTION_MsiPublishAssemblies(), ACTION_MsiUnpublishAssemblies(), ACTION_ProcessComponents(), ACTION_PublishFeatures(), ACTION_PublishProduct(), ACTION_RegisterClassInfo(), ACTION_RegisterExtensionInfo(), ACTION_RegisterMIMEInfo(), ACTION_RegisterProduct(), ACTION_RegisterProgIdInfo(), ACTION_RegisterUser(), ACTION_RemoveFiles(), ACTION_ResolveSource(), ACTION_ShowDialog(), ACTION_UnregisterClassInfo(), ACTION_UnregisterExtensionInfo(), ACTION_UnregisterMIMEInfo(), ACTION_UnregisterProgIdInfo(), add_stream(), arrange_record(), change_media(), construct_record(), deformat_string(), dialog_create(), dialog_seltree_handler(), event_set_target_path(), file_update_ui(), get_property_row(), get_transform_record(), internal_ui_handler(), ITERATE_AppSearch(), ITERATE_CreateFolders(), ITERATE_DeleteService(), ITERATE_DuplicateFiles(), ITERATE_FindRelatedProducts(), ITERATE_InstallODBCDataSource(), ITERATE_InstallODBCDriver(), ITERATE_InstallODBCTranslator(), ITERATE_MoveFiles(), ITERATE_PublishComponent(), ITERATE_RegisterFonts(), ITERATE_RemoveDuplicateFiles(), ITERATE_RemoveEnvironmentString(), ITERATE_RemoveFiles(), ITERATE_RemoveFolders(), ITERATE_RemoveIniValuesOnInstall(), ITERATE_RemoveIniValuesOnUninstall(), ITERATE_RemoveODBCDataSource(), ITERATE_RemoveODBCDriver(), ITERATE_RemoveODBCTranslator(), ITERATE_RemoveRegistryValuesOnInstall(), ITERATE_RemoveRegistryValuesOnUninstall(), ITERATE_SelfRegModules(), ITERATE_SelfUnregModules(), ITERATE_StartService(), ITERATE_StopService(), ITERATE_UnpublishComponent(), ITERATE_UnregisterFonts(), ITERATE_WriteEnvironmentString(), ITERATE_WriteIniValues(), ITERATE_WriteRegistryValues(), msi_clone_properties(), MSI_CloneRecord(), msi_create_table(), MSI_DatabaseGetPrimaryKeys(), MSI_OpenPackageW(), msi_query_merge_record(), msi_set_property(), msi_ui_progress(), msi_view_get_row(), MSI_ViewGetColumnInfo(), MsiCreateRecord(), patch_add_media(), patch_offset_get_filepatches(), patch_offset_get_files(), patch_offset_modify_db(), patch_update_filepatch_sequence(), SELECT_set_row(), TABLE_add_column(), TABLE_drop(), TABLE_remove_column(), translate_record(), ui_actioninfo(), ui_actionstart(), unpublish_feature(), UPDATE_execute(), and WHERE_set_row().

◆ MSI_DatabaseApplyTransformW()

UINT MSI_DatabaseApplyTransformW ( MSIDATABASE db,
LPCWSTR  szTransformFile,
int  iErrorCond 
)

Referenced by msi_apply_transforms().

◆ MSI_DatabaseGetPrimaryKeys()

UINT MSI_DatabaseGetPrimaryKeys ( MSIDATABASE ,
LPCWSTR  ,
MSIRECORD **   
)

◆ MSI_DatabaseIsTablePersistent()

MSICONDITION MSI_DatabaseIsTablePersistent ( MSIDATABASE db,
LPCWSTR  table 
)

Definition at line 2921 of file table.c.

2922{
2923 MSITABLE *t;
2924 UINT r;
2925
2926 TRACE("%p %s\n", db, debugstr_w(table));
2927
2928 if (!table)
2929 return MSICONDITION_ERROR;
2930
2931 r = get_table( db, table, &t );
2932 if (r != ERROR_SUCCESS)
2933 return MSICONDITION_NONE;
2934
2935 return t->persistent;
2936}
static UINT get_table(MSIDATABASE *db, LPCWSTR name, MSITABLE **table_ret)
Definition: table.c:575
@ MSICONDITION_ERROR
Definition: msiquery.h:29
@ MSICONDITION_NONE
Definition: msiquery.h:28

Referenced by MsiDatabaseIsTablePersistentW().

◆ MSI_DatabaseOpenViewW()

UINT MSI_DatabaseOpenViewW ( MSIDATABASE ,
LPCWSTR  ,
MSIQUERY **   
)

Referenced by ACTION_BindImage(), ACTION_CostFinalize(), ACTION_CreateFolders(), ACTION_CreateShortcuts(), ACTION_DeleteServices(), ACTION_DuplicateFiles(), ACTION_FindRelatedProducts(), ACTION_InstallODBC(), ACTION_InstallServices(), ACTION_InstallValidate(), ACTION_LaunchConditions(), ACTION_MigrateFeatureStates(), ACTION_MoveFiles(), ACTION_ProcessUISequence(), ACTION_PublishComponents(), ACTION_RegisterFonts(), ACTION_RegisterTypeLibraries(), ACTION_RemoveDuplicateFiles(), ACTION_RemoveEnvironmentStrings(), ACTION_RemoveExistingProducts(), ACTION_RemoveFiles(), ACTION_RemoveFolders(), ACTION_RemoveIniValues(), ACTION_RemoveODBC(), ACTION_RemoveRegistryValues(), ACTION_RemoveShortcuts(), ACTION_SelfRegModules(), ACTION_SelfUnregModules(), ACTION_SetODBCFolders(), ACTION_StartServices(), ACTION_StopServices(), ACTION_UnpublishComponents(), ACTION_UnregisterFonts(), ACTION_UnregisterTypeLibraries(), ACTION_WriteEnvironmentStrings(), ACTION_WriteIniValues(), ACTION_WriteRegistryValues(), add_stream(), add_table_to_db(), create_temp_property_table(), gather_merge_data(), get_property(), get_property_row(), is_uninstallable(), load_all_classes(), load_all_extensions(), load_all_files(), load_all_folders(), load_all_media(), load_all_mimes(), load_all_patches(), load_all_progids(), load_all_verbs(), merge_diff_row(), msi_clone_properties(), msi_load_all_components(), msi_load_all_features(), msi_set_property(), msi_table_apply_transform(), patch_add_media(), patch_offset_get_filepatches(), patch_offset_get_files(), patch_offset_modify_db(), patch_set_media_source_prop(), patch_set_offsets(), patch_update_filepatch_sequence(), publish_icons(), TransformView_add_column(), TransformView_Create(), TransformView_create_table(), TransformView_delete_row(), TransformView_drop_table(), TransformView_insert_row(), TransformView_set_row(), ui_sequence_exists(), and unpublish_icons().

◆ msi_delete_file()

BOOL msi_delete_file ( MSIPACKAGE package,
const WCHAR filename 
)

Definition at line 79 of file files.c.

80{
81 BOOL ret;
85 return ret;
86}
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
Definition: delete.c:39

Referenced by ACTION_RemoveFiles(), cabinet_copy_file(), ITERATE_PublishIcon(), ITERATE_RemoveDuplicateFiles(), ITERATE_RemoveFiles(), ITERATE_RemoveShortcuts(), ITERATE_UnpublishIcon(), and patch_file().

◆ msi_destroy_assembly_caches()

void msi_destroy_assembly_caches ( MSIPACKAGE package)

Definition at line 89 of file assembly.c.

90{
91 UINT i;
92
93 if (package->cache_sxs)
94 {
95 IAssemblyCache_Release( package->cache_sxs );
96 package->cache_sxs = NULL;
97 }
98 for (i = 0; i < CLR_VERSION_MAX; i++)
99 {
100 if (package->cache_net[i])
101 {
102 IAssemblyCache_Release( package->cache_net[i] );
103 package->cache_net[i] = NULL;
104 }
105 }
106 package->pGetFileVersion = NULL;
107 package->pCreateAssemblyNameObject = NULL;
108 package->pCreateAssemblyEnum = NULL;
109 FreeLibrary( package->hfusion10 );
110 FreeLibrary( package->hfusion11 );
111 FreeLibrary( package->hfusion20 );
112 FreeLibrary( package->hfusion40 );
113 FreeLibrary( package->hmscoree );
114 package->hfusion10 = NULL;
115 package->hfusion11 = NULL;
116 package->hfusion20 = NULL;
117 package->hfusion40 = NULL;
118 package->hmscoree = NULL;
119}
#define FreeLibrary(x)
Definition: compat.h:748
WCHAR DWORD const WCHAR void IUnknown IAssemblyName void *IAssemblyCache * cache_net[CLR_VERSION_MAX]
Definition: msipriv.h:423
HMODULE hfusion20
Definition: msipriv.h:417
HMODULE hfusion11
Definition: msipriv.h:416
HMODULE hfusion10
Definition: msipriv.h:415
HMODULE hmscoree
Definition: msipriv.h:419
HMODULE hfusion40
Definition: msipriv.h:418
IAssemblyCache * cache_sxs
Definition: msipriv.h:424

Referenced by MSI_FreePackage().

◆ msi_destroy_stringtable()

VOID msi_destroy_stringtable ( string_table st)

Definition at line 107 of file string.c.

108{
109 UINT i;
110
111 for( i=0; i<st->maxcount; i++ )
112 {
113 if( st->strings[i].persistent_refcount ||
114 st->strings[i].nonpersistent_refcount )
115 free( st->strings[i].data );
116 }
117 free( st->strings );
118 free( st->sorted );
119 free( st );
120}
UINT * sorted
Definition: string.c:58
UINT maxcount
Definition: string.c:53

Referenced by MSI_CloseDatabase(), and msi_table_apply_transform().

◆ msi_dialog_check_messages()

void msi_dialog_check_messages ( HANDLE  handle)

Definition at line 3987 of file dialog.c.

3988{
3989 DWORD r;
3990
3991 /* in threads other than the UI thread, block */
3993 {
3994 if (!handle) return;
3996 {
3997 MSG msg;
3998 while (PeekMessageW( &msg, NULL, 0, 0, PM_REMOVE ))
3999 {
4002 }
4003 }
4004 return;
4005 }
4006
4007 /* there are two choices for the UI thread */
4008 while (1)
4009 {
4011
4012 if( !handle )
4013 break;
4014
4015 /*
4016 * block here until somebody creates a new dialog or
4017 * the handle we're waiting on becomes ready
4018 */
4020 if( r == WAIT_OBJECT_0 )
4021 break;
4022 }
4023}
#define msg(x)
Definition: auth_time.c:54
static void process_pending_messages(HWND hdlg)
Definition: dialog.c:3827
static DWORD uiThreadId
Definition: dialog.c:131
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
#define WAIT_OBJECT_0
Definition: winbase.h:432
BOOL WINAPI TranslateMessage(_In_ const MSG *)
#define QS_ALLINPUT
Definition: winuser.h:906
DWORD WINAPI MsgWaitForMultipleObjects(_In_ DWORD nCount, _In_reads_opt_(nCount) CONST HANDLE *pHandles, _In_ BOOL fWaitAll, _In_ DWORD dwMilliseconds, _In_ DWORD dwWakeMask)
DWORD WINAPI MsgWaitForMultipleObjectsEx(_In_ DWORD nCount, _In_reads_opt_(nCount) CONST HANDLE *pHandles, _In_ DWORD dwMilliseconds, _In_ DWORD dwWakeMask, _In_ DWORD dwFlags)
BOOL WINAPI PeekMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT, _In_ UINT)
#define PM_REMOVE
Definition: winuser.h:1199
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)

Referenced by ACTION_FinishCustomActions(), dialog_handle_event(), ITERATE_Actions(), msi_ui_progress(), register_dll(), wait_process_handle(), and wait_thread_handle().

◆ msi_dialog_destroy()

void msi_dialog_destroy ( msi_dialog dialog)

Definition at line 4055 of file dialog.c.

4056{
4057 struct font *font, *next;
4058
4060 {
4062 return;
4063 }
4064
4065 if( dialog->hwnd )
4066 {
4067 ShowWindow( dialog->hwnd, SW_HIDE );
4068 DestroyWindow( dialog->hwnd );
4069 }
4070
4071 /* unsubscribe events */
4072 event_cleanup_subscriptions( dialog->package, dialog->name );
4073
4074 /* destroy the list of controls */
4075 while( !list_empty( &dialog->controls ) )
4076 {
4077 struct control *t;
4078
4079 t = LIST_ENTRY( list_head( &dialog->controls ), struct control, entry );
4080 destroy_control( t );
4081 }
4082
4083 /* destroy the list of fonts */
4084 LIST_FOR_EACH_ENTRY_SAFE( font, next, &dialog->fonts, struct font, entry )
4085 {
4086 list_remove( &font->entry );
4087 DeleteObject( font->hfont );
4088 free( font );
4089 }
4090 free( dialog->default_font );
4091
4092 free( dialog->control_default );
4093 free( dialog->control_cancel );
4094 dialog->package = NULL;
4095 free( dialog );
4096}
#define WM_MSI_DIALOG_DESTROY
Definition: dialog.c:127
static void destroy_control(struct control *t)
Definition: dialog.c:355
static void event_cleanup_subscriptions(MSIPACKAGE *package, const WCHAR *dialog)
Definition: dialog.c:4041
static HWND hMsiHiddenWindow
Definition: dialog.c:132
pKey DeleteObject()
static HWND dialog
Definition: gui.c:33
Definition: mk_font.cpp:20
static unsigned __int64 next
Definition: rand_nt.c:6
Definition: dialog.c:52
LONG_PTR LPARAM
Definition: windef.h:208
#define SW_HIDE
Definition: winuser.h:771
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
BOOL WINAPI DestroyWindow(_In_ HWND)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by dialog_create(), event_do_dialog(), MSI_FreePackage(), MSI_PreviewDialogW(), and MSIHiddenWindowProc().

◆ msi_dialog_unregister_class()

void msi_dialog_unregister_class ( void  )

Definition at line 4098 of file dialog.c.

4099{
4102 UnregisterClassW( L"MsiDialogCloseClass", NULL );
4103 UnregisterClassW( L"MsiHiddenWindow", NULL );
4104 uiThreadId = 0;
4105}
BOOL WINAPI UnregisterClassW(_In_ LPCWSTR, HINSTANCE)

Referenced by DllMain().

◆ msi_disable_fs_redirection()

◆ msi_download_file()

UINT msi_download_file ( LPCWSTR  szUrl,
LPWSTR  filename 
)

Definition at line 1026 of file package.c.

1027{
1029 DWORD size = 0;
1030 HRESULT hr;
1031
1032 /* call will always fail, because size is 0,
1033 * but will return ERROR_FILE_NOT_FOUND first
1034 * if the file doesn't exist
1035 */
1036 GetUrlCacheEntryInfoW( szUrl, NULL, &size );
1038 {
1039 cache_entry = malloc( size );
1040 if ( !GetUrlCacheEntryInfoW( szUrl, cache_entry, &size ) )
1041 {
1043 free( cache_entry );
1044 return error;
1045 }
1046
1047 lstrcpyW( filename, cache_entry->lpszLocalFileName );
1048 free( cache_entry );
1049 return ERROR_SUCCESS;
1050 }
1051
1053 if ( FAILED(hr) )
1054 {
1055 WARN("failed to download %s to cache file\n", debugstr_w(szUrl));
1056 return ERROR_FUNCTION_FAILED;
1057 }
1058
1059 return ERROR_SUCCESS;
1060}
BOOL WINAPI GetUrlCacheEntryInfoW(LPCWSTR lpszUrl, LPINTERNET_CACHE_ENTRY_INFOW lpCacheEntryInfo, LPDWORD lpdwCacheEntryInfoBufferSize)
Definition: urlcache.c:2012
#define error(str)
Definition: mkdosfs.c:1605
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
Definition: wininet.h:2127
Definition: svc_auth_des.c:77
HRESULT WINAPI URLDownloadToCacheFileW(LPUNKNOWN lpUnkCaller, LPCWSTR szURL, LPWSTR szFileName, DWORD dwBufLength, DWORD dwReserved, LPBINDSTATUSCALLBACK pBSC)
Definition: umon.c:853

Referenced by MSI_OpenPackageW(), and ready_media().

◆ msi_dup_property()

◆ msi_dup_record_field()

WCHAR * msi_dup_record_field ( MSIRECORD row,
INT  index 
)

Definition at line 1002 of file record.c.

1003{
1004 DWORD sz = 0;
1005 WCHAR *str;
1006 UINT r;
1007
1008 if (MSI_RecordIsNull( rec, field )) return NULL;
1009
1010 r = MSI_RecordGetStringW( rec, field, NULL, &sz );
1011 if (r != ERROR_SUCCESS)
1012 return NULL;
1013
1014 sz++;
1015 str = malloc( sz * sizeof(WCHAR) );
1016 if (!str) return NULL;
1017 str[0] = 0;
1018 r = MSI_RecordGetStringW( rec, field, str, &sz );
1019 if (r != ERROR_SUCCESS)
1020 {
1021 ERR("failed to get string!\n");
1022 free( str );
1023 return NULL;
1024 }
1025 return str;
1026}
UINT MSI_RecordGetStringW(MSIRECORD *rec, UINT iField, WCHAR *szValue, DWORD *pcchValue)
Definition: record.c:438
BOOL MSI_RecordIsNull(MSIRECORD *rec, UINT iField)
Definition: record.c:321
Definition: parser.c:44

Referenced by get_ini_file_name(), get_key_value(), get_link_file(), get_signature(), internal_ui_handler(), iterate_load_verb(), ITERATE_RegisterFonts(), ITERATE_UnregisterFonts(), load_appid(), load_class(), load_component(), load_extension(), load_feature(), load_file(), load_folder(), load_mime(), load_progid(), MSI_FormatRecordW(), msi_get_error_message(), MSI_ProcessMessage(), patch_add_media(), patch_offset_get_filepatches(), patch_offset_get_files(), and search_ini().

◆ MSI_EvaluateConditionW()

◆ msi_event_cleanup_all_subscriptions()

void msi_event_cleanup_all_subscriptions ( MSIPACKAGE package)

Definition at line 4107 of file dialog.c.

4108{
4109 struct list *item, *next;
4110
4112 {
4113 struct subscriber *sub = LIST_ENTRY( item, struct subscriber, entry );
4114 list_remove( &sub->entry );
4115 free_subscriber( sub );
4116 }
4117}
static void free_subscriber(struct subscriber *sub)
Definition: dialog.c:4033
#define LIST_FOR_EACH_SAFE(cursor, cursor2, list)
Definition: list.h:192
struct list entry
Definition: dialog.c:104
struct list subscriptions
Definition: msipriv.h:461

Referenced by event_new_dialog(), and free_package_structures().

◆ msi_event_fire()

void msi_event_fire ( MSIPACKAGE package,
const WCHAR event,
MSIRECORD rec 
)

Definition at line 4417 of file dialog.c.

4418{
4419 struct subscriber *sub;
4420
4421 TRACE("firing event %s\n", debugstr_w(event));
4422
4423 LIST_FOR_EACH_ENTRY( sub, &package->subscriptions, struct subscriber, entry )
4424 {
4425 if (wcsicmp( sub->event, event )) continue;
4426 dialog_handle_event( sub->dialog, sub->control, sub->attribute, rec );
4427 }
4428}
#define wcsicmp
Definition: compat.h:15
static void dialog_handle_event(msi_dialog *dialog, const WCHAR *control, const WCHAR *attribute, MSIRECORD *rec)
Definition: dialog.c:555
struct _cl_event * event
Definition: glext.h:7739
WCHAR * event
Definition: dialog.c:106
WCHAR * attribute
Definition: dialog.c:108
WCHAR * control
Definition: dialog.c:107
msi_dialog * dialog
Definition: dialog.c:105

Referenced by dialog_seltree_handler(), event_set_target_path(), and internal_ui_handler().

◆ msi_export_suminfo()

UINT msi_export_suminfo ( MSIDATABASE db,
HANDLE  handle 
)

Definition at line 1195 of file suminfo.c.

1196{
1197 UINT i, r, num_rows;
1198 MSISUMMARYINFO *si;
1199
1200 r = msi_get_suminfo( db->storage, 0, &si );
1201 if (r != ERROR_SUCCESS)
1202 r = msi_get_db_suminfo( db, 0, &si );
1203 if (r != ERROR_SUCCESS)
1204 return r;
1205
1207 if (!num_rows)
1208 {
1209 msiobj_release( &si->hdr );
1210 return ERROR_FUNCTION_FAILED;
1211 }
1212
1213 for (i = 0; i < num_rows; i++)
1214 {
1215 r = save_prop( si, handle, i );
1216 if (r != ERROR_SUCCESS)
1217 {
1218 msiobj_release( &si->hdr );
1219 return r;
1220 }
1221 }
1222
1223 msiobj_release( &si->hdr );
1224 return ERROR_SUCCESS;
1225}
UINT msi_get_db_suminfo(MSIDATABASE *db, UINT uiUpdateCount, MSISUMMARYINFO **ret)
Definition: suminfo.c:492
static UINT save_prop(MSISUMMARYINFO *si, HANDLE handle, UINT row)
Definition: suminfo.c:1119
static UINT get_property_count(const PROPVARIANT *property)
Definition: suminfo.c:158
int JSAMPARRAY int int num_rows
Definition: jpegint.h:421
PROPVARIANT property[MSI_MAX_PROPS]
Definition: msipriv.h:489

Referenced by export_summaryinformation().

◆ msi_find_first_file()

HANDLE msi_find_first_file ( MSIPACKAGE package,
const WCHAR filename,
WIN32_FIND_DATAW data 
)

Definition at line 124 of file files.c.

125{
129 msi_revert_fs_redirection( package );
130 return handle;
131}
HANDLE WINAPI FindFirstFileW(IN LPCWSTR lpFileName, OUT LPWIN32_FIND_DATAW lpFindFileData)
Definition: find.c:320

Referenced by move_files_wildcard(), and recurse_search_directory().

◆ msi_find_next_file()

BOOL msi_find_next_file ( MSIPACKAGE package,
HANDLE  handle,
WIN32_FIND_DATAW data 
)

Definition at line 133 of file files.c.

134{
135 BOOL ret;
138 msi_revert_fs_redirection( package );
139 return ret;
140}
BOOL WINAPI FindNextFileW(IN HANDLE hFindFile, OUT LPWIN32_FIND_DATAW lpFindFileData)
Definition: find.c:382

Referenced by move_files_wildcard(), and recurse_search_directory().

◆ MSI_FormatRecordW()

UINT MSI_FormatRecordW ( MSIPACKAGE package,
MSIRECORD record,
LPWSTR  buffer,
LPDWORD  size 
)

Definition at line 838 of file format.c.

840{
841 WCHAR *format, *deformated = NULL;
843 DWORD len;
844 MSIRECORD *record_deformated;
845 int field_count, i;
846
847 TRACE("%p %p %p %p\n", package, record, buffer, size);
849
850 if (!(format = msi_dup_record_field( record, 0 )))
852
853 field_count = MSI_RecordGetFieldCount(record);
854 record_deformated = MSI_CloneRecord(record);
855 if (!record_deformated)
856 {
858 goto end;
859 }
860 MSI_RecordSetStringW(record_deformated, 0, format);
861 for (i = 1; i <= field_count; i++)
862 {
864 {
865 deformat_string_internal(package, MSI_RecordGetString(record, i), &deformated, &len, NULL);
866 MSI_RecordSetStringW(record_deformated, i, deformated);
867 free(deformated);
868 }
869 }
870
871 deformat_string_internal(package, format, &deformated, &len, record_deformated);
872 if (buffer)
873 {
874 if (*size>len)
875 {
876 memcpy(buffer,deformated,len*sizeof(WCHAR));
877 rc = ERROR_SUCCESS;
878 buffer[len] = 0;
879 }
880 else
881 {
882 if (*size > 0)
883 {
884 memcpy(buffer,deformated,(*size)*sizeof(WCHAR));
885 buffer[(*size)-1] = 0;
886 }
887 rc = ERROR_MORE_DATA;
888 }
889 }
890 else rc = ERROR_SUCCESS;
891
892 *size = len;
893 msiobj_release(&record_deformated->hdr);
894end:
895 free( format );
896 free( deformated );
897 return rc;
898}
#define ERROR_MORE_DATA
Definition: dderror.h:13
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
static DWORD deformat_string_internal(MSIPACKAGE *package, LPCWSTR ptr, WCHAR **data, DWORD *len, MSIRECORD *record)
Definition: format.c:756
static WCHAR * build_default_format(const MSIRECORD *record)
Definition: format.c:342
void dump_record(MSIRECORD *)
Definition: record.c:1028
WCHAR * msi_dup_record_field(MSIRECORD *row, INT index)
Definition: record.c:1002
UINT MSI_RecordGetFieldCount(const MSIRECORD *rec)
Definition: record.c:108
MSIRECORD * MSI_CloneRecord(MSIRECORD *)
Definition: record.c:921
Definition: format.c:58

Referenced by deformat_string(), MSI_ProcessMessageVerbatim(), MsiFormatRecordA(), and MsiFormatRecordW().

◆ msi_free_action_script()

void msi_free_action_script ( MSIPACKAGE package,
UINT  script 
)

Definition at line 137 of file package.c.

138{
139 UINT i;
140 for (i = 0; i < package->script_actions_count[script]; i++)
141 free( package->script_actions[script][i] );
142
143 free( package->script_actions[script] );
144 package->script_actions[script] = NULL;
145 package->script_actions_count[script] = 0;
146}
LPWSTR * script_actions[SCRIPT_MAX]
Definition: msipriv.h:433
int script_actions_count[SCRIPT_MAX]
Definition: msipriv.h:434

Referenced by execute_script(), and free_package_structures().

◆ msi_free_handle_table()

void msi_free_handle_table ( void  )

Definition at line 71 of file handle.c.

72{
78}
static unsigned int handle_table_size
Definition: handle.c:69
static CRITICAL_SECTION object_cs
Definition: handle.c:48
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)

Referenced by DllMain().

◆ msi_free_media_info()

void msi_free_media_info ( MSIMEDIAINFO mi)

Definition at line 649 of file media.c.

650{
651 free(mi->disk_prompt);
652 free(mi->cabinet);
653 free(mi->volume_label);
654 free(mi->last_volume);
655 free(mi);
656}

Referenced by ACTION_InstallFiles(), and ACTION_PatchFiles().

◆ msi_free_patchinfo()

void msi_free_patchinfo ( MSIPATCHINFO patch)

Definition at line 865 of file patch.c.

866{
867 free( patch->patchcode );
868 free( patch->products );
869 free( patch->transforms );
870 free( patch->filename );
871 free( patch->localfile );
872 free( patch );
873}
LPWSTR patchcode
Definition: msipriv.h:201
LPWSTR transforms
Definition: msipriv.h:203
LPWSTR products
Definition: msipriv.h:202
LPWSTR filename
Definition: msipriv.h:204

Referenced by apply_patch_package(), free_package_structures(), and msi_apply_registered_patch().

◆ msi_get_assembly_path()

WCHAR * msi_get_assembly_path ( MSIPACKAGE package,
const WCHAR displayname 
)

Definition at line 219 of file assembly.c.

220{
221 HRESULT hr;
224
225 if (!init_assembly_caches( package ) || !(cache = package->cache_net[CLR_VERSION_V40])) return NULL;
226
227 memset( &info, 0, sizeof(info) );
228 info.cbAssemblyInfo = sizeof(info);
229 hr = IAssemblyCache_QueryAssemblyInfo( cache, 0, displayname, &info );
230 if (hr != E_NOT_SUFFICIENT_BUFFER) return NULL;
231
232 if (!(info.pszCurrentAssemblyPathBuf = malloc( info.cchBuf * sizeof(WCHAR) ))) return NULL;
233
234 hr = IAssemblyCache_QueryAssemblyInfo( cache, 0, displayname, &info );
235 if (FAILED( hr ))
236 {
237 free( info.pszCurrentAssemblyPathBuf );
238 return NULL;
239 }
240 TRACE("returning %s\n", debugstr_w(info.pszCurrentAssemblyPathBuf));
241 return info.pszCurrentAssemblyPathBuf;
242}
#define memset(x, y, z)
Definition: compat.h:39
Definition: cache.c:49

Referenced by msi_patch_assembly().

◆ msi_get_command_line_option()

const WCHAR * msi_get_command_line_option ( const WCHAR cmd,
const WCHAR option,
UINT len 
)

Definition at line 273 of file action.c.

274{
275 DWORD opt_len = lstrlenW(option);
276
277 if (!cmd)
278 return NULL;
279
280 while (*cmd)
281 {
282 BOOL found = FALSE;
283
284 while (*cmd == ' ') cmd++;
285 if (!*cmd) break;
286
287 if(!wcsnicmp(cmd, option, opt_len))
288 found = TRUE;
289
290 cmd = wcschr( cmd, '=' );
291 if(!cmd) break;
292 cmd++;
293 while (*cmd == ' ') cmd++;
294 if (!*cmd) break;
295
296 *len = parse_prop( cmd, NULL, NULL);
297 if (found) return cmd;
298 cmd += *len;
299 }
300
301 return NULL;
302}
#define wcsnicmp
Definition: compat.h:14
static int parse_prop(const WCHAR *str, WCHAR *value, int *quotes)
Definition: action.c:108
Definition: ftp_var.h:139
Definition: getopt.h:109

Referenced by MsiInstallProductW().

◆ msi_get_component_action()

INSTALLSTATE msi_get_component_action ( MSIPACKAGE package,
MSICOMPONENT comp 
)

Definition at line 609 of file action.c.

610{
611 if (!comp->Enabled)
612 {
613 TRACE("component is disabled: %s\n", debugstr_w(comp->Component));
615 }
616 if (package->need_rollback) return comp->Installed;
617 if (comp->num_clients > 0 && comp->ActionRequest == INSTALLSTATE_ABSENT)
618 {
619 TRACE("%s has %u clients left\n", debugstr_w(comp->Component), comp->num_clients);
621 }
622 return comp->ActionRequest;
623}
unsigned char need_rollback
Definition: msipriv.h:471

Referenced by ACTION_MsiPublishAssemblies(), ACTION_MsiUnpublishAssemblies(), ACTION_PatchFiles(), ACTION_RemoveFiles(), calculate_install_state(), ITERATE_CreateFolders(), ITERATE_CreateShortcuts(), ITERATE_DeleteService(), ITERATE_DuplicateFiles(), ITERATE_InstallODBCDataSource(), ITERATE_InstallODBCDriver(), ITERATE_InstallODBCTranslator(), ITERATE_InstallService(), ITERATE_MoveFiles(), ITERATE_RegisterFonts(), ITERATE_RegisterTypeLibraries(), ITERATE_RemoveDuplicateFiles(), ITERATE_RemoveEnvironmentString(), ITERATE_RemoveFiles(), ITERATE_RemoveFolders(), ITERATE_RemoveIniValuesOnInstall(), ITERATE_RemoveIniValuesOnUninstall(), ITERATE_RemoveODBCDataSource(), ITERATE_RemoveODBCDriver(), ITERATE_RemoveODBCTranslator(), ITERATE_RemoveRegistryValuesOnInstall(), ITERATE_RemoveRegistryValuesOnUninstall(), ITERATE_RemoveShortcuts(), ITERATE_SelfRegModules(), ITERATE_SelfUnregModules(), ITERATE_StartService(), ITERATE_StopService(), ITERATE_UnregisterFonts(), ITERATE_UnregisterTypeLibraries(), ITERATE_WriteEnvironmentString(), ITERATE_WriteIniValues(), ITERATE_WriteRegistryValues(), and patchfiles_cb().

◆ msi_get_db_suminfo()

UINT msi_get_db_suminfo ( MSIDATABASE db,
UINT  uiUpdateCount,
MSISUMMARYINFO **  si 
)

Definition at line 492 of file suminfo.c.

493{
494 IStream *stm;
495 MSISUMMARYINFO *si;
496 UINT r;
497
498 if (!(si = create_suminfo( db->storage, uiUpdateCount ))) return ERROR_OUTOFMEMORY;
499
500 r = msi_get_stream( db, L"\5SummaryInformation", &stm );
501 if (r != ERROR_SUCCESS)
502 {
503 msiobj_release( &si->hdr );
504 return r;
505 }
506
507 r = load_summary_info( si, stm );
508 IStream_Release( stm );
509 if (r != ERROR_SUCCESS)
510 {
511 msiobj_release( &si->hdr );
512 return r;
513 }
514
515 *ret = si;
516 return ERROR_SUCCESS;
517}
static UINT load_summary_info(MSISUMMARYINFO *si, IStream *stm)
Definition: suminfo.c:256
UINT msi_get_stream(MSIDATABASE *, const WCHAR *, IStream **)
Definition: streams.c:499

Referenced by msi_export_suminfo(), msi_get_package_code(), msi_load_suminfo_properties(), MSI_OpenPackageW(), and MsiGetSummaryInformationW().

◆ msi_get_disk_file_size()

DWORD msi_get_disk_file_size ( MSIPACKAGE package,
const WCHAR filename 
)

Definition at line 199 of file files.c.

200{
201 DWORD size;
202 HANDLE file;
206 CloseHandle( file );
207 return size;
208}
#define OPEN_EXISTING
Definition: compat.h:775
#define GENERIC_READ
Definition: compat.h:135
#define FILE_SHARE_READ
Definition: compat.h:136
DWORD WINAPI GetFileSize(HANDLE hFile, LPDWORD lpFileSizeHigh)
Definition: fileinfo.c:331
HANDLE msi_create_file(MSIPACKAGE *package, const WCHAR *filename, DWORD access, DWORD sharing, DWORD creation, DWORD flags)
Definition: files.c:60
#define INVALID_FILE_SIZE
Definition: winbase.h:574

Referenced by calculate_file_cost(), and calculate_install_state().

◆ msi_get_disk_file_version()

VS_FIXEDFILEINFO * msi_get_disk_file_version ( MSIPACKAGE package,
const WCHAR filename 
)

Definition at line 170 of file files.c.

171{
173 DWORD version_size;
174 UINT size;
175 void *version;
176
177 if (!(version_size = msi_get_file_version_info( package, filename, 0, NULL ))) return NULL;
178 if (!(version = malloc( version_size ))) return NULL;
179
180 msi_get_file_version_info( package, filename, version_size, version );
181
182 if (!VerQueryValueW( version, L"\\", (void **)&ptr, &size ))
183 {
184 free( version );
185 return NULL;
186 }
187
188 if (!(ret = malloc( size )))
189 {
190 free( version );
191 return NULL;
192 }
193
194 memcpy( ret, ptr, size );
195 free( version );
196 return ret;
197}
DWORD msi_get_file_version_info(MSIPACKAGE *package, const WCHAR *path, DWORD buflen, BYTE *buffer)
Definition: files.c:160
BOOL WINAPI VerQueryValueW(LPCVOID pBlock, LPCWSTR lpSubBlock, LPVOID *lplpBuffer, PUINT puLen)
Definition: version.c:1057

Referenced by ACTION_RemoveFiles(), calculate_file_cost(), and calculate_install_state().

◆ msi_get_error_message()

WCHAR * msi_get_error_message ( MSIDATABASE db,
int  error 
)

Definition at line 1818 of file package.c.

1819{
1821 LPWSTR ret = NULL;
1822
1823 if ((record = MSI_QueryGetRecord(db, L"SELECT `Message` FROM `Error` WHERE `Error` = %d", error)))
1824 {
1826 msiobj_release(&record->hdr);
1827 }
1828 else if (error < 2000)
1829 {
1831 if (len)
1832 {
1833 ret = malloc((len + 1) * sizeof(WCHAR));
1835 }
1836 else
1837 ret = NULL;
1838 }
1839
1840 return ret;
1841}
HINSTANCE msi_hInstance
Definition: msi_main.c:51
#define IDS_ERROR_BASE
Definition: resource.h:33
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)

Referenced by ACTION_ExecuteAction(), MSI_OpenPackageW(), MSI_ProcessMessage(), and ui_actioninfo().

◆ msi_get_feature_action()

INSTALLSTATE msi_get_feature_action ( MSIPACKAGE package,
MSIFEATURE feature 
)

◆ msi_get_file_attributes()

DWORD msi_get_file_attributes ( MSIPACKAGE package,
const WCHAR path 
)

◆ msi_get_file_version_info()

DWORD msi_get_file_version_info ( MSIPACKAGE package,
const WCHAR path,
DWORD  buflen,
BYTE buffer 
)

Definition at line 160 of file files.c.

161{
164 if (buffer) size = GetFileVersionInfoW( path, 0, buflen, buffer );
166 msi_revert_fs_redirection( package );
167 return size;
168}
BOOL WINAPI GetFileVersionInfoW(LPCWSTR filename, DWORD handle, DWORD datasize, LPVOID data)
Definition: version.c:845
DWORD WINAPI GetFileVersionInfoSizeW(LPCWSTR filename, LPDWORD handle)
Definition: version.c:611

Referenced by file_version_matches(), msi_get_disk_file_version(), and search_file().

◆ msi_get_filehash()

UINT msi_get_filehash ( MSIPACKAGE package,
const WCHAR path,
MSIFILEHASHINFO hash 
)

Definition at line 4018 of file msi.c.

4019{
4021 void *p;
4022 DWORD length;
4024
4025 if (package)
4027 else
4030 {
4031 WARN( "can't open file %lu\n", GetLastError() );
4032 return ERROR_FILE_NOT_FOUND;
4033 }
4034 if ((length = GetFileSize( handle, NULL )))
4035 {
4037 {
4038 if ((p = MapViewOfFile( mapping, FILE_MAP_READ, 0, 0, length )))
4039 {
4040 struct md5_ctx ctx;
4041
4042 MD5Init( &ctx );
4043 MD5Update( &ctx, p, length );
4044 MD5Final( &ctx );
4045 UnmapViewOfFile( p );
4046
4047 memcpy( hash->dwData, ctx.digest, sizeof(hash->dwData) );
4048 r = ERROR_SUCCESS;
4049 }
4051 }
4052 }
4053 else
4054 {
4055 /* Empty file -> set hash to 0 */
4056 memset( hash->dwData, 0, sizeof(hash->dwData) );
4057 r = ERROR_SUCCESS;
4058 }
4059
4061 return r;
4062}
#define PAGE_READONLY
Definition: compat.h:138
#define UnmapViewOfFile
Definition: compat.h:746
#define CreateFileMappingW(a, b, c, d, e, f)
Definition: compat.h:744
#define FILE_MAP_READ
Definition: compat.h:776
#define MapViewOfFile
Definition: compat.h:745
void WINAPI MD5Update(struct md5_ctx *, const unsigned char *, unsigned int)
void WINAPI MD5Init(struct md5_ctx *)
void WINAPI MD5Final(struct md5_ctx *)
GLuint GLsizei GLsizei * length
Definition: glext.h:6040
GLenum GLenum GLenum GLenum mapping
Definition: glext.h:9031
#define FILE_SHARE_DELETE
Definition: nt_native.h:682
Definition: _hash_fun.h:40
Definition: msi.c:4007

Referenced by file_hash_matches(), and MsiGetFileHashW().

◆ msi_get_font_file_version()

WCHAR * msi_get_font_file_version ( MSIPACKAGE package,
const WCHAR filename 
)

Definition at line 189 of file font.c.

190{
191 WCHAR *version, *p, *q, *ret = NULL;
192
194 {
195 int len, major = 0, minor = 0;
196 if ((p = wcschr( version, ';' ))) *p = 0;
197 p = version;
198 while (*p && !iswdigit( *p )) p++;
199 if ((q = wcschr( p, '.' )))
200 {
201 major = wcstol( p, NULL, 10 );
202 p = ++q;
203 while (*q && iswdigit( *q )) q++;
204 if (!*q || *q == ' ') minor = wcstol( p, NULL, 10 );
205 else major = 0;
206 }
207 len = lstrlenW( L"%u.%u.0.0" ) + 20;
208 ret = malloc( len * sizeof(WCHAR) );
209 swprintf( ret, len, L"%u.%u.0.0", major, minor );
210 free( version );
211 }
212 return ret;
213}
static WCHAR * load_ttf_name_id(MSIPACKAGE *package, const WCHAR *filename, DWORD id)
Definition: font.c:76
#define NAME_ID_VERSION
Definition: font.c:57
GLdouble GLdouble GLdouble GLdouble q
Definition: gl.h:2063
#define iswdigit(_c)
Definition: ctype.h:667
_Check_return_ long __cdecl wcstol(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)
#define minor(rdev)
Definition: propsheet.cpp:929
#define major(rdev)
Definition: propsheet.cpp:928

Referenced by calculate_file_cost(), calculate_install_state(), and MsiGetFileVersionW().

◆ msi_get_loaded_component()

MSICOMPONENT * msi_get_loaded_component ( MSIPACKAGE package,
const WCHAR Component 
)

Definition at line 550 of file action.c.

551{
552 MSICOMPONENT *comp;
553
555 {
556 if (!wcscmp( Component, comp->Component )) return comp;
557 }
558 return NULL;
559}
_In_ ULONG Component
Definition: potypes.h:496

Referenced by deformat_component(), iterate_all_classes(), iterate_all_extensions(), ITERATE_CreateFolders(), ITERATE_CreateShortcuts(), ITERATE_DeleteService(), ITERATE_DuplicateFiles(), ITERATE_InstallODBCDataSource(), ITERATE_InstallODBCDriver(), ITERATE_InstallODBCTranslator(), ITERATE_InstallService(), iterate_load_featurecomponents(), ITERATE_MoveFiles(), iterate_patched_component(), ITERATE_PublishComponent(), ITERATE_RegisterFonts(), ITERATE_RegisterTypeLibraries(), ITERATE_RemoveDuplicateFiles(), ITERATE_RemoveEnvironmentString(), ITERATE_RemoveFiles(), ITERATE_RemoveFolders(), ITERATE_RemoveIniValuesOnInstall(), ITERATE_RemoveIniValuesOnUninstall(), ITERATE_RemoveODBCDataSource(), ITERATE_RemoveODBCDriver(), ITERATE_RemoveODBCTranslator(), ITERATE_RemoveRegistryValuesOnInstall(), ITERATE_RemoveRegistryValuesOnUninstall(), ITERATE_RemoveShortcuts(), ITERATE_StartService(), ITERATE_StopService(), ITERATE_UnpublishComponent(), ITERATE_UnregisterFonts(), ITERATE_UnregisterTypeLibraries(), ITERATE_WriteEnvironmentString(), ITERATE_WriteIniValues(), ITERATE_WriteRegistryValues(), load_class(), load_extension(), load_file(), MSI_GetComponentStateW(), MSI_SetComponentStateW(), and MsiEnumComponentCostsW().

◆ msi_get_loaded_feature()

◆ msi_get_loaded_file()

◆ msi_get_loaded_folder()

MSIFOLDER * msi_get_loaded_folder ( MSIPACKAGE package,
const WCHAR dir 
)

◆ msi_get_package_code()

WCHAR * msi_get_package_code ( MSIDATABASE db)

Definition at line 1277 of file package.c.

1278{
1279 WCHAR *ret;
1280 MSISUMMARYINFO *si;
1281 UINT r;
1282
1283 r = msi_get_suminfo( db->storage, 0, &si );
1284 if (r != ERROR_SUCCESS)
1285 {
1286 r = msi_get_db_suminfo( db, 0, &si );
1287 if (r != ERROR_SUCCESS)
1288 {
1289 WARN("failed to load summary info %u\n", r);
1290 return NULL;
1291 }
1292 }
1294 msiobj_release( &si->hdr );
1295 return ret;
1296}
#define PID_REVNUMBER
Definition: suminfo.c:51
UINT msi_get_db_suminfo(MSIDATABASE *db, UINT uiUpdateCount, MSISUMMARYINFO **si)
Definition: suminfo.c:492

Referenced by ACTION_PublishProduct(), and publish_product_properties().

◆ msi_get_property()

UINT msi_get_property ( MSIDATABASE db,
LPCWSTR  szName,
LPWSTR  szValueBuf,
LPDWORD  pchValueBuf 
)

Definition at line 2250 of file package.c.

2252{
2253 MSIRECORD *row;
2255
2256 TRACE("%p %s %p %p\n", db, debugstr_w(szName), szValueBuf, pchValueBuf);
2257
2258 row = get_property_row( db, szName );
2259
2260 if (*pchValueBuf > 0)
2261 szValueBuf[0] = 0;
2262
2263 if (row)
2264 {
2265 rc = MSI_RecordGetStringW(row, 1, szValueBuf, pchValueBuf);
2266 msiobj_release(&row->hdr);
2267 }
2268
2269 if (rc == ERROR_SUCCESS)
2270 TRACE("returning %s for property %s\n", debugstr_wn(szValueBuf, *pchValueBuf),
2272 else if (rc == ERROR_MORE_DATA)
2273 TRACE( "need %lu sized buffer for %s\n", *pchValueBuf, debugstr_w(szName) );
2274 else
2275 {
2276 *pchValueBuf = 0;
2277 TRACE("property %s not found\n", debugstr_w(szName));
2278 }
2279
2280 return rc;
2281}
static MSIRECORD * get_property_row(MSIDATABASE *db, const WCHAR *name)
Definition: package.c:2183
UINT MSI_RecordGetStringW(MSIRECORD *, UINT, LPWSTR, LPDWORD)
static const WCHAR szName[]
Definition: powrprof.c:45

Referenced by create_temp_dir(), deformat_property(), dialog_get_checkbox_state(), msi_create_temp_file(), msi_dup_property(), MSI_InstallPackage(), and msi_set_property().

◆ msi_get_property_int()

◆ msi_get_remote()

◆ msi_get_stream()

UINT msi_get_stream ( MSIDATABASE db,
const WCHAR name,
IStream **  ret 
)

Definition at line 499 of file streams.c.

500{
502 WCHAR *encname;
503 HRESULT hr;
504 UINT r;
505
506 if ((stream = find_stream( db, name )))
507 {
509
510 pos.QuadPart = 0;
511 hr = IStream_Seek( stream->stream, pos, STREAM_SEEK_SET, NULL );
512 if (FAILED( hr ))
514
515 *ret = stream->stream;
516 IStream_AddRef( *ret );
517 return ERROR_SUCCESS;
518 }
519
520 if (!(encname = encode_streamname( FALSE, name )))
521 return ERROR_OUTOFMEMORY;
522
523 hr = open_stream( db, encname, ret );
524 free( encname );
525 if (FAILED( hr ))
527
528 r = append_stream( db, name, *ret );
529 if (r != ERROR_SUCCESS)
530 {
531 IStream_Release( *ret );
532 return r;
533 }
534
535 IStream_AddRef( *ret );
536 return ERROR_SUCCESS;
537}
#define open_stream
Definition: intsym.h:251
static UINT append_stream(MSIDATABASE *db, const WCHAR *name, IStream *stream)
Definition: streams.c:430
static MSISTREAM * find_stream(MSIDATABASE *db, const WCHAR *name)
Definition: streams.c:415

Referenced by cabinet_open_stream(), msi_get_db_suminfo(), and TABLE_fetch_stream().

◆ msi_get_string_table_codepage()

UINT msi_get_string_table_codepage ( const string_table st)

Definition at line 671 of file string.c.

672{
673 return st->codepage;
674}
UINT codepage
Definition: string.c:55

Referenced by ACTION_ExecuteAction(), MSI_DatabaseExport(), and MSI_OpenPackageW().

◆ msi_get_suminfo()

UINT msi_get_suminfo ( IStorage stg,
UINT  uiUpdateCount,
MSISUMMARYINFO **  si 
)

Definition at line 462 of file suminfo.c.

463{
464 IStream *stm;
465 MSISUMMARYINFO *si;
466 HRESULT hr;
467 UINT r;
468
469 TRACE("%p, %u\n", stg, uiUpdateCount);
470
471 if (!(si = create_suminfo( stg, uiUpdateCount ))) return ERROR_OUTOFMEMORY;
472
473 hr = IStorage_OpenStream( si->storage, L"\5SummaryInformation", 0, STGM_READ|STGM_SHARE_EXCLUSIVE, 0, &stm );
474 if (FAILED( hr ))
475 {
476 msiobj_release( &si->hdr );
478 }
479
480 r = load_summary_info( si, stm );
481 IStream_Release( stm );
482 if (r != ERROR_SUCCESS)
483 {
484 msiobj_release( &si->hdr );
485 return r;
486 }
487
488 *ret = si;
489 return ERROR_SUCCESS;
490}
#define STGM_READ
Definition: objbase.h:917
IStorage * storage
Definition: msipriv.h:487

Referenced by apply_patch_package(), check_transform_applicable(), msi_add_suminfo(), MSI_ApplicablePatchW(), msi_apply_registered_patch(), msi_export_suminfo(), msi_get_package_code(), msi_get_suminfo_product(), msi_load_suminfo_properties(), MSI_OpenPackageW(), and MsiGetSummaryInformationW().

◆ msi_get_suminfo_product()

WCHAR * msi_get_suminfo_product ( IStorage stg)

Definition at line 725 of file suminfo.c.

726{
727 MSISUMMARYINFO *si;
728 LPWSTR prod;
729 UINT r;
730
731 r = msi_get_suminfo( stg, 0, &si );
732 if (r != ERROR_SUCCESS)
733 {
734 ERR("no summary information!\n");
735 return NULL;
736 }
738 msiobj_release( &si->hdr );
739 return prod;
740}
LPWSTR msi_suminfo_dup_string(MSISUMMARYINFO *si, UINT uiProperty)
Definition: suminfo.c:701

Referenced by check_transform_applicable().

◆ msi_get_target_folder()

const WCHAR * msi_get_target_folder ( MSIPACKAGE package,
const WCHAR name 
)

Definition at line 232 of file install.c.

233{
235
236 if (!folder) return NULL;
237 if (!folder->ResolvedTarget)
238 {
240 while (parent->Parent && wcscmp( parent->Parent, parent->Directory ))
241 {
242 parent = msi_get_loaded_folder( package, parent->Parent );
243 }
244 msi_resolve_target_folder( package, parent->Directory, TRUE );
245 }
246 return folder->ResolvedTarget;
247}
void msi_resolve_target_folder(MSIPACKAGE *package, const WCHAR *name, BOOL load_prop)
Definition: action.c:2176
r parent
Definition: btrfs.c:3010

Referenced by create_folder(), deformat_component(), get_duplicate_filename(), get_ini_file_name(), get_link_file(), HANDLE_CustomType34(), ITERATE_CreateFolders(), ITERATE_CreateShortcuts(), ITERATE_InstallODBCDriver(), ITERATE_RegisterTypeLibraries(), ITERATE_RemoveFolders(), MSI_SetTargetPathW(), MsiGetTargetPathA(), MsiGetTargetPathW(), resolve_keypath(), and set_target_path().

◆ msi_get_temp_file_name()

BOOL msi_get_temp_file_name ( MSIPACKAGE package,
const WCHAR tmp_path,
const WCHAR prefix,
WCHAR tmp_filename 
)

Definition at line 51 of file files.c.

52{
53 BOOL ret;
55 ret = GetTempFileNameW( tmp_path, prefix, 0, tmp_filename );
57 return ret;
58}

Referenced by cabinet_copy_file().

◆ MSI_GetComponentStateW()

UINT MSI_GetComponentStateW ( MSIPACKAGE package,
LPCWSTR  szComponent,
INSTALLSTATE piInstalled,
INSTALLSTATE piAction 
)

Definition at line 1427 of file install.c.

1429{
1430 MSICOMPONENT *comp;
1431
1432 TRACE("%p %s %p %p\n", package, debugstr_w(szComponent),
1433 piInstalled, piAction);
1434
1435 comp = msi_get_loaded_component(package,szComponent);
1436 if (!comp)
1438
1439 if (piInstalled)
1440 {
1441 if (comp->Enabled)
1442 *piInstalled = comp->Installed;
1443 else
1444 *piInstalled = INSTALLSTATE_UNKNOWN;
1445 }
1446
1447 if (piAction)
1448 {
1449 if (comp->Enabled)
1450 *piAction = comp->Action;
1451 else
1452 *piAction = INSTALLSTATE_UNKNOWN;
1453 }
1454
1455 TRACE("states (%i, %i)\n", comp->Installed, comp->Action );
1456 return ERROR_SUCCESS;
1457}
MSICOMPONENT * msi_get_loaded_component(MSIPACKAGE *package, const WCHAR *Component)
Definition: action.c:550
#define ERROR_UNKNOWN_COMPONENT
Definition: winerror.h:965

Referenced by MsiGetComponentStateW().

◆ MSI_GetFeatureCost()

UINT MSI_GetFeatureCost ( MSIPACKAGE package,
MSIFEATURE feature,
MSICOSTTREE  tree,
INSTALLSTATE  state,
LPINT  cost 
)

Definition at line 1155 of file install.c.

1157{
1158 TRACE("%s, %u, %d, %p\n", debugstr_w(feature->Feature), tree, state, cost);
1159
1160 *cost = 0;
1161 switch (tree)
1162 {
1164 {
1166
1168 {
1169 if (child->ActionRequest == state)
1170 *cost += feature_cost( child );
1171 }
1172 break;
1173 }
1175 {
1176 const WCHAR *feature_parent = feature->Feature_Parent;
1177 for (;;)
1178 {
1179 MSIFEATURE *parent = msi_get_loaded_feature( package, feature_parent );
1180 if (!parent)
1181 break;
1182
1183 if (parent->ActionRequest == state)
1184 *cost += feature_cost( parent );
1185
1186 feature_parent = parent->Feature_Parent;
1187 }
1188 break;
1189 }
1191 if (feature->ActionRequest == state)
1192 *cost = feature_cost( feature );
1193 break;
1194
1195 default:
1196 WARN("unhandled cost tree %u\n", tree);
1197 break;
1198 }
1199
1200 return ERROR_SUCCESS;
1201}
static int state
Definition: maze.c:121
MSIFEATURE * msi_get_loaded_feature(MSIPACKAGE *package, const WCHAR *Feature)
Definition: action.c:561
static INT feature_cost(MSIFEATURE *feature)
Definition: install.c:1143
static HWND child
Definition: cursoricon.c:298
@ MSICOSTTREE_PARENTS
Definition: msiquery.h:44
@ MSICOSTTREE_CHILDREN
Definition: msiquery.h:43
@ MSICOSTTREE_SELFONLY
Definition: msiquery.h:42

Referenced by MsiGetFeatureCostW(), and vcl_get_cost().

◆ MSI_GetFeatureStateW()

UINT MSI_GetFeatureStateW ( MSIPACKAGE package,
LPCWSTR  szFeature,
INSTALLSTATE piInstalled,
INSTALLSTATE piAction 
)

Definition at line 1065 of file install.c.

1067{
1069
1070 feature = msi_get_loaded_feature(package,szFeature);
1071 if (!feature)
1072 return ERROR_UNKNOWN_FEATURE;
1073
1074 if (piInstalled)
1075 *piInstalled = feature->Installed;
1076
1077 if (piAction)
1078 *piAction = feature->ActionRequest;
1079
1080 TRACE("returning %i %i\n", feature->Installed, feature->ActionRequest);
1081
1082 return ERROR_SUCCESS;
1083}
#define ERROR_UNKNOWN_FEATURE
Definition: winerror.h:964

Referenced by MsiGetFeatureStateW().

◆ msi_init_string_table()

HRESULT msi_init_string_table ( IStorage stg)

Definition at line 460 of file string.c.

461{
462 USHORT zero[2] = { 0, 0 };
463 UINT ret;
464
465 /* create the StringPool stream... add the zero string to it*/
466 ret = write_stream_data(stg, L"_StringPool", zero, sizeof zero, TRUE);
467 if (ret != ERROR_SUCCESS)
468 return E_FAIL;
469
470 /* create the StringData stream... make it zero length */
471 ret = write_stream_data(stg, L"_StringData", NULL, 0, TRUE);
472 if (ret != ERROR_SUCCESS)
473 return E_FAIL;
474
475 return S_OK;
476}
#define E_FAIL
Definition: ddrawi.h:102
UINT write_stream_data(IStorage *stg, LPCWSTR stname, LPCVOID data, UINT sz, BOOL bTable)
Definition: table.c:298
unsigned short USHORT
Definition: pedump.c:61
int zero
Definition: sehframes.cpp:29

Referenced by db_initialize().

◆ msi_install_assembly()

UINT msi_install_assembly ( MSIPACKAGE package,
MSICOMPONENT comp 
)

Definition at line 356 of file assembly.c.

357{
358 HRESULT hr;
359 const WCHAR *manifest;
363
364 if (!init_assembly_caches( package )) return ERROR_FUNCTION_FAILED;
365
366 if (comp->assembly->feature)
367 feature = msi_get_loaded_feature( package, comp->assembly->feature );
368
369 if (assembly->application)
370 {
371 if (feature) feature->Action = INSTALLSTATE_LOCAL;
372 return ERROR_SUCCESS;
373 }
374 if (assembly->attributes == msidbAssemblyAttributesWin32)
375 {
376 if (!assembly->manifest)
377 {
378 WARN("no manifest\n");
380 }
382 cache = package->cache_sxs;
383 }
384 else
385 {
386 manifest = msi_get_loaded_file( package, comp->KeyPath )->TargetPath;
387 cache = package->cache_net[get_clr_version( package, manifest )];
388 if (!cache) return ERROR_SUCCESS;
389 }
390 TRACE("installing assembly %s\n", debugstr_w(manifest));
391
392 hr = IAssemblyCache_InstallAssembly( cache, 0, manifest, NULL );
393 if (hr != S_OK)
394 {
395 ERR( "failed to install assembly %s (%#lx)\n", debugstr_w(manifest), hr );
397 }
398 if (feature) feature->Action = INSTALLSTATE_LOCAL;
399 return ERROR_SUCCESS;
400}
static enum clr_version get_clr_version(MSIPACKAGE *package, const WCHAR *filename)
Definition: assembly.c:331
struct file_info manifest
Definition: actctx.c:527
LPWSTR feature
Definition: msipriv.h:512
LPWSTR TargetPath
Definition: msipriv.h:617
static const CHAR manifest[]
Definition: v6util.h:41

Referenced by ACTION_InstallFinalize().

◆ MSI_InstallPackage()

UINT MSI_InstallPackage ( MSIPACKAGE package,
LPCWSTR  szPackagePath,
LPCWSTR  szCommandLine 
)

Definition at line 7740 of file action.c.

7742{
7743 WCHAR *reinstall = NULL, *productcode, *action;
7744 struct dummy_thread thread_info = {NULL, NULL, NULL};
7745 UINT rc;
7746 DWORD len = 0;
7747
7748 if (szPackagePath)
7749 {
7750 LPWSTR p, dir;
7751 LPCWSTR file;
7752
7753 dir = wcsdup(szPackagePath);
7754 p = wcsrchr(dir, '\\');
7755 if (p)
7756 {
7757 *(++p) = 0;
7758 file = szPackagePath + (p - dir);
7759 }
7760 else
7761 {
7762 free(dir);
7763 dir = malloc(MAX_PATH * sizeof(WCHAR));
7765 lstrcatW(dir, L"\\");
7766 file = szPackagePath;
7767 }
7768
7769 free(package->PackagePath);
7770 package->PackagePath = malloc((wcslen(dir) + wcslen(file) + 1) * sizeof(WCHAR));
7771 if (!package->PackagePath)
7772 {
7773 free(dir);
7774 return ERROR_OUTOFMEMORY;
7775 }
7776
7777 lstrcpyW(package->PackagePath, dir);
7778 lstrcatW(package->PackagePath, file);
7779 free(dir);
7780
7782 }
7783
7784 rc = msi_parse_command_line( package, szCommandLine, FALSE );
7785 if (rc != ERROR_SUCCESS)
7786 return rc;
7787
7788 msi_apply_transforms( package );
7789 msi_apply_patches( package );
7790
7791 if (msi_get_property( package->db, L"ACTION", NULL, &len ))
7792 msi_set_property( package->db, L"ACTION", L"INSTALL", -1 );
7793 action = msi_dup_property( package->db, L"ACTION" );
7795
7796 msi_set_original_database_property( package->db, szPackagePath );
7797 msi_parse_command_line( package, szCommandLine, FALSE );
7799 msi_set_context( package );
7800
7802
7803 productcode = msi_dup_property( package->db, L"ProductCode" );
7804 if (wcsicmp( productcode, package->ProductCode ))
7805 {
7806 TRACE( "product code changed %s -> %s\n", debugstr_w(package->ProductCode), debugstr_w(productcode) );
7807 free( package->ProductCode );
7808 package->ProductCode = productcode;
7809 }
7810 else free( productcode );
7811
7812 if (msi_get_property_int( package->db, L"DISABLEROLLBACK", 0 ))
7813 {
7814 TRACE("disabling rollback\n");
7815 msi_set_property( package->db, L"RollbackDisabled", L"1", -1 );
7816 }
7817
7818 rc = ACTION_PerformAction(package, action);
7819
7820 /* process the ending type action */
7821 if (rc == ERROR_SUCCESS)
7822 ACTION_PerformActionSequence(package, -1);
7823 else if (rc == ERROR_INSTALL_USEREXIT)
7824 ACTION_PerformActionSequence(package, -2);
7825 else if (rc == ERROR_INSTALL_SUSPEND)
7826 ACTION_PerformActionSequence(package, -4);
7827 else /* failed */
7828 {
7829 ACTION_PerformActionSequence(package, -3);
7830 if (!msi_get_property_int( package->db, L"RollbackDisabled", 0 ))
7831 {
7832 package->need_rollback = TRUE;
7833 }
7834 }
7835
7836 /* finish up running custom actions */
7838
7840
7841 if (package->need_rollback && !(reinstall = msi_dup_property( package->db, L"REINSTALL" )))
7842 {
7843 WARN("installation failed, running rollback script\n");
7844 execute_script( package, SCRIPT_ROLLBACK );
7845 }
7846 free( reinstall );
7847 free( action );
7848
7849 if (rc == ERROR_SUCCESS && package->need_reboot_at_end)
7851
7852 return rc;
7853}
#define GetCurrentDirectoryW(x, y)
Definition: compat.h:756
UINT msi_set_context(MSIPACKAGE *package)
Definition: action.c:394
static void stop_dummy_thread(struct dummy_thread *info)
Definition: action.c:7724
static UINT ACTION_PerformActionSequence(MSIPACKAGE *package, UINT seq)
Definition: action.c:7658
UINT ACTION_PerformAction(MSIPACKAGE *package, const WCHAR *action)
Definition: action.c:7640
UINT msi_parse_command_line(MSIPACKAGE *package, LPCWSTR szCommandLine, BOOL preserve_case)
Definition: action.c:213
static UINT execute_script(MSIPACKAGE *package, UINT script)
Definition: action.c:1396
static void start_dummy_thread(struct dummy_thread *info)
Definition: action.c:7715
void ACTION_FinishCustomActions(const MSIPACKAGE *package)
Definition: custom.c:1629
UINT msi_apply_patches(MSIPACKAGE *package)
Definition: patch.c:932
UINT msi_set_original_database_property(MSIDATABASE *, const WCHAR *)
Definition: package.c:1310
UINT msi_apply_transforms(MSIPACKAGE *package)
Definition: patch.c:950
unsigned char need_reboot_at_end
Definition: msipriv.h:469
#define ERROR_INSTALL_USEREXIT
Definition: winerror.h:960
#define ERROR_SUCCESS_REBOOT_REQUIRED
Definition: winerror.h:1215
LPWSTR WINAPI CharUpperW(_Inout_ LPWSTR)

Referenced by MsiConfigureFeatureW(), MsiConfigureProductExW(), MsiInstallProductW(), and MsiReinstallFeatureW().

◆ msi_is_global_assembly()

◆ MSI_IterateRecords()

UINT MSI_IterateRecords ( MSIQUERY view,
LPDWORD  count,
record_func  func,
LPVOID  param 
)

Definition at line 163 of file msiquery.c.

165{
166 MSIRECORD *rec = NULL;
167 UINT r, n = 0, max = 0;
168
170 if( r != ERROR_SUCCESS )
171 return r;
172
173 if( count )
174 max = *count;
175
176 /* iterate a query */
177 for( n = 0; (max == 0) || (n < max); n++ )
178 {
179 r = MSI_ViewFetch( view, &rec );
180 if( r != ERROR_SUCCESS )
181 break;
182 if (func)
183 r = func( rec, param );
184 msiobj_release( &rec->hdr );
185 if( r != ERROR_SUCCESS )
186 break;
187 }
188
190
191 if( count )
192 *count = n;
193
194 if( r == ERROR_NO_MORE_ITEMS )
196
197 return r;
198}
#define ERROR_NO_MORE_ITEMS
Definition: compat.h:105
GLenum func
Definition: glext.h:6028
GLfloat param
Definition: glext.h:5796
UINT MSI_ViewExecute(MSIQUERY *query, MSIRECORD *rec)
Definition: msiquery.c:502
UINT MSI_ViewClose(MSIQUERY *query)
Definition: msiquery.c:454
UINT MSI_ViewFetch(MSIQUERY *query, MSIRECORD **prec)
Definition: msiquery.c:377
#define max(a, b)
Definition: svc.c:63

Referenced by ACTION_AppSearch(), ACTION_BindImage(), ACTION_CCPSearch(), ACTION_CostFinalize(), ACTION_CreateFolders(), ACTION_CreateShortcuts(), ACTION_DeleteServices(), ACTION_DuplicateFiles(), ACTION_ExecuteAction(), ACTION_FindRelatedProducts(), ACTION_InstallODBC(), ACTION_InstallServices(), ACTION_InstallValidate(), ACTION_LaunchConditions(), ACTION_MigrateFeatureStates(), ACTION_MoveFiles(), ACTION_ProcessExecSequence(), ACTION_ProcessUISequence(), ACTION_PublishComponents(), ACTION_RegisterFonts(), ACTION_RegisterTypeLibraries(), ACTION_RemoveDuplicateFiles(), ACTION_RemoveEnvironmentStrings(), ACTION_RemoveExistingProducts(), ACTION_RemoveFiles(), ACTION_RemoveFolders(), ACTION_RemoveIniValues(), ACTION_RemoveODBC(), ACTION_RemoveRegistryValues(), ACTION_RemoveShortcuts(), ACTION_SelfRegModules(), ACTION_SelfUnregModules(), ACTION_SetODBCFolders(), ACTION_StartServices(), ACTION_StopServices(), ACTION_UnpublishComponents(), ACTION_UnregisterFonts(), ACTION_UnregisterTypeLibraries(), ACTION_WriteEnvironmentStrings(), ACTION_WriteIniValues(), ACTION_WriteRegistryValues(), combobox_add_items(), dialog_build_font_list(), dialog_button_handler(), dialog_evaluate_control_conditions(), dialog_fill_controls(), dialog_map_events(), dialog_radiogroup_control(), gather_merge_data(), get_assembly_display_name(), listbox_add_items(), listview_add_items(), load_all_classes(), load_all_extensions(), load_all_files(), load_all_folders(), load_all_media(), load_all_mimes(), load_all_patches(), load_all_progids(), load_all_verbs(), load_feature(), mark_patched_components(), merge_diff_tables(), MSI_DatabaseExport(), MSI_DatabaseGetPrimaryKeys(), msi_load_all_components(), msi_load_all_features(), MSI_Sequence(), publish_icons(), ui_sequence_exists(), unimplemented_action_stub(), and unpublish_icons().

◆ msi_load_all_components()

UINT msi_load_all_components ( MSIPACKAGE package)

Definition at line 807 of file action.c.

808{
809 MSIQUERY *view;
810 UINT r;
811
812 if (!list_empty(&package->components))
813 return ERROR_SUCCESS;
814
815 r = MSI_DatabaseOpenViewW( package->db, L"SELECT * FROM `Component`", &view );
816 if (r != ERROR_SUCCESS)
817 return r;
818
820 msiobj_release(&view->hdr);
821 return r;
822}
static UINT load_component(MSIRECORD *row, LPVOID param)
Definition: action.c:777

Referenced by ACTION_CostInitialize(), and MsiGetFeatureInfoW().

◆ msi_load_all_features()

UINT msi_load_all_features ( MSIPACKAGE package)

Definition at line 950 of file action.c.

951{
952 MSIQUERY *view;
953 UINT r;
954
955 if (!list_empty(&package->features))
956 return ERROR_SUCCESS;
957
958 r = MSI_DatabaseOpenViewW( package->db, L"SELECT * FROM `Feature` ORDER BY `Display`", &view );
959 if (r != ERROR_SUCCESS)
960 return r;
961
962 r = MSI_IterateRecords( view, NULL, load_feature, package );
963 if (r != ERROR_SUCCESS)
964 {
965 msiobj_release( &view->hdr );
966 return r;
967 }
969 msiobj_release( &view->hdr );
970 return r;
971}
static UINT load_feature(MSIRECORD *row, LPVOID param)
Definition: action.c:877
static UINT find_feature_children(MSIRECORD *row, LPVOID param)
Definition: action.c:930

Referenced by ACTION_CostInitialize(), and MsiGetFeatureInfoW().

◆ msi_load_assembly()

MSIASSEMBLY * msi_load_assembly ( MSIPACKAGE package,
MSICOMPONENT comp 
)

Definition at line 292 of file assembly.c.

293{
294 MSIRECORD *rec;
295 MSIASSEMBLY *a;
296
297 if (!(rec = get_assembly_record( package, comp->Component ))) return NULL;
298 if (!(a = calloc( 1, sizeof(MSIASSEMBLY) )))
299 {
300 msiobj_release( &rec->hdr );
301 return NULL;
302 }
303 a->feature = wcsdup( MSI_RecordGetString( rec, 2 ) );
304 TRACE("feature %s\n", debugstr_w(a->feature));
305
306 a->manifest = wcsdup( MSI_RecordGetString( rec, 3 ) );
307 TRACE("manifest %s\n", debugstr_w(a->manifest));
308
309 a->application = wcsdup( MSI_RecordGetString( rec, 4 ) );
310 TRACE("application %s\n", debugstr_w(a->application));
311
312 a->attributes = MSI_RecordGetInteger( rec, 5 );
313 TRACE( "attributes %lu\n", a->attributes );
314
315 if (!(a->display_name = get_assembly_display_name( package->db, comp->Component, a )))
316 {
317 WARN("can't get display name\n");
318 msiobj_release( &rec->hdr );
319 free( a->feature );
320 free( a->manifest );
321 free( a->application );
322 free( a );
323 return NULL;
324 }
325 TRACE("display name %s\n", debugstr_w(a->display_name));
326
327 msiobj_release( &rec->hdr );
328 return a;
329}
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
#define a
Definition: ke_i.h:78
static MSIRECORD * get_assembly_record(MSIPACKAGE *package, const WCHAR *comp)
Definition: assembly.c:121
static WCHAR * get_assembly_display_name(MSIDATABASE *db, const WCHAR *comp, MSIASSEMBLY *assembly)
Definition: assembly.c:172

Referenced by load_component().

◆ msi_load_media_info()

UINT msi_load_media_info ( MSIPACKAGE package,
UINT  Sequence,
MSIMEDIAINFO mi 
)

Definition at line 677 of file media.c.

678{
679 MSIRECORD *row;
680 WCHAR *source_dir, *source, *base_url = NULL;
682
683 if (Sequence <= mi->last_sequence) /* already loaded */
684 return ERROR_SUCCESS;
685
686 row = MSI_QueryGetRecord(package->db, L"SELECT * FROM `Media` WHERE `LastSequence` >= %d ORDER BY `DiskId`", Sequence);
687 if (!row)
688 {
689 TRACE("Unable to query row\n");
691 }
692
693 mi->is_extracted = FALSE;
694 mi->disk_id = MSI_RecordGetInteger(row, 1);
695 mi->last_sequence = MSI_RecordGetInteger(row, 2);
696 free(mi->disk_prompt);
697 mi->disk_prompt = wcsdup(MSI_RecordGetString(row, 3));
698 free(mi->cabinet);
699 mi->cabinet = wcsdup(MSI_RecordGetString(row, 4));
700 free(mi->volume_label);
701 mi->volume_label = wcsdup(MSI_RecordGetString(row, 5));
702 msiobj_release(&row->hdr);
703
705 source_dir = msi_dup_property(package->db, L"SourceDir");
706 lstrcpyW(mi->sourcedir, source_dir);
707 PathAddBackslashW(mi->sourcedir);
708 mi->type = get_drive_type(source_dir);
709
711 if (mi->type == DRIVE_CDROM || mi->type == DRIVE_REMOVABLE)
712 {
713 source = source_dir;
715 }
716 else if ((base_url = get_base_url(package->db)))
717 {
720 }
721 else
722 {
723 source = mi->sourcedir;
725 }
726
727 msi_package_add_media_disk(package, package->Context,
728 MSICODE_PRODUCT, mi->disk_id,
729 mi->volume_label, mi->disk_prompt);
730
731 msi_package_add_info(package, package->Context,
733
734 TRACE("sequence %u -> cabinet %s disk id %u\n", Sequence, debugstr_w(mi->cabinet), mi->disk_id);
735
736 free(base_url);
737 free(source_dir);
738 return ERROR_SUCCESS;
739}
static WCHAR * get_base_url(MSIDATABASE *db)
Definition: media.c:669
static UINT get_drive_type(const WCHAR *path)
Definition: media.c:658
#define DRIVE_CDROM
Definition: machpc98.h:119
const char * base_url
Definition: mimeole.c:1466
@ MSICODE_PRODUCT
Definition: msi.h:215
@ MSISOURCETYPE_URL
Definition: msi.h:209
@ MSISOURCETYPE_NETWORK
Definition: msi.h:208
@ MSISOURCETYPE_MEDIA
Definition: msi.h:210
static const WCHAR INSTALLPROPERTY_LASTUSEDSOURCEW[]
Definition: msi.h:405
UINT msi_package_add_media_disk(MSIPACKAGE *, DWORD, DWORD, DWORD, LPWSTR, LPWSTR)
Definition: package.c:2648
UINT msi_package_add_info(MSIPACKAGE *, DWORD, DWORD, LPCWSTR, LPWSTR)
Definition: package.c:2625
#define PathAddBackslashW
Definition: pathcch.h:301
#define DRIVE_REMOVABLE
Definition: winbase.h:277

Referenced by ACTION_InstallFiles(), and ACTION_PatchFiles().

◆ msi_load_string_table()

string_table * msi_load_string_table ( IStorage stg,
UINT bytes_per_strref 
)

Definition at line 478 of file string.c.

479{
480 string_table *st = NULL;
481 CHAR *data = NULL;
482 USHORT *pool = NULL;
483 UINT r, datasize = 0, poolsize = 0, codepage;
484 DWORD i, count, offset, len, n, refs;
485
486 r = read_stream_data( stg, L"_StringPool", TRUE, (BYTE **)&pool, &poolsize );
487 if( r != ERROR_SUCCESS)
488 goto end;
489 r = read_stream_data( stg, L"_StringData", TRUE, (BYTE **)&data, &datasize );
490 if( r != ERROR_SUCCESS)
491 goto end;
492
493 if ( (poolsize > 4) && (pool[1] & 0x8000) )
494 *bytes_per_strref = LONG_STR_BYTES;
495 else
496 *bytes_per_strref = sizeof(USHORT);
497
498 count = poolsize/4;
499 if( poolsize > 4 )
500 codepage = pool[0] | ( (pool[1] & ~0x8000) << 16 );
501 else
504 if (!st)
505 goto end;
506
507 offset = 0;
508 n = 1;
509 i = 1;
510 while( i<count )
511 {
512 /* the string reference count is always the second word */
513 refs = pool[i*2+1];
514
515 /* empty entries have two zeros, still have a string id */
516 if (pool[i*2] == 0 && refs == 0)
517 {
518 i++;
519 n++;
520 continue;
521 }
522
523 /*
524 * If a string is over 64k, the previous string entry is made null
525 * and its the high word of the length is inserted in the null string's
526 * reference count field.
527 */
528 if( pool[i*2] == 0)
529 {
530 len = (pool[i*2+3] << 16) + pool[i*2+2];
531 i += 2;
532 }
533 else
534 {
535 len = pool[i*2];
536 i += 1;
537 }
538
539 if ( (offset + len) > datasize )
540 {
541 ERR("string table corrupt?\n");
542 break;
543 }
544
545 r = add_string( st, n, data+offset, len, refs, TRUE );
546 if( r != n )
547 ERR( "Failed to add string %lu\n", n );
548 n++;
549 offset += len;
550 }
551
552 if ( datasize != offset )
553 ERR( "string table load failed! (%u != %lu), please report\n", datasize, offset );
554
555 TRACE( "loaded %lu strings\n", count );
556
557end:
558 free( pool );
559 free( data );
560
561 return st;
562}
static SIZE_T datasize
Definition: asm.c:30
#define CP_ACP
Definition: compat.h:109
static int add_string(string_table *st, UINT n, const char *data, UINT len, USHORT refcount, BOOL persistent)
Definition: string.c:257
static string_table * init_stringtable(int entries, UINT codepage)
Definition: string.c:71
static HRESULT read_stream_data(nsChannelBSC *This, IStream *stream)
Definition: navigate.c:960
#define LONG_STR_BYTES
Definition: msipriv.h:57
int codepage
Definition: win_iconv.c:156
char CHAR
Definition: xmlstorage.h:175

Referenced by MSI_OpenDatabaseW(), and msi_table_apply_transform().

◆ msi_load_suminfo_properties()

UINT msi_load_suminfo_properties ( MSIPACKAGE package)

Definition at line 1267 of file suminfo.c.

1268{
1269 MSISUMMARYINFO *si;
1270 WCHAR *package_code;
1271 UINT r;
1272 DWORD len;
1273 awstring str;
1274 INT count;
1275
1276 r = msi_get_suminfo( package->db->storage, 0, &si );
1277 if (r != ERROR_SUCCESS)
1278 {
1279 r = msi_get_db_suminfo( package->db, 0, &si );
1280 if (r != ERROR_SUCCESS)
1281 {
1282 ERR("Unable to open summary information stream %u\n", r);
1283 return r;
1284 }
1285 }
1286
1287 str.unicode = TRUE;
1288 str.str.w = NULL;
1289 len = 0;
1290 r = get_prop( si, PID_REVNUMBER, NULL, NULL, NULL, &str, &len );
1291 if (r != ERROR_MORE_DATA)
1292 {
1293 WARN("Unable to query revision number %u\n", r);
1294 msiobj_release( &si->hdr );
1295 return ERROR_FUNCTION_FAILED;
1296 }
1297
1298 len++;
1299 if (!(package_code = malloc( len * sizeof(WCHAR) ))) return ERROR_OUTOFMEMORY;
1300 str.str.w = package_code;
1301
1302 r = get_prop( si, PID_REVNUMBER, NULL, NULL, NULL, &str, &len );
1303 if (r != ERROR_SUCCESS)
1304 {
1305 free( package_code );
1306 msiobj_release( &si->hdr );
1307 return r;
1308 }
1309
1310 r = msi_set_property( package->db, L"PackageCode", package_code, len );
1311 free( package_code );
1312
1313 count = 0;
1315 package->WordCount = count;
1316
1317 msiobj_release( &si->hdr );
1318 return r;
1319}
static UINT get_prop(MSISUMMARYINFO *si, UINT uiProperty, UINT *puiDataType, INT *piValue, FILETIME *pftValue, awstring *str, DWORD *pcchValueBuf)
Definition: suminfo.c:646
#define PID_WORDCOUNT
Definition: suminfo.c:57

Referenced by MSI_CreatePackage().

◆ msi_locate_product()

UINT msi_locate_product ( LPCWSTR  szProduct,
MSIINSTALLCONTEXT context 
)

Definition at line 54 of file msi.c.

55{
56 HKEY hkey = NULL;
57
59 if (!szProduct) return ERROR_UNKNOWN_PRODUCT;
60
62 &hkey, FALSE) == ERROR_SUCCESS)
65 &hkey, FALSE) == ERROR_SUCCESS)
67 else if (MSIREG_OpenProductKey(szProduct, NULL,
69 &hkey, FALSE) == ERROR_SUCCESS)
71
72 RegCloseKey(hkey);
73
76
77 return ERROR_SUCCESS;
78}
@ MSIINSTALLCONTEXT_NONE
Definition: msi.h:197
@ MSIINSTALLCONTEXT_USERUNMANAGED
Definition: msi.h:199
@ MSIINSTALLCONTEXT_USERMANAGED
Definition: msi.h:198
UINT MSIREG_OpenProductKey(LPCWSTR szProduct, LPCWSTR szUserSid, MSIINSTALLCONTEXT context, HKEY *key, BOOL create)
Definition: registry.c:338
Definition: http.c:7252
#define ERROR_UNKNOWN_PRODUCT
Definition: winerror.h:963

Referenced by get_registered_local_package(), MSI_OpenPackageW(), MSI_OpenProductW(), MSI_ProvideQualifiedComponentEx(), msi_set_context(), MsiConfigureProductExW(), and MsiReinstallFeatureW().

◆ msi_move_file()

BOOL msi_move_file ( MSIPACKAGE package,
const WCHAR from,
const WCHAR to,
DWORD  flags 
)

Definition at line 142 of file files.c.

143{
144 BOOL ret;
146 ret = MoveFileExW( from, to, flags );
147 msi_revert_fs_redirection( package );
148 return ret;
149}
BOOL WINAPI MoveFileExW(IN LPCWSTR lpExistingFileName, IN LPCWSTR lpNewFileName OPTIONAL, IN DWORD dwFlags)
Definition: move.c:1120
CardRegion * from
Definition: spigame.cpp:19

Referenced by cabinet_copy_file(), copy_install_file(), move_file(), and patch_file().

◆ msi_normalize_path()

WCHAR * msi_normalize_path ( const WCHAR in)

Definition at line 2116 of file action.c.

2117{
2118 const WCHAR *p = in;
2119 WCHAR *q, *ret;
2120 int n, len = lstrlenW( in ) + 2;
2121
2122 if (!(q = ret = malloc( len * sizeof(WCHAR) ))) return NULL;
2123
2124 len = 0;
2125 while (1)
2126 {
2127 /* copy until the end of the string or a space */
2128 while (*p != ' ' && (*q = *p))
2129 {
2130 p++, len++;
2131 /* reduce many backslashes to one */
2132 if (*p != '\\' || *q != '\\')
2133 q++;
2134 }
2135
2136 /* quit at the end of the string */
2137 if (!*p)
2138 break;
2139
2140 /* count the number of spaces */
2141 n = 0;
2142 while (p[n] == ' ')
2143 n++;
2144
2145 /* if it's leading or trailing space, skip it */
2146 if ( len == 0 || p[-1] == '\\' || p[n] == '\\' )
2147 p += n;
2148 else /* copy n spaces */
2149 while (n && (*q++ = *p++)) n--;
2150 }
2151 while (q - ret > 0 && q[-1] == ' ') q--;
2152 if (q - ret > 0 && q[-1] != '\\')
2153 {
2154 q[0] = '\\';
2155 q[1] = 0;
2156 }
2157 return ret;
2158}

Referenced by msi_resolve_target_folder(), and set_target_path().

◆ MSI_OpenDatabaseW()

UINT MSI_OpenDatabaseW ( LPCWSTR  szDBPath,
LPCWSTR  szPersist,
MSIDATABASE **  pdb 
)

Definition at line 140 of file database.c.

141{
142 IStorage *stg = NULL;
143 HRESULT r;
144 MSIDATABASE *db = NULL;
147 UINT mode;
148 STATSTG stat;
149 BOOL created = FALSE, patch = FALSE;
151
152 TRACE("%s %s\n",debugstr_w(szDBPath),debugstr_w(szPersist) );
153
154 if( !pdb )
156
157 save_path = szDBPath;
158 if ( IS_INTMSIDBOPEN(szPersist) )
159 {
160 mode = LOWORD(szPersist);
161 }
162 else
163 {
164 if (!CopyFileW( szDBPath, szPersist, FALSE ))
165 return ERROR_OPEN_FAILED;
166
167 szDBPath = szPersist;
169 created = TRUE;
170 }
171
173 {
174 TRACE("Database is a patch\n");
175 mode &= ~MSI_OPEN_PATCHFILE;
176 patch = TRUE;
177 }
178
179 if( mode == MSI_OPEN_READONLY )
180 {
181 r = StgOpenStorage( szDBPath, NULL,
183 }
184 else if( mode == MSI_OPEN_CREATE )
185 {
186 r = StgCreateDocfile( szDBPath,
188
189 if( SUCCEEDED(r) )
190 r = db_initialize( stg, patch ? &CLSID_MsiPatch : &CLSID_MsiDatabase );
191 created = TRUE;
192 }
193 else if( mode == MSI_OPEN_CREATEDIRECT )
194 {
195 r = StgCreateDocfile( szDBPath,
197
198 if( SUCCEEDED(r) )
199 r = db_initialize( stg, patch ? &CLSID_MsiPatch : &CLSID_MsiDatabase );
200 created = TRUE;
201 }
202 else if( mode == MSI_OPEN_TRANSACT )
203 {
204 r = StgOpenStorage( szDBPath, NULL,
206 }
207 else if( mode == MSI_OPEN_DIRECT )
208 {
209 r = StgOpenStorage( szDBPath, NULL,
211 }
212 else
213 {
214 ERR("unknown flag %x\n",mode);
216 }
217
218 if( FAILED( r ) || !stg )
219 {
220 WARN("open failed r = %#lx for %s\n", r, debugstr_w(szDBPath));
222 }
223
224 r = IStorage_Stat( stg, &stat, STATFLAG_NONAME );
225 if( FAILED( r ) )
226 {
227 FIXME("Failed to stat storage\n");
228 goto end;
229 }
230
231 if ( !IsEqualGUID( &stat.clsid, &CLSID_MsiDatabase ) &&
232 !IsEqualGUID( &stat.clsid, &CLSID_MsiPatch ) &&
233 !IsEqualGUID( &stat.clsid, &CLSID_MsiTransform ) )
234 {
235 ERR("storage GUID is not a MSI database GUID %s\n",
236 debugstr_guid(&stat.clsid) );
237 goto end;
238 }
239
240 if ( patch && !IsEqualGUID( &stat.clsid, &CLSID_MsiPatch ) )
241 {
242 ERR("storage GUID is not the MSI patch GUID %s\n",
243 debugstr_guid(&stat.clsid) );
245 goto end;
246 }
247
250 if( !db )
251 {
252 FIXME("Failed to allocate a handle\n");
253 goto end;
254 }
255
256 if (!wcschr( save_path, '\\' ))
257 {
259 lstrcatW( path, L"\\" );
261 }
262 else
264
265 db->path = wcsdup( path );
268
269 if( TRACE_ON( msi ) )
270 enum_stream_names( stg );
271
272 db->storage = stg;
273 db->mode = mode;
274 if (created)
275 db->deletefile = wcsdup( szDBPath );
276 list_init( &db->tables );
277 list_init( &db->transforms );
278
280 if( !db->strings )
281 goto end;
282
284
285 msiobj_addref( &db->hdr );
286 IStorage_AddRef( stg );
287 *pdb = db;
288
289end:
290 if( db )
291 msiobj_release( &db->hdr );
292 if( stg )
293 IStorage_Release( stg );
294
295 return ret;
296}
static struct @1565 save_path[MOVE_LIST_SIZE]
static void list_init(struct list_entry *head)
Definition: list.h:51
static PDB pdb
Definition: db.cpp:172
#define TRACE_ON(x)
Definition: compat.h:75
BOOL WINAPI CopyFileW(IN LPCWSTR lpExistingFileName, IN LPCWSTR lpNewFileName, IN BOOL bFailIfExists)
Definition: copy.c:439
static VOID MSI_CloseDatabase(MSIOBJECTHDR *arg)
Definition: database.c:86
#define IS_INTMSIDBOPEN(x)
Definition: database.c:53
static HRESULT db_initialize(IStorage *stg, const GUID *clsid)
Definition: database.c:104
HRESULT WINAPI StgOpenStorage(const OLECHAR *pwcsName, IStorage *pstgPriority, DWORD grfMode, SNB snbExclude, DWORD reserved, IStorage **ppstgOpen)
Definition: storage32.c:8755
HRESULT WINAPI StgCreateDocfile(LPCOLESTR pwcsName, DWORD grfMode, DWORD reserved, IStorage **ppstgOpen)
Definition: storage32.c:8636
GLenum mode
Definition: glext.h:6217
#define MSI_INITIAL_MEDIA_TRANSFORM_DISKID
Definition: msipriv.h:84
#define MSIHANDLETYPE_DATABASE
Definition: msipriv.h:722
#define MSI_OPEN_DIRECT
Definition: msipriv.h:101
#define MSI_OPEN_CREATEDIRECT
Definition: msipriv.h:103
#define MSI_OPEN_TRANSACT
Definition: msipriv.h:100
string_table * msi_load_string_table(IStorage *stg, UINT *bytes_per_strref)
Definition: string.c:478
#define MSI_OPEN_CREATE
Definition: msipriv.h:102
#define MSI_OPEN_READONLY
Definition: msipriv.h:99
void enum_stream_names(IStorage *stg)
Definition: table.c:206
#define MSI_INITIAL_MEDIA_TRANSFORM_OFFSET
Definition: msipriv.h:83
#define MSI_OPEN_PATCHFILE
Definition: msipriv.h:104
#define STGM_CREATE
Definition: objbase.h:926
#define STGM_DIRECT
Definition: objbase.h:914
#define STGM_READWRITE
Definition: objbase.h:919
#define STGM_TRANSACTED
Definition: objbase.h:915
#define STGM_SHARE_DENY_WRITE
Definition: objbase.h:922
#define LOWORD(l)
Definition: pedump.c:82
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
UINT media_transform_disk_id
Definition: msipriv.h:117
UINT bytes_per_strref
Definition: msipriv.h:111
LPWSTR deletefile
Definition: msipriv.h:113
UINT media_transform_offset
Definition: msipriv.h:116
#define ERROR_OPEN_FAILED
Definition: winerror.h:184

Referenced by apply_patch_package(), MSI_ApplicablePatchW(), msi_apply_registered_patch(), MSI_OpenPackageW(), MsiGetSummaryInformationW(), and MsiOpenDatabaseW().

◆ MSI_OpenPackageW()

UINT MSI_OpenPackageW ( LPCWSTR  szPackage,
DWORD  dwOptions,
MSIPACKAGE **  pPackage 
)

Definition at line 1384 of file package.c.

1385{
1386 MSIDATABASE *db;
1387 MSIPACKAGE *package;
1389 MSIRECORD *data_row, *info_row;
1390 UINT r;
1391 WCHAR localfile[MAX_PATH], cachefile[MAX_PATH];
1392 LPCWSTR file = szPackage;
1393 DWORD index = 0;
1394 MSISUMMARYINFO *si;
1395 BOOL delete_on_close = FALSE;
1396 WCHAR *info_template, *productname, *product_code;
1398
1399 TRACE("%s %p\n", debugstr_w(szPackage), pPackage);
1400
1402
1403 localfile[0] = 0;
1404 if( szPackage[0] == '#' )
1405 {
1406 handle = wcstol(&szPackage[1], NULL, 10);
1408 return ERROR_INVALID_HANDLE;
1409 }
1410 else
1411 {
1412 WCHAR *product_version = NULL;
1413
1414 if ( UrlIsW( szPackage, URLIS_URL ) )
1415 {
1416 r = msi_download_file( szPackage, cachefile );
1417 if (r != ERROR_SUCCESS)
1418 return r;
1419
1420 file = cachefile;
1421 }
1422#ifdef __REACTOS__
1423 AppHelpCheckPackage(file);
1424#endif
1425
1427 if (r != ERROR_SUCCESS)
1428 {
1430 return ERROR_FILE_NOT_FOUND;
1431 return r;
1432 }
1433 r = get_local_package( db, localfile );
1435 {
1436 DWORD localfile_attr;
1437
1438 r = msi_create_empty_local_file( localfile, L".msi" );
1439 if (r != ERROR_SUCCESS)
1440 {
1441 msiobj_release( &db->hdr );
1442 return r;
1443 }
1444
1445 if (!CopyFileW( file, localfile, FALSE ))
1446 {
1447 r = GetLastError();
1448 WARN("unable to copy package %s to %s (%u)\n", debugstr_w(file), debugstr_w(localfile), r);
1449 DeleteFileW( localfile );
1450 msiobj_release( &db->hdr );
1451 return r;
1452 }
1453 delete_on_close = TRUE;
1454
1455 /* Remove read-only bit, we are opening it with write access in MSI_OpenDatabaseW below. */
1456 localfile_attr = GetFileAttributesW( localfile );
1457 if (localfile_attr & FILE_ATTRIBUTE_READONLY)
1458 SetFileAttributesW( localfile, localfile_attr & ~FILE_ATTRIBUTE_READONLY);
1459 }
1461 {
1462 if (!CopyFileW( file, localfile, FALSE ))
1463 {
1464 r = GetLastError();
1465 WARN("unable to update cached package (%u)\n", r);
1466 msiobj_release( &db->hdr );
1467 return r;
1468 }
1469 }
1470 else
1471 product_version = get_product_version( db );
1472 msiobj_release( &db->hdr );
1473 TRACE("opening package %s\n", debugstr_w( localfile ));
1474 r = MSI_OpenDatabaseW( localfile, MSIDBOPEN_TRANSACT, &db );
1475 if (r != ERROR_SUCCESS)
1476 {
1477 free( product_version );
1478 return r;
1479 }
1480
1481 if (product_version)
1482 {
1483 WCHAR *cache_version = get_product_version( db );
1484 if (!product_version != !cache_version ||
1485 (product_version && wcscmp(product_version, cache_version)))
1486 {
1487 msiobj_release( &db->hdr );
1488 free( product_version );
1489 free( cache_version );
1490 return ERROR_PRODUCT_VERSION;
1491 }
1492 free( product_version );
1493 free( cache_version );
1494 }
1495 }
1496 package = MSI_CreatePackage( db );
1497 msiobj_release( &db->hdr );
1498 if (!package) return ERROR_INSTALL_PACKAGE_INVALID;
1499 package->localfile = wcsdup( localfile );
1500 package->delete_on_close = delete_on_close;
1501
1502 r = msi_get_suminfo( db->storage, 0, &si );
1503 if (r != ERROR_SUCCESS)
1504 {
1505 r = msi_get_db_suminfo( db, 0, &si );
1506 if (r != ERROR_SUCCESS)
1507 {
1508 WARN("failed to load summary info\n");
1509 msiobj_release( &package->hdr );
1511 }
1512 }
1513 r = parse_suminfo( si, package );
1514 msiobj_release( &si->hdr );
1515 if (r != ERROR_SUCCESS)
1516 {
1517 WARN("failed to parse summary info %u\n", r);
1518 msiobj_release( &package->hdr );
1519 return r;
1520 }
1521 r = validate_package( package );
1522 if (r != ERROR_SUCCESS)
1523 {
1524 msiobj_release( &package->hdr );
1525 return r;
1526 }
1527 msi_set_property( package->db, L"DATABASE", db->path, -1 );
1528 set_installed_prop( package );
1529 msi_set_context( package );
1530
1531 product_code = get_product_code( db );
1532 if (msi_locate_product( product_code, &context ) == ERROR_SUCCESS)
1533 {
1534 TRACE("product already registered\n");
1535 msi_set_property( package->db, L"ProductToBeRegistered", L"1", -1 );
1536 }
1537 free( product_code );
1538
1539 while (1)
1540 {
1541 WCHAR patch_code[GUID_SIZE];
1542 r = MsiEnumPatchesExW( package->ProductCode, NULL, package->Context,
1543 MSIPATCHSTATE_APPLIED, index, patch_code, NULL, NULL, NULL, NULL );
1544 if (r != ERROR_SUCCESS)
1545 break;
1546
1547 TRACE("found registered patch %s\n", debugstr_w(patch_code));
1548
1549 r = msi_apply_registered_patch( package, patch_code );
1550 if (r != ERROR_SUCCESS)
1551 {
1552 ERR("registered patch failed to apply %u\n", r);
1553 msiobj_release( &package->hdr );
1554 return r;
1555 }
1556 index++;
1557 }
1558 if (index) msi_adjust_privilege_properties( package );
1559
1560 r = msi_set_original_database_property( package->db, szPackage );
1561 if (r != ERROR_SUCCESS)
1562 {
1563 msiobj_release( &package->hdr );
1564 return r;
1565 }
1566 if (gszLogFile)
1569
1570 /* FIXME: when should these messages be sent? */
1571 data_row = MSI_CreateRecord(3);
1572 if (!data_row)
1573 return ERROR_OUTOFMEMORY;
1574 MSI_RecordSetStringW(data_row, 0, NULL);
1575 MSI_RecordSetInteger(data_row, 1, 0);
1576 MSI_RecordSetInteger(data_row, 2, package->num_langids ? package->langids[0] : 0);
1579
1580 info_row = MSI_CreateRecord(0);
1581 if (!info_row)
1582 {
1583 msiobj_release(&data_row->hdr);
1584 return ERROR_OUTOFMEMORY;
1585 }
1586 info_template = msi_get_error_message(package->db, MSIERR_INFO_LOGGINGSTART);
1587 MSI_RecordSetStringW(info_row, 0, info_template);
1588 free(info_template);
1590
1592
1593 productname = msi_dup_property(package->db, INSTALLPROPERTY_PRODUCTNAMEW);
1594 MSI_RecordSetInteger(data_row, 1, 1);
1595 MSI_RecordSetStringW(data_row, 2, productname);
1596 MSI_RecordSetStringW(data_row, 3, NULL);
1598
1599 free(productname);
1600 msiobj_release(&info_row->hdr);
1601 msiobj_release(&data_row->hdr);
1602
1603 *pPackage = package;
1604 return ERROR_SUCCESS;
1605}
BOOL WINAPI SetFileAttributesW(LPCWSTR lpFileName, DWORD dwFileAttributes)
Definition: fileinfo.c:794
UINT msi_locate_product(LPCWSTR szProduct, MSIINSTALLCONTEXT *context)
Definition: msi.c:54
static UINT validate_package(MSIPACKAGE *package)
Definition: package.c:1171
UINT msi_download_file(LPCWSTR szUrl, LPWSTR filename)
Definition: package.c:1026
INT MSI_ProcessMessage(MSIPACKAGE *package, INSTALLMESSAGE eMessageType, MSIRECORD *record)
Definition: package.c:1909
static UINT get_local_package(MSIDATABASE *db, WCHAR *localfile)
Definition: package.c:1298
static WCHAR * get_product_version(MSIDATABASE *db)
Definition: package.c:1247
static UINT parse_suminfo(MSISUMMARYINFO *si, MSIPACKAGE *package)
Definition: package.c:1102
static WCHAR * get_product_code(MSIDATABASE *db)
Definition: package.c:1242
static UINT set_installed_prop(MSIPACKAGE *package)
Definition: package.c:457
UINT msi_create_empty_local_file(LPWSTR path, LPCWSTR suffix)
Definition: package.c:1062
UINT WINAPI MsiEnumPatchesExW(const WCHAR *szProductCode, const WCHAR *szUserSid, DWORD dwContext, DWORD dwFilter, DWORD dwIndex, WCHAR *szPatchCode, WCHAR *szTargetProductCode, MSIINSTALLCONTEXT *pdwTargetProductContext, WCHAR *szTargetUserSid, DWORD *pcchTargetUserSid)
Definition: registry.c:1949
#define MSIERR_INFO_LOGGINGSTART
Definition: resource.h:24
BOOL WINAPI UrlIsW(LPCWSTR pszUrl, URLIS Urlis)
Definition: url.c:1933
@ MSIPATCHSTATE_APPLIED
Definition: msi.h:54
enum tagMSIINSTALLCONTEXT MSIINSTALLCONTEXT
static const WCHAR INSTALLPROPERTY_PRODUCTNAMEW[]
Definition: msi.h:277
@ INSTALLMESSAGE_COMMONDATA
Definition: msi.h:105
@ INSTALLMESSAGE_INFO
Definition: msi.h:98
@ INSTALLMESSAGE_INITIALIZE
Definition: msi.h:106
WCHAR * gszLogFile
Definition: msi_main.c:50
UINT msi_get_string_table_codepage(const string_table *st)
Definition: string.c:671
UINT MSI_RecordSetInteger(MSIRECORD *, UINT, int)
Definition: record.c:280
#define GUID_SIZE
Definition: msipriv.h:733
INT MSI_ProcessMessageVerbatim(MSIPACKAGE *, INSTALLMESSAGE, MSIRECORD *)
Definition: package.c:1843
UINT msi_apply_registered_patch(MSIPACKAGE *package, LPCWSTR patch_code)
Definition: patch.c:990
#define WINE_OPENPACKAGEFLAGS_RECACHE
Definition: msipriv.h:884
WCHAR * msi_get_error_message(MSIDATABASE *, int)
Definition: package.c:1818
#define MSIDBOPEN_TRANSACT
Definition: msiquery.h:67
#define FILE_SHARE_WRITE
Definition: nt_native.h:681
#define FILE_ATTRIBUTE_READONLY
Definition: nt_native.h:702
@ URLIS_URL
Definition: shlwapi.h:1217
DWORD dwOptions
Definition: solitaire.cpp:25
BOOL delete_on_close
Definition: msipriv.h:450
UINT num_langids
Definition: msipriv.h:397
LANGID * langids
Definition: msipriv.h:398
LPWSTR localfile
Definition: msipriv.h:449
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23
#define ERROR_INSTALL_PACKAGE_INVALID
Definition: winerror.h:978
#define ERROR_PRODUCT_VERSION
Definition: winerror.h:996
#define MB_ICONHAND
Definition: winuser.h:791

Referenced by MSI_OpenProductW(), MsiDetermineApplicablePatchesW(), MsiInstallProductW(), MsiOpenPackageExW(), MsiReinstallFeatureW(), and open_package().

◆ MSI_OpenQuery()

UINT WINAPIV MSI_OpenQuery ( MSIDATABASE db,
MSIQUERY **  view,
LPCWSTR  fmt,
  ... 
)

Definition at line 138 of file msiquery.c.

139{
140 UINT r;
141 int size = 100, res;
143
144 /* construct the string */
145 for (;;)
146 {
147 va_list va;
148 query = malloc(size * sizeof(WCHAR));
149 va_start(va, fmt);
150 res = vswprintf(query, size, fmt, va);
151 va_end(va);
152 if (res == -1) size *= 2;
153 else if (res >= size) size = res + 1;
154 else break;
155 free(query);
156 }
157 /* perform the query */
159 free(query);
160 return r;
161}
static _Check_return_opt_ int __cdecl vswprintf(_Out_writes_z_(_SizeInWords) wchar_t *_DstBuf, _In_ size_t _SizeInWords, _In_z_ _Printf_format_string_ const wchar_t *_Format, va_list _ArgList)
Definition: stdio.h:977
UINT MSI_DatabaseOpenViewW(MSIDATABASE *db, const WCHAR *szQuery, MSIQUERY **pView)
Definition: msiquery.c:110
Definition: dsound.c:943

Referenced by ACTION_AppSearch(), ACTION_CCPSearch(), ACTION_ExecuteAction(), ACTION_ProcessExecSequence(), add_records_to_table(), combobox_add_items(), dialog_build_font_list(), dialog_button_handler(), dialog_evaluate_control_conditions(), dialog_fill_controls(), dialog_map_events(), dialog_radiogroup_control(), get_assembly_display_name(), get_assembly_record(), get_merge_table(), listbox_add_items(), listview_add_items(), load_feature(), load_file_hash(), load_folder_persistence(), mark_patched_components(), merge_diff_tables(), MSI_DatabaseExport(), MSI_DatabaseGetPrimaryKeys(), MSI_Sequence(), MsiGetProductPropertyW(), unimplemented_action_stub(), and update_merge_errors().

◆ msi_package_add_info()

UINT msi_package_add_info ( MSIPACKAGE package,
DWORD  context,
DWORD  options,
LPCWSTR  property,
LPWSTR  value 
)

Definition at line 2625 of file package.c.

2627{
2629
2631 {
2632 if (!wcscmp( info->value, value )) return ERROR_SUCCESS;
2633 }
2634
2635 info = malloc(sizeof(MSISOURCELISTINFO));
2636 if (!info)
2637 return ERROR_OUTOFMEMORY;
2638
2639 info->context = context;
2640 info->options = options;
2641 info->property = property;
2642 info->value = wcsdup(value);
2643 list_add_head(&package->sourcelist_info, &info->entry);
2644
2645 return ERROR_SUCCESS;
2646}
struct list sourcelist_info
Definition: msipriv.h:463
Definition: pdh_main.c:94

Referenced by msi_load_media_info().

◆ msi_package_add_media_disk()

UINT msi_package_add_media_disk ( MSIPACKAGE package,
DWORD  context,
DWORD  options,
DWORD  disk_id,
LPWSTR  volume_label,
LPWSTR  disk_prompt 
)

Definition at line 2648 of file package.c.

2650{
2651 MSIMEDIADISK *disk;
2652
2654 {
2655 if (disk->disk_id == disk_id) return ERROR_SUCCESS;
2656 }
2657
2658 disk = malloc(sizeof(MSIMEDIADISK));
2659 if (!disk)
2660 return ERROR_OUTOFMEMORY;
2661
2662 disk->context = context;
2663 disk->options = options;
2664 disk->disk_id = disk_id;
2666 disk->disk_prompt = wcsdup(disk_prompt);
2667 list_add_head(&package->sourcelist_media, &disk->entry);
2668
2669 return ERROR_SUCCESS;
2670}
__u8 volume_label[11]
Definition: mkdosfs.c:4
DWORD context
Definition: msipriv.h:169
DWORD options
Definition: msipriv.h:170
LPWSTR volume_label
Definition: msipriv.h:172
struct list entry
Definition: msipriv.h:168
LPWSTR disk_prompt
Definition: msipriv.h:173
DWORD disk_id
Definition: msipriv.h:171
struct list sourcelist_media
Definition: msipriv.h:464

Referenced by msi_load_media_info().

◆ msi_parse_command_line()

UINT msi_parse_command_line ( MSIPACKAGE package,
LPCWSTR  szCommandLine,
BOOL  preserve_case 
)

Definition at line 213 of file action.c.

215{
216 LPCWSTR ptr, ptr2;
217 int num_quotes;
218 DWORD len;
219 WCHAR *prop, *val;
220 UINT r;
221
222 if (!szCommandLine)
223 return ERROR_SUCCESS;
224
225 ptr = szCommandLine;
226 while (*ptr)
227 {
228 while (*ptr == ' ') ptr++;
229 if (!*ptr) break;
230
231 ptr2 = wcschr( ptr, '=' );
232 if (!ptr2) return ERROR_INVALID_COMMAND_LINE;
233
234 len = ptr2 - ptr;
235 if (!len) return ERROR_INVALID_COMMAND_LINE;
236
237 while (ptr[len - 1] == ' ') len--;
238
239 prop = malloc( (len + 1) * sizeof(WCHAR) );
240 memcpy( prop, ptr, len * sizeof(WCHAR) );
241 prop[len] = 0;
242 if (!preserve_case) wcsupr( prop );
243
244 ptr2++;
245 while (*ptr2 == ' ') ptr2++;
246
247 num_quotes = 0;
248 val = malloc( (wcslen( ptr2 ) + 1) * sizeof(WCHAR) );
249 len = parse_prop( ptr2, val, &num_quotes );
250 if (num_quotes % 2)
251 {
252 WARN("unbalanced quotes\n");
253 free( val );
254 free( prop );
256 }
258 TRACE("Found commandline property %s = %s\n", debugstr_w(prop), debugstr_w(val));
259
260 r = msi_set_property( package->db, prop, val, -1 );
261 if (r == ERROR_SUCCESS && !wcscmp( prop, L"SourceDir" ))
262 msi_reset_source_folders( package );
263
264 free( val );
265 free( prop );
266
267 ptr = ptr2 + len;
268 }
269
270 return ERROR_SUCCESS;
271}
static void remove_quotes(WCHAR *str)
Definition: action.c:201
_CRTIMP wchar_t *__cdecl wcsupr(_Inout_z_ wchar_t *_Str)
#define ERROR_INVALID_COMMAND_LINE
Definition: winerror.h:997

Referenced by load_admin_properties(), and MSI_InstallPackage().

◆ msi_parse_version_string()

void msi_parse_version_string ( LPCWSTR  verStr,
PDWORD  ms,
PDWORD  ls 
)

Definition at line 52 of file appsearch.c.

53{
54 const WCHAR *ptr;
55 int x1 = 0, x2 = 0, x3 = 0, x4 = 0;
56
57 x1 = wcstol(verStr, NULL, 10);
58 ptr = wcschr(verStr, '.');
59 if (ptr)
60 {
61 x2 = wcstol(ptr + 1, NULL, 10);
62 ptr = wcschr(ptr + 1, '.');
63 }
64 if (ptr)
65 {
66 x3 = wcstol(ptr + 1, NULL, 10);
67 ptr = wcschr(ptr + 1, '.');
68 }
69 if (ptr)
70 x4 = wcstol(ptr + 1, NULL, 10);
71 /* FIXME: byte-order dependent? */
72 *ms = x1 << 16 | x2;
73 if (ls) *ls = x3 << 16 | x4;
74}
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG x2
Definition: winddi.h:3710
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG x1
Definition: winddi.h:3708

Referenced by check_transform_applicable(), get_signature(), msi_compare_file_versions(), and msi_compare_font_versions().

◆ msi_patch_assembly()

UINT msi_patch_assembly ( MSIPACKAGE package,
MSIASSEMBLY assembly,
MSIFILEPATCH patch 
)

Definition at line 726 of file files.c.

727{
730 IAssemblyEnum *iter;
731
732 if (!(iter = msi_create_assembly_enum( package, assembly->display_name )))
734
735 while ((IAssemblyEnum_GetNextAssembly( iter, NULL, &name, 0 ) == S_OK))
736 {
737 WCHAR *displayname, *path;
738 DWORD len = 0;
739 HRESULT hr;
740
741 hr = IAssemblyName_GetDisplayName( name, NULL, &len, 0 );
742 if (hr != E_NOT_SUFFICIENT_BUFFER || !(displayname = malloc( len * sizeof(WCHAR) )))
743 break;
744
745 hr = IAssemblyName_GetDisplayName( name, displayname, &len, 0 );
746 if (FAILED( hr ))
747 {
748 free( displayname );
749 break;
750 }
751
752 if ((path = msi_get_assembly_path( package, displayname )))
753 {
754 if (!copy_file( package, path, patch->File->TargetPath, FALSE ))
755 {
756 ERR( "failed to copy file %s -> %s (%lu)\n", debugstr_w(path),
758 free( path );
759 free( displayname );
760 IAssemblyName_Release( name );
761 break;
762 }
763 r = patch_file( package, patch );
764 free( path );
765 }
766
767 free( displayname );
768 IAssemblyName_Release( name );
769 if (r == ERROR_SUCCESS) break;
770 }
771
772 IAssemblyEnum_Release( iter );
773 return r;
774}
static BOOL copy_file(MSIPACKAGE *package, const WCHAR *src, const WCHAR *dst, BOOL fail_if_exists)
Definition: files.c:70
IAssemblyEnum * msi_create_assembly_enum(MSIPACKAGE *package, const WCHAR *displayname)
Definition: assembly.c:244
WCHAR * msi_get_assembly_path(MSIPACKAGE *package, const WCHAR *displayname)
Definition: assembly.c:219

Referenced by ACTION_InstallFinalize().

◆ MSI_ProcessMessage()

INT MSI_ProcessMessage ( MSIPACKAGE package,
INSTALLMESSAGE  eMessageType,
MSIRECORD record 
)

Definition at line 1909 of file package.c.

1910{
1911 switch (eMessageType & 0xff000000)
1912 {
1920 {
1921 /* error message */
1922
1923 LPWSTR template;
1924 LPWSTR template_rec = NULL, template_prefix = NULL;
1926
1927 if (MSI_RecordIsNull(record, 0))
1928 {
1929 if (error >= 32)
1930 {
1931 template_rec = msi_get_error_message(package->db, error);
1932
1933 if (!template_rec && error >= 2000)
1934 {
1935 /* internal error, not localized */
1936 if ((template_rec = (LPWSTR) get_internal_error_message(error)))
1937 {
1938 MSI_RecordSetStringW(record, 0, template_rec);
1940 }
1941 template_rec = msi_get_error_message(package->db, MSIERR_INSTALLERROR);
1942 MSI_RecordSetStringW(record, 0, template_rec);
1943 MSI_ProcessMessageVerbatim(package, eMessageType, record);
1944 free(template_rec);
1945 return 0;
1946 }
1947 }
1948 }
1949 else
1950 template_rec = msi_dup_record_field(record, 0);
1951
1952 template_prefix = msi_get_error_message(package->db, eMessageType >> 24);
1953 if (!template_prefix) template_prefix = wcsdup(L"");
1954
1955 if (!template_rec)
1956 {
1957 /* always returns 0 */
1958 MSI_RecordSetStringW(record, 0, template_prefix);
1959 MSI_ProcessMessageVerbatim(package, eMessageType, record);
1960 free(template_prefix);
1961 return 0;
1962 }
1963
1964 template = malloc((wcslen(template_rec) + wcslen(template_prefix) + 1) * sizeof(WCHAR));
1965 if (!template)
1966 {
1967 free(template_prefix);
1968 free(template_rec);
1969 return ERROR_OUTOFMEMORY;
1970 }
1971
1972 lstrcpyW(template, template_prefix);
1973 lstrcatW(template, template_rec);
1974 MSI_RecordSetStringW(record, 0, template);
1975
1976 free(template_prefix);
1977 free(template_rec);
1978 free(template);
1979 }
1980 break;
1982 {
1983 WCHAR *template = msi_get_error_message(package->db, MSIERR_ACTIONSTART);
1984 MSI_RecordSetStringW(record, 0, template);
1985 free(template);
1986
1987 free(package->LastAction);
1988 free(package->LastActionTemplate);
1989 package->LastAction = msi_dup_record_field(record, 1);
1990 if (!package->LastAction) package->LastAction = wcsdup(L"");
1992 break;
1993 }
1995 if (package->LastAction && package->LastActionTemplate)
1996 {
1997 size_t len = lstrlenW(package->LastAction) + lstrlenW(package->LastActionTemplate) + 7;
1998 WCHAR *template = malloc(len * sizeof(WCHAR));
1999 if (!template) return ERROR_OUTOFMEMORY;
2000 swprintf(template, len, L"{{%s: }}%s", package->LastAction, package->LastActionTemplate);
2001 MSI_RecordSetStringW(record, 0, template);
2002 free(template);
2003 }
2004 break;
2006 {
2007 WCHAR *template = msi_get_error_message(package->db, MSIERR_COMMONDATA);
2008 MSI_RecordSetStringW(record, 0, template);
2009 free(template);
2010 }
2011 break;
2012 }
2013
2014 return MSI_ProcessMessageVerbatim(package, eMessageType, record);
2015}
static LPCWSTR get_internal_error_message(int error)
Definition: package.c:1802
INT MSI_ProcessMessageVerbatim(MSIPACKAGE *package, INSTALLMESSAGE eMessageType, MSIRECORD *record)
Definition: package.c:1843
LPWSTR msi_get_error_message(MSIDATABASE *db, int error)
Definition: package.c:1818
#define MSIERR_INSTALLERROR
Definition: resource.h:21
#define MSIERR_ACTIONSTART
Definition: resource.h:22
#define MSIERR_COMMONDATA
Definition: resource.h:23
@ INSTALLMESSAGE_WARNING
Definition: msi.h:96
@ INSTALLMESSAGE_ACTIONSTART
Definition: msi.h:102
@ INSTALLMESSAGE_ERROR
Definition: msi.h:95
@ INSTALLMESSAGE_USER
Definition: msi.h:97
@ INSTALLMESSAGE_OUTOFDISKSPACE
Definition: msi.h:101
@ INSTALLMESSAGE_FATALEXIT
Definition: msi.h:94
BOOL MSI_RecordIsNull(MSIRECORD *, UINT)
Definition: record.c:321

Referenced by ACTION_AllocateRegistrySpace(), ACTION_ExecuteAction(), ACTION_MsiPublishAssemblies(), ACTION_MsiUnpublishAssemblies(), ACTION_ProcessComponents(), ACTION_PublishFeatures(), ACTION_PublishProduct(), ACTION_RegisterClassInfo(), ACTION_RegisterExtensionInfo(), ACTION_RegisterMIMEInfo(), ACTION_RegisterProduct(), ACTION_RegisterProgIdInfo(), ACTION_RegisterUser(), ACTION_RemoveFiles(), ACTION_ResolveSource(), ACTION_ShowDialog(), ACTION_UnregisterClassInfo(), ACTION_UnregisterExtensionInfo(), ACTION_UnregisterMIMEInfo(), ACTION_UnregisterProgIdInfo(), change_media(), dialog_create(), file_update_ui(), ITERATE_AppSearch(), ITERATE_CreateFolders(), ITERATE_CreateShortcuts(), ITERATE_DeleteService(), ITERATE_DuplicateFiles(), ITERATE_FindRelatedProducts(), ITERATE_InstallODBCDataSource(), ITERATE_InstallODBCDriver(), ITERATE_InstallODBCTranslator(), ITERATE_MoveFiles(), iterate_properties(), ITERATE_PublishComponent(), ITERATE_RegisterFonts(), ITERATE_RegisterTypeLibraries(), ITERATE_RemoveDuplicateFiles(), ITERATE_RemoveEnvironmentString(), ITERATE_RemoveFiles(), ITERATE_RemoveFolders(), ITERATE_RemoveIniValuesOnInstall(), ITERATE_RemoveIniValuesOnUninstall(), ITERATE_RemoveODBCDataSource(), ITERATE_RemoveODBCDriver(), ITERATE_RemoveODBCTranslator(), ITERATE_RemoveRegistryValuesOnInstall(), ITERATE_RemoveRegistryValuesOnUninstall(), ITERATE_RemoveShortcuts(), ITERATE_SelfRegModules(), ITERATE_SelfUnregModules(), ITERATE_StartService(), ITERATE_StopService(), ITERATE_UnpublishComponent(), ITERATE_UnregisterFonts(), ITERATE_UnregisterTypeLibraries(), ITERATE_WriteEnvironmentString(), ITERATE_WriteIniValues(), ITERATE_WriteRegistryValues(), MSI_FreePackage(), MSI_OpenPackageW(), msi_ui_progress(), MsiOpenPackageExW(), MsiProcessMessage(), ui_actioninfo(), ui_actionstart(), and unpublish_feature().

◆ MSI_ProcessMessageVerbatim()

INT MSI_ProcessMessageVerbatim ( MSIPACKAGE package,
INSTALLMESSAGE  eMessageType,
MSIRECORD record 
)

Definition at line 1843 of file package.c.

1844{
1845 LPWSTR message = {0};
1846 DWORD len;
1847 DWORD log_type = 1 << (eMessageType >> 24);
1848 UINT res;
1849 INT rc = 0;
1850 char *msg;
1851
1852 TRACE("%x\n", eMessageType);
1853 if (TRACE_ON(msi)) dump_record(record);
1854
1855 if (!package || !record)
1856 message = NULL;
1857 else {
1858 res = MSI_FormatRecordW(package, record, message, &len);
1859 if (res != ERROR_SUCCESS && res != ERROR_MORE_DATA)
1860 return res;
1861 len++;
1862 message = malloc(len * sizeof(WCHAR));
1863 if (!message) return ERROR_OUTOFMEMORY;
1864 MSI_FormatRecordW(package, record, message, &len);
1865 }
1866
1867 /* convert it to ANSI */
1868 len = WideCharToMultiByte( CP_ACP, 0, message, -1, NULL, 0, NULL, NULL );
1869 msg = malloc( len );
1871
1872 if (gUIHandlerRecord && (gUIFilterRecord & log_type))
1873 {
1874 MSIHANDLE rec = alloc_msihandle(&record->hdr);
1875 TRACE( "calling UI handler %p(pvContext = %p, iMessageType = %#x, hRecord = %lu)\n",
1876 gUIHandlerRecord, gUIContextRecord, eMessageType, rec );
1877 rc = gUIHandlerRecord( gUIContextRecord, eMessageType, rec );
1878 MsiCloseHandle( rec );
1879 }
1880 if (!rc && gUIHandlerW && (gUIFilter & log_type))
1881 {
1882 TRACE( "calling UI handler %p(pvContext = %p, iMessageType = %#x, szMessage = %s)\n",
1883 gUIHandlerW, gUIContext, eMessageType, debugstr_w(message) );
1884 rc = gUIHandlerW( gUIContext, eMessageType, message );
1885 }
1886 else if (!rc && gUIHandlerA && (gUIFilter & log_type))
1887 {
1888 TRACE( "calling UI handler %p(pvContext = %p, iMessageType = %#x, szMessage = %s)\n",
1889 gUIHandlerA, gUIContext, eMessageType, debugstr_a(msg) );
1890 rc = gUIHandlerA( gUIContext, eMessageType, msg );
1891 }
1892
1893 if (!rc)
1894 rc = internal_ui_handler(package, eMessageType, record, message);
1895
1896 if (!rc && package && package->log_file != INVALID_HANDLE_VALUE &&
1897 (eMessageType & 0xff000000) != INSTALLMESSAGE_PROGRESS)
1898 {
1899 DWORD written;
1900 WriteFile( package->log_file, msg, len - 1, &written, NULL );
1901 WriteFile( package->log_file, "\n", 1, &written, NULL );
1902 }
1903 free( msg );
1904 free( message );
1905
1906 return rc;
1907}
#define WideCharToMultiByte
Definition: compat.h:111
UINT MSI_FormatRecordW(MSIPACKAGE *package, MSIRECORD *record, LPWSTR buffer, LPDWORD size)
Definition: format.c:838
MSIHANDLE alloc_msihandle(MSIOBJECTHDR *obj)
Definition: handle.c:111
UINT WINAPI MsiCloseHandle(MSIHANDLE handle)
Definition: handle.c:269
static INT internal_ui_handler(MSIPACKAGE *package, INSTALLMESSAGE eMessageType, MSIRECORD *record, LPCWSTR message)
Definition: package.c:1700
#define debugstr_a
Definition: kernel32.h:31
@ INSTALLMESSAGE_PROGRESS
Definition: msi.h:104
INSTALLUI_HANDLERA gUIHandlerA
Definition: msi_main.c:43
DWORD gUIFilter
Definition: msi_main.c:46
LPVOID gUIContextRecord
Definition: msi_main.c:49
DWORD gUIFilterRecord
Definition: msi_main.c:47
LPVOID gUIContext
Definition: msi_main.c:48
INSTALLUI_HANDLER_RECORD gUIHandlerRecord
Definition: msi_main.c:45
INSTALLUI_HANDLERW gUIHandlerW
Definition: msi_main.c:44
Definition: tftpd.h:60

Referenced by ACTION_ExecuteAction(), MSI_OpenPackageW(), and MSI_ProcessMessage().

◆ MSI_QueryGetRecord()

◆ msi_record_get_string()

const WCHAR * msi_record_get_string ( const MSIRECORD rec,
UINT  field,
int len 
)

◆ msi_record_set_string()

UINT msi_record_set_string ( MSIRECORD rec,
UINT  field,
const WCHAR value,
int  len 
)

Definition at line 573 of file record.c.

574{
575 if (field > rec->count)
576 return ERROR_INVALID_FIELD;
577
578 MSI_FreeField( &rec->fields[field] );
579
580 if (value && len < 0) len = lstrlenW( value );
581
582 if (value && len)
583 {
586 rec->fields[field].len = len;
587 }
588 else
589 {
591 rec->fields[field].u.szwVal = NULL;
592 rec->fields[field].len = 0;
593 }
594 return 0;
595}
WCHAR * msi_strdupW(const WCHAR *value, int len)
Definition: record.c:155
#define ERROR_INVALID_FIELD
Definition: winerror.h:974

Referenced by get_transform_record(), MSI_RecordSetStringW(), msi_set_property(), and msi_view_refresh_row().

◆ MSI_RecordCopyField()

UINT MSI_RecordCopyField ( MSIRECORD in_rec,
UINT  in_n,
MSIRECORD out_rec,
UINT  out_n 
)

Definition at line 166 of file record.c.

168{
170
171 msiobj_lock( &in_rec->hdr );
172
173 if ( in_n > in_rec->count || out_n > out_rec->count )
175 else if ( in_rec != out_rec || in_n != out_n )
176 {
177 LPWSTR str;
178 MSIFIELD *in, *out;
179
180 in = &in_rec->fields[in_n];
181 out = &out_rec->fields[out_n];
182
183 switch ( in->type )
184 {
185 case MSIFIELD_NULL:
186 break;
187 case MSIFIELD_INT:
188 out->u.iVal = in->u.iVal;
189 break;
190 case MSIFIELD_WSTR:
191 if ((str = msi_strdupW( in->u.szwVal, in->len )))
192 {
193 out->u.szwVal = str;
194 out->len = in->len;
195 }
196 else r = ERROR_OUTOFMEMORY;
197 break;
198 case MSIFIELD_STREAM:
199 IStream_AddRef( in->u.stream );
200 out->u.stream = in->u.stream;
201 break;
202 default:
203 ERR("invalid field type %d\n", in->type);
204 }
205 if (r == ERROR_SUCCESS)
206 out->type = in->type;
207 }
208
209 msiobj_unlock( &in_rec->hdr );
210 return r;
211}
void msiobj_lock(MSIOBJECTHDR *info)
Definition: handle.c:231
void msiobj_unlock(MSIOBJECTHDR *info)
Definition: handle.c:236

Referenced by arrange_record(), msi_clone_properties(), MSI_CloneRecord(), msi_query_merge_record(), refresh_record(), SELECT_set_row(), translate_record(), UPDATE_execute(), and WHERE_set_row().

◆ MSI_RecordGetFieldCount()

◆ MSI_RecordGetInteger()

int MSI_RecordGetInteger ( MSIRECORD rec,
UINT  iField 
)

Definition at line 213 of file record.c.

214{
215 int ret = 0;
216
217 TRACE("%p %d\n", rec, iField );
218
219 if( iField > rec->count )
220 return MSI_NULL_INTEGER;
221
222 switch( rec->fields[iField].type )
223 {
224 case MSIFIELD_INT:
225 return rec->fields[iField].u.iVal;
226 case MSIFIELD_WSTR:
227 if( string2intW( rec->fields[iField].u.szwVal, &ret ) )
228 return ret;
229 return MSI_NULL_INTEGER;
230 default:
231 break;
232 }
233
234 return MSI_NULL_INTEGER;
235}
static BOOL string2intW(LPCWSTR str, int *out)
Definition: record.c:132

Referenced by ACTION_CustomAction(), ACTION_ProcessComponents(), dialog_add_control(), dialog_add_font(), dialog_adjust_dialog_pos(), dialog_bitmap_control(), dialog_button_control(), dialog_combo_control(), dialog_create(), dialog_create_window(), dialog_directory_combo(), dialog_directory_list(), dialog_handle_event(), dialog_hyperlink(), dialog_icon_control(), dialog_list_box(), dialog_listview(), dialog_oncreate(), dialog_pathedit_control(), dialog_progress_bar(), dialog_radiogroup_control(), dialog_selection_tree(), dialog_text_control(), dialog_volumeselect_combo(), get_signature(), get_table_value_from_record(), internal_ui_handler(), ITERATE_CostFinalizeConditions(), ITERATE_CreateShortcuts(), ITERATE_DeleteService(), ITERATE_FindRelatedProducts(), ITERATE_InstallODBCDataSource(), ITERATE_InstallService(), iterate_load_verb(), ITERATE_MigrateFeatureStates(), ITERATE_MoveFiles(), ITERATE_RemoveExistingProducts(), ITERATE_RemoveFiles(), ITERATE_RemoveIniValuesOnInstall(), ITERATE_RemoveIniValuesOnUninstall(), ITERATE_RemoveODBCDataSource(), ITERATE_RemoveRegistryValuesOnInstall(), ITERATE_RemoveRegistryValuesOnUninstall(), ITERATE_StartService(), ITERATE_StopService(), ITERATE_UnregisterTypeLibraries(), ITERATE_WriteIniValues(), ITERATE_WriteRegistryValues(), load_class(), load_component(), load_feature(), load_file(), load_file_disk_id(), load_file_hash(), load_media(), load_patch(), load_patch_disk_id(), load_progid(), msi_load_assembly(), msi_load_media_info(), MSI_ProcessMessage(), msi_select_update(), MsiRecordGetInteger(), patch_add_media(), patch_offset_get_filepatches(), patch_offset_get_files(), patch_set_offsets(), patch_update_file_sequence(), patch_update_filepatch_sequence(), primary_key_iterator(), record_to_row(), resolve_keypath(), search_components(), search_dr(), search_ini(), search_reg(), table_load_transform(), table_validate_new(), and WHERE_evaluate().

◆ MSI_RecordGetIStream()

UINT MSI_RecordGetIStream ( MSIRECORD rec,
UINT  iField,
IStream **  pstm 
)

Definition at line 852 of file record.c.

853{
854 TRACE("%p %d %p\n", rec, iField, pstm);
855
856 if( iField > rec->count )
857 return ERROR_INVALID_FIELD;
858
859 if( rec->fields[iField].type != MSIFIELD_STREAM )
860 return ERROR_INVALID_FIELD;
861
862 *pstm = rec->fields[iField].u.stream;
863 IStream_AddRef( *pstm );
864
865 return ERROR_SUCCESS;
866}

Referenced by load_picture(), MSI_RecordStreamToFile(), msi_select_update(), STORAGES_set_row(), STREAMS_set_row(), and TABLE_set_row().

◆ MSI_RecordGetString()

const WCHAR * MSI_RecordGetString ( const MSIRECORD rec,
UINT  iField 
)

Definition at line 433 of file record.c.

434{
435 return msi_record_get_string( rec, iField, NULL );
436}
const WCHAR * msi_record_get_string(const MSIRECORD *rec, UINT field, int *len)
Definition: record.c:420

Referenced by ACTION_CustomAction(), ACTION_PerformActionSequence(), combobox_add_item(), create_diff_row_query(), dialog_add_control(), dialog_add_font(), dialog_checkbox_control(), dialog_combo_control(), dialog_control_event(), dialog_create(), dialog_create_controls(), dialog_create_radiobutton(), dialog_create_window(), dialog_directory_combo(), dialog_directory_list(), dialog_edit_control(), dialog_get_uitext(), dialog_handle_event(), dialog_hyperlink(), dialog_list_box(), dialog_listview(), dialog_maskedit_control(), dialog_oncreate(), dialog_pathedit_control(), dialog_radiogroup_control(), dialog_scrolltext_control(), dialog_selection_tree(), dialog_seltree_handler(), dialog_set_control_condition(), dialog_text_control(), dialog_vcl_add_columns(), dialog_volumeselect_combo(), find_feature_children(), find_folder_children(), get_assembly_name_attribute(), get_assembly_record(), get_deformatted_field(), get_duplicate_filename(), get_ini_file_name(), get_key_value(), get_link_file(), get_property(), get_query_columns(), get_query_types(), get_table_labels(), HANDLE_CustomType19(), internal_ui_handler(), is_uninstallable(), ITERATE_Actions(), iterate_all_classes(), iterate_all_extensions(), iterate_all_mimes(), iterate_all_progids(), ITERATE_AppSearch(), ITERATE_BindImage(), ITERATE_CCPSearch(), ITERATE_CostFinalizeConditions(), ITERATE_CreateFolders(), ITERATE_CreateShortcuts(), ITERATE_DeleteService(), ITERATE_DuplicateFiles(), ITERATE_FindRelatedProducts(), ITERATE_InstallODBCDataSource(), ITERATE_InstallODBCDriver(), ITERATE_InstallODBCTranslator(), ITERATE_InstallService(), ITERATE_LaunchConditions(), iterate_load_featurecomponents(), iterate_load_verb(), ITERATE_MigrateFeatureStates(), ITERATE_MoveFiles(), iterate_patched_component(), ITERATE_PublishComponent(), ITERATE_PublishIcon(), ITERATE_RegisterFonts(), ITERATE_RegisterTypeLibraries(), ITERATE_RemoveDuplicateFiles(), ITERATE_RemoveEnvironmentString(), ITERATE_RemoveExistingProducts(), ITERATE_RemoveFiles(), ITERATE_RemoveFolders(), ITERATE_RemoveIniValuesOnInstall(), ITERATE_RemoveIniValuesOnUninstall(), ITERATE_RemoveODBCDataSource(), ITERATE_RemoveODBCDriver(), ITERATE_RemoveODBCTranslator(), ITERATE_RemoveRegistryValuesOnInstall(), ITERATE_RemoveRegistryValuesOnUninstall(), ITERATE_RemoveShortcuts(), ITERATE_SelfRegModules(), ITERATE_SelfUnregModules(), ITERATE_StartService(), ITERATE_StopService(), ITERATE_UnpublishComponent(), ITERATE_UnpublishIcon(), ITERATE_UnregisterFonts(), ITERATE_UnregisterTypeLibraries(), ITERATE_WriteEnvironmentString(), ITERATE_WriteIniValues(), ITERATE_WriteRegistryValues(), join_find_row(), listbox_add_item(), listview_add_item(), load_appid(), load_class(), load_extension(), load_file(), load_media(), load_mime(), load_patch(), load_progid(), map_event(), media_get_disk_info(), merge_diff_tables(), merge_verify_colnames(), merge_verify_primary_keys(), MSI_FormatRecordW(), msi_load_assembly(), msi_load_media_info(), MsiGetProductPropertyW(), patch_set_media_source_prop(), patch_update_file_sequence(), patch_update_filepatch_sequence(), primary_key_iterator(), resolve_keypath(), search_components(), search_dr(), search_reg(), storages_find_row(), STORAGES_set_row(), streams_find_row(), STREAMS_set_row(), STRING_evaluate(), and ui_actionstart().

◆ MSI_RecordGetStringA()

UINT MSI_RecordGetStringA ( MSIRECORD rec,
UINT  iField,
LPSTR  szValue,
LPDWORD  pcchValue 
)

Definition at line 351 of file record.c.

353{
354 UINT len = 0, ret = ERROR_SUCCESS;
355 CHAR buffer[16];
356
357 TRACE("%p %d %p %p\n", rec, iField, szValue, pcchValue);
358
359 if( iField > rec->count )
360 {
361 if ( szValue && *pcchValue > 0 )
362 szValue[0] = 0;
363
364 *pcchValue = 0;
365 return ERROR_SUCCESS;
366 }
367
368 switch( rec->fields[iField].type )
369 {
370 case MSIFIELD_INT:
371 wsprintfA(buffer, "%d", rec->fields[iField].u.iVal);
372 len = lstrlenA( buffer );
373 if (szValue)
374 lstrcpynA(szValue, buffer, *pcchValue);
375 break;
376 case MSIFIELD_WSTR:
377 len = WideCharToMultiByte( CP_ACP, 0, rec->fields[iField].u.szwVal,
378 rec->fields[iField].len + 1, NULL, 0 , NULL, NULL );
379 if (szValue)
380 WideCharToMultiByte( CP_ACP, 0, rec->fields[iField].u.szwVal,
381 rec->fields[iField].len + 1, szValue, *pcchValue, NULL, NULL );
382 if( szValue && *pcchValue && len>*pcchValue )
383 szValue[*pcchValue-1] = 0;
384 if( len )
385 len--;
386 break;
387 case MSIFIELD_NULL:
388 if( szValue && *pcchValue > 0 )
389 szValue[0] = 0;
390 break;
391 default:
393 break;
394 }
395
396 if( szValue && *pcchValue <= len )
398 *pcchValue = len;
399
400 return ret;
401}
#define lstrcpynA
Definition: compat.h:751
int WINAPI lstrlenA(LPCSTR lpString)
Definition: lstring.c:145
int WINAPIV wsprintfA(_Out_ LPSTR, _In_ _Printf_format_string_ LPCSTR,...)

Referenced by export_field(), and MsiRecordGetStringA().

◆ MSI_RecordGetStringW()

◆ MSI_RecordIsNull()

◆ MSI_RecordReadStream()

UINT MSI_RecordReadStream ( MSIRECORD rec,
UINT  iField,
char buf,
LPDWORD  sz 
)

Definition at line 761 of file record.c.

762{
763 ULONG count;
764 HRESULT r;
765 IStream *stm;
766
767 TRACE("%p %d %p %p\n", rec, iField, buf, sz);
768
769 if( !sz )
771
772 if( iField > rec->count)
774
775 if ( rec->fields[iField].type == MSIFIELD_NULL )
776 {
777 *sz = 0;
778 return ERROR_INVALID_DATA;
779 }
780
781 if( rec->fields[iField].type != MSIFIELD_STREAM )
783
784 stm = rec->fields[iField].u.stream;
785 if( !stm )
787
788 /* if there's no buffer pointer, calculate the length to the end */
789 if( !buf )
790 {
791 LARGE_INTEGER ofs;
793
794 ofs.QuadPart = cur.QuadPart = 0;
795 end.QuadPart = 0;
796 IStream_Seek( stm, ofs, STREAM_SEEK_SET, &cur );
797 IStream_Seek( stm, ofs, STREAM_SEEK_END, &end );
798 ofs.QuadPart = cur.QuadPart;
799 IStream_Seek( stm, ofs, STREAM_SEEK_SET, &cur );
800 *sz = end.QuadPart - cur.QuadPart;
801
802 return ERROR_SUCCESS;
803 }
804
805 /* read the data */
806 count = 0;
807 r = IStream_Read( stm, buf, *sz, &count );
808 if( FAILED( r ) )
809 {
810 *sz = 0;
812 }
813
814 *sz = count;
815
816 return ERROR_SUCCESS;
817}
FxCollectionEntry * cur
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
LONGLONG QuadPart
Definition: typedefs.h:114
#define ERROR_INVALID_DATATYPE
Definition: winerror.h:1111
#define ERROR_INVALID_DATA
Definition: winerror.h:116

Referenced by create_temp_binary(), export_stream(), HANDLE_CustomType5_6(), ITERATE_PublishIcon(), and MsiRecordReadStream().

◆ MSI_RecordsAreEqual()

BOOL MSI_RecordsAreEqual ( MSIRECORD a,
MSIRECORD b 
)

Definition at line 986 of file record.c.

987{
988 UINT i;
989
990 if (a->count != b->count)
991 return FALSE;
992
993 for (i = 0; i <= a->count; i++)
994 {
995 if (!MSI_RecordsAreFieldsEqual( a, b, i ))
996 return FALSE;
997 }
998
999 return TRUE;
1000}
BOOL MSI_RecordsAreFieldsEqual(MSIRECORD *a, MSIRECORD *b, UINT field)
Definition: record.c:957
GLboolean GLboolean GLboolean b
Definition: glext.h:6204

Referenced by merge_diff_row().

◆ MSI_RecordsAreFieldsEqual()

BOOL MSI_RecordsAreFieldsEqual ( MSIRECORD a,
MSIRECORD b,
UINT  field 
)

Definition at line 957 of file record.c.

958{
959 if (a->fields[field].type != b->fields[field].type)
960 return FALSE;
961
962 switch (a->fields[field].type)
963 {
964 case MSIFIELD_NULL:
965 break;
966
967 case MSIFIELD_INT:
968 if (a->fields[field].u.iVal != b->fields[field].u.iVal)
969 return FALSE;
970 break;
971
972 case MSIFIELD_WSTR:
973 if (a->fields[field].len != b->fields[field].len) return FALSE;
974 if (memcmp( a->fields[field].u.szwVal, b->fields[field].u.szwVal,
975 a->fields[field].len * sizeof(WCHAR) )) return FALSE;
976 break;
977
978 case MSIFIELD_STREAM:
979 default:
980 return FALSE;
981 }
982 return TRUE;
983}
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112

Referenced by join_modify_update(), and MSI_RecordsAreEqual().

◆ MSI_RecordSetInteger()

◆ MSI_RecordSetIStream()

UINT MSI_RecordSetIStream ( MSIRECORD rec,
UINT  iField,
IStream stm 
)

Definition at line 836 of file record.c.

837{
838 TRACE("%p %d %p\n", rec, iField, stm);
839
840 if( iField > rec->count )
841 return ERROR_INVALID_FIELD;
842
843 MSI_FreeField( &rec->fields[iField] );
844
845 rec->fields[iField].type = MSIFIELD_STREAM;
846 rec->fields[iField].u.stream = stm;
847 IStream_AddRef( stm );
848
849 return ERROR_SUCCESS;
850}

Referenced by add_stream(), copy_remote_record(), and msi_view_refresh_row().

◆ MSI_RecordSetStream()

UINT MSI_RecordSetStream ( MSIRECORD rec,
UINT  iField,
IStream stream 
)

Definition at line 671 of file record.c.

672{
673 if ( (iField == 0) || (iField > rec->count) )
675
676 MSI_FreeField( &rec->fields[iField] );
677 rec->fields[iField].type = MSIFIELD_STREAM;
678 rec->fields[iField].u.stream = stream;
679
680 return ERROR_SUCCESS;
681}

Referenced by get_transform_record(), and MSI_RecordSetStreamFromFileW().

◆ MSI_RecordSetStreamFromFileW()

UINT MSI_RecordSetStreamFromFileW ( MSIRECORD rec,
UINT  iField,
LPCWSTR  szFilename 
)

Definition at line 683 of file record.c.

684{
685 IStream *stm = NULL;
686 HRESULT hr;
687 UINT ret;
688
689 if( (iField == 0) || (iField > rec->count) )
691
692 /* no filename means we should seek back to the start of the stream */
693 if( !szFilename )
694 {
695 LARGE_INTEGER ofs;
697
698 if( rec->fields[iField].type != MSIFIELD_STREAM )
699 return ERROR_INVALID_FIELD;
700
701 stm = rec->fields[iField].u.stream;
702 if( !stm )
703 return ERROR_INVALID_FIELD;
704
705 ofs.QuadPart = 0;
706 hr = IStream_Seek( stm, ofs, STREAM_SEEK_SET, &cur );
707 if (FAILED( hr ))
709 }
710 else
711 {
712 /* read the file into a stream and save the stream in the record */
713 ret = RECORD_StreamFromFile(szFilename, &stm);
714 if (ret != ERROR_SUCCESS)
715 return ret;
716
717 /* if all's good, store it in the record */
718 MSI_RecordSetStream(rec, iField, stm);
719 }
720
721 return ERROR_SUCCESS;
722}
static UINT RECORD_StreamFromFile(LPCWSTR szFile, IStream **pstm)
Definition: record.c:623
UINT MSI_RecordSetStream(MSIRECORD *rec, UINT iField, IStream *stream)
Definition: record.c:671

Referenced by construct_record(), and MsiRecordSetStreamW().

◆ MSI_RecordSetStringW()

UINT MSI_RecordSetStringW ( MSIRECORD rec,
UINT  iField,
LPCWSTR  szValue 
)

Definition at line 597 of file record.c.

598{
599 TRACE("%p %d %s\n", rec, iField, debugstr_w(szValue));
600
601 return msi_record_set_string( rec, iField, szValue, -1 );
602}
UINT msi_record_set_string(MSIRECORD *rec, UINT field, const WCHAR *value, int len)
Definition: record.c:573

Referenced by ACTION_ExecuteAction(), ACTION_MsiPublishAssemblies(), ACTION_MsiUnpublishAssemblies(), ACTION_ProcessComponents(), ACTION_PublishFeatures(), ACTION_PublishProduct(), ACTION_RegisterClassInfo(), ACTION_RegisterExtensionInfo(), ACTION_RegisterMIMEInfo(), ACTION_RegisterProduct(), ACTION_RegisterProgIdInfo(), ACTION_RegisterUser(), ACTION_RemoveFiles(), ACTION_ResolveSource(), ACTION_ShowDialog(), ACTION_UnregisterClassInfo(), ACTION_UnregisterExtensionInfo(), ACTION_UnregisterMIMEInfo(), ACTION_UnregisterProgIdInfo(), add_stream(), change_media(), construct_record(), copy_remote_record(), deformat_string(), dialog_create(), dialog_seltree_handler(), event_set_target_path(), file_update_ui(), get_property_row(), internal_ui_handler(), ITERATE_AppSearch(), ITERATE_CreateFolders(), ITERATE_DeleteService(), ITERATE_DuplicateFiles(), ITERATE_FindRelatedProducts(), ITERATE_InstallODBCDataSource(), ITERATE_InstallODBCDriver(), ITERATE_InstallODBCTranslator(), ITERATE_MoveFiles(), iterate_properties(), ITERATE_PublishComponent(), ITERATE_RegisterFonts(), ITERATE_RemoveDuplicateFiles(), ITERATE_RemoveEnvironmentString(), ITERATE_RemoveFiles(), ITERATE_RemoveFolders(), ITERATE_RemoveIniValuesOnInstall(), ITERATE_RemoveIniValuesOnUninstall(), ITERATE_RemoveODBCDataSource(), ITERATE_RemoveODBCDriver(), ITERATE_RemoveODBCTranslator(), ITERATE_RemoveRegistryValuesOnInstall(), ITERATE_RemoveRegistryValuesOnUninstall(), ITERATE_SelfRegModules(), ITERATE_SelfUnregModules(), ITERATE_StartService(), ITERATE_StopService(), ITERATE_UnpublishComponent(), ITERATE_UnregisterFonts(), ITERATE_WriteEnvironmentString(), ITERATE_WriteIniValues(), ITERATE_WriteRegistryValues(), msi_create_table(), MSI_DatabaseExport(), MSI_FormatRecordW(), MSI_OpenPackageW(), MSI_ProcessMessage(), msi_query_merge_record(), MSI_ViewGetColumnInfo(), MsiRecordSetStringA(), MsiRecordSetStringW(), patch_add_media(), patch_update_filepatch_sequence(), primary_key_iterator(), set_record_type_string(), TABLE_add_column(), TABLE_drop(), TABLE_remove_column(), ui_actioninfo(), ui_actionstart(), and unpublish_feature().

◆ MSI_RecordStreamToFile()

UINT MSI_RecordStreamToFile ( MSIRECORD rec,
UINT  iField,
LPCWSTR  name 
)

Definition at line 900 of file record.c.

901{
902 IStream *stm = NULL;
903 UINT r;
904
905 TRACE("%p %u %s\n", rec, iField, debugstr_w(name));
906
907 msiobj_lock( &rec->hdr );
908
909 r = MSI_RecordGetIStream( rec, iField, &stm );
910 if( r == ERROR_SUCCESS )
911 {
912 r = dump_stream_to_file( stm, name );
913 IStream_Release( stm );
914 }
915
916 msiobj_unlock( &rec->hdr );
917
918 return r;
919}
UINT MSI_RecordGetIStream(MSIRECORD *rec, UINT iField, IStream **pstm)
Definition: record.c:852
static UINT dump_stream_to_file(IStream *stm, const WCHAR *name)
Definition: record.c:868

Referenced by load_image().

◆ msi_reduce_to_long_filename()

void msi_reduce_to_long_filename ( WCHAR filename)

Definition at line 1053 of file files.c.

1054{
1055 WCHAR *p = wcschr( filename, '|' );
1056 if (p) memmove( filename, p + 1, (lstrlenW( p + 1 ) + 1) * sizeof(WCHAR) );
1057}
#define memmove(s1, s2, n)
Definition: mkisofs.h:881

Referenced by get_duplicate_filename(), get_link_file(), ITERATE_MoveFiles(), ITERATE_RemoveFiles(), load_class(), and load_file().

◆ msi_reg_get_val_dword()

BOOL msi_reg_get_val_dword ( HKEY  hkey,
LPCWSTR  name,
DWORD val 
)

Definition at line 262 of file registry.c.

263{
264 DWORD type, len = sizeof (DWORD);
265 LONG r = RegQueryValueExW(hkey, name, NULL, &type, (LPBYTE) val, &len);
266 return r == ERROR_SUCCESS && type == REG_DWORD;
267}
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4103
#define DWORD
Definition: nt_native.h:44
#define REG_DWORD
Definition: sdbapi.c:596
unsigned char * LPBYTE
Definition: typedefs.h:53

Referenced by MSI_GetComponentPath(), MsiQueryProductStateW(), and reg_get_value().

◆ msi_reg_get_val_str()

◆ msi_reg_set_subkey_val()

LONG msi_reg_set_subkey_val ( HKEY  hkey,
LPCWSTR  path,
LPCWSTR  name,
LPCWSTR  val 
)

Definition at line 230 of file registry.c.

231{
232 HKEY hsubkey = 0;
233 LONG r;
234
235 r = RegCreateKeyW( hkey, path, &hsubkey );
236 if (r != ERROR_SUCCESS)
237 return r;
238 r = msi_reg_set_val_str( hsubkey, name, val );
239 RegCloseKey( hsubkey );
240 return r;
241}
LONG msi_reg_set_val_str(HKEY hkey, LPCWSTR name, LPCWSTR value)
Definition: registry.c:209

Referenced by ACTION_RegisterClassInfo(), ACTION_RegisterMIMEInfo(), register_progid(), and register_verb().

◆ msi_reg_set_val_dword()

LONG msi_reg_set_val_dword ( HKEY  hkey,
LPCWSTR  name,
DWORD  val 
)

Definition at line 225 of file registry.c.

226{
227 return RegSetValueExW( hkey, name, 0, REG_DWORD, (LPBYTE)&val, sizeof (DWORD) );
228}

Referenced by publish_install_properties(), publish_product_properties(), and write_shared_dlls_count().

◆ msi_reg_set_val_multi_str()

LONG msi_reg_set_val_multi_str ( HKEY  hkey,
LPCWSTR  name,
LPCWSTR  value 
)

Definition at line 217 of file registry.c.

218{
219 LPCWSTR p = value;
220 while (*p) p += lstrlenW(p) + 1;
221 return RegSetValueExW( hkey, name, 0, REG_MULTI_SZ,
222 (const BYTE *)value, (p + 1 - value) * sizeof(WCHAR) );
223}

Referenced by ITERATE_PublishComponent(), publish_product_properties(), and register_verb().

◆ msi_reg_set_val_str()

◆ msi_register_unique_action()

UINT msi_register_unique_action ( MSIPACKAGE package,
const WCHAR action 
)

Definition at line 113 of file custom.c.

114{
115 UINT count;
116 WCHAR **newbuf = NULL;
117
118 TRACE("Registering %s as unique action\n", debugstr_w(action));
119
120 count = package->unique_actions_count;
121 package->unique_actions_count++;
122 if (count != 0) newbuf = realloc( package->unique_actions,
123 package->unique_actions_count * sizeof(WCHAR *) );
124 else newbuf = malloc( sizeof(WCHAR *) );
125
126 newbuf[count] = wcsdup( action );
127 package->unique_actions = newbuf;
128 return ERROR_SUCCESS;
129}
#define realloc
Definition: debug_ros.c:6

Referenced by ACTION_AppSearch(), ACTION_CCPSearch(), ACTION_FindRelatedProducts(), and check_execution_scheduling_options().

◆ msi_remove_directory()

BOOL msi_remove_directory ( MSIPACKAGE package,
const WCHAR path 
)

Definition at line 97 of file files.c.

98{
99 BOOL ret;
102 msi_revert_fs_redirection( package );
103 return ret;
104}
BOOL WINAPI RemoveDirectoryW(IN LPCWSTR lpPathName)
Definition: dir.c:732

Referenced by ITERATE_RemoveFiles(), and ITERATE_UnpublishIcon().

◆ msi_reset_source_folders()

void msi_reset_source_folders ( MSIPACKAGE package)

Definition at line 2089 of file package.c.

2090{
2092
2094 {
2095 free( folder->ResolvedSource );
2096 folder->ResolvedSource = NULL;
2097 }
2098}

Referenced by ACTION_CustomAction(), append_productcode(), dialog_set_property(), ITERATE_AppSearch(), msi_parse_command_line(), msi_set_sourcedir_props(), and MsiSetPropertyW().

◆ msi_resolve_file_source()

WCHAR * msi_resolve_file_source ( MSIPACKAGE package,
MSIFILE file 
)

Definition at line 536 of file files.c.

537{
538 WCHAR *p, *path;
539
540 TRACE("Working to resolve source of file %s\n", debugstr_w(file->File));
541
542 if (file->IsCompressed) return NULL;
543
544 p = msi_resolve_source_folder( package, file->Component->Directory, NULL );
545 path = msi_build_directory_name( 2, p, file->ShortName );
546
547 if (file->LongName && msi_get_file_attributes( package, path ) == INVALID_FILE_ATTRIBUTES)
548 {
549 free( path );
550 path = msi_build_directory_name( 2, p, file->LongName );
551 }
552 free( p );
553 TRACE("file %s source resolves to %s\n", debugstr_w(file->File), debugstr_w(path));
554 return path;
555}
DWORD msi_get_file_attributes(MSIPACKAGE *package, const WCHAR *path)
Definition: files.c:115
WCHAR * msi_resolve_source_folder(MSIPACKAGE *package, const WCHAR *name, MSIFOLDER **folder)
Definition: install.c:364

Referenced by ACTION_InstallFiles(), and ACTION_ProcessComponents().

◆ msi_resolve_source_folder()

WCHAR * msi_resolve_source_folder ( MSIPACKAGE package,
const WCHAR name,
MSIFOLDER **  folder 
)

Definition at line 364 of file install.c.

365{
366 MSIFOLDER *f;
367 LPWSTR p, path = NULL, parent;
368
369 TRACE("working to resolve %s\n", debugstr_w(name));
370
371 if (!wcscmp( name, L"SourceDir" )) name = L"TARGETDIR";
372 if (!(f = msi_get_loaded_folder( package, name ))) return NULL;
373
374 /* special resolving for root dir */
375 if (!wcscmp( name, L"TARGETDIR" ) && !f->ResolvedSource)
376 {
377 f->ResolvedSource = get_source_root( package );
378 }
379 if (folder) *folder = f;
380 if (f->ResolvedSource)
381 {
382 path = wcsdup( f->ResolvedSource );
383 TRACE(" already resolved to %s\n", debugstr_w(path));
384 return path;
385 }
386 if (!f->Parent) return path;
387 parent = f->Parent;
388 TRACE(" ! parent is %s\n", debugstr_w(parent));
389
390 p = msi_resolve_source_folder( package, parent, NULL );
391
393 path = get_source_root( package );
394 else if (package->WordCount & msidbSumInfoSourceTypeSFN)
395 path = msi_build_directory_name( 3, p, f->SourceShortPath, NULL );
396 else
397 path = msi_build_directory_name( 3, p, f->SourceLongPath, NULL );
398
399 TRACE("-> %s\n", debugstr_w(path));
400 f->ResolvedSource = wcsdup( path );
401 free( p );
402
403 return path;
404}
static WCHAR * get_source_root(MSIPACKAGE *package)
Definition: install.c:358
@ msidbSumInfoSourceTypeSFN
Definition: msidefs.h:221
@ msidbSumInfoSourceTypeCompressed
Definition: msidefs.h:222

Referenced by deformat_component(), msi_resolve_file_source(), msi_resolve_source_folder(), MsiGetSourcePathA(), and MsiGetSourcePathW().

◆ msi_resolve_target_folder()

void msi_resolve_target_folder ( MSIPACKAGE package,
const WCHAR name,
BOOL  load_prop 
)

Definition at line 2176 of file action.c.

2177{
2178 FolderList *fl;
2180 WCHAR *path, *normalized_path;
2181
2182 TRACE("resolving %s\n", debugstr_w(name));
2183
2184 if (!(folder = msi_get_loaded_folder( package, name ))) return;
2185
2186 if (!wcscmp( folder->Directory, L"TARGETDIR" )) /* special resolving for target root dir */
2187 {
2188 if (!(path = get_install_location( package )) &&
2189 (!load_prop || !(path = msi_dup_property( package->db, L"TARGETDIR" ))))
2190 {
2191 path = msi_dup_property( package->db, L"ROOTDRIVE" );
2192 }
2193 }
2194 else if (!load_prop || !(path = msi_dup_property( package->db, folder->Directory )))
2195 {
2196 if (folder->Parent && wcscmp( folder->Directory, folder->Parent ))
2197 {
2198 parent = msi_get_loaded_folder( package, folder->Parent );
2199 path = msi_build_directory_name( 3, parent->ResolvedTarget, folder->TargetDefault, NULL );
2200 }
2201 else
2202 path = msi_build_directory_name( 2, folder->TargetDefault, NULL );
2203 }
2204
2205 normalized_path = msi_normalize_path( path );
2206 msi_set_property( package->db, folder->Directory, normalized_path, -1 );
2207 free( path );
2208
2209 free( folder->ResolvedTarget );
2210 folder->ResolvedTarget = normalized_path;
2211
2213 {
2214 child = fl->folder;
2215 msi_resolve_target_folder( package, child->Directory, load_prop );
2216 }
2217 TRACE("%s resolves to %s\n", debugstr_w(name), debugstr_w(folder->ResolvedTarget));
2218}
WCHAR * msi_normalize_path(const WCHAR *in)
Definition: action.c:2116
static WCHAR * get_install_location(MSIPACKAGE *package)
Definition: action.c:2160
_In_ FLONG fl
Definition: winddi.h:1279

Referenced by ACTION_CostFinalize(), msi_get_target_folder(), msi_resolve_target_folder(), and set_target_path().

◆ msi_revert_fs_redirection()

◆ msi_save_string_table()

UINT msi_save_string_table ( const string_table st,
IStorage storage,
UINT bytes_per_strref 
)

Definition at line 564 of file string.c.

565{
566 UINT i, datasize = 0, poolsize = 0, sz, used, r, codepage, n;
568 CHAR *data = NULL;
569 USHORT *pool = NULL;
570
571 TRACE("\n");
572
573 /* construct the new table in memory first */
574 string_totalsize( st, &datasize, &poolsize );
575
576 TRACE("%u %u %u\n", st->maxcount, datasize, poolsize );
577
578 pool = malloc( poolsize );
579 if( ! pool )
580 {
581 WARN("Failed to alloc pool %d bytes\n", poolsize );
582 goto err;
583 }
584 data = malloc( datasize );
585 if( ! data )
586 {
587 WARN("Failed to alloc data %d bytes\n", datasize );
588 goto err;
589 }
590
591 used = 0;
592 codepage = st->codepage;
593 pool[0] = codepage & 0xffff;
594 pool[1] = codepage >> 16;
595 if (st->maxcount > 0xffff)
596 {
597 pool[1] |= 0x8000;
598 *bytes_per_strref = LONG_STR_BYTES;
599 }
600 else
601 *bytes_per_strref = sizeof(USHORT);
602
603 n = 1;
604 for( i=1; i<st->maxcount; i++ )
605 {
606 if( !st->strings[i].persistent_refcount )
607 {
608 pool[ n*2 ] = 0;
609 pool[ n*2 + 1] = 0;
610 n++;
611 continue;
612 }
613
614 sz = datasize - used;
615 r = id2string( st, i, data+used, &sz );
616 if( r != ERROR_SUCCESS )
617 {
618 ERR("failed to fetch string\n");
619 sz = 0;
620 }
621
622 if (sz)
623 pool[ n*2 + 1 ] = st->strings[i].persistent_refcount;
624 else
625 pool[ n*2 + 1 ] = 0;
626 if (sz < 0x10000)
627 {
628 pool[ n*2 ] = sz;
629 n++;
630 }
631 else
632 {
633 pool[ n*2 ] = 0;
634 pool[ n*2 + 2 ] = sz&0xffff;
635 pool[ n*2 + 3 ] = (sz>>16);
636 n += 2;
637 }
638 used += sz;
639 if( used > datasize )
640 {
641 ERR("oops overran %d >= %d\n", used, datasize);
642 goto err;
643 }
644 }
645
646 if( used != datasize )
647 {
648 ERR("oops used %d != datasize %d\n", used, datasize);
649 goto err;
650 }
651
652 /* write the streams */
653 r = write_stream_data( storage, L"_StringData", data, datasize, TRUE );
654 TRACE("Wrote StringData r=%08x\n", r);
655 if( r )
656 goto err;
657 r = write_stream_data( storage, L"_StringPool", pool, poolsize, TRUE );
658 TRACE("Wrote StringPool r=%08x\n", r);
659 if( r )
660 goto err;
661
663
664err:
665 free( data );
666 free( pool );
667
668 return ret;
669}
static int used
Definition: adh-main.c:39
static UINT id2string(const string_table *st, UINT id, char *buffer, UINT *sz)
Definition: string.c:372
static void string_totalsize(const string_table *st, UINT *datasize, UINT *poolsize)
Definition: string.c:424
#define err(...)

Referenced by MSI_CommitTables().

◆ msi_schedule_action()

UINT msi_schedule_action ( MSIPACKAGE package,
UINT  script,
const WCHAR action 
)

Definition at line 90 of file custom.c.

91{
92 UINT count;
93 WCHAR **newbuf = NULL;
94
95 if (script >= SCRIPT_MAX)
96 {
97 FIXME("Unknown script requested %u\n", script);
99 }
100 TRACE("Scheduling action %s in script %u\n", debugstr_w(action), script);
101
103 package->script_actions_count[script]++;
104 if (count != 0) newbuf = realloc( package->script_actions[script],
105 package->script_actions_count[script] * sizeof(WCHAR *) );
106 else newbuf = malloc( sizeof(WCHAR *) );
107
108 newbuf[count] = wcsdup( action );
109 package->script_actions[script] = newbuf;
110 return ERROR_SUCCESS;
111}

Referenced by ACTION_CreateFolders(), ACTION_CreateShortcuts(), ACTION_DeleteServices(), ACTION_DuplicateFiles(), ACTION_HandleStandardAction(), ACTION_InstallFiles(), ACTION_InstallODBC(), ACTION_InstallServices(), ACTION_MoveFiles(), ACTION_MsiPublishAssemblies(), ACTION_MsiUnpublishAssemblies(), ACTION_PatchFiles(), ACTION_ProcessComponents(), ACTION_PublishComponents(), ACTION_PublishFeatures(), ACTION_PublishProduct(), ACTION_RegisterClassInfo(), ACTION_RegisterExtensionInfo(), ACTION_RegisterFonts(), ACTION_RegisterMIMEInfo(), ACTION_RegisterProduct(), ACTION_RegisterProgIdInfo(), ACTION_RegisterTypeLibraries(), ACTION_RegisterUser(), ACTION_RemoveDuplicateFiles(), ACTION_RemoveEnvironmentStrings(), ACTION_RemoveFiles(), ACTION_RemoveFolders(), ACTION_RemoveIniValues(), ACTION_RemoveODBC(), ACTION_RemoveRegistryValues(), ACTION_RemoveShortcuts(), ACTION_SelfRegModules(), ACTION_SelfUnregModules(), ACTION_StartServices(), ACTION_StopServices(), ACTION_UnpublishComponents(), ACTION_UnpublishFeatures(), ACTION_UnregisterClassInfo(), ACTION_UnregisterExtensionInfo(), ACTION_UnregisterFonts(), ACTION_UnregisterMIMEInfo(), ACTION_UnregisterProgIdInfo(), ACTION_UnregisterTypeLibraries(), ACTION_WriteEnvironmentStrings(), ACTION_WriteIniValues(), ACTION_WriteRegistryValues(), and defer_custom_action().

◆ MSI_Sequence()

UINT MSI_Sequence ( MSIPACKAGE package,
LPCWSTR  szTable 
)

Definition at line 450 of file action.c.

451{
452 MSIQUERY *view;
453 UINT r;
454
455 TRACE("%p %s\n", package, debugstr_w(table));
456
457 r = MSI_OpenQuery( package->db, &view, L"SELECT * FROM `%s` WHERE `Sequence` > 0 ORDER BY `Sequence`", table );
458 if (r == ERROR_SUCCESS)
459 {
461 msiobj_release(&view->hdr);
462 }
463 return r;
464}
static UINT ITERATE_Actions(MSIRECORD *row, LPVOID param)
Definition: action.c:408

Referenced by MsiSequenceW().

◆ msi_set_context()

UINT msi_set_context ( MSIPACKAGE package)

Definition at line 394 of file action.c.

395{
396 UINT r = msi_locate_product( package->ProductCode, &package->Context );
397 if (r != ERROR_SUCCESS)
398 {
399 int num = msi_get_property_int( package->db, L"ALLUSERS", 0 );
400 if (num == 1 || num == 2)
402 else
404 }
405 return ERROR_SUCCESS;
406}
GLuint GLuint num
Definition: glext.h:9618

Referenced by MSI_InstallPackage(), and MSI_OpenPackageW().

◆ msi_set_file_attributes()

BOOL msi_set_file_attributes ( MSIPACKAGE package,
const WCHAR filename,
DWORD  attrs 
)

Definition at line 106 of file files.c.

107{
108 BOOL ret;
110 ret = SetFileAttributesW( filename, attrs );
111 msi_revert_fs_redirection( package );
112 return ret;
113}

Referenced by ACTION_RemoveFiles(), cabinet_copy_file(), copy_file_attributes(), and copy_install_file().

◆ msi_set_last_used_source()

UINT msi_set_last_used_source ( LPCWSTR  product,
LPCWSTR  usersid,
MSIINSTALLCONTEXT  context,
DWORD  options,
LPCWSTR  value 
)

Definition at line 686 of file source.c.

689{
690 HKEY source;
692 WCHAR typechar;
693 DWORD size;
694 UINT r;
695 int index = 1;
696
698 typechar = 'n';
699 else if (options & MSISOURCETYPE_URL)
700 typechar = 'u';
701 else if (options & MSISOURCETYPE_MEDIA)
702 typechar = 'm';
703 else
705
707 {
708 r = MsiSourceListAddSourceExW(product, usersid, context,
709 options, value, 0);
710 if (r != ERROR_SUCCESS)
711 return r;
712
713 index = 0;
714 while ((r = MsiSourceListEnumSourcesW(product, usersid, context, options,
716 index++;
717
718 if (r != ERROR_NO_MORE_ITEMS)
719 return r;
720 }
721
722 size = lstrlenW(L"%c;%d;%s") + lstrlenW(value) + 7;
723 buffer = malloc(size * sizeof(WCHAR));
724 if (!buffer)
725 return ERROR_OUTOFMEMORY;
726
728 if (r != ERROR_SUCCESS)
729 {
730 free(buffer);
731 return r;
732 }
733
734 swprintf(buffer, size, L"%c;%d;%s", typechar, index, value);
735
736 size = (lstrlenW(buffer) + 1) * sizeof(WCHAR);
739 free(buffer);
740
742 return r;
743}
UINT WINAPI MsiSourceListAddSourceExW(const WCHAR *szProduct, const WCHAR *szUserSid, MSIINSTALLCONTEXT dwContext, DWORD dwOptions, const WCHAR *szSource, DWORD dwIndex)
Definition: source.c:1033
static UINT OpenSourceKey(LPCWSTR szProduct, HKEY *key, DWORD dwOptions, MSIINSTALLCONTEXT context, BOOL create)
Definition: source.c:53
UINT WINAPI MsiSourceListEnumSourcesW(const WCHAR *szProductCodeOrPatch, const WCHAR *szUserSid, MSIINSTALLCONTEXT dwContext, DWORD dwOptions, DWORD dwIndex, WCHAR *szSource, DWORD *pcchSource)
Definition: source.c:398

Referenced by MsiSourceListSetInfoW(), and publish_sourcelist().

◆ msi_set_original_database_property()

UINT msi_set_original_database_property ( MSIDATABASE db,
const WCHAR package 
)

Definition at line 1310 of file package.c.

1311{
1312 UINT r;
1313
1314 if (UrlIsW( package, URLIS_URL ))
1315 r = msi_set_property( db, L"OriginalDatabase", package, -1 );
1316 else if (package[0] == '#')
1317 r = msi_set_property( db, L"OriginalDatabase", db->path, -1 );
1318 else
1319 {
1320 DWORD len;
1321 WCHAR *path;
1322
1323 if (!(len = GetFullPathNameW( package, 0, NULL, NULL ))) return GetLastError();
1324 if (!(path = malloc( len * sizeof(WCHAR) ))) return ERROR_OUTOFMEMORY;
1325 len = GetFullPathNameW( package, len, path, NULL );
1326 r = msi_set_property( db, L"OriginalDatabase", path, len );
1327 free( path );
1328 }
1329 return r;
1330}
DWORD WINAPI GetFullPathNameW(IN LPCWSTR lpFileName, IN DWORD nBufferLength, OUT LPWSTR lpBuffer, OUT LPWSTR *lpFilePart)
Definition: path.c:1106

Referenced by MSI_InstallPackage(), and MSI_OpenPackageW().

◆ msi_set_property()

UINT msi_set_property ( MSIDATABASE db,
const WCHAR name,
const WCHAR value,
int  len 
)

Definition at line 2100 of file package.c.

2101{
2102 MSIQUERY *view;
2103 MSIRECORD *row = NULL;
2104 DWORD sz = 0;
2105 WCHAR query[1024];
2106 UINT rc;
2107
2108 TRACE("%p %s %s %d\n", db, debugstr_w(name), debugstr_wn(value, len), len);
2109
2110 if (!name)
2112
2113 /* this one is weird... */
2114 if (!name[0])
2116
2117 if (value && len < 0) len = lstrlenW( value );
2118
2119 rc = msi_get_property( db, name, 0, &sz );
2120 if (!value || (!*value && !len))
2121 {
2122 swprintf( query, ARRAY_SIZE(query), L"DELETE FROM `_Property` WHERE `_Property` = '%s'", name );
2123 }
2124 else if (rc == ERROR_MORE_DATA || rc == ERROR_SUCCESS)
2125 {
2126 swprintf( query, ARRAY_SIZE(query), L"UPDATE `_Property` SET `Value` = ? WHERE `_Property` = '%s'", name );
2127 row = MSI_CreateRecord(1);
2129 }
2130 else
2131 {
2132 lstrcpyW( query, L"INSERT INTO `_Property` (`_Property`,`Value`) VALUES (?,?)" );
2133 row = MSI_CreateRecord(2);
2134 msi_record_set_string( row, 1, name, -1 );
2136 }
2137
2138 rc = MSI_DatabaseOpenViewW(db, query, &view);
2139 if (rc == ERROR_SUCCESS)
2140 {
2141 rc = MSI_ViewExecute(view, row);
2143 msiobj_release(&view->hdr);
2144 }
2145 if (row) msiobj_release(&row->hdr);
2146 return rc;
2147}
UINT msi_get_property(MSIDATABASE *db, LPCWSTR szName, LPWSTR szValueBuf, LPDWORD pchValueBuf)
Definition: package.c:2250
UINT msi_record_set_string(MSIRECORD *, UINT, const WCHAR *, int)
Definition: record.c:573

Referenced by ACTION_CostFinalize(), ACTION_CostInitialize(), ACTION_CustomAction(), ACTION_DisableRollback(), ACTION_INSTALL(), ACTION_ProcessExecSequence(), append_productcode(), dialog_set_property(), event_add_local(), event_add_source(), event_reinstall(), event_reinstall_mode(), event_remove(), ITERATE_AppSearch(), ITERATE_CCPSearch(), msi_adjust_privilege_properties(), MSI_CreatePackage(), MSI_InstallPackage(), msi_load_suminfo_properties(), MSI_OpenPackageW(), msi_parse_command_line(), msi_resolve_target_folder(), msi_set_original_database_property(), msi_set_sourcedir_props(), MSI_SetInstallLevel(), msi_validate_product_id(), MsiSetPropertyW(), patch_set_media_source_prop(), process_overrides(), set_deferred_action_props(), set_installed_prop(), set_installer_properties(), set_msi_assembly_prop(), set_target_path(), and set_user_sid_prop().

◆ msi_set_sourcedir_props()

UINT msi_set_sourcedir_props ( MSIPACKAGE package,
BOOL  replace 
)

Definition at line 352 of file action.c.

353{
354 WCHAR *source, *check, *p, *db;
355 DWORD len;
356
357 if (!(db = msi_dup_property( package->db, L"OriginalDatabase" )))
358 return ERROR_OUTOFMEMORY;
359
360 if (!(p = wcsrchr( db, '\\' )) && !(p = wcsrchr( db, '/' )))
361 {
362 free(db);
363 return ERROR_SUCCESS;
364 }
365 len = p - db + 2;
366 source = malloc( len * sizeof(WCHAR) );
367 lstrcpynW( source, db, len );
368 free( db );
369
370 check = msi_dup_property( package->db, L"SourceDir" );
371 if (!check || replace)
372 {
373 UINT r = msi_set_property( package->db, L"SourceDir", source, -1 );
374 if (r == ERROR_SUCCESS)
375 msi_reset_source_folders( package );
376 }
377 free( check );
378
379 check = msi_dup_property( package->db, L"SOURCEDIR" );
380 if (!check || replace)
381 msi_set_property( package->db, L"SOURCEDIR", source, -1 );
382
383 free( check );
384 free( source );
385
386 return ERROR_SUCCESS;
387}
#define lstrcpynW
Definition: compat.h:738
#define check(expected, result)
Definition: dplayx.c:32
INT replace(TCHAR source[MAX_PATH], TCHAR dest[MAX_PATH], DWORD dwFlags, BOOL *doMore)
Definition: replace.c:38

Referenced by ACTION_InstallFiles(), ACTION_ProcessComponents(), ACTION_ResolveSource(), get_source_root(), MSI_InstallPackage(), and msi_load_media_info().

◆ msi_set_string_table_codepage()

UINT msi_set_string_table_codepage ( string_table st,
UINT  codepage 
)

Definition at line 676 of file string.c.

677{
679 {
680 st->codepage = codepage;
681 return ERROR_SUCCESS;
682 }
684}
static BOOL validate_codepage(UINT codepage)
Definition: string.c:61

Referenced by MSI_DatabaseImport().

◆ MSI_SetFeatureStates()

UINT MSI_SetFeatureStates ( MSIPACKAGE package)

Definition at line 1639 of file action.c.

1640{
1641 int level;
1642 MSICOMPONENT* component;
1644
1645 TRACE("Checking Install Level\n");
1646
1647 level = msi_get_property_int(package->db, L"INSTALLLEVEL", 1);
1648
1649 if (msi_get_property_int( package->db, L"Preselected", 0 ))
1650 {
1652 {
1653 if (!is_feature_selected( feature, level )) continue;
1654
1655 if (feature->ActionRequest == INSTALLSTATE_UNKNOWN)
1656 {
1657 if (feature->Installed == INSTALLSTATE_ABSENT)
1658 {
1659 feature->Action = INSTALLSTATE_UNKNOWN;
1660 feature->ActionRequest = INSTALLSTATE_UNKNOWN;
1661 }
1662 else
1663 {
1664 feature->Action = feature->Installed;
1665 feature->ActionRequest = feature->Installed;
1666 }
1667 }
1668 }
1669 }
1670 else if (!msi_get_property_int( package->db, L"Installed", 0 ))
1671 {
1673 {
1674 if (!is_feature_selected( feature, level )) continue;
1675
1676 if (feature->ActionRequest == INSTALLSTATE_UNKNOWN)
1677 {
1679 {
1680 feature->Action = INSTALLSTATE_SOURCE;
1681 feature->ActionRequest = INSTALLSTATE_SOURCE;
1682 }
1683 else if (feature->Attributes & msidbFeatureAttributesFavorAdvertise)
1684 {
1686 feature->ActionRequest = INSTALLSTATE_ADVERTISED;
1687 }
1688 else
1689 {
1690 feature->Action = INSTALLSTATE_LOCAL;
1691 feature->ActionRequest = INSTALLSTATE_LOCAL;
1692 }
1693 }
1694 }
1695 }
1696 else
1697 {
1699 {
1700 ComponentList *cl;
1701 MSIFEATURE *cur;
1702
1703 if (!is_feature_selected( feature, level )) continue;
1704 if (feature->ActionRequest != INSTALLSTATE_UNKNOWN) continue;
1705
1706 LIST_FOR_EACH_ENTRY( cl, &feature->Components, ComponentList, entry )
1707 {
1708 if (!cl->component->updated && !cl->component->added)
1709 continue;
1710
1711 cur = feature;
1712 while (cur)
1713 {
1714 if (cur->ActionRequest != INSTALLSTATE_UNKNOWN)
1715 break;
1716
1717 if (cur->Installed != INSTALLSTATE_ABSENT)
1718 {
1719 cur->Action = cur->Installed;
1720 cur->ActionRequest = cur->Installed;
1721 }
1722 else if (!cl->component->added)
1723 {
1724 break;
1725 }
1726 else if (cur->Attributes & msidbFeatureAttributesFavorSource)
1727 {
1728 cur->Action = INSTALLSTATE_SOURCE;
1729 cur->ActionRequest = INSTALLSTATE_SOURCE;
1730 }
1731 else if (cur->Attributes & msidbFeatureAttributesFavorAdvertise)
1732 {
1733 cur->Action = INSTALLSTATE_ADVERTISED;
1734 cur->ActionRequest = INSTALLSTATE_ADVERTISED;
1735 }
1736 else
1737 {
1738 cur->Action = INSTALLSTATE_LOCAL;
1739 cur->ActionRequest = INSTALLSTATE_LOCAL;
1740 }
1741
1742 if (!cur->Feature_Parent)
1743 break;
1744 cur = msi_get_loaded_feature(package, cur->Feature_Parent);
1745 }
1746 }
1747 }
1748 }
1749
1750 /* disable child features of unselected parent or follow parent */
1752 {
1753 if (feature->Feature_Parent) continue;
1756 }
1757
1758 /* now we want to set component state based based on feature state */
1760 {
1761 ComponentList *cl;
1762
1763 TRACE("examining feature %s (level %d installed %d request %d action %d)\n",
1764 debugstr_w(feature->Feature), feature->Level, feature->Installed,
1765 feature->ActionRequest, feature->Action);
1766
1767 /* features with components that have compressed files are made local */
1768 LIST_FOR_EACH_ENTRY( cl, &feature->Components, ComponentList, entry )
1769 {
1770 if (cl->component->ForceLocalState &&
1771 feature->ActionRequest == INSTALLSTATE_SOURCE)
1772 {
1773 feature->Action = INSTALLSTATE_LOCAL;
1774 feature->ActionRequest = INSTALLSTATE_LOCAL;
1775 break;
1776 }
1777 }
1778
1779 LIST_FOR_EACH_ENTRY( cl, &feature->Components, ComponentList, entry )
1780 {
1781 component = cl->component;
1782
1783 switch (feature->ActionRequest)
1784 {
1786 component->anyAbsent = 1;
1787 break;
1789 component->hasAdvertisedFeature = 1;
1790 break;
1792 component->hasSourceFeature = 1;
1793 break;
1794 case INSTALLSTATE_LOCAL:
1795 component->hasLocalFeature = 1;
1796 break;
1799 component->hasAdvertisedFeature = 1;
1800 else if (feature->Attributes & msidbFeatureAttributesFavorSource)
1801 component->hasSourceFeature = 1;
1802 else
1803 component->hasLocalFeature = 1;
1804 break;
1806 if (feature->Installed == INSTALLSTATE_ADVERTISED)
1807 component->hasAdvertisedFeature = 1;
1808 if (feature->Installed == INSTALLSTATE_SOURCE)
1809 component->hasSourceFeature = 1;
1810 if (feature->Installed == INSTALLSTATE_LOCAL)
1811 component->hasLocalFeature = 1;
1812 break;
1813 default:
1814 break;
1815 }
1816 }
1817 }
1818
1819 LIST_FOR_EACH_ENTRY( component, &package->components, MSICOMPONENT, entry )
1820 {
1821 /* check if it's local or source */
1822 if (!(component->Attributes & msidbComponentAttributesOptional) &&
1823 (component->hasLocalFeature || component->hasSourceFeature))
1824 {
1826 !component->ForceLocalState)
1827 {
1828 component->Action = INSTALLSTATE_SOURCE;
1830 }
1831 else
1832 {
1833 component->Action = INSTALLSTATE_LOCAL;
1834 component->ActionRequest = INSTALLSTATE_LOCAL;
1835 }
1836 continue;
1837 }
1838
1839 /* if any feature is local, the component must be local too */
1840 if (component->hasLocalFeature)
1841 {
1842 component->Action = INSTALLSTATE_LOCAL;
1843 component->ActionRequest = INSTALLSTATE_LOCAL;
1844 continue;
1845 }
1846 if (component->hasSourceFeature)
1847 {
1848 component->Action = INSTALLSTATE_SOURCE;
1850 continue;
1851 }
1852 if (component->hasAdvertisedFeature)
1853 {
1854 component->Action = INSTALLSTATE_ADVERTISED;
1856 continue;
1857 }
1858 TRACE("nobody wants component %s\n", debugstr_w(component->Component));
1859 if (component->anyAbsent && component->ComponentId)
1860 {
1861 component->Action = INSTALLSTATE_ABSENT;
1863 }
1864 }
1865
1866 LIST_FOR_EACH_ENTRY( component, &package->components, MSICOMPONENT, entry )
1867 {
1868 if (component->ActionRequest == INSTALLSTATE_DEFAULT)
1869 {
1870 TRACE("%s was default, setting to local\n", debugstr_w(component->Component));
1871 component->Action = INSTALLSTATE_LOCAL;
1872 component->ActionRequest = INSTALLSTATE_LOCAL;
1873 }
1874
1875 if (component->ActionRequest == INSTALLSTATE_SOURCE &&
1876 component->Installed == INSTALLSTATE_SOURCE &&
1877 component->hasSourceFeature)
1878 {
1879 component->Action = INSTALLSTATE_UNKNOWN;
1881 }
1882
1883 if (component->Action == INSTALLSTATE_LOCAL || component->Action == INSTALLSTATE_SOURCE)
1884 component->num_clients++;
1885 else if (component->Action == INSTALLSTATE_ABSENT)
1886 {
1887 component->num_clients--;
1888
1889 if (component->num_clients > 0)
1890 {
1891 TRACE("multiple clients uses %s - disallowing uninstallation\n", debugstr_w(component->Component));
1892 component->Action = INSTALLSTATE_UNKNOWN;
1893 }
1894 }
1895
1896 TRACE("component %s (installed %d request %d action %d)\n",
1897 debugstr_w(component->Component), component->Installed, component->ActionRequest, component->Action);
1898 }
1899
1900 return ERROR_SUCCESS;
1901}
static BOOL is_feature_selected(MSIFEATURE *feature, INT level)
Definition: action.c:1506
static void disable_children(MSIFEATURE *feature, int level)
Definition: action.c:1600
static void follow_parent(MSIFEATURE *feature)
Definition: action.c:1620
GLint level
Definition: gl.h:1546
@ INSTALLSTATE_DEFAULT
Definition: msi.h:48
@ msidbFeatureAttributesFavorAdvertise
Definition: msidefs.h:151
unsigned int hasAdvertisedFeature
Definition: msipriv.h:544
unsigned int anyAbsent
Definition: msipriv.h:543
unsigned int updated
Definition: msipriv.h:548
unsigned int hasSourceFeature
Definition: msipriv.h:546
BOOL ForceLocalState
Definition: msipriv.h:533
unsigned int added
Definition: msipriv.h:547

Referenced by ACTION_CostFinalize(), and MSI_SetInstallLevel().

◆ MSI_SetFeatureStateW()

UINT MSI_SetFeatureStateW ( MSIPACKAGE package,
LPCWSTR  szFeature,
INSTALLSTATE  iState 
)

Definition at line 915 of file install.c.

916{
917 UINT rc = ERROR_SUCCESS;
919
920 TRACE("%s %i\n", debugstr_w(szFeature), iState);
921
922 feature = msi_get_loaded_feature( package, szFeature );
923 if (!feature)
925
926 if (iState == INSTALLSTATE_ADVERTISED &&
929
930 feature->ActionRequest = iState;
931
933
934 /* update all the features that are children of this feature */
936 {
937 if (child->Feature_Parent && !wcscmp( szFeature, child->Feature_Parent ))
938 MSI_SetFeatureStateW(package, child->Feature, iState);
939 }
940
941 return rc;
942}
UINT MSI_SetFeatureStateW(MSIPACKAGE *package, LPCWSTR szFeature, INSTALLSTATE iState)
Definition: install.c:915
void ACTION_UpdateComponentStates(MSIPACKAGE *package, MSIFEATURE *feature)
Definition: install.c:833
@ msidbFeatureAttributesDisallowAdvertise
Definition: msidefs.h:152

Referenced by event_add_local(), event_add_source(), event_remove(), MSI_SetFeatureStateW(), MsiConfigureFeatureW(), and MsiSetFeatureStateW().

◆ MSI_SetInstallLevel()

UINT MSI_SetInstallLevel ( MSIPACKAGE package,
int  iInstallLevel 
)

Definition at line 1571 of file install.c.

1572{
1573 WCHAR level[6];
1574 int len;
1575 UINT r;
1576
1577 TRACE("%p %i\n", package, iInstallLevel);
1578
1579 if (iInstallLevel > 32767)
1581
1582 if (iInstallLevel < 1)
1583 return MSI_SetFeatureStates( package );
1584
1585 len = swprintf( level, ARRAY_SIZE(level), L"%d", iInstallLevel );
1586 r = msi_set_property( package->db, L"INSTALLLEVEL", level, len );
1587 if ( r == ERROR_SUCCESS )
1588 r = MSI_SetFeatureStates( package );
1589
1590 return r;
1591}
UINT MSI_SetFeatureStates(MSIPACKAGE *package)
Definition: action.c:1639

Referenced by event_set_install_level(), and MsiSetInstallLevel().

◆ MSI_SetTargetPathW()

UINT MSI_SetTargetPathW ( MSIPACKAGE package,
LPCWSTR  szFolder,
LPCWSTR  szFolderPath 
)

Definition at line 564 of file install.c.

565{
566 DWORD attrib;
568 MSIFILE *file;
569
570 TRACE("%p %s %s\n", package, debugstr_w(szFolder), debugstr_w(szFolderPath));
571
572 attrib = msi_get_file_attributes( package, szFolderPath );
573 /* native MSI tests writeability by making temporary files at each drive */
574 if (attrib != INVALID_FILE_ATTRIBUTES &&
575 (attrib & FILE_ATTRIBUTE_OFFLINE || attrib & FILE_ATTRIBUTE_READONLY))
576 {
578 }
579 if (!(folder = msi_get_loaded_folder( package, szFolder ))) return ERROR_DIRECTORY;
580
581 set_target_path( package, folder, szFolderPath );
582
584 {
585 const WCHAR *dir;
586 MSICOMPONENT *comp = file->Component;
587
588 if (!comp->Enabled || msi_is_global_assembly( comp )) continue;
589
590 dir = msi_get_target_folder( package, comp->Directory );
591 free( file->TargetPath );
592 file->TargetPath = msi_build_directory_name( 2, dir, file->FileName );
593 }
594 return ERROR_SUCCESS;
595}
static void set_target_path(MSIPACKAGE *package, MSIFOLDER *folder, const WCHAR *path)
Definition: install.c:542
const WCHAR * msi_get_target_folder(MSIPACKAGE *package, const WCHAR *name)
Definition: install.c:232
#define FILE_ATTRIBUTE_OFFLINE
Definition: nt_native.h:712
#define ERROR_DIRECTORY
Definition: winerror.h:295

Referenced by ACTION_CustomAction(), event_set_target_path(), and MsiSetTargetPathW().

◆ msi_split_string()

WCHAR ** msi_split_string ( const WCHAR str,
WCHAR  sep 
)

Definition at line 304 of file action.c.

305{
306 LPCWSTR pc;
307 LPWSTR p, *ret = NULL;
308 UINT count = 0;
309
310 if (!str)
311 return ret;
312
313 /* count the number of substrings */
314 for ( pc = str, count = 0; pc; count++ )
315 {
316 pc = wcschr( pc, sep );
317 if (pc)
318 pc++;
319 }
320
321 /* allocate space for an array of substring pointers and the substrings */
322 ret = malloc( (count + 1) * sizeof(WCHAR *) + (wcslen(str) + 1) * sizeof(WCHAR) );
323 if (!ret)
324 return ret;
325
326 /* copy the string and set the pointers */
327 p = (LPWSTR) &ret[count+1];
328 lstrcpyW( p, str );
329 for( count = 0; (ret[count] = p); count++ )
330 {
331 p = wcschr( p, sep );
332 if (p)
333 *p++ = 0;
334 }
335
336 return ret;
337}

Referenced by apply_patch_db(), get_patch_product_codes(), ITERATE_BindImage(), msi_apply_patches(), msi_apply_transforms(), and msi_check_patch_applicable().

◆ msi_strcpy_to_awstring()

UINT msi_strcpy_to_awstring ( const WCHAR str,
int  len,
awstring awbuf,
DWORD sz 
)

Definition at line 158 of file install.c.

159{
161
162 if (awbuf->str.w && !sz)
164 if (!sz)
165 return ERROR_SUCCESS;
166
167 if (len < 0) len = lstrlenW( str );
168
169 if (awbuf->unicode && awbuf->str.w)
170 {
171 memcpy( awbuf->str.w, str, min(len + 1, *sz) * sizeof(WCHAR) );
172 if (*sz && len >= *sz)
173 awbuf->str.w[*sz - 1] = 0;
174 }
175 else
176 {
177 int lenA = WideCharToMultiByte( CP_ACP, 0, str, len + 1, NULL, 0, NULL, NULL );
178 if (lenA) lenA--;
179 WideCharToMultiByte( CP_ACP, 0, str, len + 1, awbuf->str.a, *sz, NULL, NULL );
180 if (awbuf->str.a && *sz && lenA >= *sz)
181 awbuf->str.a[*sz - 1] = 0;
182 len = lenA;
183 }
184 if (awbuf->str.w && len >= *sz)
186 *sz = len;
187 return r;
188}
#define min(a, b)
Definition: monoChain.cc:55
LPWSTR w
Definition: msipriv.h:743
LPSTR a
Definition: msipriv.h:742
union awstring::@501 str
BOOL unicode
Definition: msipriv.h:740

Referenced by MSI_EnumComponentQualifiers(), MSI_GetComponentPath(), MSI_GetProductInfo(), and MSI_GetUserInfo().

◆ msi_strdupW()

WCHAR * msi_strdupW ( const WCHAR value,
int  len 
)

Definition at line 155 of file record.c.

156{
157 WCHAR *ret;
158
159 if (!value) return NULL;
160 if (!(ret = malloc( (len + 1) * sizeof(WCHAR) ))) return NULL;
161 memcpy( ret, value, len * sizeof(WCHAR) );
162 ret[len] = 0;
163 return ret;
164}

Referenced by ACTION_ExecuteAction(), msi_record_set_string(), MSI_RecordCopyField(), and parse_value().

◆ msi_string2id()

UINT msi_string2id ( const string_table st,
const WCHAR data,
int  len,
UINT id 
)

Definition at line 400 of file string.c.

401{
402 int i, c, low = 0, high = st->sortcount - 1;
403
404 if (len < 0) len = lstrlenW( str );
405
406 while (low <= high)
407 {
408 i = (low + high) / 2;
409 c = cmp_string( str, len, st->strings[st->sorted[i]].data, st->strings[st->sorted[i]].len );
410
411 if (c < 0)
412 high = i - 1;
413 else if (c > 0)
414 low = i + 1;
415 else
416 {
417 *id = st->sorted[i];
418 return ERROR_SUCCESS;
419 }
420 }
422}
static int cmp_string(const WCHAR *str1, int len1, const WCHAR *str2, int len2)
Definition: string.c:163
const GLubyte * c
Definition: glext.h:8905
#define c
Definition: ke_i.h:80
UINT sortcount
Definition: string.c:56

Referenced by find_stream(), get_table_value_from_record(), get_tablecolumns(), join_find_row(), msi_add_string(), record_to_row(), storages_find_row(), streams_find_row(), string2id(), TABLE_add_column(), TABLE_Exists(), TABLE_set_string(), and TransformView_Create().

◆ msi_string_lookup()

const WCHAR * msi_string_lookup ( const string_table st,
UINT  id,
int len 
)

Definition at line 343 of file string.c.

344{
345 if( id == 0 )
346 {
347 if (len) *len = 0;
348 return L"";
349 }
350 if( id >= st->maxcount )
351 return NULL;
352
353 if( id && !st->strings[id].persistent_refcount && !st->strings[id].nonpersistent_refcount)
354 return NULL;
355
356 if (len) *len = st->strings[id].len;
357
358 return st->strings[id].data;
359}
GLuint id
Definition: glext.h:5910

Referenced by dump_table(), get_stream_name(), get_tablecolumns(), get_transform_record(), id2string(), msi_commit_streams(), msi_create_table(), msi_view_refresh_row(), STORAGES_set_stream(), STREAMS_delete_row(), STRING_evaluate(), TABLE_add_column(), TransformView_Create(), and TransformView_drop_table().

◆ msi_strncpyW()

UINT msi_strncpyW ( const WCHAR str,
int  len,
WCHAR buf,
DWORD sz 
)

Definition at line 213 of file install.c.

214{
216
217 if (!sz)
219
220 if (len < 0) len = lstrlenW(str);
221 if (buf)
222 memcpy(buf, str, min(len + 1, *sz) * sizeof(WCHAR));
223 if (buf && len >= *sz)
224 {
225 if (*sz) buf[*sz - 1] = 0;
227 }
228 *sz = len;
229 return r;
230}

Referenced by MsiFormatRecordW(), MsiGetPropertyW(), MsiGetSourcePathW(), MsiGetTargetPathW(), MsiSummaryInfoGetPropertyW(), and MsiViewGetErrorW().

◆ msi_strncpyWtoA()

UINT msi_strncpyWtoA ( const WCHAR str,
int  len,
char buf,
DWORD sz,
BOOL  remote 
)

Definition at line 190 of file install.c.

191{
193 DWORD lenA;
194
195 if (!sz)
197
198 if (lenW < 0) lenW = lstrlenW(str);
199 lenA = WideCharToMultiByte(CP_ACP, 0, str, lenW + 1, NULL, 0, NULL, NULL);
200 WideCharToMultiByte(CP_ACP, 0, str, lenW + 1, buf, *sz, NULL, NULL);
201 lenA--;
202 if (buf && lenA >= *sz)
203 {
204 if (*sz) buf[*sz - 1] = 0;
206 }
207 if (remote && lenA >= *sz)
208 lenA *= 2;
209 *sz = lenA;
210 return r;
211}

Referenced by MsiFormatRecordA(), MsiGetPropertyA(), MsiGetSourcePathA(), MsiGetTargetPathA(), MsiSummaryInfoGetPropertyA(), and MsiViewGetErrorA().

◆ msi_suminfo_dup_string()

WCHAR * msi_suminfo_dup_string ( MSISUMMARYINFO si,
UINT  property 
)

Definition at line 701 of file suminfo.c.

702{
703 PROPVARIANT *prop;
704
705 if ( uiProperty >= MSI_MAX_PROPS )
706 return NULL;
707 prop = &si->property[uiProperty];
708 if( prop->vt != VT_LPSTR )
709 return NULL;
710 return strdupAtoW( prop->pszVal );
711}
static WCHAR * strdupAtoW(const char *str)
Definition: main.c:65
@ VT_LPSTR
Definition: compat.h:2324
#define MSI_MAX_PROPS
Definition: msipriv.h:482

Referenced by check_transform_applicable(), msi_check_patch_applicable(), msi_get_package_code(), msi_get_suminfo_product(), parse_patch_summary(), and parse_suminfo().

◆ msi_suminfo_get_int32()

INT msi_suminfo_get_int32 ( MSISUMMARYINFO si,
UINT  uiProperty 
)

Definition at line 713 of file suminfo.c.

714{
715 PROPVARIANT *prop;
716
717 if ( uiProperty >= MSI_MAX_PROPS )
718 return -1;
719 prop = &si->property[uiProperty];
720 if( prop->vt != VT_I4 )
721 return -1;
722 return prop->lVal;
723}

Referenced by check_transform_applicable(), and parse_suminfo().

◆ msi_table_apply_transform()

UINT msi_table_apply_transform ( MSIDATABASE db,
IStorage stg,
int  err_cond 
)

Definition at line 3368 of file table.c.

3369{
3370 struct list transforms;
3371 IEnumSTATSTG *stgenum = NULL;
3372 struct transform_data *transform;
3373 struct transform_data *tables = NULL, *columns = NULL;
3374 HRESULT hr;
3375 STATSTG stat;
3378 UINT bytes_per_strref;
3379 BOOL property_update = FALSE;
3381
3382 TRACE("%p %p\n", db, stg );
3383
3384 strings = msi_load_string_table( stg, &bytes_per_strref );
3385 if( !strings )
3386 goto end;
3387
3388 hr = IStorage_EnumElements( stg, 0, NULL, 0, &stgenum );
3389 if (FAILED( hr ))
3390 goto end;
3391
3392 list_init(&transforms);
3393
3394 while ( TRUE )
3395 {
3396 struct table_view *tv = NULL;
3397 WCHAR name[0x40];
3398 ULONG count = 0;
3399
3400 hr = IEnumSTATSTG_Next( stgenum, 1, &stat, &count );
3401 if (FAILED( hr ) || !count)
3402 break;
3403
3404 decode_streamname( stat.pwcsName, name );
3405 CoTaskMemFree( stat.pwcsName );
3406 if ( name[0] != 0x4840 )
3407 continue;
3408
3409 if ( !wcscmp( name+1, L"_StringPool" ) ||
3410 !wcscmp( name+1, L"_StringData" ) )
3411 continue;
3412
3413 transform = calloc( 1, sizeof(*transform) );
3414 if ( !transform )
3415 break;
3416
3417 list_add_tail( &transforms, &transform->entry );
3418
3419 transform->name = wcsdup( name + 1 );
3420
3421 if ( !wcscmp( transform->name, L"_Tables" ) )
3422 tables = transform;
3423 else if (!wcscmp( transform->name, L"_Columns" ) )
3425 else if (!wcscmp( transform->name, L"Property" ))
3426 property_update = TRUE;
3427
3428 TRACE("transform contains stream %s\n", debugstr_w(name));
3429
3430 /* load the table */
3431 if (TABLE_CreateView( db, transform->name, (MSIVIEW**) &tv ) != ERROR_SUCCESS)
3432 continue;
3433
3434 if (tv->view.ops->execute( &tv->view, NULL ) != ERROR_SUCCESS)
3435 {
3436 tv->view.ops->delete( &tv->view );
3437 continue;
3438 }
3439
3440 tv->view.ops->delete( &tv->view );
3441 }
3442
3443 if (err_cond & MSITRANSFORM_ERROR_VIEWTRANSFORM)
3444 {
3445 static const WCHAR create_query[] = L"CREATE TABLE `_TransformView` ( "
3446 L"`Table` CHAR(0) NOT NULL TEMPORARY, `Column` CHAR(0) NOT NULL TEMPORARY, "
3447 L"`Row` CHAR(0) TEMPORARY, `Data` CHAR(0) TEMPORARY, `Current` CHAR(0) TEMPORARY "
3448 L"PRIMARY KEY `Table`, `Column`, `Row` ) HOLD";
3449
3450 MSIQUERY *query;
3451 UINT r;
3452
3454 if (r != ERROR_SUCCESS)
3455 goto end;
3456
3458 if (r == ERROR_SUCCESS)
3460 msiobj_release( &query->hdr );
3462 goto end;
3463
3464 if (TABLE_CreateView(db, L"_TransformView", &transform_view) != ERROR_SUCCESS)
3465 goto end;
3466
3468 transform_view->ops->add_ref( transform_view );
3469
3470 r = transform_view->ops->add_column( transform_view, L"new",
3471 MSITYPE_TEMPORARY | MSITYPE_NULLABLE | 0x402 /* INT */, FALSE );
3472 if (r != ERROR_SUCCESS)
3473 goto end;
3474 }
3475
3476 /*
3477 * Apply _Tables and _Columns transforms first so that
3478 * the table metadata is correct, and empty tables exist.
3479 */
3480 ret = table_load_transform( db, stg, strings, tables, bytes_per_strref, err_cond );
3482 goto end;
3483
3484 ret = table_load_transform( db, stg, strings, columns, bytes_per_strref, err_cond );
3486 goto end;
3487
3489
3490 while ( !list_empty( &transforms ) )
3491 {
3492 transform = LIST_ENTRY( list_head( &transforms ), struct transform_data, entry );
3493
3494 if ( wcscmp( transform->name, L"_Columns" ) &&
3495 wcscmp( transform->name, L"_Tables" ) &&
3496 ret == ERROR_SUCCESS )
3497 {
3498 ret = table_load_transform( db, stg, strings, transform, bytes_per_strref, err_cond );
3499 }
3500
3501 list_remove( &transform->entry );
3502 free( transform->name );
3503 free( transform );
3504 }
3505
3506 if ( ret == ERROR_SUCCESS )
3507 {
3508 append_storage_to_db( db, stg );
3509 if (property_update) msi_clone_properties( db );
3510 }
3511
3512end:
3513 if ( stgenum )
3514 IEnumSTATSTG_Release( stgenum );
3515 if ( strings )
3517 if (transform_view)
3518 {
3519 struct tagMSITABLE *table = ((struct table_view *)transform_view)->table;
3520
3521 if (ret != ERROR_SUCCESS)
3522 transform_view->ops->release( transform_view );
3523
3524 if (!wcscmp(table->colinfo[table->col_count - 1].colname, L"new"))
3525 TABLE_remove_column( transform_view, table->colinfo[table->col_count - 1].number );
3526 transform_view->ops->delete( transform_view );
3527 }
3528
3529 return ret;
3530}
static void transform_view(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
Definition: state.c:3964
void append_storage_to_db(MSIDATABASE *db, IStorage *stg)
Definition: database.c:76
static UINT table_load_transform(MSIDATABASE *db, IStorage *stg, string_table *st, struct transform_data *transform, UINT bytes_per_strref, int err_cond)
Definition: table.c:3175
static UINT TABLE_remove_column(struct tagMSIVIEW *view, UINT number)
Definition: table.c:1937
UINT TABLE_CreateView(MSIDATABASE *db, LPCWSTR name, MSIVIEW **view)
Definition: table.c:2191
struct nls_table * tables
Definition: nls_base.c:22
GLsizei const GLchar *const * strings
Definition: glext.h:7622
#define MSITYPE_TEMPORARY
Definition: msipriv.h:53
#define MSITYPE_NULLABLE
Definition: msipriv.h:51
VOID msi_destroy_stringtable(string_table *st)
Definition: string.c:107
@ MSITRANSFORM_ERROR_VIEWTRANSFORM
Definition: msiquery.h:156
static struct query * create_query(void)
Definition: pdh_main.c:152
MSIDATABASE * db
Definition: table.c:999
struct column_info * columns
Definition: table.c:1001
UINT(* execute)(struct tagMSIVIEW *view, MSIRECORD *record)
Definition: msipriv.h:293
UINT(* delete)(struct tagMSIVIEW *)
Definition: msipriv.h:324
const MSIVIEWOPS * ops
Definition: msipriv.h:355
#define ERROR_INVALID_TABLE
Definition: winerror.h:986
#define ERROR_BAD_QUERY_SYNTAX
Definition: winerror.h:973

Referenced by apply_substorage_transform(), and MSI_DatabaseApplyTransformW().

◆ msi_ui_progress()

void msi_ui_progress ( MSIPACKAGE package,
int  a,
int  b,
int  c,
int  d 
)

◆ msi_uninstall_assembly()

UINT msi_uninstall_assembly ( MSIPACKAGE package,
MSICOMPONENT comp 
)

Definition at line 402 of file assembly.c.

403{
404 HRESULT hr;
408
409 if (!init_assembly_caches( package )) return ERROR_FUNCTION_FAILED;
410
411 if (comp->assembly->feature)
412 feature = msi_get_loaded_feature( package, comp->assembly->feature );
413
414 if (assembly->application)
415 {
416 if (feature) feature->Action = INSTALLSTATE_ABSENT;
417 return ERROR_SUCCESS;
418 }
419 TRACE("removing %s\n", debugstr_w(assembly->display_name));
420
421 if (assembly->attributes == msidbAssemblyAttributesWin32)
422 {
423 cache = package->cache_sxs;
424 hr = IAssemblyCache_UninstallAssembly( cache, 0, assembly->display_name, NULL, NULL );
425 if (FAILED( hr )) WARN( "failed to uninstall assembly %#lx\n", hr );
426 }
427 else
428 {
429 unsigned int i;
430 for (i = 0; i < CLR_VERSION_MAX; i++)
431 {
432 if (!assembly->clr_version[i]) continue;
433 cache = package->cache_net[i];
434 if (cache)
435 {
436 hr = IAssemblyCache_UninstallAssembly( cache, 0, assembly->display_name, NULL, NULL );
437 if (FAILED( hr )) WARN( "failed to uninstall assembly %#lx\n", hr );
438 }
439 }
440 }
441 if (feature) feature->Action = INSTALLSTATE_ABSENT;
442 return ERROR_SUCCESS;
443}

Referenced by ACTION_RemoveFiles().

◆ msi_validate_product_id()

UINT msi_validate_product_id ( MSIPACKAGE package)

Definition at line 7188 of file action.c.

7189{
7190 LPWSTR key, template, id;
7192
7193 id = msi_dup_property( package->db, L"ProductID" );
7194 if (id)
7195 {
7196 free( id );
7197 return ERROR_SUCCESS;
7198 }
7199 template = msi_dup_property( package->db, L"PIDTemplate" );
7200 key = msi_dup_property( package->db, L"PIDKEY" );
7201 if (key && template)
7202 {
7203 FIXME( "partial stub: template %s key %s\n", debugstr_w(template), debugstr_w(key) );
7204#ifdef __REACTOS__
7205 WARN("Product key validation HACK, see CORE-14710\n");
7206#else
7207 r = msi_set_property( package->db, L"ProductID", key, -1 );
7208#endif
7209 }
7210 free( template );
7211 free( key );
7212 return r;
7213}

Referenced by ACTION_ValidateProductID(), and event_validate_product_id().

◆ msi_version_str_to_dword()

DWORD msi_version_str_to_dword ( LPCWSTR  p)

Definition at line 188 of file registry.c.

189{
190 DWORD major, minor = 0, build = 0, version = 0;
191
192 if (!p)
193 return version;
194
195 major = wcstol(p, NULL, 10);
196
197 p = wcschr(p, '.');
198 if (p)
199 {
200 minor = wcstol(p+1, NULL, 10);
201 p = wcschr(p+1, '.');
202 if (p)
203 build = wcstol(p+1, NULL, 10);
204 }
205
206 return MAKELONG(build, MAKEWORD(minor, major));
207}
#define MAKEWORD(a, b)
Definition: typedefs.h:248
#define MAKELONG(a, b)
Definition: typedefs.h:249

Referenced by ITERATE_FindRelatedProducts(), publish_install_properties(), and publish_product_properties().

◆ msi_view_get_row()

UINT msi_view_get_row ( MSIDATABASE db,
MSIVIEW view,
UINT  row,
MSIRECORD **  rec 
)

Definition at line 353 of file msiquery.c.

354{
355 UINT row_count = 0, col_count = 0, r;
357
358 TRACE("view %p, row %u, rec %p.\n", view, row, rec);
359
360 if ((r = view->ops->get_dimensions(view, &row_count, &col_count)))
361 return r;
362
363 if (row >= row_count)
364 return ERROR_NO_MORE_ITEMS;
365
366 if (!(object = MSI_CreateRecord( col_count )))
367 return ERROR_OUTOFMEMORY;
368
369 if ((r = msi_view_refresh_row(db, view, row, object)))
370 msiobj_release( &object->hdr );
371 else
372 *rec = object;
373
374 return r;
375}
UINT msi_view_refresh_row(MSIDATABASE *db, MSIVIEW *view, UINT row, MSIRECORD *rec)
Definition: msiquery.c:287

Referenced by join_modify_update(), MSI_ViewFetch(), TABLE_get_row(), TransformView_delete_row(), and TransformView_set_row().

◆ MSI_ViewClose()

UINT MSI_ViewClose ( MSIQUERY query)

◆ MSI_ViewExecute()

◆ MSI_ViewFetch()

UINT MSI_ViewFetch ( MSIQUERY query,
MSIRECORD **  prec 
)

Definition at line 377 of file msiquery.c.

378{
379 MSIVIEW *view;
380 UINT r;
381
382 TRACE("%p %p\n", query, prec );
383
384 view = query->view;
385 if( !view )
387
388 r = msi_view_get_row(query->db, view, query->row, prec);
389 if (r == ERROR_SUCCESS)
390 {
391 query->row ++;
392 (*prec)->cookie = (UINT64)(ULONG_PTR)query;
393 MSI_RecordSetInteger(*prec, 0, 1);
394 }
395 else if (r == ERROR_NO_MORE_ITEMS)
396 {
397 /* end of view; reset cursor to first row */
398 query->row = 0;
399 }
400
401 return r;
402}
unsigned long long UINT64
UINT msi_view_get_row(MSIDATABASE *db, MSIVIEW *view, UINT row, MSIRECORD **rec)
Definition: msiquery.c:353
uint32_t ULONG_PTR
Definition: typedefs.h:65

Referenced by add_records_to_table(), get_assembly_record(), get_property(), get_property_row(), is_uninstallable(), load_file_hash(), load_folder_persistence(), merge_diff_row(), msi_clone_properties(), MSI_IterateRecords(), MSI_QueryGetRecord(), MsiGetProductPropertyW(), MsiViewFetch(), patch_add_media(), patch_offset_get_filepatches(), patch_offset_get_files(), patch_offset_modify_db(), patch_set_media_source_prop(), patch_set_offsets(), and TransformView_Create().

◆ MSI_ViewGetColumnInfo()

UINT MSI_ViewGetColumnInfo ( MSIQUERY query,
MSICOLINFO  info,
MSIRECORD **  prec 
)

Definition at line 602 of file msiquery.c.

603{
605 MSIRECORD *rec;
608 BOOL temporary;
609
610 if( !view )
612
613 if( !view->ops->get_dimensions )
615
616 r = view->ops->get_dimensions( view, NULL, &count );
617 if( r != ERROR_SUCCESS )
618 return r;
619 if( !count )
621
622 rec = MSI_CreateRecord( count );
623 if( !rec )
625
626 for( i=0; i<count; i++ )
627 {
628 name = NULL;
629 r = view->ops->get_column_info( view, i+1, &name, &type, &temporary, NULL );
630 if( r != ERROR_SUCCESS )
631 continue;
632 if (info == MSICOLINFO_NAMES)
633 MSI_RecordSetStringW( rec, i+1, name );
634 else
635 set_record_type_string( rec, i+1, type, temporary );
636 }
637 *prec = rec;
638 return ERROR_SUCCESS;
639}
static UINT set_record_type_string(MSIRECORD *rec, UINT field, UINT type, BOOL temporary)
Definition: msiquery.c:567
@ MSICOLINFO_NAMES
Definition: msiquery.h:36

Referenced by get_key_value(), get_query_columns(), get_query_types(), merge_verify_colnames(), MSI_DatabaseExport(), and MsiViewGetColumnInfo().

◆ MSI_ViewModify()

UINT MSI_ViewModify ( MSIQUERY query,
MSIMODIFY  mode,
MSIRECORD rec 
)

Definition at line 697 of file msiquery.c.

698{
699 MSIVIEW *view = NULL;
700 UINT r;
701
702 if ( !query || !rec )
704
705 view = query->view;
706 if ( !view || !view->ops->modify)
708
709 if ( mode == MSIMODIFY_UPDATE && rec->cookie != (UINT64)(ULONG_PTR)query )
711
712 r = view->ops->modify( view, mode, rec, query->row - 1 );
714 query->row--;
715
716 return r;
717}
@ MSIMODIFY_DELETE
Definition: msiquery.h:57
@ MSIMODIFY_UPDATE
Definition: msiquery.h:53

Referenced by add_records_to_table(), MsiViewModify(), patch_set_offsets(), and patch_update_file_sequence().

◆ MsiCreateAndVerifyInstallerDirectory()

UINT WINAPI MsiCreateAndVerifyInstallerDirectory ( DWORD  dwReserved)

Definition at line 3810 of file msi.c.

3811{
3813
3814 TRACE( "%#lx\n", dwReserved );
3815
3816 if (dwReserved)
3817 {
3818 FIXME( "dwReserved = %#lx\n", dwReserved );
3820 }
3821
3823 return ERROR_FUNCTION_FAILED;
3824
3825 lstrcatW(path, L"\\Installer");
3826
3828 return ERROR_FUNCTION_FAILED;
3829
3830 return ERROR_SUCCESS;
3831}
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS _In_ DWORD dwReserved
Definition: mswsock.h:95

◆ MsiDecomposeDescriptorA()

UINT WINAPI MsiDecomposeDescriptorA ( LPCSTR  szDescriptor,
LPSTR  szProduct,
LPSTR  szFeature,
LPSTR  szComponent,
LPDWORD  pUsed 
)

Definition at line 984 of file registry.c.

986{
987 WCHAR product[MAX_FEATURE_CHARS+1];
989 WCHAR component[MAX_FEATURE_CHARS+1];
990 LPWSTR str = NULL, p = NULL, f = NULL, c = NULL;
991 UINT r;
992
993 TRACE("%s %p %p %p %p\n", debugstr_a(szDescriptor), szProduct,
994 szFeature, szComponent, pUsed);
995
996 str = strdupAtoW( szDescriptor );
997 if( szDescriptor && !str )
998 return ERROR_OUTOFMEMORY;
999
1000 if (szProduct)
1001 p = product;
1002 if (szFeature)
1003 f = feature;
1004 if (szComponent)
1005 c = component;
1006
1007 r = MsiDecomposeDescriptorW( str, p, f, c, pUsed );
1008
1009 if (r == ERROR_SUCCESS)
1010 {
1011 WideCharToMultiByte( CP_ACP, 0, p, -1,
1012 szProduct, MAX_FEATURE_CHARS+1, NULL, NULL );
1013 WideCharToMultiByte( CP_ACP, 0, f, -1,
1014 szFeature, MAX_FEATURE_CHARS+1, NULL, NULL );
1015 WideCharToMultiByte( CP_ACP, 0, c, -1,
1016 szComponent, MAX_FEATURE_CHARS+1, NULL, NULL );
1017 }
1018
1019 free( str );
1020
1021 return r;
1022}
UINT WINAPI MsiDecomposeDescriptorW(LPCWSTR szDescriptor, LPWSTR szProduct, LPWSTR szFeature, LPWSTR szComponent, LPDWORD pUsed)
Definition: registry.c:927
#define MAX_FEATURE_CHARS
Definition: msi.h:257

◆ MsiDecomposeDescriptorW()

UINT WINAPI MsiDecomposeDescriptorW ( LPCWSTR  szDescriptor,
LPWSTR  szProduct,
LPWSTR  szFeature,
LPWSTR  szComponent,
LPDWORD  pUsed 
)

Definition at line 927 of file registry.c.

929{
930 UINT len;
931 const WCHAR *p;
932 GUID product, component;
933
934 TRACE("%s %p %p %p %p\n", debugstr_w(szDescriptor), szProduct,
935 szFeature, szComponent, pUsed);
936
937 if (!decode_base85_guid( szDescriptor, &product ))
939
940 TRACE("product %s\n", debugstr_guid( &product ));
941
942 if (!(p = wcschr( &szDescriptor[20], '>' )))
943 p = wcschr( &szDescriptor[20], '<' );
944 if (!p)
946
947 len = (p - &szDescriptor[20]);
948 if( len > MAX_FEATURE_CHARS )
950
951 TRACE("feature %s\n", debugstr_wn( &szDescriptor[20], len ));
952
953 if (*p == '>')
954 {
955 if (!decode_base85_guid( p+1, &component ))
957 TRACE( "component %s\n", debugstr_guid(&component) );
958 }
959
960 if (szProduct)
961 StringFromGUID2( &product, szProduct, MAX_FEATURE_CHARS+1 );
962 if (szComponent)
963 {
964 if (*p == '>')
965 StringFromGUID2( &component, szComponent, MAX_FEATURE_CHARS+1 );
966 else
967 szComponent[0] = 0;
968 }
969 if (szFeature)
970 {
971 memcpy( szFeature, &szDescriptor[20], len*sizeof(WCHAR) );
972 szFeature[len] = 0;
973 }
974
975 len = p - szDescriptor + 1;
976 if (*p == '>') len += 20;
977
978 TRACE("length = %d\n", len);
979 if (pUsed) *pUsed = len;
980
981 return ERROR_SUCCESS;
982}
BOOL decode_base85_guid(LPCWSTR str, GUID *guid)
Definition: registry.c:132
INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax)
Definition: compobj.c:2434

Referenced by MSI_EnumComponentQualifiers(), MSI_ProvideQualifiedComponentEx(), MsiDecomposeDescriptorA(), and MsiGetShortcutTargetW().

◆ msihandle2msiinfo()

void * msihandle2msiinfo ( MSIHANDLE  handle,
UINT  type 
)

Definition at line 158 of file handle.c.

159{
161
163 handle--;
165 goto out;
166 if (handle_table[handle].remote)
167 goto out;
168 if (!handle_table[handle].u.obj)
169 goto out;
170 if (handle_table[handle].u.obj->magic != MSIHANDLE_MAGIC)
171 goto out;
172 if (type && (handle_table[handle].u.obj->type != type))
173 goto out;
174 ret = handle_table[handle].u.obj;
176
177out:
179
180 return ret;
181}
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 * u
Definition: glfuncs.h:240

Referenced by copy_remote_record(), marshal_record(), MSI_OpenPackageW(), MsiDatabaseApplyTransformW(), MsiDatabaseCommit(), MsiDatabaseExportW(), MsiDatabaseGetPrimaryKeysW(), MsiDatabaseImportW(), MsiDatabaseIsTablePersistentW(), MsiDatabaseMergeW(), MsiDatabaseOpenViewW(), MsiEnableUIPreview(), MsiEnumComponentCostsW(), MsiFormatRecordA(), MsiFormatRecordW(), MsiGetDatabaseState(), MsiGetFeatureInfoW(), MsiGetSummaryInformationW(), MsiPreviewDialogW(), MsiProcessMessage(), MsiRecordClearData(), MsiRecordDataSize(), MsiRecordGetFieldCount(), MsiRecordGetInteger(), MsiRecordGetStringA(), MsiRecordGetStringW(), MsiRecordIsNull(), MsiRecordReadStream(), MsiRecordSetInteger(), MsiRecordSetStreamW(), MsiRecordSetStringA(), MsiRecordSetStringW(), MsiSetFeatureAttributesW(), MsiSummaryInfoGetPropertyA(), MsiSummaryInfoGetPropertyCount(), MsiSummaryInfoGetPropertyW(), MsiSummaryInfoPersist(), MsiSummaryInfoSetPropertyA(), MsiSummaryInfoSetPropertyW(), MsiViewClose(), MsiViewExecute(), MsiViewFetch(), MsiViewGetColumnInfo(), MsiViewGetErrorA(), MsiViewGetErrorW(), and MsiViewModify().

◆ MsiLoadStringA()

LANGID WINAPI MsiLoadStringA ( MSIHANDLE  handle,
UINT  id,
LPSTR  lpBuffer,
int  nBufferMax,
LANGID  lang 
)

Definition at line 2397 of file msi.c.

2399{
2400 LPWSTR bufW;
2401 LANGID r;
2402 INT len;
2403
2404 bufW = malloc(nBufferMax * sizeof(WCHAR));
2405 r = MsiLoadStringW(handle, id, bufW, nBufferMax, lang);
2406 if( r )
2407 {
2408 len = WideCharToMultiByte(CP_ACP, 0, bufW, -1, NULL, 0, NULL, NULL );
2409 if( len <= nBufferMax )
2410 WideCharToMultiByte( CP_ACP, 0, bufW, -1,
2411 lpBuffer, nBufferMax, NULL, NULL );
2412 else
2413 r = 0;
2414 }
2415 free(bufW);
2416 return r;
2417}
static TAGREF LPCWSTR LPDWORD LPVOID lpBuffer
Definition: db.cpp:175
LANGID WINAPI MsiLoadStringW(MSIHANDLE handle, UINT id, WCHAR *lpBuffer, int nBufferMax, LANGID lang)
Definition: msi.c:2359
USHORT LANGID
Definition: mui.h:9
static const WCHAR lang[]
Definition: wbemdisp.c:287

◆ MsiLoadStringW()

LANGID WINAPI MsiLoadStringW ( MSIHANDLE  ,
UINT  ,
LPWSTR  ,
int  ,
LANGID   
)

◆ msiobj_addref()

void msiobj_addref ( MSIOBJECTHDR info)

Definition at line 217 of file handle.c.

218{
219 if( !info )
220 return;
221
222 if( info->magic != MSIHANDLE_MAGIC )
223 {
224 ERR("Invalid handle!\n");
225 return;
226 }
227
228 InterlockedIncrement(&info->refcount);
229}
#define InterlockedIncrement
Definition: armddk.h:53

Referenced by alloc_msihandle(), CREATE_CreateView(), DISTINCT_CreateView(), do_msidbCustomActionTypeDll(), do_msidbCustomActionTypeScript(), INSERT_CreateView(), MSI_CreatePackage(), MSI_DatabaseOpenViewW(), MSI_EnableUIPreview(), MSI_OpenDatabaseW(), msihandle2msiinfo(), UPDATE_CreateView(), and WHERE_CreateView().

◆ msiobj_lock()

◆ msiobj_release()

int msiobj_release ( MSIOBJECTHDR info)

Definition at line 241 of file handle.c.

242{
243 int ret;
244
245 if( !info )
246 return -1;
247
248 if( info->magic != MSIHANDLE_MAGIC )
249 {
250 ERR("Invalid handle!\n");
251 return -1;
252 }
253
254 ret = InterlockedDecrement( &info->refcount );
255 if( ret==0 )
256 {
257 if( info->destructor )
258 info->destructor( info );
259 TRACE("object %p destroyed\n", info);
260 free( info );
261 }
262
263 return ret;
264}
#define InterlockedDecrement
Definition: armddk.h:52

Referenced by ACTION_AllocateRegistrySpace(), ACTION_AppSearch(), ACTION_BindImage(), ACTION_CCPSearch(), ACTION_CostFinalize(), ACTION_CreateFolders(), ACTION_CreateShortcuts(), ACTION_CustomAction(), ACTION_DeleteServices(), ACTION_DuplicateFiles(), ACTION_ExecuteAction(), ACTION_FindRelatedProducts(), ACTION_InstallODBC(), ACTION_InstallServices(), ACTION_InstallValidate(), ACTION_LaunchConditions(), ACTION_MigrateFeatureStates(), ACTION_MoveFiles(), ACTION_MsiPublishAssemblies(), ACTION_MsiUnpublishAssemblies(), ACTION_PerformActionSequence(), ACTION_ProcessComponents(), ACTION_ProcessExecSequence(), ACTION_ProcessUISequence(), ACTION_PublishComponents(), ACTION_PublishFeatures(), ACTION_PublishProduct(), ACTION_RegisterClassInfo(), ACTION_RegisterExtensionInfo(), ACTION_RegisterFonts(), ACTION_RegisterMIMEInfo(), ACTION_RegisterProduct(), ACTION_RegisterProgIdInfo(), ACTION_RegisterTypeLibraries(), ACTION_RegisterUser(), ACTION_RemoveDuplicateFiles(), ACTION_RemoveEnvironmentStrings(), ACTION_RemoveExistingProducts(), ACTION_RemoveFiles(), ACTION_RemoveFolders(), ACTION_RemoveIniValues(), ACTION_RemoveODBC(), ACTION_RemoveRegistryValues(), ACTION_RemoveShortcuts(), ACTION_ResolveSource(), ACTION_SelfRegModules(), ACTION_SelfUnregModules(), ACTION_SetODBCFolders(), ACTION_ShowDialog(), ACTION_StartServices(), ACTION_StopServices(), ACTION_UnpublishComponents(), ACTION_UnregisterClassInfo(), ACTION_UnregisterExtensionInfo(), ACTION_UnregisterFonts(), ACTION_UnregisterMIMEInfo(), ACTION_UnregisterProgIdInfo(), ACTION_UnregisterTypeLibraries(), ACTION_WriteEnvironmentStrings(), ACTION_WriteIniValues(), ACTION_WriteRegistryValues(), add_records_to_table(), add_stream(), add_table_to_db(), apply_patch_package(), arrange_record(), change_media(), check_transform_applicable(), combobox_add_items(), construct_record(), copy_remote_record(), CREATE_delete(), create_diff_row_query(), create_temp_binary(), create_temp_property_table(), deformat_string(), dialog_build_font_list(), dialog_button_handler(), dialog_create(), dialog_evaluate_control_conditions(), dialog_fill_controls(), dialog_get_uitext(), dialog_map_events(), dialog_oncreate(), dialog_radiogroup_control(), dialog_seltree_handler(), DISTINCT_delete(), event_set_target_path(), file_update_ui(), free_custom_action_data(), gather_merge_data(), get_assembly_display_name(), get_assembly_record(), get_checkbox_value(), get_key_value(), get_merge_table(), get_property(), get_property_row(), get_query_columns(), get_query_types(), get_signature(), get_table_labels(), get_transform_record(), HANDLE_CustomType19(), HANDLE_CustomType5_6(), INSERT_delete(), INSERT_execute(), internal_ui_handler(), is_uninstallable(), ITERATE_AppSearch(), ITERATE_CreateFolders(), ITERATE_DeleteService(), ITERATE_DuplicateFiles(), ITERATE_FindRelatedProducts(), ITERATE_InstallODBCDataSource(), ITERATE_InstallODBCDriver(), ITERATE_InstallODBCTranslator(), ITERATE_InstallService(), ITERATE_MoveFiles(), iterate_properties(), ITERATE_PublishComponent(), ITERATE_RegisterFonts(), ITERATE_RemoveDuplicateFiles(), ITERATE_RemoveEnvironmentString(), ITERATE_RemoveFiles(), ITERATE_RemoveFolders(), ITERATE_RemoveIniValuesOnInstall(), ITERATE_RemoveIniValuesOnUninstall(), ITERATE_RemoveODBCDataSource(), ITERATE_RemoveODBCDriver(), ITERATE_RemoveODBCTranslator(), ITERATE_RemoveRegistryValuesOnInstall(), ITERATE_RemoveRegistryValuesOnUninstall(), ITERATE_SelfRegModules(), ITERATE_SelfUnregModules(), ITERATE_StartService(), ITERATE_StopService(), ITERATE_UnpublishComponent(), ITERATE_UnregisterFonts(), ITERATE_WriteEnvironmentString(), ITERATE_WriteIniValues(), ITERATE_WriteRegistryValues(), join_modify_update(), listbox_add_items(), listview_add_items(), load_all_classes(), load_all_extensions(), load_all_files(), load_all_folders(), load_all_media(), load_all_mimes(), load_all_patches(), load_all_progids(), load_all_verbs(), load_feature(), load_file_disk_id(), load_file_hash(), load_folder_persistence(), load_given_appid(), load_given_class(), load_given_extension(), load_given_mime(), load_given_progid(), load_image(), load_patch_disk_id(), load_picture(), mark_patched_components(), marshal_record(), media_get_disk_info(), merge_diff_row(), merge_diff_tables(), merge_free_rows(), merge_verify_colnames(), merge_verify_primary_keys(), msi_add_suminfo(), MSI_ApplicablePatchW(), msi_apply_registered_patch(), msi_clone_properties(), MSI_CloneRecord(), MSI_ClosePreview(), MSI_CloseView(), msi_create_table(), MSI_CreatePackage(), MSI_DatabaseExport(), MSI_DatabaseGetPrimaryKeys(), MSI_DatabaseOpenViewW(), MSI_EnableUIPreview(), msi_export_suminfo(), MSI_FormatRecordW(), MSI_FreePackage(), msi_get_db_suminfo(), msi_get_error_message(), msi_get_package_code(), msi_get_property(), msi_get_suminfo(), msi_get_suminfo_product(), MSI_IterateRecords(), msi_load_all_components(), msi_load_all_features(), msi_load_assembly(), msi_load_media_info(), msi_load_suminfo_properties(), MSI_OpenDatabaseW(), MSI_OpenPackageW(), msi_query_merge_record(), MSI_QueryGetRecord(), MSI_Sequence(), msi_set_property(), msi_table_apply_transform(), msi_ui_progress(), msi_view_get_row(), MsiCloseHandle(), MsiCollectUserInfoA(), MsiCollectUserInfoW(), MsiConfigureFeatureW(), MsiConfigureProductExW(), MsiCreateRecord(), MsiDatabaseApplyTransformW(), MsiDatabaseCommit(), MsiDatabaseExportW(), MsiDatabaseGetPrimaryKeysW(), MsiDatabaseImportW(), MsiDatabaseIsTablePersistentW(), MsiDatabaseMergeW(), MsiDatabaseOpenViewW(), MsiDetermineApplicablePatchesW(), MsiDeterminePatchSequenceW(), MsiDoActionW(), MsiEnableUIPreview(), MsiEnumComponentCostsW(), MsiFormatRecordA(), MsiFormatRecordW(), MsiGetActiveDatabase(), MsiGetComponentStateW(), MsiGetDatabaseState(), MsiGetFeatureCostW(), MsiGetFeatureInfoW(), MsiGetFeatureStateW(), MsiGetLanguage(), MsiGetMode(), MsiGetProductPropertyW(), MsiGetPropertyA(), MsiGetPropertyW(), MsiGetSourcePathA(), MsiGetSourcePathW(), MsiGetSummaryInformationW(), MsiGetTargetPathA(), MsiGetTargetPathW(), MsiInstallProductW(), MsiOpenDatabaseW(), MsiOpenPackageExW(), MsiOpenProductW(), MsiPreviewDialogW(), MsiProcessMessage(), MsiRecordClearData(), MsiRecordDataSize(), MsiRecordGetFieldCount(), MsiRecordGetInteger(), MsiRecordGetStringA(), MsiRecordGetStringW(), MsiRecordIsNull(), MsiRecordReadStream(), MsiRecordSetInteger(), MsiRecordSetStreamW(), MsiRecordSetStringA(), MsiRecordSetStringW(), MsiReinstallFeatureW(), MsiSequenceW(), MsiSetComponentStateW(), MsiSetFeatureAttributesW(), MsiSetFeatureStateW(), MsiSetInstallLevel(), MsiSetMode(), MsiSetPropertyW(), MsiSetTargetPathW(), MsiSummaryInfoGetPropertyA(), MsiSummaryInfoGetPropertyCount(), MsiSummaryInfoGetPropertyW(), MsiSummaryInfoPersist(), MsiSummaryInfoSetPropertyA(), MsiSummaryInfoSetPropertyW(), MsiViewClose(), MsiViewExecute(), MsiViewFetch(), MsiViewGetColumnInfo(), MsiViewGetErrorA(), MsiViewGetErrorW(), MsiViewModify(), patch_add_media(), patch_offset_get_filepatches(), patch_offset_get_files(), patch_offset_modify_db(), patch_set_media_source_prop(), patch_set_offsets(), patch_update_filepatch_sequence(), publish_icons(), refresh_record(), resolve_keypath(), search_components(), search_dr(), search_ini(), search_reg(), SELECT_insert_row(), SELECT_modify(), SELECT_set_row(), TABLE_add_column(), TABLE_drop(), table_load_transform(), TABLE_remove_column(), TransformView_add_column(), TransformView_Create(), TransformView_create_table(), TransformView_delete_row(), TransformView_drop_table(), TransformView_insert_row(), TransformView_set_row(), translate_record(), ui_actioninfo(), ui_actionstart(), ui_sequence_exists(), unimplemented_action_stub(), unpublish_feature(), unpublish_icons(), UPDATE_delete(), UPDATE_execute(), update_merge_errors(), WHERE_delete(), and WHERE_set_row().

◆ msiobj_unlock()

◆ MSIREG_DeleteClassesUpgradeCodesKey()

UINT MSIREG_DeleteClassesUpgradeCodesKey ( LPCWSTR  szUpgradeCode)

Definition at line 890 of file registry.c.

891{
893 WCHAR squashed_uc[SQUASHED_GUID_SIZE];
894 HKEY hkey;
895 LONG r;
896
897 if (!squash_guid( szUpgradeCode, squashed_uc )) return ERROR_FUNCTION_FAILED;
898 TRACE("%s squashed %s\n", debugstr_w(szUpgradeCode), debugstr_w(squashed_uc));
899
900 if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"Software\\Classes\\Installer\\UpgradeCodes", 0, access, &hkey))
901 return ERROR_SUCCESS;
902 r = RegDeleteTreeW( hkey, squashed_uc );
903 RegCloseKey(hkey);
904 return r;
905}
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3333
BOOL squash_guid(LPCWSTR in, LPWSTR out)
Definition: registry.c:74

Referenced by remove_product_upgrade_code().

◆ MSIREG_DeleteLocalClassesFeaturesKey()

UINT MSIREG_DeleteLocalClassesFeaturesKey ( LPCWSTR  szProductCode)

Definition at line 858 of file registry.c.

859{
861 WCHAR squashed_pc[SQUASHED_GUID_SIZE];
862 HKEY hkey;
863 LONG r;
864
865 if (!squash_guid( szProductCode, squashed_pc )) return ERROR_FUNCTION_FAILED;
866 TRACE("%s squashed %s\n", debugstr_w(szProductCode), debugstr_w(squashed_pc));
867
868 if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"Software\\Classes\\Installer\\Features", 0, access, &hkey))
869 return ERROR_SUCCESS;
870 r = RegDeleteTreeW( hkey, squashed_pc );
871 RegCloseKey(hkey);
872 return r;
873}

Referenced by ACTION_UnpublishProduct().

◆ MSIREG_DeleteLocalClassesProductKey()

UINT MSIREG_DeleteLocalClassesProductKey ( LPCWSTR  szProductCode)

Definition at line 841 of file registry.c.

842{
844 WCHAR squashed_pc[SQUASHED_GUID_SIZE];
845 HKEY hkey;
846 LONG r;
847
848 if (!squash_guid( szProductCode, squashed_pc )) return ERROR_FUNCTION_FAILED;
849 TRACE("%s squashed %s\n", debugstr_w(szProductCode), debugstr_w(squashed_pc));
850
851 if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"Software\\Classes\\Installer\\Products", 0, access, &hkey))
852 return ERROR_SUCCESS;
853 r = RegDeleteTreeW( hkey, squashed_pc );
854 RegCloseKey(hkey);
855 return r;
856}

Referenced by ACTION_UnpublishProduct().

◆ MSIREG_DeleteProductKey()

UINT MSIREG_DeleteProductKey ( LPCWSTR  szProduct)

Definition at line 751 of file registry.c.

752{
754 WCHAR squashed_pc[SQUASHED_GUID_SIZE];
755 HKEY hkey;
756 LONG r;
757
758 if (!squash_guid( szProduct, squashed_pc )) return ERROR_FUNCTION_FAILED;
759 TRACE("%s squashed %s\n", debugstr_w(szProduct), debugstr_w(squashed_pc));
760
761 if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\Products",
762 0, access, &hkey)) return ERROR_SUCCESS;
763 r = RegDeleteTreeW( hkey, squashed_pc );
764 RegCloseKey(hkey);
765 return r;
766}

Referenced by ACTION_UnpublishProduct().

◆ MSIREG_DeleteUninstallKey()

UINT MSIREG_DeleteUninstallKey ( const WCHAR ,
enum  platform 
)

Referenced by ACTION_UnpublishProduct().

◆ MSIREG_DeleteUpgradeCodesKey()

UINT MSIREG_DeleteUpgradeCodesKey ( const WCHAR code)

Definition at line 812 of file registry.c.

813{
814 WCHAR squashed_code[SQUASHED_GUID_SIZE];
816 HKEY hkey;
817 LONG ret;
818
819 if (!squash_guid( code, squashed_code )) return ERROR_FUNCTION_FAILED;
820 TRACE( "%s squashed %s\n", debugstr_w(code), debugstr_w(squashed_code) );
821
822 if (RegOpenKeyExW( HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UpgradeCodes\\",
823 0, access, &hkey )) return ERROR_SUCCESS;
824 ret = RegDeleteTreeW( hkey, squashed_code );
825 RegCloseKey( hkey );
826 return ret;
827}
Definition: inflate.c:139

Referenced by remove_product_upgrade_code().

◆ MSIREG_DeleteUserDataComponentKey()

UINT MSIREG_DeleteUserDataComponentKey ( LPCWSTR  szComponent,
LPCWSTR  szUserSid 
)

Definition at line 552 of file registry.c.

553{
554 static const WCHAR fmtW[] =
555 L"Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\%s\\Components";
557 WCHAR *usersid, squashed_comp[SQUASHED_GUID_SIZE], keypath[0x200];
558 HKEY hkey;
559 LONG r;
560
561 if (!squash_guid( szComponent, squashed_comp )) return ERROR_FUNCTION_FAILED;
562 TRACE("%s squashed %s\n", debugstr_w(szComponent), debugstr_w(squashed_comp));
563
564 if (!szUserSid)
565 {
566 if (!(usersid = get_user_sid()))
567 {
568 ERR("Failed to retrieve user SID\n");
570 }
571 swprintf(keypath, ARRAY_SIZE(keypath), fmtW, usersid);
572 LocalFree(usersid);
573 }
574 else swprintf(keypath, ARRAY_SIZE(keypath), fmtW, szUserSid);
575
576 if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, keypath, 0, access, &hkey)) return ERROR_SUCCESS;
577 r = RegDeleteTreeW( hkey, squashed_comp );
578 RegCloseKey(hkey);
579 return r;
580}
static WCHAR * get_user_sid(void)
Definition: registry.c:269
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1594

Referenced by ACTION_ProcessComponents().

◆ MSIREG_DeleteUserDataPatchKey()

UINT MSIREG_DeleteUserDataPatchKey ( LPCWSTR  patch,
MSIINSTALLCONTEXT  context 
)

Definition at line 636 of file registry.c.

637{
638 static const WCHAR fmtW[] =
639 L"Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\%s\\Patches";
641 WCHAR *usersid, squashed_patch[SQUASHED_GUID_SIZE], keypath[0x200];
642 HKEY hkey;
643 LONG r;
644
645 if (!squash_guid( patch, squashed_patch )) return ERROR_FUNCTION_FAILED;
646 TRACE("%s squashed %s\n", debugstr_w(patch), debugstr_w(squashed_patch));
647
649 swprintf(keypath, ARRAY_SIZE(keypath), fmtW, L"S-1-5-18");
650 else
651 {
652 if (!(usersid = get_user_sid()))
653 {
654 ERR("Failed to retrieve user SID\n");
656 }
657 swprintf(keypath, ARRAY_SIZE(keypath), fmtW, usersid);
658 LocalFree(usersid);
659 }
660 if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, keypath, 0, access, &hkey)) return ERROR_SUCCESS;
661 r = RegDeleteTreeW( hkey, squashed_patch );
662 RegCloseKey(hkey);
663 return r;
664}

Referenced by ACTION_UnpublishProduct().

◆ MSIREG_DeleteUserDataProductKey()

UINT MSIREG_DeleteUserDataProductKey ( LPCWSTR  szProduct,
MSIINSTALLCONTEXT  context 
)

Definition at line 720 of file registry.c.

721{
722 static const WCHAR fmtW[] =
723 L"Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\%s\\Products";
725 WCHAR *usersid, squashed_pc[SQUASHED_GUID_SIZE], keypath[0x200];
726 HKEY hkey;
727 LONG r;
728
729 if (!squash_guid( szProduct, squashed_pc )) return ERROR_FUNCTION_FAILED;
730 TRACE("%s squashed %s\n", debugstr_w(szProduct), debugstr_w(squashed_pc));
731
733 swprintf(keypath, ARRAY_SIZE(keypath), fmtW, L"S-1-5-18");
734 else
735 {
736 if (!(usersid = get_user_sid()))
737 {
738 ERR("Failed to retrieve user SID\n");
740 }
741 swprintf(keypath, ARRAY_SIZE(keypath), fmtW, usersid);
742 LocalFree(usersid);
743 }
744
745 if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, keypath, 0, access, &hkey)) return ERROR_SUCCESS;
746 r = RegDeleteTreeW( hkey, squashed_pc );
747 RegCloseKey(hkey);
748 return r;
749}

Referenced by ACTION_RegisterUser(), and ACTION_UnpublishProduct().

◆ MSIREG_DeleteUserFeaturesKey()

UINT MSIREG_DeleteUserFeaturesKey ( LPCWSTR  szProduct)

Definition at line 445 of file registry.c.

446{
447 WCHAR squashed_pc[SQUASHED_GUID_SIZE], keypath[0x200];
448
449 if (!squash_guid( szProduct, squashed_pc )) return ERROR_FUNCTION_FAILED;
450 TRACE("%s squashed %s\n", debugstr_w(szProduct), debugstr_w(squashed_pc));
451
452 lstrcpyW( keypath, L"Software\\Microsoft\\Installer\\Features\\" );
453 lstrcatW( keypath, squashed_pc );
454 return RegDeleteTreeW(HKEY_CURRENT_USER, keypath);
455}
#define HKEY_CURRENT_USER
Definition: winreg.h:11

Referenced by ACTION_UnpublishProduct().

◆ MSIREG_DeleteUserProductKey()

UINT MSIREG_DeleteUserProductKey ( LPCWSTR  szProduct)

Definition at line 378 of file registry.c.

379{
380 WCHAR squashed_pc[SQUASHED_GUID_SIZE], keypath[0x200];
381
382 if (!squash_guid( szProduct, squashed_pc )) return ERROR_FUNCTION_FAILED;
383 TRACE("%s squashed %s\n", debugstr_w(szProduct), debugstr_w(squashed_pc));
384
385 lstrcpyW( keypath, L"Software\\Microsoft\\Installer\\Products\\" );
386 lstrcatW( keypath, squashed_pc );
387 return RegDeleteTreeW(HKEY_CURRENT_USER, keypath);
388}

Referenced by ACTION_UnpublishProduct().

◆ MSIREG_DeleteUserUpgradeCodesKey()

UINT MSIREG_DeleteUserUpgradeCodesKey ( LPCWSTR  szUpgradeCode)

Definition at line 829 of file registry.c.

830{
831 WCHAR squashed_uc[SQUASHED_GUID_SIZE], keypath[0x200];
832
833 if (!squash_guid( szUpgradeCode, squashed_uc )) return ERROR_FUNCTION_FAILED;
834 TRACE("%s squashed %s\n", debugstr_w(szUpgradeCode), debugstr_w(squashed_uc));
835
836 lstrcpyW(keypath, L"Software\\Microsoft\\Installer\\UpgradeCodes\\");
837 lstrcatW( keypath, squashed_uc );
838 return RegDeleteTreeW(HKEY_CURRENT_USER, keypath);
839}

Referenced by remove_product_upgrade_code().

◆ MSIREG_OpenClassesUpgradeCodesKey()

UINT MSIREG_OpenClassesUpgradeCodesKey ( LPCWSTR  szUpgradeCode,
HKEY key,
BOOL  create 
)

Definition at line 875 of file registry.c.

876{
878 WCHAR squashed_uc[SQUASHED_GUID_SIZE], keypath[0x200];
879
880 if (!squash_guid( szUpgradeCode, squashed_uc )) return ERROR_FUNCTION_FAILED;
881 TRACE("%s squashed %s\n", debugstr_w(szUpgradeCode), debugstr_w(squashed_uc));
882
883 lstrcpyW(keypath, L"Software\\Classes\\Installer\\UpgradeCodes\\");
884 lstrcatW( keypath, squashed_uc );
885
886 if (create) return RegCreateKeyExW(HKEY_LOCAL_MACHINE, keypath, 0, NULL, 0, access, NULL, key, NULL);
887 return RegOpenKeyExW(HKEY_LOCAL_MACHINE, keypath, 0, access, key);
888}
static const struct access_res create[16]
Definition: package.c:7505

Referenced by ITERATE_MigrateFeatureStates(), publish_upgrade_code(), and remove_product_upgrade_code().

◆ MSIREG_OpenFeaturesKey()

UINT MSIREG_OpenFeaturesKey ( LPCWSTR  szProduct,
LPCWSTR  szUserSid,
MSIINSTALLCONTEXT  context,
HKEY key,
BOOL  create 
)

Definition at line 404 of file registry.c.

406{
409 WCHAR squashed_pc[SQUASHED_GUID_SIZE], keypath[MAX_PATH], *usersid = NULL;
410
411 if (!squash_guid( szProduct, squashed_pc )) return ERROR_FUNCTION_FAILED;
412 TRACE("%s squashed %s\n", debugstr_w(szProduct), debugstr_w(squashed_pc));
413
415 {
416 lstrcpyW(keypath, L"Software\\Classes\\Installer\\Features\\");
417 lstrcatW( keypath, squashed_pc );
418 }
420 {
422 lstrcpyW(keypath, L"Software\\Microsoft\\Installer\\Features\\");
423 lstrcatW( keypath, squashed_pc );
424 }
425 else
426 {
427 if (!szUserSid)
428 {
429 if (!(usersid = get_user_sid()))
430 {
431 ERR("Failed to retrieve user SID\n");
433 }
434 szUserSid = usersid;
435 }
436 swprintf( keypath, ARRAY_SIZE(keypath),
437 L"Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\Managed\\%s\\Installer\\Features\\%s",
438 szUserSid, squashed_pc );
439 LocalFree(usersid);
440 }
441 if (create) return RegCreateKeyExW(root, keypath, 0, NULL, 0, access, NULL, key, NULL);
442 return RegOpenKeyExW(root, keypath, 0, access, key);
443}

Referenced by ACTION_PublishFeatures(), query_feature_state(), and unpublish_feature().

◆ MSIREG_OpenInstallProps()

UINT MSIREG_OpenInstallProps ( LPCWSTR  szProduct,
MSIINSTALLCONTEXT  dwContext,
LPCWSTR  szUserSid,
HKEY key,
BOOL  create 
)

Definition at line 692 of file registry.c.

693{
694 static const WCHAR fmtW[] =
695 L"Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\%s\\Products\\%s\\InstallProperties";
697 WCHAR *usersid, squashed_pc[SQUASHED_GUID_SIZE], keypath[0x200];
698
699 if (!squash_guid( szProduct, squashed_pc )) return ERROR_FUNCTION_FAILED;
700 TRACE("%s squashed %s\n", debugstr_w(szProduct), debugstr_w(squashed_pc));
701
702 if (dwContext == MSIINSTALLCONTEXT_MACHINE)
703 swprintf( keypath, ARRAY_SIZE(keypath), fmtW, L"S-1-5-18", squashed_pc );
704 else if (szUserSid)
705 swprintf( keypath, ARRAY_SIZE(keypath), fmtW, szUserSid, squashed_pc );
706 else
707 {
708 if (!(usersid = get_user_sid()))
709 {
710 ERR("Failed to retrieve user SID\n");
712 }
713 swprintf( keypath, ARRAY_SIZE(keypath), fmtW, usersid, squashed_pc );
714 LocalFree(usersid);
715 }
716 if (create) return RegCreateKeyExW(HKEY_LOCAL_MACHINE, keypath, 0, NULL, 0, access, NULL, key, NULL);
717 return RegOpenKeyExW(HKEY_LOCAL_MACHINE, keypath, 0, access, key);
718}

Referenced by ACTION_RegisterProduct(), ACTION_RegisterUser(), comp_find_package(), get_install_location(), get_registered_local_package(), MSI_GetComponentPath(), MSI_GetProductInfo(), MSI_GetUserInfo(), MSI_OpenProductW(), MsiGetPatchInfoExW(), MsiGetProductInfoExW(), MsiQueryProductStateW(), and open_package().

◆ MSIREG_OpenPatchesKey()

UINT MSIREG_OpenPatchesKey ( LPCWSTR  szPatch,
HKEY key,
BOOL  create 
)

Definition at line 768 of file registry.c.

769{
771 WCHAR squashed_pc[SQUASHED_GUID_SIZE], keypath[0x200];
772
773 if (!squash_guid( szPatch, squashed_pc )) return ERROR_FUNCTION_FAILED;
774 TRACE("%s squashed %s\n", debugstr_w(szPatch), debugstr_w(squashed_pc));
775
776 lstrcpyW( keypath, L"Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\Patches\\" );
777 lstrcatW( keypath, squashed_pc );
778
779 if (create) return RegCreateKeyExW(HKEY_LOCAL_MACHINE, keypath, 0, NULL, 0, access, NULL, key, NULL);
780 return RegOpenKeyExW(HKEY_LOCAL_MACHINE, keypath, 0, access, key);
781}

Referenced by OpenSourceKey().

◆ MSIREG_OpenProductKey()

UINT MSIREG_OpenProductKey ( LPCWSTR  szProduct,
LPCWSTR  szUserSid,
MSIINSTALLCONTEXT  context,
HKEY key,
BOOL  create 
)

Definition at line 338 of file registry.c.

339{
342 WCHAR *usersid = NULL, squashed_pc[SQUASHED_GUID_SIZE], keypath[MAX_PATH];
343
344 if (!squash_guid( szProduct, squashed_pc )) return ERROR_FUNCTION_FAILED;
345 TRACE("%s squashed %s\n", debugstr_w(szProduct), debugstr_w(squashed_pc));
346
348 {
349 lstrcpyW(keypath, L"Software\\Classes\\Installer\\Products\\");
350 lstrcatW( keypath, squashed_pc );
351 }
353 {
355 lstrcpyW( keypath, L"Software\\Microsoft\\Installer\\Products\\" );
356 lstrcatW( keypath, squashed_pc );
357 }
358 else
359 {
360 if (!szUserSid)
361 {
362 if (!(usersid = get_user_sid()))
363 {
364 ERR("Failed to retrieve user SID\n");
366 }
367 szUserSid = usersid;
368 }
369 swprintf( keypath, ARRAY_SIZE(keypath),
370 L"Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\Managed\\%s\\Installer\\Products\\%s",
371 szUserSid, squashed_pc );
372 LocalFree(usersid);
373 }
374 if (create) return RegCreateKeyExW(root, keypath, 0, NULL, 0, access, NULL, key, NULL);
375 return RegOpenKeyExW(root, keypath, 0, access, key);
376}

Referenced by ACTION_PublishProduct(), check_product_patches(), comp_find_prod_key(), ITERATE_FindRelatedProducts(), MSI_GetComponentPath(), MSI_GetProductInfo(), MSI_GetUserInfo(), msi_locate_product(), MsiEnumPatchesW(), MsiGetPatchInfoExW(), MsiGetProductCodeW(), MsiGetProductInfoExW(), MsiQueryProductStateW(), MsiSourceListAddSourceW(), OpenSourceKey(), and publish_patches().

◆ MSIREG_OpenUninstallKey()

UINT MSIREG_OpenUninstallKey ( const WCHAR ,
enum  platform,
HKEY ,
BOOL   
)

◆ MSIREG_OpenUpgradeCodesKey()

UINT MSIREG_OpenUpgradeCodesKey ( LPCWSTR  szProduct,
HKEY key,
BOOL  create 
)

Definition at line 783 of file registry.c.

784{
786 WCHAR squashed_uc[SQUASHED_GUID_SIZE], keypath[0x200];
787
788 if (!squash_guid( szUpgradeCode, squashed_uc )) return ERROR_FUNCTION_FAILED;
789 TRACE("%s squashed %s\n", debugstr_w(szUpgradeCode), debugstr_w(squashed_uc));
790
791 lstrcpyW( keypath, L"Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UpgradeCodes\\" );
792 lstrcatW( keypath, squashed_uc );
793
794 if (create) return RegCreateKeyExW(HKEY_LOCAL_MACHINE, keypath, 0, NULL, 0, access, NULL, key, NULL);
795 return RegOpenKeyExW(HKEY_LOCAL_MACHINE, keypath, 0, access, key);
796}

Referenced by ACTION_RegisterProduct(), ITERATE_FindRelatedProducts(), MsiEnumRelatedProductsW(), and remove_product_upgrade_code().

◆ MSIREG_OpenUserComponentsKey()

UINT MSIREG_OpenUserComponentsKey ( LPCWSTR  szComponent,
HKEY key,
BOOL  create 
)

Definition at line 505 of file registry.c.

506{
507 WCHAR squashed_cc[SQUASHED_GUID_SIZE], keypath[0x200];
509 UINT ret;
510
511 if (!squash_guid( szComponent, squashed_cc)) return ERROR_FUNCTION_FAILED;
512 TRACE("%s squashed %s\n", debugstr_w(szComponent), debugstr_w(squashed_cc));
513
514 lstrcpyW(keypath, L"Software\\Microsoft\\Installer\\Components\\");
515 lstrcatW( keypath, squashed_cc );
516
517 if (create) return RegCreateKeyW(HKEY_CURRENT_USER, keypath, key);
519 if (ret != ERROR_FILE_NOT_FOUND) return ret;
520
521 lstrcpyW(keypath, L"Software\\Classes\\Installer\\Components\\");
522 lstrcatW( keypath, squashed_cc );
523 return RegOpenKeyExW( HKEY_LOCAL_MACHINE, keypath, 0, access, key );
524}

Referenced by ITERATE_PublishComponent(), MSI_EnumComponentQualifiers(), and MSI_ProvideQualifiedComponentEx().

◆ MSIREG_OpenUserDataComponentKey()

UINT MSIREG_OpenUserDataComponentKey ( LPCWSTR  szComponent,
LPCWSTR  szUserSid,
HKEY key,
BOOL  create 
)

Definition at line 526 of file registry.c.

527{
528 static const WCHAR fmtW[] =
529 L"Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\%s\\Components\\%s";
531 WCHAR *usersid, squashed_comp[SQUASHED_GUID_SIZE], keypath[0x200];
532
533 if (!squash_guid( szComponent, squashed_comp )) return ERROR_FUNCTION_FAILED;
534 TRACE("%s squashed %s\n", debugstr_w(szComponent), debugstr_w(squashed_comp));
535
536 if (!szUserSid)
537 {
538 if (!(usersid = get_user_sid()))
539 {
540 ERR("Failed to retrieve user SID\n");
542 }
543 swprintf( keypath, ARRAY_SIZE(keypath), fmtW, usersid, squashed_comp );
544 LocalFree(usersid);
545 }
546 else swprintf( keypath, ARRAY_SIZE(keypath), fmtW, szUserSid, squashed_comp );
547
548 if (create) return RegCreateKeyExW(HKEY_LOCAL_MACHINE, keypath, 0, NULL, 0, access, NULL, key, NULL);
549 return RegOpenKeyExW(HKEY_LOCAL_MACHINE, keypath, 0, access, key);
550}

Referenced by ACTION_ProcessComponents(), comp_find_prodcode(), get_client_counts(), MsiEnumClientsW(), MsiGetProductCodeW(), open_userdata_comp_key(), and query_feature_state().

◆ MSIREG_OpenUserDataFeaturesKey()

UINT MSIREG_OpenUserDataFeaturesKey ( LPCWSTR  szProduct,
LPCWSTR  szUserSid,
MSIINSTALLCONTEXT  context,
HKEY key,
BOOL  create 
)

Definition at line 472 of file registry.c.

474{
475 static const WCHAR fmtW[] =
476 L"Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\%s\\Products\\%s\\Features";
478 WCHAR squashed_pc[SQUASHED_GUID_SIZE], keypath[0x200], *usersid = NULL;
479
480 if (!squash_guid( szProduct, squashed_pc )) return ERROR_FUNCTION_FAILED;
481 TRACE("%s squashed %s\n", debugstr_w(szProduct), debugstr_w(squashed_pc));
482
484 {
485 swprintf( keypath, ARRAY_SIZE(keypath), fmtW, L"S-1-5-18", squashed_pc );
486 }
487 else
488 {
489 if (!szUserSid)
490 {
491 if (!(usersid = get_user_sid()))
492 {
493 ERR("Failed to retrieve user SID\n");
495 }
496 szUserSid = usersid;
497 }
498 swprintf( keypath, ARRAY_SIZE(keypath), fmtW, szUserSid, squashed_pc );
499 LocalFree(usersid);
500 }
501 if (create) return RegCreateKeyExW(HKEY_LOCAL_MACHINE, keypath, 0, NULL, 0, access, NULL, key, NULL);
502 return RegOpenKeyExW(HKEY_LOCAL_MACHINE, keypath, 0, access, key);
503}

Referenced by ACTION_PublishFeatures(), MSI_ProvideQualifiedComponentEx(), query_feature_state(), and unpublish_feature().

◆ MSIREG_OpenUserDataPatchKey()

UINT MSIREG_OpenUserDataPatchKey ( LPCWSTR  szPatch,
MSIINSTALLCONTEXT  dwContext,
HKEY key,
BOOL  create 
)

Definition at line 610 of file registry.c.

611{
612 static const WCHAR fmtW[] =
613 L"Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\%s\\Patches\\%s";
615 WCHAR *usersid, squashed_patch[SQUASHED_GUID_SIZE], keypath[0x200];
616
617 if (!squash_guid( szPatch, squashed_patch )) return ERROR_FUNCTION_FAILED;
618 TRACE("%s squashed %s\n", debugstr_w(szPatch), debugstr_w(squashed_patch));
619
620 if (dwContext == MSIINSTALLCONTEXT_MACHINE)
621 swprintf( keypath, ARRAY_SIZE(keypath), fmtW, L"S-1-5-18", squashed_patch );
622 else
623 {
624 if (!(usersid = get_user_sid()))
625 {
626 ERR("Failed to retrieve user SID\n");
628 }
629 swprintf( keypath, ARRAY_SIZE(keypath), fmtW, usersid, squashed_patch );
630 LocalFree(usersid);
631 }
632 if (create) return RegCreateKeyExW(HKEY_LOCAL_MACHINE, keypath, 0, NULL, 0, access, NULL, key, NULL);
633 return RegOpenKeyExW(HKEY_LOCAL_MACHINE, keypath, 0, access, key);
634}

Referenced by check_product_patches(), MsiGetPatchInfoExW(), and publish_patches().

◆ MSIREG_OpenUserDataProductKey()

UINT MSIREG_OpenUserDataProductKey ( LPCWSTR  szProduct,
MSIINSTALLCONTEXT  dwContext,
LPCWSTR  szUserSid,
HKEY key,
BOOL  create 
)

Definition at line 582 of file registry.c.

583{
584 static const WCHAR fmtW[] =
585 L"Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\%s\\Products\\%s";
587 WCHAR *usersid, squashed_pc[SQUASHED_GUID_SIZE], keypath[0x200];
588
589 if (!squash_guid( szProduct, squashed_pc )) return ERROR_FUNCTION_FAILED;
590 TRACE("%s squashed %s\n", debugstr_w(szProduct), debugstr_w(squashed_pc));
591
592 if (dwContext == MSIINSTALLCONTEXT_MACHINE)
593 swprintf( keypath, ARRAY_SIZE(keypath), fmtW, L"S-1-5-18", squashed_pc );
594 else if (szUserSid)
595 swprintf( keypath, ARRAY_SIZE(keypath), fmtW, szUserSid, squashed_pc );
596 else
597 {
598 if (!(usersid = get_user_sid()))
599 {
600 ERR("Failed to retrieve user SID\n");
602 }
603 swprintf( keypath, ARRAY_SIZE(keypath), fmtW, usersid, squashed_pc );
604 LocalFree(usersid);
605 }
606 if (create) return RegCreateKeyExW(HKEY_LOCAL_MACHINE, keypath, 0, NULL, 0, access, NULL, key, NULL);
607 return RegOpenKeyExW(HKEY_LOCAL_MACHINE, keypath, 0, access, key);
608}

Referenced by ACTION_PublishProduct(), check_product_patches(), get_patch_state(), MSI_GetComponentPath(), and MsiGetPatchInfoExW().

◆ MSIREG_OpenUserDataProductPatchesKey()

UINT MSIREG_OpenUserDataProductPatchesKey ( LPCWSTR  product,
MSIINSTALLCONTEXT  context,
HKEY key,
BOOL  create 
)

Definition at line 666 of file registry.c.

667{
668 static const WCHAR fmtW[] =
669 L"Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\%s\\Products\\%s\\Patches";
671 WCHAR *usersid, squashed_product[SQUASHED_GUID_SIZE], keypath[0x200];
672
673 if (!squash_guid( product, squashed_product )) return ERROR_FUNCTION_FAILED;
674 TRACE("%s squashed %s\n", debugstr_w(product), debugstr_w(squashed_product));
675
677 swprintf( keypath, ARRAY_SIZE(keypath), fmtW, L"S-1-5-18", squashed_product );
678 else
679 {
680 if (!(usersid = get_user_sid()))
681 {
682 ERR("Failed to retrieve user SID\n");
684 }
685 swprintf( keypath, ARRAY_SIZE(keypath), fmtW, usersid, squashed_product );
686 LocalFree(usersid);
687 }
688 if (create) return RegCreateKeyExW(HKEY_LOCAL_MACHINE, keypath, 0, NULL, 0, access, NULL, key, NULL);
689 return RegOpenKeyExW(HKEY_LOCAL_MACHINE, keypath, 0, access, key);
690}

Referenced by publish_patches().

◆ MSIREG_OpenUserPatchesKey()

UINT MSIREG_OpenUserPatchesKey ( LPCWSTR  szPatch,
HKEY key,
BOOL  create 
)

Definition at line 390 of file registry.c.

391{
392 WCHAR squashed_pc[SQUASHED_GUID_SIZE], keypath[0x200];
393
394 if (!squash_guid( szPatch, squashed_pc )) return ERROR_FUNCTION_FAILED;
395 TRACE("%s squashed %s\n", debugstr_w(szPatch), debugstr_w(squashed_pc));
396
397 lstrcpyW( keypath, L"Software\\Microsoft\\Installer\\Patches\\" );
398 lstrcatW( keypath, squashed_pc );
399
400 if (create) return RegCreateKeyW(HKEY_CURRENT_USER, keypath, key);
401 return RegOpenKeyW(HKEY_CURRENT_USER, keypath, key);
402}

Referenced by OpenSourceKey().

◆ MSIREG_OpenUserUpgradeCodesKey()

UINT MSIREG_OpenUserUpgradeCodesKey ( LPCWSTR  szProduct,
HKEY key,
BOOL  create 
)

Definition at line 798 of file registry.c.

799{
800 WCHAR squashed_uc[SQUASHED_GUID_SIZE], keypath[0x200];
801
802 if (!squash_guid( szUpgradeCode, squashed_uc )) return ERROR_FUNCTION_FAILED;
803 TRACE("%s squashed %s\n", debugstr_w(szUpgradeCode), debugstr_w(squashed_uc));
804
805 lstrcpyW(keypath, L"Software\\Microsoft\\Installer\\UpgradeCodes\\");
806 lstrcatW( keypath, squashed_uc );
807
808 if (create) return RegCreateKeyW(HKEY_CURRENT_USER, keypath, key);
809 return RegOpenKeyW(HKEY_CURRENT_USER, keypath, key);
810}

Referenced by ITERATE_MigrateFeatureStates(), publish_upgrade_code(), and remove_product_upgrade_code().

◆ read_stream_data()

UINT read_stream_data ( IStorage stg,
LPCWSTR  stname,
BOOL  table,
BYTE **  pdata,
UINT psz 
)

Definition at line 234 of file table.c.

236{
237 HRESULT r;
239 VOID *data;
240 ULONG sz, count;
241 IStream *stm = NULL;
242 STATSTG stat;
243 LPWSTR encname;
244
245 encname = encode_streamname(table, stname);
246
247 TRACE("%s -> %s\n",debugstr_w(stname),debugstr_w(encname));
248
249 r = IStorage_OpenStream(stg, encname, NULL,
251 free(encname);
252 if( FAILED( r ) )
253 {
254 WARN( "open stream failed r = %#lx - empty table?\n", r );
255 return ret;
256 }
257
258 r = IStream_Stat(stm, &stat, STATFLAG_NONAME );
259 if( FAILED( r ) )
260 {
261 WARN( "open stream failed r = %#lx!\n", r );
262 goto end;
263 }
264
265 if( stat.cbSize.QuadPart >> 32 )
266 {
267 WARN("Too big!\n");
268 goto end;
269 }
270
271 sz = stat.cbSize.QuadPart;
272 data = malloc(sz);
273 if( !data )
274 {
275 WARN( "couldn't allocate memory r = %#lx!\n", r );
277 goto end;
278 }
279
280 r = IStream_Read(stm, data, sz, &count );
281 if( FAILED( r ) || ( count != sz ) )
282 {
283 free(data);
284 WARN("read stream failed r = %#lx!\n", r);
285 goto end;
286 }
287
288 *pdata = data;
289 *psz = sz;
291
292end:
293 IStream_Release( stm );
294
295 return ret;
296}
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
LPWSTR encode_streamname(BOOL bTable, LPCWSTR in)
Definition: table.c:121
static PROTOCOLDATA * pdata
Definition: protocol.c:158

Referenced by read_table_from_storage(), and table_load_transform().

◆ ready_media()

UINT ready_media ( MSIPACKAGE package,
BOOL  compressed,
MSIMEDIAINFO mi 
)

Definition at line 838 of file media.c.

839{
840 UINT rc;
841 WCHAR *cabinet_file = NULL;
842
843 /* media info for continuous cabinet is already loaded */
844 if (mi->is_continuous) return ERROR_SUCCESS;
845
846 if (mi->cabinet)
847 {
849
850 /* cabinet is internal, no checks needed */
851 if (mi->cabinet[0] == '#') return ERROR_SUCCESS;
852
853 if (!(cabinet_file = get_cabinet_filename( mi ))) return ERROR_OUTOFMEMORY;
854
855 /* package should be downloaded */
856 if (compressed && GetFileAttributesW( cabinet_file ) == INVALID_FILE_ATTRIBUTES &&
857 (base_url = get_base_url( package->db )))
858 {
859 WCHAR temppath[MAX_PATH], *p, *url;
860
861 free( cabinet_file );
862 if (!(url = realloc( base_url, (wcslen( base_url ) + wcslen( mi->cabinet ) + 1) * sizeof(WCHAR) )))
863 {
864 free( base_url );
865 return ERROR_OUTOFMEMORY;
866 }
867 lstrcatW( url, mi->cabinet );
868 if ((rc = msi_download_file( url, temppath )) != ERROR_SUCCESS)
869 {
870 ERR("failed to download %s (%u)\n", debugstr_w(url), rc);
871 free( url );
872 return rc;
873 }
874 if ((p = wcsrchr( temppath, '\\' ))) *p = 0;
875 lstrcpyW( mi->sourcedir, temppath );
876 PathAddBackslashW( mi->sourcedir );
877 free( mi->cabinet );
878 mi->cabinet = wcsdup( p + 1 );
879
880 free( url );
881 return ERROR_SUCCESS;
882 }
883 }
884 /* check volume matches, change media if not */
885 if (mi->volume_label)
886 {
887 /* assume first volume is in the drive */
888 if (mi->last_volume && wcsicmp( mi->last_volume, mi->volume_label ))
889 {
890 WCHAR *source = msi_dup_property( package->db, L"SourceDir" );
892 free( source );
893
894 if (!match && (mi->type == DRIVE_CDROM || mi->type == DRIVE_REMOVABLE))
895 {
896 if ((rc = change_media( package, mi )) != ERROR_SUCCESS)
897 {
898 free( cabinet_file );
899 return rc;
900 }
901 }
902 }
903
904 free(mi->last_volume);
905 mi->last_volume = wcsdup(mi->volume_label);
906 }
907 if (mi->cabinet)
908 {
909 if (compressed && GetFileAttributesW( cabinet_file ) == INVALID_FILE_ATTRIBUTES)
910 {
911 if ((rc = find_published_source( package, mi )) != ERROR_SUCCESS)
912 {
913 ERR("cabinet not found: %s\n", debugstr_w(cabinet_file));
914 free( cabinet_file );
916 }
917 }
918 }
919 free( cabinet_file );
920 return ERROR_SUCCESS;
921}
static UINT change_media(MSIPACKAGE *package, MSIMEDIAINFO *mi)
Definition: media.c:63
static WCHAR * get_cabinet_filename(MSIMEDIAINFO *mi)
Definition: media.c:289
static BOOL source_matches_volume(MSIMEDIAINFO *mi, LPCWSTR source_root)
Definition: media.c:39
static UINT find_published_source(MSIPACKAGE *package, MSIMEDIAINFO *mi)
Definition: media.c:742
static const WCHAR url[]
Definition: encode.c:1432
UINT msi_download_file(LPCWSTR szUrl, LPWSTR filename)
Definition: package.c:1026
Definition: match.c:28

Referenced by ACTION_InstallFiles(), and ACTION_PatchFiles().

◆ release_typelib()

void release_typelib ( void  )

Definition at line 159 of file apps.c.

160{
161 unsigned i;
162
163 for (i = 0; i < ARRAY_SIZE(typeinfo); i++)
164 if (typeinfo[i])
165 ITypeInfo_Release(typeinfo[i]);
166
167 if (typelib)
168 ITypeLib_Release(typelib);
169}

◆ rpc_filter()

◆ squash_guid()

BOOL squash_guid ( LPCWSTR  in,
LPWSTR  out 
)

Definition at line 74 of file registry.c.

75{
76 DWORD i,n=1;
77 GUID guid;
78
79 out[0] = 0;
80
81 if (FAILED(CLSIDFromString((LPCOLESTR)in, &guid)))
82 return FALSE;
83
84 for(i=0; i<8; i++)
85 out[7-i] = in[n++];
86 n++;
87 for(i=0; i<4; i++)
88 out[11-i] = in[n++];
89 n++;
90 for(i=0; i<4; i++)
91 out[15-i] = in[n++];
92 n++;
93 for(i=0; i<2; i++)
94 {
95 out[17+i*2] = in[n++];
96 out[16+i*2] = in[n++];
97 }
98 n++;
99 for( ; i<8; i++)
100 {
101 out[17+i*2] = in[n++];
102 out[16+i*2] = in[n++];
103 }
104 out[32]=0;
105 return TRUE;
106}

Referenced by ACTION_ForceReboot(), ACTION_ProcessComponents(), ACTION_PublishProduct(), ACTION_RegisterProduct(), compose_base85_guid(), create_test_guid(), ITERATE_UnpublishComponent(), MSI_GetComponentPath(), MSI_GetProductInfo(), MSI_GetUserInfo(), MsiEnumPatchesExW(), MsiEnumPatchesW(), MsiGetPatchInfoExW(), MsiGetProductCodeW(), MsiGetProductInfoExW(), MsiOpenProductW(), MsiQueryComponentStateW(), MsiQueryFeatureStateExW(), MsiQueryFeatureStateW(), MSIREG_DeleteClassesUpgradeCodesKey(), MSIREG_DeleteLocalClassesFeaturesKey(), MSIREG_DeleteLocalClassesProductKey(), MSIREG_DeleteProductKey(), MSIREG_DeleteUpgradeCodesKey(), MSIREG_DeleteUserDataComponentKey(), MSIREG_DeleteUserDataPatchKey(), MSIREG_DeleteUserDataProductKey(), MSIREG_DeleteUserFeaturesKey(), MSIREG_DeleteUserProductKey(), MSIREG_DeleteUserUpgradeCodesKey(), MSIREG_OpenClassesUpgradeCodesKey(), MSIREG_OpenFeaturesKey(), MSIREG_OpenInstallerFeaturesKey(), MSIREG_OpenInstallProps(), MSIREG_OpenPatchesKey(), MSIREG_OpenProductKey(), MSIREG_OpenUpgradeCodesKey(), MSIREG_OpenUserComponentsKey(), MSIREG_OpenUserDataComponentKey(), MSIREG_OpenUserDataFeaturesKey(), MSIREG_OpenUserDataPatchKey(), MSIREG_OpenUserDataProductKey(), MSIREG_OpenUserDataProductPatchesKey(), MSIREG_OpenUserPatchesKey(), MSIREG_OpenUserUpgradeCodesKey(), MsiSourceListAddMediaDiskW(), MsiSourceListAddSourceExW(), MsiSourceListAddSourceW(), MsiSourceListEnumMediaDisksW(), MsiSourceListEnumSourcesW(), MsiSourceListGetInfoW(), MsiSourceListSetInfoW(), publish_patches(), publish_product_properties(), publish_upgrade_code(), and remove_product_upgrade_code().

◆ strdupAtoW()

static LPWSTR strdupAtoW ( LPCSTR  str)
inlinestatic

Definition at line 1159 of file msipriv.h.

1160{
1161 LPWSTR ret = NULL;
1162 DWORD len;
1163
1164 if (!str) return ret;
1165 len = MultiByteToWideChar( CP_ACP, 0, str, -1, NULL, 0 );
1166 ret = malloc( len * sizeof(WCHAR) );
1167 if (ret)
1168 MultiByteToWideChar( CP_ACP, 0, str, -1, ret, len );
1169 return ret;
1170}
#define MultiByteToWideChar
Definition: compat.h:110

◆ strdupUtoW()

static LPWSTR strdupUtoW ( LPCSTR  str)
inlinestatic

Definition at line 1185 of file msipriv.h.

1186{
1187 LPWSTR ret = NULL;
1188 DWORD len;
1189
1190 if (!str) return ret;
1191 len = MultiByteToWideChar( CP_UTF8, 0, str, -1, NULL, 0 );
1192 ret = malloc( len * sizeof(WCHAR) );
1193 if (ret)
1194 MultiByteToWideChar( CP_UTF8, 0, str, -1, ret, len );
1195 return ret;
1196}
#define CP_UTF8
Definition: nls.h:20

Referenced by cabinet_open().

◆ strdupWtoA()

static char * strdupWtoA ( LPCWSTR  str)
inlinestatic

Definition at line 1146 of file msipriv.h.

1147{
1148 LPSTR ret = NULL;
1149 DWORD len;
1150
1151 if (!str) return ret;
1152 len = WideCharToMultiByte( CP_ACP, 0, str, -1, NULL, 0, NULL, NULL);
1153 ret = malloc( len );
1154 if (ret)
1155 WideCharToMultiByte( CP_ACP, 0, str, -1, ret, len, NULL, NULL );
1156 return ret;
1157}
char * LPSTR
Definition: xmlstorage.h:182

◆ strdupWtoU()

static char * strdupWtoU ( LPCWSTR  str)
inlinestatic

Definition at line 1172 of file msipriv.h.

1173{
1174 LPSTR ret = NULL;
1175 DWORD len;
1176
1177 if (!str) return ret;
1178 len = WideCharToMultiByte( CP_UTF8, 0, str, -1, NULL, 0, NULL, NULL);
1179 ret = malloc( len );
1180 if (ret)
1182 return ret;
1183}

Referenced by extract_cabinet().

◆ TABLE_Exists()

BOOL TABLE_Exists ( MSIDATABASE db,
LPCWSTR  name 
)

Definition at line 962 of file table.c.

963{
964 UINT r, table_id, i;
966
967 if( !wcscmp( name, L"_Tables" ) || !wcscmp( name, L"_Columns" ) ||
968 !wcscmp( name, L"_Streams" ) || !wcscmp( name, L"_Storages" ) )
969 return TRUE;
970
971 r = msi_string2id( db->strings, name, -1, &table_id );
972 if( r != ERROR_SUCCESS )
973 {
974 TRACE("Couldn't find id for %s\n", debugstr_w(name));
975 return FALSE;
976 }
977
978 r = get_table( db, L"_Tables", &table );
979 if( r != ERROR_SUCCESS )
980 {
981 ERR("table _Tables not available\n");
982 return FALSE;
983 }
984
985 for( i = 0; i < table->row_count; i++ )
986 {
987 if( read_table_int( table->data, i, 0, LONG_STR_BYTES ) == table_id )
988 return TRUE;
989 }
990
991 return FALSE;
992}
static UINT read_table_int(BYTE *const *data, UINT row, UINT col, UINT bytes)
Definition: table.c:621
UINT msi_string2id(const string_table *st, const WCHAR *data, int len, UINT *id)
Definition: string.c:400
BYTE * data

Referenced by ACTION_ShowDialog(), merge_diff_row(), merge_diff_tables(), merge_table(), msi_create_table(), MSI_DatabaseGetPrimaryKeys(), MSI_DatabaseImport(), and update_merge_errors().

◆ unmarshal_record()

UINT unmarshal_record ( const struct wire_record in,
MSIHANDLE out 
)

Definition at line 1095 of file record.c.

1096{
1097 if (!in)
1098 {
1099 *out = 0;
1100 return ERROR_SUCCESS;
1101 }
1102
1103 *out = MsiCreateRecord(in->count);
1104 if (!*out) return ERROR_OUTOFMEMORY;
1105
1106 return copy_remote_record(in, *out);
1107}
MSIHANDLE WINAPI MsiCreateRecord(UINT cParams)
Definition: record.c:92
UINT copy_remote_record(const struct wire_record *in, MSIHANDLE out)
Definition: record.c:1052

Referenced by MsiDatabaseGetPrimaryKeysW(), MsiViewFetch(), MsiViewGetColumnInfo(), s_remote_FormatRecord(), s_remote_ProcessMessage(), s_remote_ViewExecute(), and s_remote_ViewModify().

◆ unsquash_guid()

BOOL unsquash_guid ( LPCWSTR  in,
LPWSTR  out 
)

Definition at line 41 of file registry.c.

42{
43 DWORD i,n=0;
44
45 if (lstrlenW(in) != 32)
46 return FALSE;
47
48 out[n++]='{';
49 for(i=0; i<8; i++)
50 out[n++] = in[7-i];
51 out[n++]='-';
52 for(i=0; i<4; i++)
53 out[n++] = in[11-i];
54 out[n++]='-';
55 for(i=0; i<4; i++)
56 out[n++] = in[15-i];
57 out[n++]='-';
58 for(i=0; i<2; i++)
59 {
60 out[n++] = in[17+i*2];
61 out[n++] = in[16+i*2];
62 }
63 out[n++]='-';
64 for( ; i<8; i++)
65 {
66 out[n++] = in[17+i*2];
67 out[n++] = in[16+i*2];
68 }
69 out[n++]='}';
70 out[n]=0;
71 return TRUE;
72}

Referenced by check_product_patches(), fetch_machine_component(), fetch_machine_product(), fetch_user_component(), fetch_user_product(), ITERATE_FindRelatedProducts(), MSI_GetProductInfo(), MsiEnumClientsW(), MsiEnumRelatedProductsW(), and MsiGetProductCodeW().

◆ VIEW_find_column()

UINT VIEW_find_column ( MSIVIEW table,
LPCWSTR  name,
LPCWSTR  table_name,
UINT n 
)

Definition at line 59 of file msiquery.c.

60{
61 LPCWSTR col_name, haystack_table_name;
62 UINT i, count, r;
63
64 r = table->ops->get_dimensions( table, NULL, &count );
65 if( r != ERROR_SUCCESS )
66 return r;
67
68 for( i=1; i<=count; i++ )
69 {
70 INT x;
71
72 r = table->ops->get_column_info( table, i, &col_name, NULL,
73 NULL, &haystack_table_name );
74 if( r != ERROR_SUCCESS )
75 return r;
76 x = wcscmp( name, col_name );
77 if( table_name )
78 x |= wcscmp( table_name, haystack_table_name );
79 if( !x )
80 {
81 *n = i;
82 return ERROR_SUCCESS;
83 }
84 }
86}

Referenced by SELECT_AddColumn().

◆ write_stream_data()

UINT write_stream_data ( IStorage stg,
LPCWSTR  stname,
LPCVOID  data,
UINT  sz,
BOOL  bTable 
)

Definition at line 298 of file table.c.

300{
301 HRESULT r;
303 ULONG count;
304 IStream *stm = NULL;
307 LPWSTR encname;
308
309 encname = encode_streamname(bTable, stname );
310 r = IStorage_OpenStream( stg, encname, NULL,
312 if( FAILED(r) )
313 {
314 r = IStorage_CreateStream( stg, encname,
315 STGM_WRITE | STGM_SHARE_EXCLUSIVE, 0, 0, &stm);
316 }
317 free( encname );
318 if( FAILED( r ) )
319 {
320 WARN( "open stream failed r = %#lx\n", r );
321 return ret;
322 }
323
324 size.QuadPart = sz;
325 r = IStream_SetSize( stm, size );
326 if( FAILED( r ) )
327 {
328 WARN("Failed to SetSize\n");
329 goto end;
330 }
331
332 pos.QuadPart = 0;
333 r = IStream_Seek( stm, pos, STREAM_SEEK_SET, NULL );
334 if( FAILED( r ) )
335 {
336 WARN("Failed to Seek\n");
337 goto end;
338 }
339
340 if (sz)
341 {
342 r = IStream_Write(stm, data, sz, &count );
343 if( FAILED( r ) || ( count != sz ) )
344 {
345 WARN("Failed to Write\n");
346 goto end;
347 }
348 }
349
351
352end:
353 IStream_Release( stm );
354
355 return ret;
356}

Referenced by db_initialize(), msi_init_string_table(), msi_save_string_table(), and save_table().

Variable Documentation

◆ gszLogFile

WCHAR* gszLogFile
extern

Definition at line 50 of file msi_main.c.

Referenced by DllMain(), MSI_OpenPackageW(), and MsiEnableLogW().

◆ gUIContext

LPVOID gUIContext
extern

Definition at line 48 of file msi_main.c.

Referenced by MSI_ProcessMessageVerbatim(), MsiSetExternalUIA(), and MsiSetExternalUIW().

◆ gUIContextRecord

LPVOID gUIContextRecord
extern

Definition at line 49 of file msi_main.c.

Referenced by MSI_ProcessMessageVerbatim(), and MsiSetExternalUIRecord().

◆ gUIFilter

DWORD gUIFilter
extern

Definition at line 46 of file msi_main.c.

Referenced by MSI_ProcessMessageVerbatim(), MsiSetExternalUIA(), and MsiSetExternalUIW().

◆ gUIFilterRecord

DWORD gUIFilterRecord
extern

Definition at line 47 of file msi_main.c.

Referenced by MSI_ProcessMessageVerbatim(), and MsiSetExternalUIRecord().

◆ gUIHandlerA

INSTALLUI_HANDLERA gUIHandlerA
extern

Definition at line 43 of file msi_main.c.

Referenced by MSI_ProcessMessageVerbatim(), MsiSetExternalUIA(), and MsiSetExternalUIW().

◆ gUIHandlerRecord

INSTALLUI_HANDLER_RECORD gUIHandlerRecord
extern

Definition at line 45 of file msi_main.c.

Referenced by MSI_ProcessMessageVerbatim(), and MsiSetExternalUIRecord().

◆ gUIHandlerW

INSTALLUI_HANDLERW gUIHandlerW
extern

Definition at line 44 of file msi_main.c.

Referenced by MSI_ProcessMessageVerbatim(), MsiSetExternalUIA(), and MsiSetExternalUIW().

◆ gUIhwnd

HWND gUIhwnd
extern

Definition at line 42 of file msi_main.c.

Referenced by internal_ui_handler(), and MsiSetInternalUI().

◆ gUILevel

INSTALLUILEVEL gUILevel
extern

Definition at line 41 of file msi_main.c.

Referenced by MSI_CreatePackage(), and MsiSetInternalUI().

◆ is_64bit

◆ is_wow64

BOOL is_wow64
extern

Definition at line 52 of file msi.c.

Referenced by __IsWow64Process(), _SHGetCurrentVersionPath(), _SHGetDefaultValue(), CoGetPSClsid(), custom_start_server(), delete_component_path(), DllMain(), do_msidbCustomActionTypeDll(), get_owner_company(), get_registry_view(), IsOS(), msi_disable_fs_redirection(), msi_revert_fs_redirection(), reg_get_typelib_module(), RegisterTypeLib(), set_component_path(), START_TEST(), test_CoGetPSClsid(), test_create_env(), test_installprops(), test_IsWow64Process(), test_LBS_NODATA(), test_MsiConfigureProductEx(), test_MsiEnumClients(), test_MsiEnumComponents(), test_MsiEnumComponentsEx(), test_MsiEnumPatches(), test_MsiEnumPatchesEx_machine(), test_MsiEnumPatchesEx_usermanaged(), test_MsiEnumPatchesEx_userunmanaged(), test_MsiEnumProducts(), test_MsiEnumProductsEx(), test_MsiGetComponentPath(), test_MsiGetComponentPathEx(), test_MsiGetPatchInfo(), test_MsiGetPatchInfoEx(), test_MsiGetProductCode(), test_MsiGetProductInfoEx(), test_MsiGetProductProperty(), test_MsiGetUserInfo(), test_MsiOpenProduct(), test_MsiProvideQualifiedComponentEx(), test_MsiQueryComponentState(), test_MsiQueryFeatureState(), test_MsiQueryProductState(), test_NtMapViewOfSection(), test_null(), test_process_components(), test_publish(), test_publish_assemblies(), test_publish_features(), test_publish_product(), test_redirection(), test_register_font(), test_register_product(), test_register_typelib(), test_register_user(), test_RtlThreadErrorMode(), test_SHGetFolderPathA(), test_SHParseDisplayName(), test_stub(), test_SystemInfo(), test_thread_processor(), UnRegisterTypeLib(), and validate_package().

◆ msi_hInstance

HINSTANCE msi_hInstance
extern

Definition at line 51 of file msi_main.c.

Referenced by DllMain().