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

Variables

static const BOOL is_64bit = sizeof(void *) > sizeof(int)
 
BOOL is_wow64 DECLSPEC_HIDDEN
 

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 1095 of file msipriv.h.

◆ MSICABEXTRACT_FILEEXTRACTED

#define MSICABEXTRACT_FILEEXTRACTED   0x02

Definition at line 1096 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 883 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

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 1093 of file msipriv.h.

◆ record_func

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

Definition at line 865 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 1118 of file msipriv.h.

1118 {
1121 Record_tid,
1125 View_tid,
1126 LAST_tid
1127} tid_t;
tid_t
Definition: msipriv.h:1118
@ View_tid
Definition: msipriv.h:1125
@ Session_tid
Definition: msipriv.h:1122
@ Database_tid
Definition: msipriv.h:1119
@ LAST_tid
Definition: msipriv.h:1126
@ SummaryInfo_tid
Definition: msipriv.h:1124
@ StringList_tid
Definition: msipriv.h:1123
@ Record_tid
Definition: msipriv.h:1121
@ Installer_tid
Definition: msipriv.h:1120

Function Documentation

◆ ACTION_AppSearch()

UINT ACTION_AppSearch ( MSIPACKAGE package)

Definition at line 1071 of file appsearch.c.

1072{
1073 MSIQUERY *view;
1074 UINT r;
1075
1076 if (msi_action_is_unique(package, L"AppSearch"))
1077 {
1078 TRACE("Skipping AppSearch action: already done in UI sequence\n");
1079 return ERROR_SUCCESS;
1080 }
1081 else
1082 msi_register_unique_action(package, L"AppSearch");
1083
1084 r = MSI_OpenQuery( package->db, &view, L"SELECT * FROM `AppSearch`" );
1085 if (r != ERROR_SUCCESS)
1086 return ERROR_SUCCESS;
1087
1089 msiobj_release( &view->hdr );
1090 return r;
1091}
static UINT ITERATE_AppSearch(MSIRECORD *row, LPVOID param)
Definition: appsearch.c:1036
#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 MSI_IterateRecords(MSIQUERY *, LPDWORD, record_func, LPVOID) DECLSPEC_HIDDEN
Definition: msiquery.c:163
UINT WINAPIV MSI_OpenQuery(MSIDATABASE *, MSIQUERY **, LPCWSTR,...) DECLSPEC_HIDDEN
Definition: msiquery.c:138
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 1118 of file appsearch.c.

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

◆ ACTION_CustomAction()

UINT ACTION_CustomAction ( MSIPACKAGE package,
const WCHAR action 
)

Definition at line 1460 of file custom.c.

1461{
1462 UINT rc = ERROR_SUCCESS;
1463 MSIRECORD *row;
1464 UINT type;
1465 const WCHAR *source, *target, *ptr, *deferred_data = NULL;
1466 WCHAR *deformated = NULL;
1467 int len;
1468
1469 /* deferred action: [properties]Action */
1470 if ((ptr = wcsrchr(action, ']')))
1471 {
1472 deferred_data = action;
1473 action = ptr + 1;
1474 }
1475
1476 row = MSI_QueryGetRecord( package->db, L"SELECT * FROM `CustomAction` WHERE `Action` = '%s'", action );
1477 if (!row)
1479
1483
1484 TRACE("Handling custom action %s (%x %s %s)\n",debugstr_w(action),type,
1486
1487 /* handle some of the deferred actions */
1489 FIXME("msidbCustomActionTypeTSAware not handled\n");
1490
1492 {
1494 WARN("msidbCustomActionTypeNoImpersonate not handled\n");
1495
1496 if (!action_type_matches_script(type, package->script))
1497 {
1498 rc = defer_custom_action( package, action, type );
1499 goto end;
1500 }
1501 else
1502 {
1503 LPWSTR actiondata = msi_dup_property( package->db, action );
1504
1506 package->scheduled_action_running = TRUE;
1507
1509 package->commit_action_running = TRUE;
1510
1512 package->rollback_action_running = TRUE;
1513
1514 if (deferred_data)
1515 set_deferred_action_props(package, deferred_data);
1516 else if (actiondata)
1517 msi_set_property( package->db, L"CustomActionData", actiondata, -1 );
1518 else
1519 msi_set_property( package->db, L"CustomActionData", L"", -1 );
1520
1521 msi_free(actiondata);
1522 }
1523 }
1525 {
1526 rc = ERROR_SUCCESS;
1527 goto end;
1528 }
1529
1530 switch (type & CUSTOM_ACTION_TYPE_MASK)
1531 {
1532 case 1: /* DLL file stored in a Binary table stream */
1533 rc = HANDLE_CustomType1( package, source, target, type, action );
1534 break;
1535 case 2: /* EXE file stored in a Binary table stream */
1536 rc = HANDLE_CustomType2( package, source, target, type, action );
1537 break;
1538 case 5:
1539 case 6: /* JScript/VBScript file stored in a Binary table stream */
1540 rc = HANDLE_CustomType5_6( package, source, target, type, action );
1541 break;
1542 case 7: /* Concurrent install from substorage */
1543 deformat_string( package, target, &deformated );
1544 rc = HANDLE_CustomType7( package, source, target, type, action );
1545 msi_free( deformated );
1546 break;
1547 case 17:
1548 rc = HANDLE_CustomType17( package, source, target, type, action );
1549 break;
1550 case 18: /* EXE file installed with package */
1551 rc = HANDLE_CustomType18( package, source, target, type, action );
1552 break;
1553 case 19: /* Error that halts install */
1554 rc = HANDLE_CustomType19( package, source, target, type, action );
1555 break;
1556 case 21: /* JScript/VBScript file installed with the product */
1557 case 22:
1558 rc = HANDLE_CustomType21_22( package, source, target, type, action );
1559 break;
1560 case 23: /* Installs another package in the source tree */
1561 deformat_string( package, target, &deformated );
1562 rc = HANDLE_CustomType23( package, source, deformated, type, action );
1563 msi_free( deformated );
1564 break;
1565 case 34: /* EXE to be run in specified directory */
1566 rc = HANDLE_CustomType34( package, source, target, type, action );
1567 break;
1568 case 35: /* Directory set with formatted text */
1569 deformat_string( package, target, &deformated );
1570 MSI_SetTargetPathW( package, source, deformated );
1571 msi_free( deformated );
1572 break;
1573 case 37: /* JScript/VBScript text stored in target column */
1574 case 38:
1575 rc = HANDLE_CustomType37_38( package, source, target, type, action );
1576 break;
1577 case 50: /* EXE file specified by a property value */
1578 rc = HANDLE_CustomType50( package, source, target, type, action );
1579 break;
1580 case 51: /* Property set with formatted text */
1581 if (!source) break;
1582 len = deformat_string( package, target, &deformated );
1583 rc = msi_set_property( package->db, source, deformated, len );
1584 if (rc == ERROR_SUCCESS && !wcscmp( source, L"SourceDir" )) msi_reset_source_folders( package );
1585 msi_free( deformated );
1586 break;
1587 case 53: /* JScript/VBScript text specified by a property value */
1588 case 54:
1589 rc = HANDLE_CustomType53_54( package, source, target, type, action );
1590 break;
1591 default:
1592 FIXME( "unhandled action type %u (%s %s)\n", type & CUSTOM_ACTION_TYPE_MASK, debugstr_w(source),
1593 debugstr_w(target) );
1594 }
1595
1596end:
1598 package->commit_action_running = FALSE;
1599 package->rollback_action_running = FALSE;
1600 msiobj_release(&row->hdr);
1601 return rc;
1602}
#define FIXME(fmt,...)
Definition: debug.h:111
#define WARN(fmt,...)
Definition: debug.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define wcsrchr
Definition: compat.h:16
const WCHAR * action
Definition: action.c:7479
static UINT HANDLE_CustomType1(MSIPACKAGE *package, const WCHAR *source, const WCHAR *target, INT type, const WCHAR *action)
Definition: custom.c:861
static UINT defer_custom_action(MSIPACKAGE *package, const WCHAR *action, UINT type)
Definition: custom.c:1423
static UINT HANDLE_CustomType7(MSIPACKAGE *package, const WCHAR *source, const WCHAR *target, INT type, const WCHAR *action)
Definition: custom.c:1122
#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:1271
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:1330
static UINT HANDLE_CustomType23(MSIPACKAGE *package, const WCHAR *source, const WCHAR *target, INT type, const WCHAR *action)
Definition: custom.c:1043
static UINT HANDLE_CustomType17(MSIPACKAGE *package, const WCHAR *source, const WCHAR *target, INT type, const WCHAR *action)
Definition: custom.c:963
static UINT HANDLE_CustomType2(MSIPACKAGE *package, const WCHAR *source, const WCHAR *target, INT type, const WCHAR *action)
Definition: custom.c:944
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:1405
static UINT HANDLE_CustomType34(MSIPACKAGE *package, const WCHAR *source, const WCHAR *target, INT type, const WCHAR *action)
Definition: custom.c:1174
static UINT HANDLE_CustomType5_6(MSIPACKAGE *package, const WCHAR *source, const WCHAR *target, INT type, const WCHAR *action)
Definition: custom.c:1282
static UINT HANDLE_CustomType18(MSIPACKAGE *package, const WCHAR *source, const WCHAR *target, INT type, const WCHAR *action)
Definition: custom.c:983
static UINT HANDLE_CustomType50(MSIPACKAGE *package, const WCHAR *source, const WCHAR *target, INT type, const WCHAR *action)
Definition: custom.c:1156
static UINT HANDLE_CustomType53_54(MSIPACKAGE *package, const WCHAR *source, const WCHAR *target, INT type, const WCHAR *action)
Definition: custom.c:1389
static UINT HANDLE_CustomType19(MSIPACKAGE *package, const WCHAR *source, const WCHAR *target, INT type, const WCHAR *action)
Definition: custom.c:1001
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
UINT msi_set_property(MSIDATABASE *, const WCHAR *, const WCHAR *, int) DECLSPEC_HIDDEN
Definition: package.c:2100
MSIRECORD *WINAPIV MSI_QueryGetRecord(MSIDATABASE *db, LPCWSTR query,...) DECLSPEC_HIDDEN
Definition: msiquery.c:201
static void msi_free(void *mem)
Definition: msipriv.h:1159
int MSI_RecordGetInteger(MSIRECORD *, UINT) DECLSPEC_HIDDEN
Definition: record.c:213
void msi_reset_source_folders(MSIPACKAGE *package) DECLSPEC_HIDDEN
Definition: package.c:2089
const WCHAR * MSI_RecordGetString(const MSIRECORD *, UINT) DECLSPEC_HIDDEN
Definition: record.c:433
LPWSTR msi_dup_property(MSIDATABASE *db, LPCWSTR prop) DECLSPEC_HIDDEN
Definition: package.c:2283
_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 1336 of file files.c.

1337{
1338 MSIQUERY *view;
1339 UINT rc;
1340
1341 if (package->script == SCRIPT_NONE)
1342 return msi_schedule_action(package, SCRIPT_INSTALL, L"DuplicateFiles");
1343
1344 rc = MSI_DatabaseOpenViewW(package->db, L"SELECT * FROM `DuplicateFile`", &view);
1345 if (rc != ERROR_SUCCESS)
1346 return ERROR_SUCCESS;
1347
1349 msiobj_release(&view->hdr);
1350 return rc;
1351}
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:1275
UINT MSI_DatabaseOpenViewW(MSIDATABASE *, LPCWSTR, MSIQUERY **) DECLSPEC_HIDDEN

◆ 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) DECLSPEC_HIDDEN
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 1604 of file custom.c.

1605{
1606 struct list *item;
1607 HANDLE *wait_handles;
1608 unsigned int handle_count, i;
1610
1611 while ((item = list_head( &package->RunningActions )))
1612 {
1614
1615 list_remove( &action->entry );
1616
1617 TRACE("waiting for %s\n", debugstr_w( action->name ) );
1619
1620 CloseHandle( action->handle );
1621 msi_free( action->name );
1622 msi_free( action );
1623 }
1624
1626
1627 handle_count = list_count( &msi_pending_custom_actions );
1628 wait_handles = msi_alloc( handle_count * sizeof(HANDLE) );
1629
1630 handle_count = 0;
1632 {
1633 if (info->package == package )
1634 {
1635 if (DuplicateHandle(GetCurrentProcess(), info->handle, GetCurrentProcess(), &wait_handles[handle_count], SYNCHRONIZE, FALSE, 0))
1636 handle_count++;
1637 }
1638 }
1639
1641
1642 for (i = 0; i < handle_count; i++)
1643 {
1644 msi_dialog_check_messages( wait_handles[i] );
1645 CloseHandle( wait_handles[i] );
1646 }
1647 msi_free( wait_handles );
1648
1651 {
1652 if (info->package == package)
1654 }
1656}
static void list_remove(struct list_entry *entry)
Definition: list.h:90
Definition: list.h:37
#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 msi_pending_custom_actions
Definition: custom.c:73
static CRITICAL_SECTION msi_custom_action_cs
Definition: custom.c:63
static void free_custom_action_data(msi_custom_action_info *info)
Definition: custom.c:395
void msi_dialog_check_messages(HANDLE handle)
Definition: dialog.c:4072
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
static void * msi_alloc(size_t len) __WINE_ALLOC_SIZE(1)
Definition: msipriv.h:1142
#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 5183 of file action.c.

5184{
5185 WCHAR buffer[256], sysdir[MAX_PATH], squashed_pc[SQUASHED_GUID_SIZE];
5186 HKEY hkey;
5187
5188 squash_guid( package->ProductCode, squashed_pc );
5189
5190 GetSystemDirectoryW(sysdir, ARRAY_SIZE(sysdir));
5191 RegCreateKeyW(HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce", &hkey);
5192 swprintf(buffer, ARRAY_SIZE(buffer), L"%s\\MsiExec.exe /@ \"%s\"", sysdir, squashed_pc);
5193
5194 msi_reg_set_val_str( hkey, squashed_pc, buffer );
5195 RegCloseKey(hkey);
5196
5197 TRACE("Reboot command %s\n",debugstr_w(buffer));
5198
5199 RegCreateKeyW(HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\RunOnceEntries",
5200 &hkey);
5201 swprintf( buffer, ARRAY_SIZE(buffer), L"/I \"%s\" AFTERREBOOT=1 RUNONCEENTRY=\"%s\"", package->ProductCode,
5202 squashed_pc );
5203
5204 msi_reg_set_val_str( hkey, squashed_pc, buffer );
5205 RegCloseKey(hkey);
5206
5207 return ERROR_INSTALL_SUSPEND;
5208}
#define ARRAY_SIZE(A)
Definition: main.h:33
#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) DECLSPEC_HIDDEN
Definition: registry.c:74
LONG msi_reg_set_val_str(HKEY hkey, LPCWSTR name, LPCWSTR value) DECLSPEC_HIDDEN
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 556 of file files.c.

557{
559 UINT rc = ERROR_SUCCESS;
560 MSIFILE *file;
561
563
564 if (package->script == SCRIPT_NONE)
565 return msi_schedule_action(package, SCRIPT_INSTALL, L"InstallFiles");
566
567 schedule_install_files(package);
568 mi = msi_alloc_zero( sizeof(MSIMEDIAINFO) );
569
571 {
572 BOOL is_global_assembly = msi_is_global_assembly( file->Component );
573
574 msi_file_update_ui( package, file, L"InstallFiles" );
575
576 rc = msi_load_media_info( package, file->Sequence, mi );
577 if (rc != ERROR_SUCCESS)
578 {
579 ERR("Unable to load media info for %s (%u)\n", debugstr_w(file->File), rc);
581 goto done;
582 }
583
584 if (file->state != msifs_hashmatch &&
585 file->state != msifs_skipped &&
586 (file->state != msifs_present || !msi_get_property_int( package->db, L"Installed", 0 )) &&
587 (rc = ready_media( package, file->IsCompressed, mi )))
588 {
589 ERR("Failed to ready media for %s\n", debugstr_w(file->File));
590 goto done;
591 }
592
593 if (file->state != msifs_missing && !mi->is_continuous && file->state != msifs_overwrite)
594 continue;
595
596 if (file->Sequence > mi->last_sequence || mi->is_continuous ||
597 (file->IsCompressed && !mi->is_extracted))
598 {
601
602 data.mi = mi;
603 data.package = package;
605 data.user = &cursor;
606
607 if (file->IsCompressed && !msi_cabextract(package, mi, &data))
608 {
609 ERR("Failed to extract cabinet: %s\n", debugstr_w(mi->cabinet));
611 goto done;
612 }
613 }
614
615 if (!file->IsCompressed)
616 {
618
619 TRACE("copying %s to %s\n", debugstr_w(source), debugstr_w(file->TargetPath));
620
621 if (!is_global_assembly)
622 {
623 create_directory(package, file->Component->Directory);
624 }
625 rc = copy_install_file(package, file, source);
626 if (rc != ERROR_SUCCESS)
627 {
628 ERR("Failed to copy %s to %s (%u)\n", debugstr_w(source), debugstr_w(file->TargetPath), rc);
631 goto done;
632 }
633 if (!is_global_assembly) file->state = msifs_installed;
635 }
636 else if (!is_global_assembly && file->state != msifs_installed &&
637 !(file->Attributes & msidbFileAttributesPatchAdded))
638 {
639 ERR("compressed file wasn't installed (%s)\n", debugstr_w(file->File));
641 goto done;
642 }
643 }
645 {
646 MSICOMPONENT *comp = file->Component;
647
648 if (!msi_is_global_assembly( comp ) || comp->assembly->installed ||
649 (file->state != msifs_missing && file->state != msifs_overwrite)) continue;
650
651 rc = msi_install_assembly( package, comp );
652 if (rc != ERROR_SUCCESS)
653 {
654 ERR("Failed to install assembly\n");
656 break;
657 }
658 file->state = msifs_installed;
659 }
660
661done:
663 return rc;
664}
#define ERR(fmt,...)
Definition: debug.h:110
BOOL msi_is_global_assembly(MSICOMPONENT *comp)
Definition: action.c:2037
UINT msi_set_sourcedir_props(MSIPACKAGE *package, BOOL replace)
Definition: action.c:354
WCHAR * msi_resolve_file_source(MSIPACKAGE *package, MSIFILE *file)
Definition: files.c:528
static void msi_file_update_ui(MSIPACKAGE *package, MSIFILE *f, const WCHAR *action)
Definition: files.c:242
static BOOL installfiles_cb(MSIPACKAGE *package, LPCWSTR filename, DWORD action, LPWSTR *path, DWORD *attrs, PVOID user)
Definition: files.c:497
static UINT create_directory(MSIPACKAGE *package, const WCHAR *dir)
Definition: files.c:467
static void schedule_install_files(MSIPACKAGE *package)
Definition: files.c:379
static UINT copy_install_file(MSIPACKAGE *package, MSIFILE *file, LPWSTR source)
Definition: files.c:408
UINT ready_media(MSIPACKAGE *package, BOOL compressed, MSIMEDIAINFO *mi)
Definition: media.c:850
void msi_free_media_info(MSIMEDIAINFO *mi)
Definition: media.c:661
BOOL msi_cabextract(MSIPACKAGE *package, MSIMEDIAINFO *mi, LPVOID data)
Definition: media.c:652
UINT msi_load_media_info(MSIPACKAGE *package, UINT Sequence, MSIMEDIAINFO *mi)
Definition: media.c:689
unsigned int BOOL
Definition: ntddk_ex.h:94
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
UINT msi_install_assembly(MSIPACKAGE *package, MSICOMPONENT *comp)
Definition: assembly.c:411
@ msidbFileAttributesPatchAdded
Definition: msidefs.h:37
static void * msi_alloc_zero(size_t len) __WINE_ALLOC_SIZE(1)
Definition: msipriv.h:1148
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
Definition: fci.c:127
BOOL installed
Definition: msipriv.h:518
MSIASSEMBLY * assembly
Definition: msipriv.h:540
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 1206 of file files.c.

1207{
1208 MSIQUERY *view;
1209 UINT rc;
1210
1211 if (package->script == SCRIPT_NONE)
1212 return msi_schedule_action(package, SCRIPT_INSTALL, L"MoveFiles");
1213
1214 rc = MSI_DatabaseOpenViewW(package->db, L"SELECT * FROM `MoveFile`", &view);
1215 if (rc != ERROR_SUCCESS)
1216 return ERROR_SUCCESS;
1217
1219 msiobj_release(&view->hdr);
1220 return rc;
1221}
static UINT ITERATE_MoveFiles(MSIRECORD *rec, LPVOID param)
Definition: files.c:1080

◆ ACTION_MsiPublishAssemblies()

UINT ACTION_MsiPublishAssemblies ( MSIPACKAGE package)

Definition at line 595 of file assembly.c.

596{
597 MSICOMPONENT *comp;
598
599 if (package->script == SCRIPT_NONE)
600 return msi_schedule_action(package, SCRIPT_INSTALL, L"MsiPublishAssemblies");
601
603 {
604 LONG res;
605 HKEY hkey;
606 GUID guid;
607 DWORD size;
608 WCHAR buffer[43];
609 MSIRECORD *uirow;
611 BOOL win32;
612
613 if (!assembly || !comp->ComponentId) continue;
614
615 comp->Action = msi_get_component_action( package, comp );
616 if (comp->Action != INSTALLSTATE_LOCAL)
617 {
618 TRACE("component not scheduled for installation %s\n", debugstr_w(comp->Component));
619 continue;
620 }
621 TRACE("publishing %s\n", debugstr_w(comp->Component));
622
623 CLSIDFromString( package->ProductCode, &guid );
625 buffer[20] = '>';
628 buffer[42] = 0;
629
630 win32 = assembly->attributes & msidbAssemblyAttributesWin32;
631 if (assembly->application)
632 {
633 MSIFILE *file = msi_get_loaded_file( package, assembly->application );
634 if (!file)
635 {
636 WARN("no matching file %s for local assembly\n", debugstr_w(assembly->application));
637 continue;
638 }
639 if ((res = open_local_assembly_key( package->Context, win32, file->TargetPath, &hkey )))
640 {
641 WARN( "failed to open local assembly key %ld\n", res );
643 }
644 }
645 else
646 {
647 if ((res = open_global_assembly_key( package->Context, win32, &hkey )))
648 {
649 WARN( "failed to open global assembly key %ld\n", res );
651 }
652 }
653 size = sizeof(buffer);
654 if ((res = RegSetValueExW( hkey, assembly->display_name, 0, REG_MULTI_SZ, (const BYTE *)buffer, size )))
655 {
656 WARN( "failed to set assembly value %ld\n", res );
657 }
658 RegCloseKey( hkey );
659
660 uirow = MSI_CreateRecord( 2 );
661 MSI_RecordSetStringW( uirow, 2, assembly->display_name );
663 msiobj_release( &uirow->hdr );
664 }
665 return ERROR_SUCCESS;
666}
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:4911
INSTALLSTATE msi_get_component_action(MSIPACKAGE *package, MSICOMPONENT *comp)
Definition: action.c:611
MSIFILE * msi_get_loaded_file(MSIPACKAGE *package, const WCHAR *key)
Definition: action.c:574
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:535
static LONG open_global_assembly_key(UINT context, BOOL win32, HKEY *hkey)
Definition: assembly.c:575
@ INSTALLMESSAGE_ACTIONDATA
Definition: msi.h:103
@ INSTALLSTATE_LOCAL
Definition: msi.h:46
@ msidbAssemblyAttributesWin32
Definition: msidefs.h:216
INT MSI_ProcessMessage(MSIPACKAGE *, INSTALLMESSAGE, MSIRECORD *) DECLSPEC_HIDDEN
Definition: package.c:1914
MSIRECORD * MSI_CreateRecord(UINT) DECLSPEC_HIDDEN
Definition: record.c:76
UINT MSI_RecordSetStringW(MSIRECORD *, UINT, LPCWSTR) DECLSPEC_HIDDEN
Definition: record.c:597
BOOL encode_base85_guid(GUID *, LPWSTR) DECLSPEC_HIDDEN
Definition: registry.c:165
#define REG_MULTI_SZ
Definition: nt_native.h:1501
long LONG
Definition: pedump.c:60
LPWSTR Component
Definition: msipriv.h:525
INSTALLSTATE Action
Definition: msipriv.h:533
LPWSTR ComponentId
Definition: msipriv.h:526
struct list components
Definition: msipriv.h:401
UINT 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 668 of file assembly.c.

669{
670 MSICOMPONENT *comp;
671
672 if (package->script == SCRIPT_NONE)
673 return msi_schedule_action(package, SCRIPT_INSTALL, L"MsiUnpublishAssemblies");
674
676 {
677 LONG res;
678 MSIRECORD *uirow;
680 BOOL win32;
681
682 if (!assembly || !comp->ComponentId) continue;
683
684 comp->Action = msi_get_component_action( package, comp );
685 if (comp->Action != INSTALLSTATE_ABSENT)
686 {
687 TRACE("component not scheduled for removal %s\n", debugstr_w(comp->Component));
688 continue;
689 }
690 TRACE("unpublishing %s\n", debugstr_w(comp->Component));
691
692 win32 = assembly->attributes & msidbAssemblyAttributesWin32;
693 if (assembly->application)
694 {
695 MSIFILE *file = msi_get_loaded_file( package, assembly->application );
696 if (!file)
697 {
698 WARN("no matching file %s for local assembly\n", debugstr_w(assembly->application));
699 continue;
700 }
701 if ((res = delete_local_assembly_key( package->Context, win32, file->TargetPath )))
702 WARN( "failed to delete local assembly key %ld\n", res );
703 }
704 else
705 {
706 HKEY hkey;
707 if ((res = open_global_assembly_key( package->Context, win32, &hkey )))
708 WARN( "failed to delete global assembly key %ld\n", res );
709 else
710 {
711 if ((res = RegDeleteValueW( hkey, assembly->display_name )))
712 WARN( "failed to delete global assembly value %ld\n", res );
713 RegCloseKey( hkey );
714 }
715 }
716
717 uirow = MSI_CreateRecord( 2 );
718 MSI_RecordSetStringW( uirow, 2, assembly->display_name );
720 msiobj_release( &uirow->hdr );
721 }
722 return ERROR_SUCCESS;
723}
LONG WINAPI RegDeleteValueW(HKEY hKey, LPCWSTR lpValueName)
Definition: reg.c:2361
static LONG delete_local_assembly_key(UINT context, BOOL win32, const WCHAR *filename)
Definition: assembly.c:555
@ INSTALLSTATE_ABSENT
Definition: msi.h:45

◆ ACTION_PatchFiles()

UINT ACTION_PatchFiles ( MSIPACKAGE package)

Definition at line 784 of file files.c.

785{
786 MSIFILEPATCH *patch;
788 UINT rc = ERROR_SUCCESS;
789
790 TRACE("%p\n", package);
791
792 if (package->script == SCRIPT_NONE)
793 return msi_schedule_action(package, SCRIPT_INSTALL, L"PatchFiles");
794
795 mi = msi_alloc_zero( sizeof(MSIMEDIAINFO) );
796
797 TRACE("extracting files\n");
798
800 {
801 MSIFILE *file = patch->File;
802 MSICOMPONENT *comp = file->Component;
803
804 rc = msi_load_media_info( package, patch->Sequence, mi );
805 if (rc != ERROR_SUCCESS)
806 {
807 ERR("Unable to load media info for %s (%u)\n", debugstr_w(file->File), rc);
809 goto done;
810 }
811 comp->Action = msi_get_component_action( package, comp );
812 if (!comp->Enabled || comp->Action != INSTALLSTATE_LOCAL) continue;
813
814 if (!patch->extracted)
815 {
817 MSIFILEPATCH *cursor = patch;
818
819 rc = ready_media( package, TRUE, mi );
820 if (rc != ERROR_SUCCESS)
821 {
822 ERR("Failed to ready media for %s\n", debugstr_w(file->File));
823 goto done;
824 }
825 data.mi = mi;
826 data.package = package;
827 data.cb = patchfiles_cb;
828 data.user = &cursor;
829
830 if (!msi_cabextract( package, mi, &data ))
831 {
832 ERR("Failed to extract cabinet: %s\n", debugstr_w(mi->cabinet));
834 goto done;
835 }
836 }
837 }
838
839 TRACE("applying patches\n");
840
842 {
843 MSICOMPONENT *comp = patch->File->Component;
844
845 if (!patch->path) continue;
846
847 if (msi_is_global_assembly( comp ))
848 rc = patch_assembly( package, comp->assembly, patch );
849 else
850 rc = patch_file( package, patch );
851
852 if (rc && !(patch->Attributes & msidbPatchAttributesNonVital))
853 {
854 ERR("Failed to apply patch to file: %s\n", debugstr_w(patch->File->File));
855 break;
856 }
857
858 if (msi_is_global_assembly( comp ))
859 {
860 if ((rc = msi_install_assembly( package, comp )))
861 {
862 ERR("Failed to install patched assembly\n");
863 break;
864 }
865 }
866 }
867
868done:
870 return rc;
871}
static UINT patch_assembly(MSIPACKAGE *package, MSIASSEMBLY *assembly, MSIFILEPATCH *patch)
Definition: files.c:734
static UINT patch_file(MSIPACKAGE *package, MSIFILEPATCH *patch)
Definition: files.c:712
static BOOL patchfiles_cb(MSIPACKAGE *package, LPCWSTR file, DWORD action, LPWSTR *path, DWORD *attrs, PVOID user)
Definition: files.c:678
@ 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 7610 of file action.c.

7611{
7612 UINT rc;
7613
7614 TRACE("Performing action (%s)\n", debugstr_w(action));
7615
7616 package->action_progress_increment = 0;
7617 rc = ACTION_HandleStandardAction(package, action);
7618
7619 if (rc == ERROR_FUNCTION_NOT_CALLED)
7620 rc = ACTION_HandleCustomAction(package, action);
7621
7622 if (rc == ERROR_FUNCTION_NOT_CALLED)
7623 WARN("unhandled msi action %s\n", debugstr_w(action));
7624
7625 return rc;
7626}
static UINT ACTION_HandleStandardAction(MSIPACKAGE *package, LPCWSTR action)
Definition: action.c:7567
static UINT ACTION_HandleCustomAction(MSIPACKAGE *package, LPCWSTR action)
Definition: action.c:514
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 = msi_alloc( 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 msi_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 = msi_alloc( (lstrlenW(L"FileType\\%s\\%d") + lstrlenW(cls->clsid) + 4) * sizeof(WCHAR));
833 swprintf( keyname, lstrlenW(L"FileType\\%s\\%d") + lstrlenW(cls->clsid) + 4,
834 L"FileType\\%s\\%d", cls->clsid, index );
835
837 msi_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:627
#define progid(str)
Definition: exdisp.idl:31
GLuint index
Definition: glext.h:6031
GLuint GLint GLboolean GLint GLenum access
Definition: glext.h:7866
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) DECLSPEC_HIDDEN
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:530
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 = msi_alloc( (lstrlenW( 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 msi_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 = msi_alloc( (lstrlenW(progid) + lstrlenW(L"\\ShellNew") + 1) * sizeof(WCHAR));
1281
1282 lstrcpyW(newkey, progid);
1283 lstrcatW(newkey, L"\\ShellNew");
1284 RegCreateKeyW(hkey, newkey, &hkey2);
1285 RegCloseKey(hkey2);
1286
1287 msi_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 276 of file font.c.

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

◆ 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 = msi_alloc( (lstrlenW( mt->Extension->Extension ) + 2) * sizeof(WCHAR) );
1423 key = msi_alloc( (lstrlenW( mt->ContentType ) +
1424 lstrlenW( L"MIME\\Database\\Content Type\\" ) + 1) * 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 msi_free( extension );
1439 msi_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 1411 of file files.c.

1412{
1413 MSIQUERY *view;
1414 UINT rc;
1415
1416 if (package->script == SCRIPT_NONE)
1417 return msi_schedule_action(package, SCRIPT_INSTALL, L"RemoveDuplicateFiles");
1418
1419 rc = MSI_DatabaseOpenViewW( package->db, L"SELECT * FROM `DuplicateFile`", &view );
1420 if (rc != ERROR_SUCCESS)
1421 return ERROR_SUCCESS;
1422
1424 msiobj_release( &view->hdr );
1425 return rc;
1426}
static UINT ITERATE_RemoveDuplicateFiles(MSIRECORD *row, LPVOID param)
Definition: files.c:1353

◆ ACTION_RemoveFiles()

UINT ACTION_RemoveFiles ( MSIPACKAGE package)

Definition at line 1549 of file files.c.

1550{
1551 MSIQUERY *view;
1552 MSICOMPONENT *comp;
1553 MSIFILE *file;
1554 UINT r;
1555
1556 if (package->script == SCRIPT_NONE)
1557 return msi_schedule_action(package, SCRIPT_INSTALL, L"RemoveFiles");
1558
1559 r = MSI_DatabaseOpenViewW(package->db, L"SELECT * FROM `RemoveFile`", &view);
1560 if (r == ERROR_SUCCESS)
1561 {
1563 msiobj_release(&view->hdr);
1564 if (r != ERROR_SUCCESS)
1565 return r;
1566 }
1567
1569 {
1570 MSIRECORD *uirow;
1571 VS_FIXEDFILEINFO *ver;
1572
1573 comp = file->Component;
1574 msi_file_update_ui( package, file, L"RemoveFiles" );
1575
1576 comp->Action = msi_get_component_action( package, comp );
1578 continue;
1579
1580 if (comp->assembly && !comp->assembly->application)
1581 continue;
1582
1584 {
1585 TRACE("permanent component, not removing file\n");
1586 continue;
1587 }
1588
1589 if (file->Version)
1590 {
1591 ver = msi_get_disk_file_version( package, file->TargetPath );
1592 if (ver && msi_compare_file_versions( ver, file->Version ) > 0)
1593 {
1594 TRACE("newer version detected, not removing file\n");
1595 msi_free( ver );
1596 continue;
1597 }
1598 msi_free( ver );
1599 }
1600
1601 if (file->state == msifs_installed)
1602 WARN("removing installed file %s\n", debugstr_w(file->TargetPath));
1603
1604 TRACE("removing %s\n", debugstr_w(file->File) );
1605
1606 msi_set_file_attributes( package, file->TargetPath, FILE_ATTRIBUTE_NORMAL );
1607 if (!msi_delete_file( package, file->TargetPath ))
1608 {
1609 WARN( "failed to delete %s (%lu)\n", debugstr_w(file->TargetPath), GetLastError() );
1610 }
1611 file->state = msifs_missing;
1612
1613 uirow = MSI_CreateRecord( 9 );
1614 MSI_RecordSetStringW( uirow, 1, file->FileName );
1615 MSI_RecordSetStringW( uirow, 9, comp->Directory );
1617 msiobj_release( &uirow->hdr );
1618 }
1619
1621 {
1622 comp->Action = msi_get_component_action( package, comp );
1623 if (comp->Action != INSTALLSTATE_ABSENT) continue;
1624
1626 {
1627 TRACE("permanent component, not removing directory\n");
1628 continue;
1629 }
1630 if (comp->assembly && !comp->assembly->application)
1631 msi_uninstall_assembly( package, comp );
1632 else
1633 {
1634 MSIFOLDER *folder = msi_get_loaded_folder( package, comp->Directory );
1635 if (folder) remove_folder( folder );
1636 }
1637 }
1638 return ERROR_SUCCESS;
1639}
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:137
int msi_compare_file_versions(VS_FIXEDFILEINFO *fi, const WCHAR *version)
Definition: action.c:1930
MSIFOLDER * msi_get_loaded_folder(MSIPACKAGE *package, const WCHAR *dir)
Definition: action.c:585
BOOL msi_set_file_attributes(MSIPACKAGE *package, const WCHAR *filename, DWORD attrs)
Definition: files.c:97
BOOL msi_delete_file(MSIPACKAGE *package, const WCHAR *filename)
Definition: files.c:70
VS_FIXEDFILEINFO * msi_get_disk_file_version(MSIPACKAGE *package, const WCHAR *filename)
Definition: files.c:161
static UINT ITERATE_RemoveFiles(MSIRECORD *row, LPVOID param)
Definition: files.c:1452
static void remove_folder(MSIFOLDER *folder)
Definition: files.c:1535
UINT msi_uninstall_assembly(MSIPACKAGE *package, MSICOMPONENT *comp)
Definition: assembly.c:456
@ 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:531
LPWSTR Directory
Definition: msipriv.h:527
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 = msi_alloc( (lstrlenW( L"FileType\\" ) + lstrlenW( cls->clsid ) + 1) * sizeof(WCHAR) );
930 if (filetype)
931 {
932 lstrcpyW( filetype, L"FileType\\" );
933 lstrcatW( filetype, cls->clsid );
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:3297
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 = msi_alloc( (lstrlenW( 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 msi_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 = msi_alloc( (lstrlenW( progid ) + lstrlenW( L"\\shell" ) + 1) * sizeof(WCHAR) );
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 msi_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 357 of file font.c.

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

◆ 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 = msi_alloc( (lstrlenW( L"MIME\\Database\\Content Type\\" ) +
1478 lstrlenW( mime->ContentType ) + 1) * 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 msi_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:532
struct list features
Definition: msipriv.h:402
int INSTALLSTATE
Definition: winemsi.idl:31

Referenced by msi_seltree_update_feature_installstate(), and MSI_SetFeatureStateW().

◆ alloc_msi_remote_handle()

MSIHANDLE alloc_msi_remote_handle ( MSIHANDLE  remote)

Definition at line 135 of file handle.c.

136{
139
141
143 if (ret)
144 {
145 entry = &msihandletable[ 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 MSI_handle_cs
Definition: handle.c:38
static msi_handle_info * msihandletable
Definition: handle.c:68
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()

◆ alloc_msiobject()

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

Definition at line 201 of file handle.c.

202{
204
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 = msi_alloc( 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 288 of file script.c.

289{
290 HRESULT hr;
291 IActiveScript *pActiveScript = NULL;
292 IActiveScriptParse *pActiveScriptParse = NULL;
293 MsiActiveScriptSite *scriptsite;
294 IDispatch *pDispatch = NULL;
295 DISPPARAMS dispparamsNoArgs = {NULL, NULL, 0, 0};
296 DISPID dispid;
297 CLSID clsid;
298 VARIANT var;
300
302
303 /* Create MsiActiveScriptSite object */
304 hr = create_activescriptsite(&scriptsite);
305 if (hr != S_OK) goto done;
306
307 /* Create an installer object */
308 hr = create_msiserver(NULL, (void**)&scriptsite->installer);
309 if (hr != S_OK) goto done;
310
311 /* Create a session object */
312 hr = create_session(hPackage, scriptsite->installer, &scriptsite->session);
313 if (hr != S_OK) goto done;
314
315 /* Create the scripting engine */
318 hr = CLSIDFromProgID(L"JScript", &clsid);
320 hr = CLSIDFromProgID(L"VBScript", &clsid);
321 else {
322 ERR("Unknown script type %d\n", type);
323 goto done;
324 }
325 if (FAILED(hr)) {
326 ERR("Could not find CLSID for Windows Script\n");
327 goto done;
328 }
329 hr = CoCreateInstance(&clsid, NULL, CLSCTX_INPROC_SERVER, &IID_IActiveScript, (void **)&pActiveScript);
330 if (FAILED(hr)) {
331 ERR("Could not instantiate class for Windows Script\n");
332 goto done;
333 }
334
335 hr = IActiveScript_QueryInterface(pActiveScript, &IID_IActiveScriptParse, (void **)&pActiveScriptParse);
336 if (FAILED(hr)) goto done;
337
338 hr = IActiveScript_SetScriptSite(pActiveScript, &scriptsite->IActiveScriptSite_iface);
339 if (FAILED(hr)) goto done;
340
341 hr = IActiveScriptParse_InitNew(pActiveScriptParse);
342 if (FAILED(hr)) goto done;
343
344 hr = IActiveScript_AddNamedItem(pActiveScript, L"Session", SCRIPTITEM_GLOBALMEMBERS|SCRIPTITEM_ISVISIBLE);
345 if (FAILED(hr)) goto done;
346
347 hr = IActiveScriptParse_ParseScriptText(pActiveScriptParse, script, NULL, NULL, NULL, 0, 0, 0L, NULL, NULL);
348 if (FAILED(hr)) goto done;
349
350 hr = IActiveScript_SetScriptState(pActiveScript, SCRIPTSTATE_CONNECTED);
351 if (FAILED(hr)) goto done;
352
353 /* Call a function if necessary through the IDispatch interface */
354 if (function && function[0]) {
355 TRACE("Calling function %s\n", debugstr_w(function));
356
357 hr = IActiveScript_GetScriptDispatch(pActiveScript, NULL, &pDispatch);
358 if (FAILED(hr)) goto done;
359
360 hr = IDispatch_GetIDsOfNames(pDispatch, &IID_NULL, (WCHAR **)&function, 1,LOCALE_USER_DEFAULT, &dispid);
361 if (FAILED(hr)) goto done;
362
363 hr = IDispatch_Invoke(pDispatch, dispid, &IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &dispparamsNoArgs, &var, NULL, NULL);
364 if (FAILED(hr)) goto done;
365
366 hr = VariantChangeType(&var, &var, 0, VT_I4);
367 if (FAILED(hr)) goto done;
368
370
372 } else {
373 /* If no function to be called, MSI behavior is to succeed */
375 }
376
377done:
378
379 if (pDispatch) IDispatch_Release(pDispatch);
380 if (pActiveScript) IActiveScript_Release(pActiveScript);
381 if (pActiveScriptParse) IActiveScriptParse_Release(pActiveScriptParse);
382 if (scriptsite)
383 {
384 if (scriptsite->session) IDispatch_Release(scriptsite->session);
385 if (scriptsite->installer) IDispatch_Release(scriptsite->installer);
386 IActiveScriptSite_Release(&scriptsite->IActiveScriptSite_iface);
387 }
388 CoUninitialize(); /* must call even if CoInitialize failed */
389 return ret;
390}
@ 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:2440
HRESULT create_msiserver(IUnknown *outer, void **ppObj)
Definition: automation.c:2421
#define IActiveScriptParse_InitNew
Definition: script.c:47
#define IActiveScriptParse_Release
Definition: script.c:46
static UINT map_return_value(LONG val)
Definition: script.c:271
static HRESULT create_activescriptsite(MsiActiveScriptSite **obj)
Definition: script.c:249
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 * installer
Definition: script.c:57
IDispatch * session
Definition: script.c:58
IActiveScriptSite IActiveScriptSite_iface
Definition: script.c:56
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().

◆ create_msiserver()

HRESULT create_msiserver ( IUnknown pOuter,
LPVOID ppObj 
)

◆ create_session()

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

Definition at line 2440 of file automation.c.

2441{
2443
2444 session = msi_alloc(sizeof(SessionObject));
2445 if (!session) return E_OUTOFMEMORY;
2446
2447 init_automation_object(&session->autoobj, msiHandle, Session_tid);
2448
2449 session->installer = installer;
2450 *disp = &session->autoobj.IDispatch_iface;
2451
2452 return S_OK;
2453}
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
static void init_automation_object(AutomationObject *This, MSIHANDLE msiHandle, tid_t tid)
Definition: automation.c:544

Referenced by call_script(), and InstallerImpl_OpenPackage().

◆ custom_stop_server()

void custom_stop_server ( HANDLE  process,
HANDLE  pipe 
)

Definition at line 681 of file custom.c.

682{
683 DWORD size;
684
685 WriteFile(pipe, &GUID_NULL, sizeof(GUID_NULL), &size, NULL);
688 CloseHandle(pipe);
689}
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 178 of file table.c.

179{
180 WCHAR ch;
181 DWORD count = 0;
182
183 while ( (ch = *in++) )
184 {
185 if( (ch >= 0x3800 ) && (ch < 0x4840 ) )
186 {
187 if( ch >= 0x4800 )
188 ch = mime2utf(ch-0x4800);
189 else
190 {
191 ch -= 0x3800;
192 *out++ = mime2utf(ch&0x3f);
193 count++;
194 ch = mime2utf((ch>>6)&0x3f);
195 }
196 }
197 *out++ = ch;
198 count++;
199 }
200 *out = 0;
201 return count;
202}
static int mime2utf(int x)
Definition: table.c:165
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}
union tagMSIFIELD::@501 u
INT iVal
Definition: msipriv.h:142
IStream * stream
Definition: msipriv.h:144
LPWSTR szwVal
Definition: msipriv.h:143
UINT count
Definition: msipriv.h:152

Referenced by MSI_FormatRecordW(), MSI_ProcessMessageVerbatim(), and msi_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()

LPWSTR encode_streamname ( BOOL  bTable,
LPCWSTR  in 
)

Definition at line 119 of file table.c.

120{
122 DWORD ch, next;
123 LPWSTR out, p;
124
125 if( !bTable )
126 count = lstrlenW( in )+2;
127 if (!(out = msi_alloc( count*sizeof(WCHAR) ))) return NULL;
128 p = out;
129
130 if( bTable )
131 {
132 *p++ = 0x4840;
133 count --;
134 }
135 while( count -- )
136 {
137 ch = *in++;
138 if( !ch )
139 {
140 *p = ch;
141 return out;
142 }
143 if( ( ch < 0x80 ) && ( utf2mime(ch) >= 0 ) )
144 {
145 ch = utf2mime(ch) + 0x4800;
146 next = *in;
147 if( next && (next<0x80) )
148 {
149 next = utf2mime(next);
150 if( next != -1 )
151 {
152 next += 0x3ffffc0;
153 ch += (next<<6);
154 in++;
155 }
156 }
157 }
158 *p++ = ch;
159 }
160 ERR("Failed to encode stream name (%s)\n",debugstr_w(in));
161 msi_free( out );
162 return NULL;
163}
static int utf2mime(int x)
Definition: table.c:104
#define MAX_STREAM_NAME
Definition: table.c:85
static unsigned __int64 next
Definition: rand_nt.c:6

Referenced by cabinet_open_stream(), msi_commit_streams(), msi_get_stream(), msi_record_encoded_stream_name(), read_stream_data(), STREAMS_delete_row(), and write_stream_data().

◆ enum_stream_names()

void enum_stream_names ( IStorage stg)

Definition at line 204 of file table.c.

205{
206 IEnumSTATSTG *stgenum = NULL;
207 HRESULT r;
208 STATSTG stat;
209 ULONG n, count;
210 WCHAR name[0x40];
211
212 r = IStorage_EnumElements( stg, 0, NULL, 0, &stgenum );
213 if( FAILED( r ) )
214 return;
215
216 n = 0;
217 while( 1 )
218 {
219 count = 0;
220 r = IEnumSTATSTG_Next( stgenum, 1, &stat, &count );
221 if( FAILED( r ) || !count )
222 break;
223 decode_streamname( stat.pwcsName, name );
224 TRACE( "stream %2lu -> %s %s\n", n, debugstr_w(stat.pwcsName), debugstr_w(name) );
225 CoTaskMemFree( stat.pwcsName );
226 n++;
227 }
228
229 IEnumSTATSTG_Release( stgenum );
230}
#define stat
Definition: acwin.h:99
BOOL decode_streamname(LPCWSTR in, LPWSTR out)
Definition: table.c:178
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 470 of file table.c.

471{
472 while( !list_empty( &db->tables ) )
473 {
475
476 list_remove( &t->entry );
477 free_table( t );
478 }
479}
static int list_empty(struct list_entry *head)
Definition: list.h:58
static void free_table(MSITABLE *table)
Definition: table.c:362
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 ITypeLib * typelib
Definition: ieframe_main.c:34
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 = strdupW(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}
static WCHAR * strdupW(const WCHAR *src)
Definition: main.c:92
#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 935 of file media.c.

936{
937 MSICABINETSTREAM *cab, *item;
938
939 TRACE("%p, %u, %p, %s\n", package, disk_id, storage, debugstr_w(name));
940
942 {
943 if (item->disk_id == disk_id)
944 {
945 TRACE("duplicate disk id %u\n", disk_id);
947 }
948 }
949 if (!(cab = msi_alloc( sizeof(*cab) ))) return ERROR_OUTOFMEMORY;
950 if (!(cab->stream = msi_alloc( (lstrlenW( name ) + 1) * sizeof(WCHAR ) )))
951 {
952 msi_free( cab );
953 return ERROR_OUTOFMEMORY;
954 }
955 lstrcpyW( cab->stream, name );
956 cab->disk_id = disk_id;
957 cab->storage = storage;
958 IStorage_AddRef( storage );
959 list_add_tail( &package->cabinet_streams, &cab->entry );
960
961 return ERROR_SUCCESS;
962}
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 = msi_alloc( (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 1073 of file suminfo.c.

1074{
1075 UINT r;
1076 int i, j;
1077 MSISUMMARYINFO *si;
1078
1079 r = msi_get_suminfo( db->storage, num_records * (num_columns / 2), &si );
1080 if (r != ERROR_SUCCESS)
1081 {
1082 if (!(si = create_suminfo( db->storage, num_records * (num_columns / 2) )))
1083 return ERROR_OUTOFMEMORY;
1084 r = ERROR_SUCCESS;
1085 }
1086
1087 for (i = 0; i < num_records; i++)
1088 {
1089 for (j = 0; j < num_columns; j += 2)
1090 {
1091 UINT pid;
1092 INT int_value = 0;
1093 FILETIME ft_value;
1094 awcstring str_value;
1095
1096 r = parse_prop( records[i][j], records[i][j + 1], &pid, &int_value, &ft_value, &str_value );
1097 if (r != ERROR_SUCCESS)
1098 goto end;
1099
1100 r = set_prop( si, pid, get_type(pid), int_value, &ft_value, &str_value );
1101 if (r != ERROR_SUCCESS)
1102 goto end;
1103 }
1104 }
1105
1106end:
1107 if (r == ERROR_SUCCESS)
1108 r = suminfo_persist( si );
1109
1110 msiobj_release( &si->hdr );
1111 return r;
1112}
UINT msi_get_suminfo(IStorage *stg, UINT uiUpdateCount, MSISUMMARYINFO **ret)
Definition: suminfo.c:457
static UINT parse_prop(LPCWSTR prop, LPCWSTR value, UINT *pid, INT *int_value, FILETIME *ft_value, awcstring *str_value)
Definition: suminfo.c:1024
static UINT suminfo_persist(MSISUMMARYINFO *si)
Definition: suminfo.c:967
static MSISUMMARYINFO * create_suminfo(IStorage *stg, UINT update_count)
Definition: suminfo.c:443
static UINT set_prop(MSISUMMARYINFO *si, UINT uiProperty, UINT type, INT iValue, FILETIME *pftValue, awcstring *str)
Definition: suminfo.c:837
static UINT get_type(UINT uiProperty)
Definition: suminfo.c:113
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 965 of file package.c.

966{
967 /* FIXME: this should depend on the user's privileges */
968 if (msi_get_property_int( package->db, L"ALLUSERS", 0 ) == 2)
969 {
970 TRACE("resetting ALLUSERS property from 2 to 1\n");
971 msi_set_property( package->db, L"ALLUSERS", L"1", -1 );
972 }
973 msi_set_property( package->db, L"AdminUser", L"1", -1 );
974 msi_set_property( package->db, L"Privileged", L"1", -1 );
975 msi_set_property( package->db, L"MsiRunningElevated", L"1", -1 );
976}
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_alloc()

static void * msi_alloc ( size_t  len)
inlinestatic

Definition at line 1142 of file msipriv.h.

1143{
1144 return malloc( len );
1145}
#define malloc
Definition: debug_ros.c:4

Referenced by ACTION_FinishCustomActions(), ACTION_PublishFeatures(), ACTION_RegisterClassInfo(), ACTION_RegisterExtensionInfo(), ACTION_RegisterMIMEInfo(), ACTION_ResolveSource(), ACTION_UnregisterClassInfo(), ACTION_UnregisterExtensionInfo(), ACTION_UnregisterMIMEInfo(), add_feature_child(), add_feature_component(), add_folder_child(), add_row(), add_storages_to_table(), add_string(), add_wildcard(), append_productcode(), append_storage_to_db(), build_default_format(), build_full_keypath(), build_local_assembly_path(), build_msiexec_args(), cabinet_alloc(), cabinet_copy_file(), convert_reg_value(), copy_install_file(), create_activescriptsite(), create_database(), create_diff_row_query(), create_key_string(), create_list(), create_list_enumerator(), create_msiserver(), create_record(), create_session(), create_stack(), create_summaryinfo(), create_temp_dir(), create_view(), deformat_component(), deformat_environment(), deformat_file(), deformat_index(), deformat_literal(), deformat_property(), deformat_string(), dialog_create_window(), DISTINCT_execute(), distinct_insert(), do_msidbCustomActionTypeDll(), do_msidbCustomActionTypeScript(), dup_formstr(), encode_streamname(), event_subscribe(), execute_command(), file_running_action(), file_version_matches(), fill_source_list(), find_published_source(), flatten_multi_string_values(), font_name_from_file(), format_replace(), get_assembly_display_name(), get_assembly_name_attribute(), get_cabinet_filename(), get_clr_version(), get_duplicate_filename(), get_file_version(), get_fusion_filename(), get_key_value(), get_patch_product_codes(), get_stream_name(), get_table(), get_unique_folder_name(), get_user_sid(), HANDLE_CustomType21_22(), HANDLE_CustomType23(), HANDLE_CustomType5_6(), HANDLE_CustomType7(), init_stringtable(), InstallerImpl_ProductInfo(), InstallerImpl_RegistryValue(), ITERATE_DeleteService(), ITERATE_InstallODBCDataSource(), ITERATE_InstallODBCDriver(), ITERATE_InstallODBCTranslator(), ITERATE_InstallService(), ITERATE_MoveFiles(), ITERATE_PublishComponent(), ITERATE_RemoveEnvironmentString(), ITERATE_RemoveExistingProducts(), ITERATE_RemoveFiles(), ITERATE_RemoveODBCDataSource(), ITERATE_RemoveRegistryValuesOnInstall(), ITERATE_RemoveRegistryValuesOnUninstall(), ITERATE_StartService(), ITERATE_StopService(), ITERATE_WriteEnvironmentString(), ITERATE_WriteRegistryValues(), load_class(), load_progid(), load_summary_info(), merge_diff_row(), msi_add_cabinet_stream(), msi_add_string(), msi_add_table_to_db(), msi_apply_transforms(), MSI_ApplyPatchW(), msi_build_createsql_postlude(), msi_build_createsql_prelude(), msi_build_directory_name(), msi_check_product_patches(), msi_combobox_add_items(), msi_create_assembly_enum(), msi_create_full_path(), msi_create_table(), msi_create_temp_file(), MSI_DatabaseExport(), MSI_DatabaseImport(), msi_dialog_add_font(), msi_dialog_combo_control(), msi_dialog_dirlist_handler(), msi_dialog_get_style(), msi_dialog_line_control(), msi_dialog_list_box(), msi_dialog_pathedit_control(), msi_dialog_scrolltext_control(), msi_dialog_selection_tree(), msi_dialog_set_property_event(), msi_dialog_text_control(), msi_dialog_vcl_add_columns(), msi_dialog_vcl_add_drives(), msi_dialog_vsc_add_drives(), msi_download_file(), msi_dup_property(), msi_dup_record_field(), MSI_EnumComponentQualifiers(), msi_export_field(), msi_export_stream(), msi_get_assembly_path(), msi_get_deferred_action(), msi_get_disk_file_version(), msi_get_error_message(), msi_get_font_file_version(), msi_get_property_row(), msi_get_query_columns(), msi_get_query_types(), msi_get_table_labels(), msi_get_window_text(), msi_import_stream_filename(), MSI_InstallPackage(), msi_listbox_add_items(), msi_load_suminfo_properties(), msi_mask_control_change(), msi_normalize_path(), MSI_OpenQuery(), msi_package_add_info(), msi_package_add_media_disk(), msi_parse_command_line(), msi_parse_line(), MSI_ProcessMessage(), MSI_ProcessMessageVerbatim(), msi_publish_patches(), MSI_QueryGetRecord(), msi_read_text_archive(), msi_record_encoded_stream_name(), msi_record_to_row(), msi_reg_get_val_str(), msi_register_unique_action(), msi_save_string_table(), msi_schedule_action(), msi_service_args_to_vector(), msi_set_last_used_source(), msi_set_original_database_property(), msi_set_sourcedir_props(), msi_split_string(), msi_strdupW(), MsiApplyMultiplePatchesW(), MsiConfigureProductExW(), MsiEnumComponentCostsA(), MsiEnumComponentsExA(), MsiEnumPatchesA(), MsiEnumPatchesExA(), MsiEnumProductsExA(), MsiFormatRecordA(), MsiGetFeatureInfoA(), MsiGetFileVersionA(), MsiGetPatchInfoA(), MsiGetPatchInfoExA(), MsiGetProductInfoExA(), MsiGetProductPropertyA(), MsiLoadStringA(), MsiProvideComponentA(), MsiQueryComponentStateW(), MsiReinstallFeatureW(), MsiSourceListAddMediaDiskW(), MsiSourceListAddSourceExW(), MsiSourceListAddSourceW(), MsiSourceListEnumMediaDisksA(), MsiSourceListEnumMediaDisksW(), MsiSourceListEnumSourcesA(), MsiSourceListGetInfoA(), MsiSourceListGetInfoW(), parse_languages(), parse_suminfo(), parse_transform_desc(), parse_value(), patch_add_media(), patch_assembly(), patch_offset_get_filepatches(), patch_offset_get_files(), patch_offset_list_create(), patchinfoAtoW(), read_properties_from_data(), read_stream_data(), read_table_from_storage(), ready_media(), record_invoke(), recurse_search_directory(), reg_get_multisz(), reg_get_sz(), reg_get_value(), register_dll(), register_verb(), resolve_keypath(), save_prop(), search_file(), search_reg(), session_invoke(), set_installer_properties(), set_msi_assembly_prop(), set_prop(), set_user_sid_prop(), split_multi_string_values(), stop_service_dependents(), strdupAtoW(), strdupW(), strdupWtoA(), stream_to_storage(), string2id(), summaryinfo_invoke(), table_create_new_row(), table_get_column_info(), TransformView_add_column(), TransformView_Create(), TransformView_create_table(), TransformView_delete_row(), TransformView_drop_table(), TransformView_insert_row(), TransformView_set_row(), Typelib_EnumResNameProc(), variant_from_registry_value(), WHERE_CreateView(), WHERE_execute(), WHERE_sort(), and wildcard_to_file().

◆ msi_alloc_zero()

◆ 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 = msi_apply_patch_package( package, patches[i] );
944
945 msi_free( patches );
946 msi_free( patch_list );
947 return r;
948}
WCHAR ** msi_split_string(const WCHAR *str, WCHAR sep)
Definition: action.c:305
static UINT msi_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 = msi_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 = strdupW( 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 = msi_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:1659
static UINT msi_parse_patch_summary(MSISUMMARYINFO *si, MSIPATCHINFO **patch)
Definition: patch.c:318
static UINT msi_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) DECLSPEC_HIDDEN
Definition: suminfo.c:457
#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 = msi_alloc( (len + lstrlenW( xforms[i] ) + 1) * sizeof(WCHAR)) ))
973 {
974 msi_free( xforms );
975 msi_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]) msi_free( transform );
983 }
984 }
985 msi_free( xforms );
986 msi_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) DECLSPEC_HIDDEN
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 2008 of file action.c.

2009{
2010 DWORD sz = 1, i;
2011 WCHAR *dir;
2012 va_list va;
2013
2014 va_start( va, count );
2015 for (i = 0; i < count; i++)
2016 {
2017 const WCHAR *str = va_arg( va, const WCHAR * );
2018 if (str) sz += lstrlenW( str ) + 1;
2019 }
2020 va_end( va );
2021
2022 dir = msi_alloc( sz * sizeof(WCHAR) );
2023 dir[0] = 0;
2024
2025 va_start( va, count );
2026 for (i = 0; i < count; i++)
2027 {
2028 const WCHAR *str = va_arg( va, const WCHAR * );
2029 if (!str) continue;
2030 lstrcatW( dir, str );
2031 if ( i + 1 != count && dir[0] && dir[lstrlenW( dir ) - 1] != '\\') lstrcatW( dir, L"\\" );
2032 }
2033 va_end( va );
2034 return dir;
2035}
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 3711 of file action.c.

3712{
3713 WCHAR *folder, *dest, *path;
3714
3715 if (package->Context == MSIINSTALLCONTEXT_MACHINE)
3716 folder = msi_dup_property( package->db, L"WindowsFolder" );
3717 else
3718 {
3719 WCHAR *appdata = msi_dup_property( package->db, L"AppDataFolder" );
3720 folder = msi_build_directory_name( 2, appdata, L"Microsoft\\" );
3721 msi_free( appdata );
3722 }
3723 dest = msi_build_directory_name( 3, folder, L"Installer\\", package->ProductCode );
3724 msi_create_full_path( package, dest );
3725 path = msi_build_directory_name( 2, dest, icon_name );
3726 msi_free( folder );
3727 msi_free( dest );
3728 return path;
3729}
WCHAR *WINAPIV msi_build_directory_name(DWORD count,...)
Definition: action.c:2008
BOOL msi_create_full_path(MSIPACKAGE *package, const WCHAR *path)
Definition: files.c:202
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 msi_publish_product_properties().

◆ msi_cabextract()

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

Definition at line 652 of file media.c.

653{
654 if (mi->cabinet[0] == '#')
655 {
656 return extract_cabinet_stream( package, mi, data );
657 }
658 return extract_cabinet( package, mi, data );
659}
static BOOL extract_cabinet(MSIPACKAGE *package, MSIMEDIAINFO *mi, LPVOID data)
Definition: media.c:579
static BOOL extract_cabinet_stream(MSIPACKAGE *package, MSIMEDIAINFO *mi, LPVOID data)
Definition: media.c:619

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 msi_free( guids );
314 msi_free( product_code );
315 return ret;
316}
#define PID_TEMPLATE
Definition: suminfo.c:49
static const GUID * guid_list[]
Definition: metadata.c:2260
LPWSTR msi_suminfo_dup_string(MSISUMMARYINFO *si, UINT uiProperty) DECLSPEC_HIDDEN
Definition: suminfo.c:696

Referenced by MSI_ApplicablePatchW(), and msi_apply_patch_package().

◆ msi_clone_properties()

UINT msi_clone_properties ( MSIDATABASE db)

Definition at line 382 of file package.c.

383{
384 MSIQUERY *view_select;
385 UINT rc;
386
387 rc = MSI_DatabaseOpenViewW( db, L"SELECT * FROM `Property`", &view_select );
388 if (rc != ERROR_SUCCESS)
389 return rc;
390
391 rc = MSI_ViewExecute( view_select, 0 );
392 if (rc != ERROR_SUCCESS)
393 {
394 MSI_ViewClose( view_select );
395 msiobj_release( &view_select->hdr );
396 return rc;
397 }
398
399 while (1)
400 {
401 MSIQUERY *view_insert, *view_update;
402 MSIRECORD *rec_select;
403
404 rc = MSI_ViewFetch( view_select, &rec_select );
405 if (rc != ERROR_SUCCESS)
406 break;
407
408 rc = MSI_DatabaseOpenViewW( db, L"INSERT INTO `_Property` (`_Property`,`Value`) VALUES (?,?)", &view_insert );
409 if (rc != ERROR_SUCCESS)
410 {
411 msiobj_release( &rec_select->hdr );
412 continue;
413 }
414
415 rc = MSI_ViewExecute( view_insert, rec_select );
416 MSI_ViewClose( view_insert );
417 msiobj_release( &view_insert->hdr );
418 if (rc != ERROR_SUCCESS)
419 {
420 MSIRECORD *rec_update;
421
422 TRACE("insert failed, trying update\n");
423
424 rc = MSI_DatabaseOpenViewW( db, L"UPDATE `_Property` SET `Value` = ? WHERE `_Property` = ?", &view_update );
425 if (rc != ERROR_SUCCESS)
426 {
427 WARN("open view failed %u\n", rc);
428 msiobj_release( &rec_select->hdr );
429 continue;
430 }
431
432 rec_update = MSI_CreateRecord( 2 );
433 MSI_RecordCopyField( rec_select, 1, rec_update, 2 );
434 MSI_RecordCopyField( rec_select, 2, rec_update, 1 );
435 rc = MSI_ViewExecute( view_update, rec_update );
436 if (rc != ERROR_SUCCESS)
437 WARN("update failed %u\n", rc);
438
439 MSI_ViewClose( view_update );
440 msiobj_release( &view_update->hdr );
441 msiobj_release( &rec_update->hdr );
442 }
443
444 msiobj_release( &rec_select->hdr );
445 }
446
447 MSI_ViewClose( view_select );
448 msiobj_release( &view_select->hdr );
449 return rc;
450}
UINT MSI_ViewClose(MSIQUERY *) DECLSPEC_HIDDEN
Definition: msiquery.c:454
UINT MSI_ViewFetch(MSIQUERY *, MSIRECORD **) DECLSPEC_HIDDEN
Definition: msiquery.c:377
UINT MSI_RecordCopyField(MSIRECORD *, UINT, MSIRECORD *, UINT) DECLSPEC_HIDDEN
Definition: record.c:166
UINT MSI_ViewExecute(MSIQUERY *, MSIRECORD *) DECLSPEC_HIDDEN
Definition: msiquery.c:502
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 msi_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 msi_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 msi_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 msi_free( encname );
650 }
651 msi_free( encname );
652 }
653
654 return ERROR_SUCCESS;
655}
#define SUCCEEDED(hr)
Definition: intsafe.h:50
LPWSTR encode_streamname(BOOL bTable, LPCWSTR in) DECLSPEC_HIDDEN
Definition: table.c:119
const WCHAR * msi_string_lookup(const string_table *st, UINT id, int *len) DECLSPEC_HIDDEN
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 2887 of file table.c.

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

1931{
1932 DWORD ms, ls;
1933
1935
1936 if (fi->dwFileVersionMS > ms) return 1;
1937 else if (fi->dwFileVersionMS < ms) return -1;
1938 else if (fi->dwFileVersionLS > ls) return 1;
1939 else if (fi->dwFileVersionLS < ls) return -1;
1940 return 0;
1941}
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 1943 of file action.c.

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

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 265 of file assembly.c.

266{
267 HRESULT hr;
270 WCHAR *str;
271 DWORD len = 0;
272
273 if (!package->pCreateAssemblyNameObject || !package->pCreateAssemblyEnum) return NULL;
274
275 hr = package->pCreateAssemblyNameObject( &name, displayname, CANOF_PARSE_DISPLAY_NAME, NULL );
276 if (FAILED( hr )) return NULL;
277
278 hr = IAssemblyName_GetName( name, &len, NULL );
279 if (hr != E_NOT_SUFFICIENT_BUFFER || !(str = msi_alloc( len * sizeof(WCHAR) )))
280 {
281 IAssemblyName_Release( name );
282 return NULL;
283 }
284
285 hr = IAssemblyName_GetName( name, &len, str );
286 IAssemblyName_Release( name );
287 if (FAILED( hr ))
288 {
289 msi_free( str );
290 return NULL;
291 }
292
293 hr = package->pCreateAssemblyNameObject( &name, str, 0, NULL );
294 msi_free( str );
295 if (FAILED( hr )) return NULL;
296
297 hr = package->pCreateAssemblyEnum( &ret, NULL, name, ASM_CACHE_GAC, NULL );
298 IAssemblyName_Release( name );
299 if (FAILED( hr )) return NULL;
300
301 return ret;
302}
@ ASM_CACHE_GAC
Definition: fusion.idl:29
#define E_NOT_SUFFICIENT_BUFFER
Definition: winerror.h:2345
@ CANOF_PARSE_DISPLAY_NAME
Definition: winsxs.idl:193

Referenced by patch_assembly().

◆ msi_create_component_advertise_string()

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

Definition at line 5465 of file action.c.

5466{
5467 WCHAR productid_85[21], component_85[21], *ret;
5468 GUID clsid;
5469 DWORD sz;
5470
5471 /* > is used if there is a component GUID and < if not. */
5472
5473 productid_85[0] = 0;
5474 component_85[0] = 0;
5475 CLSIDFromString( package->ProductCode, &clsid );
5476
5477 encode_base85_guid( &clsid, productid_85 );
5478 if (component)
5479 {
5480 CLSIDFromString( component->ComponentId, &clsid );
5481 encode_base85_guid( &clsid, component_85 );
5482 }
5483
5484 TRACE("product=%s feature=%s component=%s\n", debugstr_w(productid_85), debugstr_w(feature),
5485 debugstr_w(component_85));
5486
5487 sz = 20 + lstrlenW( feature ) + 20 + 3;
5488 ret = msi_alloc_zero( sz * sizeof(WCHAR) );
5489 if (ret) swprintf( ret, sz, L"%s%s%c%s", productid_85, feature, component ? '>' : '<', component_85 );
5490 return ret;
5491}

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 1063 of file package.c.

1064{
1065 DWORD time, len, i, offset;
1066 HANDLE handle;
1067
1068 time = GetTickCount();
1070 lstrcatW( path, L"\\Installer\\" );
1072
1073 len = lstrlenW(path);
1074 for (i = 0; i < 0x10000; i++)
1075 {
1076 offset = swprintf( path + len, MAX_PATH - len, L"%x", (time + i) & 0xffff );
1077 memcpy( path + len + offset, suffix, (lstrlenW( suffix ) + 1) * sizeof(WCHAR) );
1081 {
1083 break;
1084 }
1087 return ERROR_FUNCTION_FAILED;
1088 }
1089
1090 return ERROR_SUCCESS;
1091}
#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 msi_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 51 of file files.c.

53{
58 return handle;
59}
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:1072
static void msi_disable_fs_redirection(MSIPACKAGE *package)
Definition: msipriv.h:1068

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 202 of file files.c.

203{
204 BOOL ret = TRUE;
205 WCHAR *new_path;
206 int len;
207
208 if (!(new_path = msi_alloc( (lstrlenW( path ) + 1) * sizeof(WCHAR) ))) return FALSE;
209 lstrcpyW( new_path, path );
210
211 while ((len = lstrlenW( new_path )) && new_path[len - 1] == '\\')
212 new_path[len - 1] = 0;
213
214 while (!msi_create_directory( package, new_path ))
215 {
216 WCHAR *slash;
218 if (last_error == ERROR_ALREADY_EXISTS) break;
220 {
221 ret = FALSE;
222 break;
223 }
224 if (!(slash = wcsrchr( new_path, '\\' )))
225 {
226 ret = FALSE;
227 break;
228 }
229 len = slash - new_path;
230 new_path[len] = 0;
231 if (!msi_create_full_path( package, new_path ))
232 {
233 ret = FALSE;
234 break;
235 }
236 new_path[len] = '\\';
237 }
238 msi_free( new_path );
239 return ret;
240}
static BOOL msi_create_directory(MSIPACKAGE *package, const WCHAR *path)
Definition: files.c:79
#define ERROR_ALREADY_EXISTS
Definition: disk.h:80
#define ERROR_PATH_NOT_FOUND
Definition: winerror.h:106

Referenced by create_directory(), 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 = strdupW( tmp ))) return NULL;
230 }
231
232 if ((ret = msi_alloc( (lstrlenW( db->tempfolder ) + 20) * sizeof(WCHAR) )))
233 {
234 if (!GetTempFileNameW( db->tempfolder, L"msi", 0, ret ))
235 {
236 msi_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) DECLSPEC_HIDDEN
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(), msi_load_image(), patch_file(), and patchfiles_cb().

◆ MSI_CreatePackage()

MSIPACKAGE * MSI_CreatePackage ( MSIDATABASE db)

Definition at line 978 of file package.c.

979{
980 MSIPACKAGE *package;
981 WCHAR uilevel[11];
982 int len;
983 UINT r;
984
985 TRACE("%p\n", db);
986
987 package = msi_alloc_package();
988 if (package)
989 {
990 msiobj_addref( &db->hdr );
991 package->db = db;
992
993 package->LastAction = NULL;
994 package->LastActionTemplate = NULL;
996 package->WordCount = 0;
997 package->PackagePath = strdupW( db->path );
998
1000 msi_clone_properties( package->db );
1002
1003 package->ProductCode = msi_dup_property( package->db, L"ProductCode" );
1004
1005 set_installer_properties( package );
1006
1007 package->ui_level = gUILevel;
1008 len = swprintf( uilevel, ARRAY_SIZE(uilevel), L"%u", gUILevel & INSTALLUILEVEL_MASK );
1009 msi_set_property( package->db, L"UILevel", uilevel, len );
1010
1011 r = msi_load_suminfo_properties( package );
1012 if (r != ERROR_SUCCESS)
1013 {
1014 msiobj_release( &package->hdr );
1015 return NULL;
1016 }
1017
1019 msi_load_admin_properties( package );
1020
1021 package->log_file = INVALID_HANDLE_VALUE;
1022 package->script = SCRIPT_NONE;
1023 }
1024 return package;
1025}
static UINT msi_load_admin_properties(MSIPACKAGE *package)
Definition: package.c:950
static VOID set_installer_properties(MSIPACKAGE *package)
Definition: package.c:632
static UINT create_temp_property_table(MSIPACKAGE *package)
Definition: package.c:366
INSTALLUILEVEL gUILevel
Definition: msi_main.c:41
@ msidbSumInfoSourceTypeAdminImage
Definition: msidefs.h:223
#define INSTALLUILEVEL_MASK
Definition: msipriv.h:60
UINT msi_load_suminfo_properties(MSIPACKAGE *package) DECLSPEC_HIDDEN
Definition: suminfo.c:1262
void msi_adjust_privilege_properties(MSIPACKAGE *) DECLSPEC_HIDDEN
Definition: package.c:965
UINT msi_clone_properties(MSIDATABASE *) DECLSPEC_HIDDEN
Definition: package.c:382
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(), construct_record(), deformat_string(), dialog_create(), event_set_target_path(), 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_arrange_record(), msi_change_media(), msi_clone_properties(), MSI_CloneRecord(), msi_create_table(), MSI_DatabaseGetPrimaryKeys(), msi_dialog_seltree_handler(), msi_file_update_ui(), msi_get_property_row(), msi_get_transform_record(), MSI_OpenPackageW(), msi_query_merge_record(), msi_set_property(), msi_ui_progress(), msi_unpublish_feature(), 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(), 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 db,
LPCWSTR  table,
MSIRECORD **  prec 
)

Definition at line 1044 of file msiquery.c.

1046{
1048 MSIQUERY *query = NULL;
1049 UINT r;
1050
1051 if (!TABLE_Exists( db, table ))
1052 return ERROR_INVALID_TABLE;
1053
1054 r = MSI_OpenQuery( db, &query, L"SELECT * FROM `_Columns` WHERE `Table` = '%s'", table );
1055 if( r != ERROR_SUCCESS )
1056 return r;
1057
1058 /* count the number of primary key records */
1059 info.n = 0;
1060 info.rec = 0;
1062 if( r == ERROR_SUCCESS )
1063 {
1064 TRACE( "found %lu primary keys\n", info.n );
1065
1066 /* allocate a record and fill in the names of the tables */
1067 info.rec = MSI_CreateRecord( info.n );
1068 info.n = 0;
1070 if( r == ERROR_SUCCESS )
1071 *prec = info.rec;
1072 else
1073 msiobj_release( &info.rec->hdr );
1074 }
1075 msiobj_release( &query->hdr );
1076
1077 return r;
1078}
BOOL TABLE_Exists(MSIDATABASE *db, LPCWSTR name) DECLSPEC_HIDDEN
Definition: table.c:960
UINT MSI_IterateRecords(MSIQUERY *view, LPDWORD count, record_func func, LPVOID param)
Definition: msiquery.c:163
static UINT msi_primary_key_iterator(MSIRECORD *rec, LPVOID param)
Definition: msiquery.c:1018
UINT WINAPIV MSI_OpenQuery(MSIDATABASE *db, MSIQUERY **view, LPCWSTR fmt,...)
Definition: msiquery.c:138
#define ERROR_INVALID_TABLE
Definition: winerror.h:986

Referenced by create_diff_row_query(), merge_verify_primary_keys(), MSI_DatabaseExport(), msi_get_table_labels(), and MsiDatabaseGetPrimaryKeysW().

◆ MSI_DatabaseIsTablePersistent()

MSICONDITION MSI_DatabaseIsTablePersistent ( MSIDATABASE db,
LPCWSTR  table 
)

Definition at line 2922 of file table.c.

2923{
2924 MSITABLE *t;
2925 UINT r;
2926
2927 TRACE("%p %s\n", db, debugstr_w(table));
2928
2929 if (!table)
2930 return MSICONDITION_ERROR;
2931
2932 r = get_table( db, table, &t );
2933 if (r != ERROR_SUCCESS)
2934 return MSICONDITION_NONE;
2935
2936 return t->persistent;
2937}
static UINT get_table(MSIDATABASE *db, LPCWSTR name, MSITABLE **table_ret)
Definition: table.c:573
@ 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(), create_temp_property_table(), gather_merge_data(), get_property(), 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_add_table_to_db(), msi_clone_properties(), msi_get_property_row(), msi_load_all_components(), msi_load_all_features(), msi_publish_icons(), msi_set_property(), msi_table_apply_transform(), msi_unpublish_icons(), 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(), TransformView_add_column(), TransformView_Create(), TransformView_create_table(), TransformView_delete_row(), TransformView_drop_table(), TransformView_insert_row(), TransformView_set_row(), and ui_sequence_exists().

◆ msi_delete_file()

BOOL msi_delete_file ( MSIPACKAGE package,
const WCHAR filename 
)

Definition at line 70 of file files.c.

71{
72 BOOL ret;
76 return ret;
77}
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
Definition: delete.c:39

Referenced by ACTION_RemoveFiles(), 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 92 of file assembly.c.

93{
94 UINT i;
95
96 if (package->cache_sxs)
97 {
98 IAssemblyCache_Release( package->cache_sxs );
99 package->cache_sxs = NULL;
100 }
101 for (i = 0; i < CLR_VERSION_MAX; i++)
102 {
103 if (package->cache_net[i])
104 {
105 IAssemblyCache_Release( package->cache_net[i] );
106 package->cache_net[i] = NULL;
107 }
108 }
109 package->pGetFileVersion = NULL;
110 package->pCreateAssemblyNameObject = NULL;
111 package->pCreateAssemblyEnum = NULL;
112 FreeLibrary( package->hfusion10 );
113 FreeLibrary( package->hfusion11 );
114 FreeLibrary( package->hfusion20 );
115 FreeLibrary( package->hfusion40 );
116 FreeLibrary( package->hmscoree );
117 package->hfusion10 = NULL;
118 package->hfusion11 = NULL;
119 package->hfusion20 = NULL;
120 package->hfusion40 = NULL;
121 package->hmscoree = NULL;
122}
#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 msi_free( st->strings[i].data );
116 }
117 msi_free( st->strings );
118 msi_free( st->sorted );
119 msi_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 4072 of file dialog.c.

4073{
4074 DWORD r;
4075
4076 /* in threads other than the UI thread, block */
4078 {
4079 if (!handle) return;
4081 {
4082 MSG msg;
4083 while (PeekMessageW( &msg, NULL, 0, 0, PM_REMOVE ))
4084 {
4087 }
4088 }
4089 return;
4090 }
4091
4092 /* there are two choices for the UI thread */
4093 while (1)
4094 {
4096
4097 if( !handle )
4098 break;
4099
4100 /*
4101 * block here until somebody creates a new dialog or
4102 * the handle we're waiting on becomes ready
4103 */
4105 if( r == WAIT_OBJECT_0 )
4106 break;
4107 }
4108}
#define msg(x)
Definition: auth_time.c:54
static void process_pending_messages(HWND hdlg)
Definition: dialog.c:3911
static DWORD uiThreadId
Definition: dialog.c:140
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
#define WAIT_OBJECT_0
Definition: winbase.h:406
BOOL WINAPI TranslateMessage(_In_ const MSG *)
#define QS_ALLINPUT
Definition: winuser.h:903
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:1196
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 4140 of file dialog.c.

4141{
4142 msi_font *font, *next;
4143
4145 {
4147 return;
4148 }
4149
4150 if( dialog->hwnd )
4151 {
4152 ShowWindow( dialog->hwnd, SW_HIDE );
4153 DestroyWindow( dialog->hwnd );
4154 }
4155
4156 /* unsubscribe events */
4157 event_cleanup_subscriptions( dialog->package, dialog->name );
4158
4159 /* destroy the list of controls */
4160 while( !list_empty( &dialog->controls ) )
4161 {
4162 msi_control *t;
4163
4164 t = LIST_ENTRY( list_head( &dialog->controls ),
4165 msi_control, entry );
4167 }
4168
4169 /* destroy the list of fonts */
4171 {
4172 list_remove( &font->entry );
4173 DeleteObject( font->hfont );
4174 msi_free( font );
4175 }
4176 msi_free( dialog->default_font );
4177
4178 msi_free( dialog->control_default );
4179 msi_free( dialog->control_cancel );
4180 dialog->package = NULL;
4181 msi_free( dialog );
4182}
#define WM_MSI_DIALOG_DESTROY
Definition: dialog.c:136
static void event_cleanup_subscriptions(MSIPACKAGE *package, const WCHAR *dialog)
Definition: dialog.c:4126
static HWND hMsiHiddenWindow
Definition: dialog.c:141
static void msi_destroy_control(msi_control *t)
Definition: dialog.c:361
pKey DeleteObject()
static HWND dialog
Definition: gui.c:33
Definition: mk_font.cpp:20
LONG_PTR LPARAM
Definition: windef.h:208
#define SW_HIDE
Definition: winuser.h:768
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 4184 of file dialog.c.

4185{
4188 UnregisterClassW( L"MsiDialogCloseClass", NULL );
4189 UnregisterClassW( L"MsiHiddenWindow", NULL );
4190 uiThreadId = 0;
4191}
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 1027 of file package.c.

1028{
1030 DWORD size = 0;
1031 HRESULT hr;
1032
1033 /* call will always fail, because size is 0,
1034 * but will return ERROR_FILE_NOT_FOUND first
1035 * if the file doesn't exist
1036 */
1037 GetUrlCacheEntryInfoW( szUrl, NULL, &size );
1039 {
1041 if ( !GetUrlCacheEntryInfoW( szUrl, cache_entry, &size ) )
1042 {
1045 return error;
1046 }
1047
1048 lstrcpyW( filename, cache_entry->lpszLocalFileName );
1050 return ERROR_SUCCESS;
1051 }
1052
1054 if ( FAILED(hr) )
1055 {
1056 WARN("failed to download %s to cache file\n", debugstr_w(szUrl));
1057 return ERROR_FUNCTION_FAILED;
1058 }
1059
1060 return ERROR_SUCCESS;
1061}
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()

LPWSTR msi_dup_property ( MSIDATABASE db,
LPCWSTR  prop 
)

Definition at line 2283 of file package.c.

2284{
2285 DWORD sz = 0;
2286 LPWSTR str;
2287 UINT r;
2288
2289 r = msi_get_property(db, prop, NULL, &sz);
2290 if (r != ERROR_SUCCESS && r != ERROR_MORE_DATA)
2291 return NULL;
2292
2293 sz++;
2294 str = msi_alloc(sz * sizeof(WCHAR));
2295 r = msi_get_property(db, prop, str, &sz);
2296 if (r != ERROR_SUCCESS)
2297 {
2298 msi_free(str);
2299 str = NULL;
2300 }
2301
2302 return str;
2303}
#define ERROR_MORE_DATA
Definition: dderror.h:13
UINT msi_get_property(MSIDATABASE *db, LPCWSTR szName, LPWSTR szValueBuf, LPDWORD pchValueBuf)
Definition: package.c:2250

Referenced by ACTION_CostFinalize(), ACTION_CustomAction(), ACTION_ExecuteAction(), ACTION_RegisterProduct(), ACTION_RegisterUser(), append_productcode(), check_transform_applicable(), defer_custom_action(), event_set_target_path(), get_base_url(), get_duplicate_filename(), get_ini_file_name(), get_source_root(), HANDLE_CustomType23(), HANDLE_CustomType50(), HANDLE_CustomType53_54(), ITERATE_MoveFiles(), ITERATE_RemoveExistingProducts(), ITERATE_RemoveFiles(), MSI_ApplicablePatchXML(), msi_apply_patches(), msi_apply_transforms(), msi_build_icon_path(), msi_change_media(), msi_check_patch_applicable(), MSI_CreatePackage(), msi_dialog_combobox_update(), msi_dialog_dup_property(), msi_dialog_edit_control(), msi_dialog_maskedit_control(), msi_dialog_oncreate(), msi_dialog_radiogroup_control(), msi_get_checkbox_value(), msi_get_property_int(), MSI_InstallPackage(), msi_load_media_info(), MSI_OpenPackageW(), msi_publish_install_properties(), msi_publish_product_properties(), msi_publish_upgrade_code(), msi_resolve_target_folder(), msi_set_sourcedir_props(), msi_validate_product_id(), MsiSetFeatureAttributesW(), patch_set_media_source_prop(), process_state_property(), ready_media(), remove_product_upgrade_code(), and set_installer_properties().

◆ 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 = msi_alloc( 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 msi_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 4193 of file dialog.c.

4194{
4195 struct list *item, *next;
4196
4198 {
4199 struct subscriber *sub = LIST_ENTRY( item, struct subscriber, entry );
4200 list_remove( &sub->entry );
4201 free_subscriber( sub );
4202 }
4203}
static void free_subscriber(struct subscriber *sub)
Definition: dialog.c:4118
#define LIST_FOR_EACH_SAFE(cursor, cursor2, list)
Definition: list.h:192
struct list entry
Definition: dialog.c:112
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 4503 of file dialog.c.

4504{
4505 struct subscriber *sub;
4506
4507 TRACE("firing event %s\n", debugstr_w(event));
4508
4509 LIST_FOR_EACH_ENTRY( sub, &package->subscriptions, struct subscriber, entry )
4510 {
4511 if (wcsicmp( sub->event, event )) continue;
4512 dialog_handle_event( sub->dialog, sub->control, sub->attribute, rec );
4513 }
4514}
#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:560
struct _cl_event * event
Definition: glext.h:7739
WCHAR * event
Definition: dialog.c:114
WCHAR * attribute
Definition: dialog.c:116
WCHAR * control
Definition: dialog.c:115
msi_dialog * dialog
Definition: dialog.c:113

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

◆ msi_export_suminfo()

UINT msi_export_suminfo ( MSIDATABASE db,
HANDLE  handle 
)

Definition at line 1190 of file suminfo.c.

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

Referenced by msi_export_summaryinformation().

◆ msi_find_first_file()

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

Definition at line 115 of file files.c.

116{
120 msi_revert_fs_redirection( package );
121 return handle;
122}
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 124 of file files.c.

125{
126 BOOL ret;
129 msi_revert_fs_redirection( package );
130 return ret;
131}
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 msi_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 msi_free( format );
896 msi_free( deformated );
897 return rc;
898}
#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
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
WCHAR * msi_dup_record_field(MSIRECORD *row, INT index) DECLSPEC_HIDDEN
Definition: record.c:1002
UINT MSI_RecordGetFieldCount(const MSIRECORD *rec) DECLSPEC_HIDDEN
Definition: record.c:108
MSIRECORD * MSI_CloneRecord(MSIRECORD *) DECLSPEC_HIDDEN
Definition: record.c:921
void dump_record(MSIRECORD *) DECLSPEC_HIDDEN
Definition: record.c:1028

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

◆ msi_free()

static void msi_free ( void mem)
inlinestatic

Definition at line 1159 of file msipriv.h.

1160{
1161 free( mem );
1162}
#define free
Definition: debug_ros.c:5
Definition: mem.c:156

Referenced by ACTION_CostFinalize(), ACTION_CustomAction(), ACTION_DialogBox(), ACTION_ExecuteAction(), ACTION_FinishCustomActions(), ACTION_InstallFiles(), ACTION_ProcessComponents(), ACTION_PublishFeatures(), ACTION_PublishProduct(), ACTION_RegisterClassInfo(), ACTION_RegisterExtensionInfo(), ACTION_RegisterMIMEInfo(), ACTION_RegisterProduct(), ACTION_RegisterUser(), ACTION_RemoveFiles(), ACTION_ResolveSource(), ACTION_UnregisterClassInfo(), ACTION_UnregisterExtensionInfo(), ACTION_UnregisterMIMEInfo(), ALTER_CreateView(), ALTER_delete(), append_productcode(), AutomationObject_Release(), build_default_format(), build_multi_string_value(), cabinet_close_file_info(), cabinet_copy_file(), cabinet_free(), cabinet_next_cabinet(), cabinet_next_cabinet_stream(), cabinet_open_stream(), calculate_file_cost(), calculate_install_state(), check_transform_applicable(), construct_record(), copy_install_file(), CREATE_CreateView(), CREATE_delete(), create_diff_row_query(), create_temp_binary(), create_temp_dir(), defer_custom_action(), deformat_component(), deformat_environment(), deformat_file(), deformat_index(), deformat_property(), deformat_string_internal(), DELETE_delete(), delete_key(), delete_local_assembly_key(), dialog_create(), dialog_create_window(), dialog_handle_event(), DISTINCT_close(), DISTINCT_delete(), distinct_free(), DllMain(), DROP_CreateView(), DROP_delete(), encode_streamname(), event_set_target_path(), execute_command(), expand_any_path(), extract_cabinet(), file_version_matches(), fill_source_list(), find_published_source(), font_name_from_file(), format_replace(), free_assembly(), free_custom_action_data(), free_extension(), free_feature(), free_file_entry(), free_folder(), free_merge_table(), free_package_structures(), free_patchinfo(), free_prop(), free_reorder(), free_signature(), free_source_list(), free_stack(), free_streams(), free_subscriber(), free_table(), free_transform_desc(), free_transforms(), get_assembly_display_name(), get_base_url(), get_clr_version(), get_duplicate_filename(), get_file_version(), get_fusion_filename(), get_ini_file_name(), get_install_location(), get_key_value(), get_link_file(), get_local_package(), get_patch_product_codes(), get_path_property(), get_registered_local_package(), get_signature(), get_stream_name(), get_unique_folder_name(), get_user_sid(), HANDLE_CustomType18(), HANDLE_CustomType19(), HANDLE_CustomType2(), HANDLE_CustomType21_22(), HANDLE_CustomType23(), HANDLE_CustomType34(), HANDLE_CustomType50(), HANDLE_CustomType53_54(), HANDLE_CustomType5_6(), HANDLE_CustomType7(), init_stringtable(), INSERT_delete(), InstallerImpl_ProductInfo(), InstallerImpl_RegistryValue(), internal_ui_handler(), ITERATE_AppSearch(), ITERATE_BindImage(), ITERATE_CCPSearch(), ITERATE_CreateShortcuts(), ITERATE_DeleteService(), ITERATE_DuplicateFiles(), ITERATE_InstallODBCDataSource(), ITERATE_InstallODBCDriver(), ITERATE_InstallODBCTranslator(), ITERATE_InstallService(), ITERATE_LaunchConditions(), ITERATE_MoveFiles(), ITERATE_PublishComponent(), ITERATE_PublishIcon(), ITERATE_RegisterFonts(), ITERATE_RegisterTypeLibraries(), ITERATE_RemoveDuplicateFiles(), ITERATE_RemoveEnvironmentString(), ITERATE_RemoveExistingProducts(), ITERATE_RemoveFiles(), ITERATE_RemoveIniValuesOnInstall(), ITERATE_RemoveIniValuesOnUninstall(), ITERATE_RemoveODBCDataSource(), ITERATE_RemoveRegistryValuesOnInstall(), ITERATE_RemoveRegistryValuesOnUninstall(), ITERATE_RemoveShortcuts(), ITERATE_StartService(), ITERATE_StopService(), ITERATE_UnpublishIcon(), ITERATE_UnregisterFonts(), ITERATE_WriteEnvironmentString(), ITERATE_WriteIniValues(), ITERATE_WriteRegistryValues(), list_free(), ListEnumerator_Release(), load_class(), load_file(), load_folder(), load_patch(), load_progid(), load_summary_info(), load_ttf_name_id(), match_languages(), merge_diff_row(), merge_free_rows(), move_files_wildcard(), msi_add_cabinet_stream(), msi_add_table_to_db(), MSI_ApplicablePatchXML(), msi_apply_patch_db(), msi_apply_patches(), msi_apply_transforms(), MSI_ApplyPatchW(), msi_build_createsql_columns(), msi_build_createsql_postlude(), msi_build_icon_path(), msi_change_media(), msi_check_patch_applicable(), msi_check_product_patches(), MSI_CloseDatabase(), MSI_CloseView(), msi_commit_streams(), msi_create_assembly_enum(), msi_create_full_path(), msi_create_temp_file(), MSI_DatabaseExport(), MSI_DatabaseImport(), msi_destroy_control(), msi_destroy_stringtable(), msi_dialog_bitmap_control(), msi_dialog_button_control(), msi_dialog_button_handler(), msi_dialog_combo_control(), msi_dialog_combobox_handler(), msi_dialog_combobox_update(), msi_dialog_destroy(), msi_dialog_directorylist_new(), msi_dialog_directorylist_up(), msi_dialog_dirlist_handler(), msi_dialog_edit_control(), msi_dialog_edit_handler(), msi_dialog_icon_control(), msi_dialog_list_box(), msi_dialog_maskedit_control(), msi_dialog_oncreate(), msi_dialog_onkillfocus(), msi_dialog_radiogroup_control(), msi_dialog_scrolltext_control(), msi_dialog_selection_tree(), msi_dialog_send_event(), msi_dialog_set_property_event(), msi_dialog_text_control(), msi_dialog_update_directory_combo(), msi_dialog_update_directory_list(), msi_dialog_update_pathedit(), msi_dialog_vcl_add_columns(), msi_dialog_vcl_add_drives(), msi_dialog_volsel_handler(), msi_dialog_vsc_add_drives(), msi_download_file(), msi_dup_property(), msi_dup_record_field(), MSI_EnumComponentQualifiers(), msi_export_field(), msi_export_stream(), MSI_FormatRecordW(), msi_free_action_script(), msi_free_colinfo(), msi_free_handle_table(), msi_free_media_info(), msi_free_patchinfo(), MSI_FreeField(), MSI_FreePackage(), msi_get_assembly_path(), msi_get_binary_name(), msi_get_checkbox_value(), msi_get_disk_file_version(), msi_get_font_file_version(), msi_get_property_int(), msi_get_property_row(), msi_get_stream(), msi_get_transform_record(), MSI_GetComponentPath(), MSI_GetProductInfo(), MSI_GetUserInfo(), msi_import_stream_filename(), MSI_InstallPackage(), msi_load_admin_properties(), msi_load_assembly(), msi_load_image(), msi_load_media_info(), msi_load_string_table(), msi_load_suminfo_properties(), msi_mask_control_change(), msi_maskedit_set_text(), MSI_OpenPackageW(), MSI_OpenProductW(), MSI_OpenQuery(), msi_parse_command_line(), msi_parse_patch_summary(), MSI_ProcessMessage(), MSI_ProcessMessageVerbatim(), MSI_ProvideQualifiedComponentEx(), msi_publish_install_properties(), msi_publish_patches(), msi_publish_product_properties(), msi_publish_upgrade_code(), MSI_QueryGetRecord(), msi_read_text_archive(), msi_record_encoded_stream_name(), msi_record_to_row(), msi_reset_source_folders(), msi_resolve_file_source(), msi_resolve_source_folder(), msi_resolve_target_folder(), msi_save_string_table(), msi_scrolltext_add_text(), msi_service_args_to_vector(), msi_set_last_used_source(), msi_set_original_database_property(), msi_set_sourcedir_props(), MSI_SetTargetPathW(), msi_table_apply_transform(), msi_table_find_row(), msi_table_load_transform(), msi_update_table_columns(), msi_validate_product_id(), MsiActiveScriptSite_Release(), MsiApplyMultiplePatchesA(), MsiApplyMultiplePatchesW(), MsiApplyPatchA(), MsiBeginTransactionA(), MSIComboBox_WndProc(), MsiConfigureFeatureA(), MsiConfigureProductA(), MsiConfigureProductExA(), MsiConfigureProductExW(), MsiCreateTransformSummaryInfoA(), MsiDatabaseApplyTransformA(), MsiDatabaseCommit(), MsiDatabaseExportA(), MsiDatabaseGetPrimaryKeysA(), MsiDatabaseImportA(), MsiDatabaseIsTablePersistentA(), MsiDatabaseMergeA(), MsiDatabaseOpenViewA(), MsiDecomposeDescriptorA(), MsiDetermineApplicablePatchesA(), MsiDeterminePatchSequenceA(), MsiDoActionA(), MsiEnableLogA(), MsiEnableLogW(), MsiEnumClientsA(), MsiEnumComponentCostsA(), MsiEnumComponentQualifiersA(), MsiEnumComponentsExA(), MsiEnumFeaturesA(), MsiEnumPatchesA(), MsiEnumPatchesExA(), MsiEnumPatchesW(), MsiEnumProductsExA(), MsiEnumRelatedProductsA(), MsiFormatRecordA(), MsiGetComponentPathExA(), MsiGetComponentStateA(), MsiGetFeatureCostA(), MsiGetFeatureInfoA(), MsiGetFeatureStateA(), MsiGetFeatureUsageA(), MsiGetFeatureValidStatesA(), MsiGetFileHashA(), MsiGetFileSignatureInformationA(), MsiGetFileVersionA(), MsiGetFileVersionW(), MsiGetPatchInfoA(), MsiGetPatchInfoExA(), MsiGetPatchInfoExW(), MsiGetProductCodeA(), MsiGetProductInfoA(), MsiGetProductInfoExA(), MsiGetProductInfoExW(), MsiGetProductPropertyA(), MsiGetShortcutTargetA(), MsiGetSummaryInformationA(), MsiGetUserInfoA(), MsiInstallMissingComponentA(), MsiInstallProductA(), MSIListBox_WndProc(), MsiLoadStringA(), MSIMaskedEdit_WndProc(), msiobj_release(), MsiOpenDatabaseA(), MsiOpenPackageExA(), MsiOpenProductA(), MSIPathEdit_WndProc(), MsiPreviewDialogA(), MsiProvideComponentA(), MsiProvideQualifiedComponentExA(), MsiQueryComponentStateA(), MsiQueryComponentStateW(), MsiQueryFeatureStateA(), MsiQueryFeatureStateExA(), MsiQueryProductStateA(), MsiRecordSetStreamA(), MsiRecordSetStringA(), MsiReinstallFeatureA(), MsiReinstallFeatureW(), MsiReinstallProductA(), MSIScrollText_WndProc(), MSISelectionTree_WndProc(), MsiSequenceA(), MsiSetComponentStateA(), MsiSetFeatureAttributesA(), MsiSetFeatureAttributesW(), MsiSetFeatureStateA(), MsiSetPropertyA(), MsiSetTargetPathA(), MsiSourceListAddMediaDiskA(), MsiSourceListAddMediaDiskW(), MsiSourceListAddSourceA(), MsiSourceListAddSourceExA(), MsiSourceListAddSourceExW(), MsiSourceListAddSourceW(), MsiSourceListEnumMediaDisksA(), MsiSourceListEnumMediaDisksW(), MsiSourceListEnumSourcesA(), MsiSourceListGetInfoA(), MsiSourceListGetInfoW(), MsiSourceListSetInfoA(), MSIText_WndProc(), MsiUseFeatureExA(), MsiVerifyPackageA(), open_key(), open_local_assembly_key(), open_package(), parse_languages(), parse_suminfo(), parse_value(), patch_add_media(), patch_assembly(), patch_file(), patch_offset_list_free(), patch_set_media_source_prop(), pending_event_end_dialog(), pending_event_new_dialog(), pending_event_spawn_dialog(), process_state_property(), query_feature_state(), read_stream_data(), read_table_from_storage(), ready_media(), record_invoke(), recurse_search_directory(), register_dll(), register_verb(), remove_duplicate_values(), remove_product_upgrade_code(), replace_stack(), replace_stack_group(), replace_stack_prop(), resolve_keypath(), save_prop(), save_summary_info(), save_table(), search_dr(), search_file(), search_ini(), search_reg(), SELECT_CreateView(), SELECT_delete(), session_invoke(), set_installer_properties(), set_msi_assembly_prop(), set_target_path(), set_user_sid_prop(), split_multi_string_values(), st_find_free_entry(), stop_service_dependents(), STORAGES_CreateView(), STORAGES_delete(), STORAGES_set_row(), stream_to_storage(), STREAMS_delete(), STREAMS_delete_row(), string2id(), summaryinfo_invoke(), table_create_new_row(), TABLE_CreateView(), TABLE_delete(), TABLE_delete_row(), TABLE_fetch_stream(), table_get_column_info(), table_set_bytes(), TABLE_set_row(), TABLE_set_stream(), TransformView_add_column(), TransformView_Create(), TransformView_create_table(), TransformView_delete(), TransformView_delete_row(), TransformView_drop_table(), TransformView_insert_row(), TransformView_set_row(), Typelib_EnumResNameProc(), ui_actioninfo(), UPDATE_delete(), variant_from_registry_value(), WHERE_CreateView(), WHERE_delete(), WHERE_execute(), WHERE_sort(), and write_stream_data().

◆ msi_free_action_script()

void msi_free_action_script ( MSIPACKAGE package,
UINT  script 
)

Definition at line 138 of file package.c.

139{
140 UINT i;
141 for (i = 0; i < package->script_actions_count[script]; i++)
142 msi_free( package->script_actions[script][i] );
143
144 msi_free( package->script_actions[script] );
145 package->script_actions[script] = NULL;
146 package->script_actions_count[script] = 0;
147}
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 CRITICAL_SECTION MSI_object_cs
Definition: handle.c:48
static unsigned int msihandletable_size
Definition: handle.c:69
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)

Referenced by DllMain().

◆ msi_free_media_info()

void msi_free_media_info ( MSIMEDIAINFO mi)

Definition at line 661 of file media.c.

662{
663 msi_free(mi->disk_prompt);
664 msi_free(mi->cabinet);
665 msi_free(mi->volume_label);
666 msi_free(mi->last_volume);
667 msi_free(mi);
668}

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 msi_free( patch->patchcode );
868 msi_free( patch->products );
869 msi_free( patch->transforms );
870 msi_free( patch->filename );
871 msi_free( patch->localfile );
872 msi_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 free_package_structures(), msi_apply_patch_package(), and msi_apply_registered_patch().

◆ msi_get_assembly_path()

WCHAR * msi_get_assembly_path ( MSIPACKAGE package,
const WCHAR displayname 
)

Definition at line 240 of file assembly.c.

241{
242 HRESULT hr;
245
246 if (!cache) return NULL;
247
248 memset( &info, 0, sizeof(info) );
249 info.cbAssemblyInfo = sizeof(info);
250 hr = IAssemblyCache_QueryAssemblyInfo( cache, 0, displayname, &info );
251 if (hr != E_NOT_SUFFICIENT_BUFFER) return NULL;
252
253 if (!(info.pszCurrentAssemblyPathBuf = msi_alloc( info.cchBuf * sizeof(WCHAR) ))) return NULL;
254
255 hr = IAssemblyCache_QueryAssemblyInfo( cache, 0, displayname, &info );
256 if (FAILED( hr ))
257 {
258 msi_free( info.pszCurrentAssemblyPathBuf );
259 return NULL;
260 }
261 TRACE("returning %s\n", debugstr_w(info.pszCurrentAssemblyPathBuf));
262 return info.pszCurrentAssemblyPathBuf;
263}
#define memset(x, y, z)
Definition: compat.h:39
Definition: cache.c:49

Referenced by 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 274 of file action.c.

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

612{
613 if (!comp->Enabled)
614 {
615 TRACE("component is disabled: %s\n", debugstr_w(comp->Component));
617 }
618 if (package->need_rollback) return comp->Installed;
619 if (comp->num_clients > 0 && comp->ActionRequest == INSTALLSTATE_ABSENT)
620 {
621 TRACE("%s has %u clients left\n", debugstr_w(comp->Component), comp->num_clients);
623 }
624 return comp->ActionRequest;
625}
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 487 of file suminfo.c.

488{
489 IStream *stm;
490 MSISUMMARYINFO *si;
491 UINT r;
492
493 if (!(si = create_suminfo( db->storage, uiUpdateCount ))) return ERROR_OUTOFMEMORY;
494
495 r = msi_get_stream( db, L"\5SummaryInformation", &stm );
496 if (r != ERROR_SUCCESS)
497 {
498 msiobj_release( &si->hdr );
499 return r;
500 }
501
502 r = load_summary_info( si, stm );
503 IStream_Release( stm );
504 if (r != ERROR_SUCCESS)
505 {
506 msiobj_release( &si->hdr );
507 return r;
508 }
509
510 *ret = si;
511 return ERROR_SUCCESS;
512}
static UINT load_summary_info(MSISUMMARYINFO *si, IStream *stm)
Definition: suminfo.c:251
UINT msi_get_stream(MSIDATABASE *, const WCHAR *, IStream **) DECLSPEC_HIDDEN
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 190 of file files.c.

191{
192 DWORD size;
193 HANDLE file;
197 CloseHandle( file );
198 return size;
199}
#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:51
#define INVALID_FILE_SIZE
Definition: winbase.h:548

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 161 of file files.c.

162{
164 DWORD version_size;
165 UINT size;
166 void *version;
167
168 if (!(version_size = msi_get_file_version_info( package, filename, 0, NULL ))) return NULL;
169 if (!(version = msi_alloc( version_size ))) return NULL;
170
171 msi_get_file_version_info( package, filename, version_size, version );
172
173 if (!VerQueryValueW( version, L"\\", (void **)&ptr, &size ))
174 {
175 msi_free( version );
176 return NULL;
177 }
178
179 if (!(ret = msi_alloc( size )))
180 {
181 msi_free( version );
182 return NULL;
183 }
184
185 memcpy( ret, ptr, size );
186 msi_free( version );
187 return ret;
188}
DWORD msi_get_file_version_info(MSIPACKAGE *package, const WCHAR *path, DWORD buflen, BYTE *buffer)
Definition: files.c:151
BOOL WINAPI VerQueryValueW(LPCVOID pBlock, LPCWSTR lpSubBlock, LPVOID *lplpBuffer, PUINT puLen)
Definition: version.c:1049

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 1823 of file package.c.

1824{
1826 LPWSTR ret = NULL;
1827
1828 if ((record = MSI_QueryGetRecord(db, L"SELECT `Message` FROM `Error` WHERE `Error` = %d", error)))
1829 {
1831 msiobj_release(&record->hdr);
1832 }
1833 else if (error < 2000)
1834 {
1836 if (len)
1837 {
1838 ret = msi_alloc((len + 1) * sizeof(WCHAR));
1840 }
1841 else
1842 ret = NULL;
1843 }
1844
1845 return ret;
1846}
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 151 of file files.c.

152{
155 if (buffer) size = GetFileVersionInfoW( path, 0, buflen, buffer );
157 msi_revert_fs_redirection( package );
158 return size;
159}
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 4024 of file msi.c.

4025{
4027 void *p;
4028 DWORD length;
4030
4031 if (package)
4033 else
4036 {
4037 WARN( "can't open file %lu\n", GetLastError() );
4038 return ERROR_FILE_NOT_FOUND;
4039 }
4040 if ((length = GetFileSize( handle, NULL )))
4041 {
4043 {
4044 if ((p = MapViewOfFile( mapping, FILE_MAP_READ, 0, 0, length )))
4045 {
4046 MD5_CTX ctx;
4047
4048 MD5Init( &ctx );
4049 MD5Update( &ctx, p, length );
4050 MD5Final( &ctx );
4051 UnmapViewOfFile( p );
4052
4053 memcpy( hash->dwData, ctx.digest, sizeof(hash->dwData) );
4054 r = ERROR_SUCCESS;
4055 }
4057 }
4058 }
4059 else
4060 {
4061 /* Empty file -> set hash to 0 */
4062 memset( hash->dwData, 0, sizeof(hash->dwData) );
4063 r = ERROR_SUCCESS;
4064 }
4065
4067 return r;
4068}
#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 MD5Final(MD5_CTX *)
Definition: md5.c:113
VOID WINAPI MD5Init(MD5_CTX *)
Definition: md5.c:45
VOID WINAPI MD5Update(MD5_CTX *, const unsigned char *, unsigned int)
Definition: md5.c:59
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: msi.c:4013
Definition: _hash_fun.h:40

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 186 of file font.c.

187{
188 WCHAR *version, *p, *q, *ret = NULL;
189
191 {
192 int len, major = 0, minor = 0;
193 if ((p = wcschr( version, ';' ))) *p = 0;
194 p = version;
195 while (*p && !iswdigit( *p )) p++;
196 if ((q = wcschr( p, '.' )))
197 {
198 major = wcstol( p, NULL, 10 );
199 p = ++q;
200 while (*q && iswdigit( *q )) q++;
201 if (!*q || *q == ' ') minor = wcstol( p, NULL, 10 );
202 else major = 0;
203 }
204 len = lstrlenW( L"%u.%u.0.0" ) + 20;
205 ret = msi_alloc( len * sizeof(WCHAR) );
206 swprintf( ret, len, L"%u.%u.0.0", major, minor );
207 msi_free( version );
208 }
209 return ret;
210}
static WCHAR * load_ttf_name_id(MSIPACKAGE *package, const WCHAR *filename, DWORD id)
Definition: font.c:73
#define NAME_ID_VERSION
Definition: font.c:55
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 552 of file action.c.

553{
554 MSICOMPONENT *comp;
555
557 {
558 if (!wcscmp( Component, comp->Component )) return comp;
559 }
560 return NULL;
561}
_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 1278 of file package.c.

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

Referenced by ACTION_PublishProduct(), and msi_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
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 * msi_get_property_row(MSIDATABASE *db, LPCWSTR name)
Definition: package.c:2183
UINT MSI_RecordGetStringW(MSIRECORD *, UINT, LPWSTR, LPDWORD) DECLSPEC_HIDDEN
static const WCHAR szName[]
Definition: powrprof.c:45

Referenced by create_temp_dir(), deformat_property(), msi_create_temp_file(), msi_dialog_get_checkbox_state(), 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 msi_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 457 of file suminfo.c.

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

Referenced by check_transform_applicable(), msi_add_suminfo(), MSI_ApplicablePatchW(), msi_apply_patch_package(), 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()

LPWSTR msi_get_suminfo_product ( IStorage stg)

Definition at line 720 of file suminfo.c.

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

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:2178
r parent
Definition: btrfs.c:3010

Referenced by create_directory(), 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_GetComponentStateW()

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

Definition at line 1428 of file install.c.

1430{
1431 MSICOMPONENT *comp;
1432
1433 TRACE("%p %s %p %p\n", package, debugstr_w(szComponent),
1434 piInstalled, piAction);
1435
1436 comp = msi_get_loaded_component(package,szComponent);
1437 if (!comp)
1439
1440 if (piInstalled)
1441 {
1442 if (comp->Enabled)
1443 *piInstalled = comp->Installed;
1444 else
1445 *piInstalled = INSTALLSTATE_UNKNOWN;
1446 }
1447
1448 if (piAction)
1449 {
1450 if (comp->Enabled)
1451 *piAction = comp->Action;
1452 else
1453 *piAction = INSTALLSTATE_UNKNOWN;
1454 }
1455
1456 TRACE("states (%i, %i)\n", comp->Installed, comp->Action );
1457 return ERROR_SUCCESS;
1458}
MSICOMPONENT * msi_get_loaded_component(MSIPACKAGE *package, const WCHAR *Component)
Definition: action.c:552
#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 *cost /= 512;
1201 return ERROR_SUCCESS;
1202}
static int state
Definition: maze.c:121
MSIFEATURE * msi_get_loaded_feature(MSIPACKAGE *package, const WCHAR *Feature)
Definition: action.c:563
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 msi_vcl_get_cost(), and MsiGetFeatureCostW().

◆ 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_assembly_caches()

BOOL msi_init_assembly_caches ( MSIPACKAGE package)

Definition at line 56 of file assembly.c.

57{
58 HRESULT (WINAPI *pCreateAssemblyCache)( IAssemblyCache **, DWORD );
59
60 if (package->cache_sxs) return TRUE;
61 if (CreateAssemblyCache( &package->cache_sxs, 0 ) != S_OK) return FALSE;
62
63 if (!load_fusion_dlls( package )) return FALSE;
64 package->pGetFileVersion = (void *)GetProcAddress( package->hmscoree, "GetFileVersion" ); /* missing from v1.0.3705 */
65
66 if (package->hfusion10)
67 {
68 pCreateAssemblyCache = (void *)GetProcAddress( package->hfusion10, "CreateAssemblyCache" );
69 pCreateAssemblyCache( &package->cache_net[CLR_VERSION_V10], 0 );
70 }
71 if (package->hfusion11)
72 {
73 pCreateAssemblyCache = (void *)GetProcAddress( package->hfusion11, "CreateAssemblyCache" );
74 pCreateAssemblyCache( &package->cache_net[CLR_VERSION_V11], 0 );
75 }
76 if (package->hfusion20)
77 {
78 pCreateAssemblyCache = (void *)GetProcAddress( package->hfusion20, "CreateAssemblyCache" );
79 pCreateAssemblyCache( &package->cache_net[CLR_VERSION_V20], 0 );
80 }
81 if (package->hfusion40)
82 {
83 pCreateAssemblyCache = (void *)GetProcAddress( package->hfusion40, "CreateAssemblyCache" );
84 pCreateAssemblyCache( &package->cache_net[CLR_VERSION_V40], 0 );
85 package->pCreateAssemblyNameObject = (void *)GetProcAddress( package->hfusion40, "CreateAssemblyNameObject" );
86 package->pCreateAssemblyEnum = (void *)GetProcAddress( package->hfusion40, "CreateAssemblyEnum" );
87 }
88
89 return TRUE;
90}
#define GetProcAddress(x, y)
Definition: compat.h:753
HRESULT WINAPI CreateAssemblyCache(IAssemblyCache **ppAsmCache, DWORD dwReserved)
Definition: asmcache.c:555
static BOOL load_fusion_dlls(MSIPACKAGE *package)
Definition: assembly.c:33
#define DWORD
Definition: nt_native.h:44
#define HRESULT
Definition: msvc.h:7
#define WINAPI
Definition: msvc.h:6

Referenced by MSI_OpenPackageW().

◆ 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) DECLSPEC_HIDDEN
Definition: table.c:296
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 411 of file assembly.c.

412{
413 HRESULT hr;
414 const WCHAR *manifest;
418
419 if (comp->assembly->feature)
420 feature = msi_get_loaded_feature( package, comp->assembly->feature );
421
422 if (assembly->application)
423 {
424 if (feature) feature->Action = INSTALLSTATE_LOCAL;
425 return ERROR_SUCCESS;
426 }
427 if (assembly->attributes == msidbAssemblyAttributesWin32)
428 {
429 if (!assembly->manifest)
430 {
431 WARN("no manifest\n");
433 }
435 cache = package->cache_sxs;
436 }
437 else
438 {
439 manifest = msi_get_loaded_file( package, comp->KeyPath )->TargetPath;
440 cache = package->cache_net[get_clr_version( package, manifest )];
441 if (!cache) return ERROR_SUCCESS;
442 }
443 TRACE("installing assembly %s\n", debugstr_w(manifest));
444
445 hr = IAssemblyCache_InstallAssembly( cache, 0, manifest, NULL );
446 if (hr != S_OK)
447 {
448 ERR( "failed to install assembly %s (%#lx)\n", debugstr_w(manifest), hr );
450 }
451 if (feature) feature->Action = INSTALLSTATE_LOCAL;
452 assembly->installed = TRUE;
453 return ERROR_SUCCESS;
454}
static enum clr_version get_clr_version(MSIPACKAGE *package, const WCHAR *filename)
Definition: assembly.c:386
struct file_info manifest
Definition: actctx.c:469
LPWSTR feature
Definition: msipriv.h:512
LPWSTR TargetPath
Definition: msipriv.h:617
static const CHAR manifest[]
Definition: v6util.h:39

Referenced by ACTION_InstallFiles(), and ACTION_PatchFiles().

◆ MSI_InstallPackage()

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

Definition at line 7710 of file action.c.

7712{
7713 WCHAR *reinstall = NULL, *productcode, *action;
7714 struct dummy_thread thread_info = {NULL, NULL, NULL};
7715 UINT rc;
7716 DWORD len = 0;
7717
7718 if (szPackagePath)
7719 {
7720 LPWSTR p, dir;
7721 LPCWSTR file;
7722
7723 dir = strdupW(szPackagePath);
7724 p = wcsrchr(dir, '\\');
7725 if (p)
7726 {
7727 *(++p) = 0;
7728 file = szPackagePath + (p - dir);
7729 }
7730 else
7731 {
7732 msi_free(dir);
7733 dir = msi_alloc(MAX_PATH * sizeof(WCHAR));
7735 lstrcatW(dir, L"\\");
7736 file = szPackagePath;
7737 }
7738
7739 msi_free( package->PackagePath );
7740 package->PackagePath = msi_alloc((lstrlenW(dir) + lstrlenW(file) + 1) * sizeof(WCHAR));
7741 if (!package->PackagePath)
7742 {
7743 msi_free(dir);
7744 return ERROR_OUTOFMEMORY;
7745 }
7746
7747 lstrcpyW(package->PackagePath, dir);
7748 lstrcatW(package->PackagePath, file);
7749 msi_free(dir);
7750
7752 }
7753
7754 rc = msi_parse_command_line( package, szCommandLine, FALSE );
7755 if (rc != ERROR_SUCCESS)
7756 return rc;
7757
7758 msi_apply_transforms( package );
7759 msi_apply_patches( package );
7760
7761 if (msi_get_property( package->db, L"ACTION", NULL, &len ))
7762 msi_set_property( package->db, L"ACTION", L"INSTALL", -1 );
7763 action = msi_dup_property( package->db, L"ACTION" );
7765
7766 msi_set_original_database_property( package->db, szPackagePath );
7767 msi_parse_command_line( package, szCommandLine, FALSE );
7769 msi_set_context( package );
7770
7772
7773 productcode = msi_dup_property( package->db, L"ProductCode" );
7774 if (wcsicmp( productcode, package->ProductCode ))
7775 {
7776 TRACE( "product code changed %s -> %s\n", debugstr_w(package->ProductCode), debugstr_w(productcode) );
7777 msi_free( package->ProductCode );
7778 package->ProductCode = productcode;
7779 }
7780 else msi_free( productcode );
7781
7782 if (msi_get_property_int( package->db, L"DISABLEROLLBACK", 0 ))
7783 {
7784 TRACE("disabling rollback\n");
7785 msi_set_property( package->db, L"RollbackDisabled", L"1", -1 );
7786 }
7787
7788 rc = ACTION_PerformAction(package, action);
7789
7790 /* process the ending type action */
7791 if (rc == ERROR_SUCCESS)
7792 ACTION_PerformActionSequence(package, -1);
7793 else if (rc == ERROR_INSTALL_USEREXIT)
7794 ACTION_PerformActionSequence(package, -2);
7795 else if (rc == ERROR_INSTALL_SUSPEND)
7796 ACTION_PerformActionSequence(package, -4);
7797 else /* failed */
7798 {
7799 ACTION_PerformActionSequence(package, -3);
7800 if (!msi_get_property_int( package->db, L"RollbackDisabled", 0 ))
7801 {
7802 package->need_rollback = TRUE;
7803 }
7804 }
7805
7806 /* finish up running custom actions */
7808
7810
7811 if (package->need_rollback && !(reinstall = msi_dup_property( package->db, L"REINSTALL" )))
7812 {
7813 WARN("installation failed, running rollback script\n");
7814 execute_script( package, SCRIPT_ROLLBACK );
7815 }
7816 msi_free( reinstall );
7817 msi_free( action );
7818
7819 if (rc == ERROR_SUCCESS && package->need_reboot_at_end)
7821
7822 return rc;
7823}
#define GetCurrentDirectoryW(x, y)
Definition: compat.h:756
UINT msi_set_context(MSIPACKAGE *package)
Definition: action.c:396
static void stop_dummy_thread(struct dummy_thread *info)
Definition: action.c:7694
static UINT ACTION_PerformActionSequence(MSIPACKAGE *package, UINT seq)
Definition: action.c:7628
UINT ACTION_PerformAction(MSIPACKAGE *package, const WCHAR *action)
Definition: action.c:7610
UINT msi_parse_command_line(MSIPACKAGE *package, LPCWSTR szCommandLine, BOOL preserve_case)
Definition: action.c:214
static UINT execute_script(MSIPACKAGE *package, UINT script)
Definition: action.c:1397
static void start_dummy_thread(struct dummy_thread *info)
Definition: action.c:7685
void ACTION_FinishCustomActions(const MSIPACKAGE *package)
Definition: custom.c:1604
UINT msi_apply_transforms(MSIPACKAGE *package) DECLSPEC_HIDDEN
Definition: patch.c:950
UINT msi_apply_patches(MSIPACKAGE *package) DECLSPEC_HIDDEN
Definition: patch.c:932
UINT msi_set_original_database_property(MSIDATABASE *, const WCHAR *) DECLSPEC_HIDDEN
Definition: package.c:1311
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(), dialog_map_events(), gather_merge_data(), get_assembly_display_name(), 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_combobox_add_items(), MSI_DatabaseExport(), MSI_DatabaseGetPrimaryKeys(), msi_dialog_build_font_list(), msi_dialog_button_handler(), msi_dialog_evaluate_control_conditions(), msi_dialog_fill_controls(), msi_dialog_radiogroup_control(), msi_listbox_add_items(), msi_listview_add_items(), msi_load_all_components(), msi_load_all_features(), msi_publish_icons(), MSI_Sequence(), msi_unimplemented_action_stub(), msi_unpublish_icons(), and ui_sequence_exists().

◆ msi_load_all_components()

UINT msi_load_all_components ( MSIPACKAGE package)

Definition at line 809 of file action.c.

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

Referenced by ACTION_CostInitialize(), and MsiGetFeatureInfoW().

◆ msi_load_all_features()

UINT msi_load_all_features ( MSIPACKAGE package)

Definition at line 951 of file action.c.

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

Referenced by ACTION_CostInitialize(), and MsiGetFeatureInfoW().

◆ msi_load_assembly()

MSIASSEMBLY * msi_load_assembly ( MSIPACKAGE package,
MSICOMPONENT comp 
)

Definition at line 319 of file assembly.c.

320{
321 MSIRECORD *rec;
322 MSIASSEMBLY *a;
323
324 if (!(rec = get_assembly_record( package, comp->Component ))) return NULL;
325 if (!(a = msi_alloc_zero( sizeof(MSIASSEMBLY) )))
326 {
327 msiobj_release( &rec->hdr );
328 return NULL;
329 }
330 a->feature = strdupW( MSI_RecordGetString( rec, 2 ) );
331 TRACE("feature %s\n", debugstr_w(a->feature));
332
333 a->manifest = strdupW( MSI_RecordGetString( rec, 3 ) );
334 TRACE("manifest %s\n", debugstr_w(a->manifest));
335
336 a->application = strdupW( MSI_RecordGetString( rec, 4 ) );
337 TRACE("application %s\n", debugstr_w(a->application));
338
339 a->attributes = MSI_RecordGetInteger( rec, 5 );
340 TRACE( "attributes %lu\n", a->attributes );
341
342 if (!(a->display_name = get_assembly_display_name( package->db, comp->Component, a )))
343 {
344 WARN("can't get display name\n");
345 msiobj_release( &rec->hdr );
346 msi_free( a->feature );
347 msi_free( a->manifest );
348 msi_free( a->application );
349 msi_free( a );
350 return NULL;
351 }
352 TRACE("display name %s\n", debugstr_w(a->display_name));
353
354 if (a->application)
355 {
356 /* We can't check the manifest here because the target path may still change.
357 So we assume that the assembly is not installed and lean on the InstallFiles
358 action to determine which files need to be installed.
359 */
360 a->installed = FALSE;
361 }
362 else
363 {
364 if (a->attributes == msidbAssemblyAttributesWin32)
365 a->installed = is_assembly_installed( package->cache_sxs, a->display_name );
366 else
367 {
368 UINT i;
369 for (i = 0; i < CLR_VERSION_MAX; i++)
370 {
371 a->clr_version[i] = is_assembly_installed( package->cache_net[i], a->display_name );
372 if (a->clr_version[i])
373 {
374 TRACE("runtime version %s\n", debugstr_w(get_clr_version_str( i )));
375 a->installed = TRUE;
376 break;
377 }
378 }
379 }
380 }
381 TRACE("assembly is %s\n", a->installed ? "installed" : "not installed");
382 msiobj_release( &rec->hdr );
383 return a;
384}
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:124
static WCHAR * get_assembly_display_name(MSIDATABASE *db, const WCHAR *comp, MSIASSEMBLY *assembly)
Definition: assembly.c:175
static const WCHAR * get_clr_version_str(enum clr_version version)
Definition: assembly.c:312
static BOOL is_assembly_installed(IAssemblyCache *cache, const WCHAR *display_name)
Definition: assembly.c:222

Referenced by load_component().

◆ msi_load_media_info()

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

Definition at line 689 of file media.c.

690{
691 MSIRECORD *row;
692 WCHAR *source_dir, *source, *base_url = NULL;
694
695 if (Sequence <= mi->last_sequence) /* already loaded */
696 return ERROR_SUCCESS;
697
698 row = MSI_QueryGetRecord(package->db, L"SELECT * FROM `Media` WHERE `LastSequence` >= %d ORDER BY `DiskId`", Sequence);
699 if (!row)
700 {
701 TRACE("Unable to query row\n");
703 }
704
705 mi->is_extracted = FALSE;
706 mi->disk_id = MSI_RecordGetInteger(row, 1);
707 mi->last_sequence = MSI_RecordGetInteger(row, 2);
708 msi_free(mi->disk_prompt);
709 mi->disk_prompt = strdupW(MSI_RecordGetString(row, 3));
710 msi_free(mi->cabinet);
711 mi->cabinet = strdupW(MSI_RecordGetString(row, 4));
712 msi_free(mi->volume_label);
713 mi->volume_label = strdupW(MSI_RecordGetString(row, 5));
714 msiobj_release(&row->hdr);
715
717 source_dir = msi_dup_property(package->db, L"SourceDir");
718 lstrcpyW(mi->sourcedir, source_dir);
719 PathAddBackslashW(mi->sourcedir);
720 mi->type = get_drive_type(source_dir);
721
723 if (mi->type == DRIVE_CDROM || mi->type == DRIVE_REMOVABLE)
724 {
725 source = source_dir;
727 }
728 else if ((base_url = get_base_url(package->db)))
729 {
732 }
733 else
734 {
735 source = mi->sourcedir;
737 }
738
739 msi_package_add_media_disk(package, package->Context,
740 MSICODE_PRODUCT, mi->disk_id,
741 mi->volume_label, mi->disk_prompt);
742
743 msi_package_add_info(package, package->Context,
745
746 TRACE("sequence %u -> cabinet %s disk id %u\n", Sequence, debugstr_w(mi->cabinet), mi->disk_id);
747
749 msi_free(source_dir);
750 return ERROR_SUCCESS;
751}
static WCHAR * get_base_url(MSIDATABASE *db)
Definition: media.c:681
static UINT get_drive_type(const WCHAR *path)
Definition: media.c:670
#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_info(MSIPACKAGE *, DWORD, DWORD, LPCWSTR, LPWSTR) DECLSPEC_HIDDEN
Definition: package.c:2625
UINT msi_package_add_media_disk(MSIPACKAGE *, DWORD, DWORD, DWORD, LPWSTR, LPWSTR) DECLSPEC_HIDDEN
Definition: package.c:2648
#define PathAddBackslashW
Definition: pathcch.h:301
#define DRIVE_REMOVABLE
Definition: winbase.h:251

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 msi_free( pool );
559 msi_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 1262 of file suminfo.c.

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

57{
58 HKEY hkey = NULL;
59
61 if (!szProduct) return ERROR_UNKNOWN_PRODUCT;
62
64 &hkey, FALSE) == ERROR_SUCCESS)
67 &hkey, FALSE) == ERROR_SUCCESS)
69 else if (MSIREG_OpenProductKey(szProduct, NULL,
71 &hkey, FALSE) == ERROR_SUCCESS)
73
74 RegCloseKey(hkey);
75
78
79 return ERROR_SUCCESS;
80}
@ 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) DECLSPEC_HIDDEN
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 133 of file files.c.

134{
135 BOOL ret;
137 ret = MoveFileExW( from, to, flags );
138 msi_revert_fs_redirection( package );
139 return ret;
140}
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 2118 of file action.c.

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

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 = strdupW( 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 = strdupW( 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 @1549 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
#define MSI_OPEN_CREATE
Definition: msipriv.h:102
#define MSI_OPEN_READONLY
Definition: msipriv.h:99
#define MSI_INITIAL_MEDIA_TRANSFORM_OFFSET
Definition: msipriv.h:83
string_table * msi_load_string_table(IStorage *stg, UINT *bytes_per_strref) DECLSPEC_HIDDEN
Definition: string.c:478
void enum_stream_names(IStorage *stg) DECLSPEC_HIDDEN
Definition: table.c:204
#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 MSI_ApplicablePatchW(), msi_apply_patch_package(), msi_apply_registered_patch(), MSI_OpenPackageW(), MsiGetSummaryInformationW(), and MsiOpenDatabaseW().

◆ MSI_OpenPackageW()

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

Definition at line 1385 of file package.c.

1386{
1387 MSIDATABASE *db;
1388 MSIPACKAGE *package;
1390 MSIRECORD *data_row, *info_row;
1391 UINT r;
1392 WCHAR localfile[MAX_PATH], cachefile[MAX_PATH];
1393 LPCWSTR file = szPackage;
1394 DWORD index = 0;
1395 MSISUMMARYINFO *si;
1396 BOOL delete_on_close = FALSE;
1397 WCHAR *info_template, *productname, *product_code;
1399
1400 TRACE("%s %p\n", debugstr_w(szPackage), pPackage);
1401
1403
1404 localfile[0] = 0;
1405 if( szPackage[0] == '#' )
1406 {
1407 handle = wcstol(&szPackage[1], NULL, 10);
1409 return ERROR_INVALID_HANDLE;
1410 }
1411 else
1412 {
1413 WCHAR *product_version = NULL;
1414
1415 if ( UrlIsW( szPackage, URLIS_URL ) )
1416 {
1417 r = msi_download_file( szPackage, cachefile );
1418 if (r != ERROR_SUCCESS)
1419 return r;
1420
1421 file = cachefile;
1422 }
1423#ifdef __REACTOS__
1424 AppHelpCheckPackage(file);
1425#endif
1426
1428 if (r != ERROR_SUCCESS)
1429 {
1431 return ERROR_FILE_NOT_FOUND;
1432 return r;
1433 }
1434 r = get_local_package( db, localfile );
1436 {
1437 DWORD localfile_attr;
1438
1439 r = msi_create_empty_local_file( localfile, L".msi" );
1440 if (r != ERROR_SUCCESS)
1441 {
1442 msiobj_release( &db->hdr );
1443 return r;
1444 }
1445
1446 if (!CopyFileW( file, localfile, FALSE ))
1447 {
1448 r = GetLastError();
1449 WARN("unable to copy package %s to %s (%u)\n", debugstr_w(file), debugstr_w(localfile), r);
1450 DeleteFileW( localfile );
1451 msiobj_release( &db->hdr );
1452 return r;
1453 }
1454 delete_on_close = TRUE;
1455
1456 /* Remove read-only bit, we are opening it with write access in MSI_OpenDatabaseW below. */
1457 localfile_attr = GetFileAttributesW( localfile );
1458 if (localfile_attr & FILE_ATTRIBUTE_READONLY)
1459 SetFileAttributesW( localfile, localfile_attr & ~FILE_ATTRIBUTE_READONLY);
1460 }
1462 {
1463 if (!CopyFileW( file, localfile, FALSE ))
1464 {
1465 r = GetLastError();
1466 WARN("unable to update cached package (%u)\n", r);
1467 msiobj_release( &db->hdr );
1468 return r;
1469 }
1470 }
1471 else
1472 product_version = get_product_version( db );
1473 msiobj_release( &db->hdr );
1474 TRACE("opening package %s\n", debugstr_w( localfile ));
1475 r = MSI_OpenDatabaseW( localfile, MSIDBOPEN_TRANSACT, &db );
1476 if (r != ERROR_SUCCESS)
1477 return r;
1478
1479 if (product_version)
1480 {
1481 WCHAR *cache_version = get_product_version( db );
1482 if (!product_version != !cache_version ||
1483 (product_version && wcscmp(product_version, cache_version)))
1484 {
1485 msiobj_release( &db->hdr );
1486 msi_free(product_version);
1487 msi_free(cache_version);
1488 return ERROR_PRODUCT_VERSION;
1489 }
1490 msi_free(product_version);
1491 msi_free(cache_version);
1492 }
1493 }
1494 package = MSI_CreatePackage( db );
1495 msiobj_release( &db->hdr );
1496 if (!package) return ERROR_INSTALL_PACKAGE_INVALID;
1497 package->localfile = strdupW( localfile );
1498 package->delete_on_close = delete_on_close;
1499
1500 r = msi_get_suminfo( db->storage, 0, &si );
1501 if (r != ERROR_SUCCESS)
1502 {
1503 r = msi_get_db_suminfo( db, 0, &si );
1504 if (r != ERROR_SUCCESS)
1505 {
1506 WARN("failed to load summary info\n");
1507 msiobj_release( &package->hdr );
1509 }
1510 }
1511 r = parse_suminfo( si, package );
1512 msiobj_release( &si->hdr );
1513 if (r != ERROR_SUCCESS)
1514 {
1515 WARN("failed to parse summary info %u\n", r);
1516 msiobj_release( &package->hdr );
1517 return r;
1518 }
1519 r = validate_package( package );
1520 if (r != ERROR_SUCCESS)
1521 {
1522 msiobj_release( &package->hdr );
1523 return r;
1524 }
1525 msi_set_property( package->db, L"DATABASE", db->path, -1 );
1526 set_installed_prop( package );
1527 msi_set_context( package );
1528
1529 product_code = get_product_code( db );
1530 if (msi_locate_product( product_code, &context ) == ERROR_SUCCESS)
1531 {
1532 TRACE("product already registered\n");
1533 msi_set_property( package->db, L"ProductToBeRegistered", L"1", -1 );
1534 }
1535 msi_free(product_code);
1536
1537 while (1)
1538 {
1539 WCHAR patch_code[GUID_SIZE];
1540 r = MsiEnumPatchesExW( package->ProductCode, NULL, package->Context,
1541 MSIPATCHSTATE_APPLIED, index, patch_code, NULL, NULL, NULL, NULL );
1542 if (r != ERROR_SUCCESS)
1543 break;
1544
1545 TRACE("found registered patch %s\n", debugstr_w(patch_code));
1546
1547 r = msi_apply_registered_patch( package, patch_code );
1548 if (r != ERROR_SUCCESS)
1549 {
1550 ERR("registered patch failed to apply %u\n", r);
1551 msiobj_release( &package->hdr );
1552 return r;
1553 }
1554 index++;
1555 }
1556 if (index) msi_adjust_privilege_properties( package );
1557
1558 r = msi_set_original_database_property( package->db, szPackage );
1559 if (r != ERROR_SUCCESS)
1560 {
1561 msiobj_release( &package->hdr );
1562 return r;
1563 }
1564 if (gszLogFile)
1567
1568 if (!msi_init_assembly_caches( package ))
1569 {
1570 ERR("can't initialize assembly caches\n");
1571 msiobj_release( &package->hdr );
1572 return ERROR_FUNCTION_FAILED;
1573 }
1574
1575 /* FIXME: when should these messages be sent? */
1576 data_row = MSI_CreateRecord(3);
1577 if (!data_row)
1578 return ERROR_OUTOFMEMORY;
1579 MSI_RecordSetStringW(data_row, 0, NULL);
1580 MSI_RecordSetInteger(data_row, 1, 0);
1581 MSI_RecordSetInteger(data_row, 2, package->num_langids ? package->langids[0] : 0);
1584
1585 info_row = MSI_CreateRecord(0);
1586 if (!info_row)
1587 {
1588 msiobj_release(&data_row->hdr);
1589 return ERROR_OUTOFMEMORY;
1590 }
1591 info_template = msi_get_error_message(package->db, MSIERR_INFO_LOGGINGSTART);
1592 MSI_RecordSetStringW(info_row, 0, info_template);
1593 msi_free(info_template);
1595
1597
1598 productname = msi_dup_property(package->db, INSTALLPROPERTY_PRODUCTNAMEW);
1599 MSI_RecordSetInteger(data_row, 1, 1);
1600 MSI_RecordSetStringW(data_row, 2, productname);
1601 MSI_RecordSetStringW(data_row, 3, NULL);
1603
1604 msi_free(productname);
1605 msiobj_release(&info_row->hdr);
1606 msiobj_release(&data_row->hdr);
1607
1608 *pPackage = package;
1609 return ERROR_SUCCESS;
1610}
BOOL WINAPI SetFileAttributesW(LPCWSTR lpFileName, DWORD dwFileAttributes)
Definition: fileinfo.c:794
UINT msi_locate_product(LPCWSTR szProduct, MSIINSTALLCONTEXT *context)
Definition: msi.c:56
static UINT validate_package(MSIPACKAGE *package)
Definition: package.c:1172
UINT msi_download_file(LPCWSTR szUrl, LPWSTR filename)
Definition: package.c:1027
INT MSI_ProcessMessage(MSIPACKAGE *package, INSTALLMESSAGE eMessageType, MSIRECORD *record)
Definition: package.c:1914
static UINT get_local_package(MSIDATABASE *db, WCHAR *localfile)
Definition: package.c:1299
static WCHAR * get_product_version(MSIDATABASE *db)
Definition: package.c:1248
static UINT parse_suminfo(MSISUMMARYINFO *si, MSIPACKAGE *package)
Definition: package.c:1103
static WCHAR * get_product_code(MSIDATABASE *db)
Definition: package.c:1243
static UINT set_installed_prop(MSIPACKAGE *package)
Definition: package.c:458
UINT msi_create_empty_local_file(LPWSTR path, LPCWSTR suffix)
Definition: package.c:1063
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:1963
#define MSIERR_INFO_LOGGINGSTART
Definition: resource.h:24
BOOL WINAPI UrlIsW(LPCWSTR pszUrl, URLIS Urlis)
Definition: url.c:1933
BOOL msi_init_assembly_caches(MSIPACKAGE *package)
Definition: assembly.c:56
@ MSIPATCHSTATE_APPLIED
Definition: msi.h:54
enum tagMSIINSTALLCONTEXT MSIINSTALLCONTEXT
Definition: action.c:49
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) DECLSPEC_HIDDEN
Definition: string.c:671
#define GUID_SIZE
Definition: msipriv.h:733
UINT MSI_RecordSetInteger(MSIRECORD *, UINT, int) DECLSPEC_HIDDEN
Definition: record.c:280
#define WINE_OPENPACKAGEFLAGS_RECACHE
Definition: msipriv.h:883
UINT msi_apply_registered_patch(MSIPACKAGE *package, LPCWSTR patch_code) DECLSPEC_HIDDEN
Definition: patch.c:990
INT MSI_ProcessMessageVerbatim(MSIPACKAGE *, INSTALLMESSAGE, MSIRECORD *) DECLSPEC_HIDDEN
Definition: package.c:1848
WCHAR * msi_get_error_message(MSIDATABASE *, int) DECLSPEC_HIDDEN
Definition: package.c:1823
#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:1191
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:788

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 = msi_alloc( 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 msi_free( query );
156 }
157 /* perform the 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(), dialog_map_events(), get_assembly_display_name(), get_assembly_record(), load_feature(), load_file_hash(), load_folder_persistence(), mark_patched_components(), merge_diff_tables(), msi_add_records_to_table(), msi_combobox_add_items(), MSI_DatabaseExport(), MSI_DatabaseGetPrimaryKeys(), msi_dialog_build_font_list(), msi_dialog_button_handler(), msi_dialog_evaluate_control_conditions(), msi_dialog_fill_controls(), msi_dialog_radiogroup_control(), msi_get_merge_table(), msi_listbox_add_items(), msi_listview_add_items(), MSI_Sequence(), msi_unimplemented_action_stub(), MsiGetProductPropertyW(), 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 = msi_alloc(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 = strdupW(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 = msi_alloc(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 = strdupW(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 214 of file action.c.

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

Referenced by MSI_InstallPackage(), and msi_load_admin_properties().

◆ 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_ProcessMessage()

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

Definition at line 1914 of file package.c.

1915{
1916 switch (eMessageType & 0xff000000)
1917 {
1925 {
1926 /* error message */
1927
1928 LPWSTR template;
1929 LPWSTR template_rec = NULL, template_prefix = NULL;
1931
1932 if (MSI_RecordIsNull(record, 0))
1933 {
1934 if (error >= 32)
1935 {
1936 template_rec = msi_get_error_message(package->db, error);
1937
1938 if (!template_rec && error >= 2000)
1939 {
1940 /* internal error, not localized */
1941 if ((template_rec = (LPWSTR) get_internal_error_message(error)))
1942 {
1943 MSI_RecordSetStringW(record, 0, template_rec);
1945 }
1946 template_rec = msi_get_error_message(package->db, MSIERR_INSTALLERROR);
1947 MSI_RecordSetStringW(record, 0, template_rec);
1948 MSI_ProcessMessageVerbatim(package, eMessageType, record);
1949 msi_free(template_rec);
1950 return 0;
1951 }
1952 }
1953 }
1954 else
1955 template_rec = msi_dup_record_field(record, 0);
1956
1957 template_prefix = msi_get_error_message(package->db, eMessageType >> 24);
1958 if (!template_prefix) template_prefix = strdupW(L"");
1959
1960 if (!template_rec)
1961 {
1962 /* always returns 0 */
1963 MSI_RecordSetStringW(record, 0, template_prefix);
1964 MSI_ProcessMessageVerbatim(package, eMessageType, record);
1965 msi_free(template_prefix);
1966 return 0;
1967 }
1968
1969 template = msi_alloc((lstrlenW(template_rec) + lstrlenW(template_prefix) + 1) * sizeof(WCHAR));
1970 if (!template) return ERROR_OUTOFMEMORY;
1971
1972 lstrcpyW(template, template_prefix);
1973 lstrcatW(template, template_rec);
1974 MSI_RecordSetStringW(record, 0, template);
1975
1976 msi_free(template_prefix);
1977 msi_free(template_rec);
1978 msi_free(template);
1979 }
1980 break;
1982 {
1983 WCHAR *template = msi_get_error_message(package->db, MSIERR_ACTIONSTART);
1984 MSI_RecordSetStringW(record, 0, template);
1985 msi_free(template);
1986
1987 msi_free(package->LastAction);
1988 msi_free(package->LastActionTemplate);
1989 package->LastAction = msi_dup_record_field(record, 1);
1990 if (!package->LastAction) package->LastAction = strdupW(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 = msi_alloc(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 msi_free(template);
2003 }
2004 break;
2006 {
2007 WCHAR *template = msi_get_error_message(package->db, MSIERR_COMMONDATA);
2008 MSI_RecordSetStringW(record, 0, template);
2009 msi_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:1807
INT MSI_ProcessMessageVerbatim(MSIPACKAGE *package, INSTALLMESSAGE eMessageType, MSIRECORD *record)
Definition: package.c:1848
LPWSTR msi_get_error_message(MSIDATABASE *db, int error)
Definition: package.c:1823
#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) DECLSPEC_HIDDEN
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(), dialog_create(), 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_change_media(), msi_file_update_ui(), MSI_FreePackage(), MSI_OpenPackageW(), msi_ui_progress(), msi_unpublish_feature(), MsiOpenPackageExW(), MsiProcessMessage(), ui_actioninfo(), and ui_actionstart().

◆ MSI_ProcessMessageVerbatim()

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

Definition at line 1848 of file package.c.

1849{
1850 LPWSTR message = {0};
1851 DWORD len;
1852 DWORD log_type = 1 << (eMessageType >> 24);
1853 UINT res;
1854 INT rc = 0;
1855 char *msg;
1856
1857 TRACE("%x\n", eMessageType);
1858 if (TRACE_ON(msi)) dump_record(record);
1859
1860 if (!package || !record)
1861 message = NULL;
1862 else {
1863 res = MSI_FormatRecordW(package, record, message, &len);
1864 if (res != ERROR_SUCCESS && res != ERROR_MORE_DATA)
1865 return res;
1866 len++;
1867 message = msi_alloc(len * sizeof(WCHAR));
1868 if (!message) return ERROR_OUTOFMEMORY;
1869 MSI_FormatRecordW(package, record, message, &len);
1870 }
1871
1872 /* convert it to ANSI */
1873 len = WideCharToMultiByte( CP_ACP, 0, message, -1, NULL, 0, NULL, NULL );
1874 msg = msi_alloc( len );
1876
1877 if (gUIHandlerRecord && (gUIFilterRecord & log_type))
1878 {
1879 MSIHANDLE rec = alloc_msihandle(&record->hdr);
1880 TRACE( "calling UI handler %p(pvContext = %p, iMessageType = %#x, hRecord = %lu)\n",
1881 gUIHandlerRecord, gUIContextRecord, eMessageType, rec );
1882 rc = gUIHandlerRecord( gUIContextRecord, eMessageType, rec );
1883 MsiCloseHandle( rec );
1884 }
1885 if (!rc && gUIHandlerW && (gUIFilter & log_type))
1886 {
1887 TRACE( "calling UI handler %p(pvContext = %p, iMessageType = %#x, szMessage = %s)\n",
1888 gUIHandlerW, gUIContext, eMessageType, debugstr_w(message) );
1889 rc = gUIHandlerW( gUIContext, eMessageType, message );
1890 }
1891 else if (!rc && gUIHandlerA && (gUIFilter & log_type))
1892 {
1893 TRACE( "calling UI handler %p(pvContext = %p, iMessageType = %#x, szMessage = %s)\n",
1894 gUIHandlerA, gUIContext, eMessageType, debugstr_a(msg) );
1895 rc = gUIHandlerA( gUIContext, eMessageType, msg );
1896 }
1897
1898 if (!rc)
1899 rc = internal_ui_handler(package, eMessageType, record, message);
1900
1901 if (!rc && package && package->log_file != INVALID_HANDLE_VALUE &&
1902 (eMessageType & 0xff000000) != INSTALLMESSAGE_PROGRESS)
1903 {
1904 DWORD written;
1905 WriteFile( package->log_file, msg, len - 1, &written, NULL );
1906 WriteFile( package->log_file, "\n", 1, &written, NULL );
1907 }
1908 msi_free( msg );
1909 msi_free( message );
1910
1911 return rc;
1912}
#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:1705
#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()

MSIRECORD *WINAPIV MSI_QueryGetRecord ( MSIDATABASE db,
LPCWSTR  query,
  ... 
)

◆ msi_realloc()

◆ 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 msi_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 msi_arrange_record(), msi_clone_properties(), MSI_CloneRecord(), msi_query_merge_record(), msi_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_create(), dialog_create_window(), dialog_handle_event(), 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_dialog_add_control(), msi_dialog_add_font(), msi_dialog_adjust_dialog_pos(), msi_dialog_bitmap_control(), msi_dialog_button_control(), msi_dialog_combo_control(), msi_dialog_directory_combo(), msi_dialog_directory_list(), msi_dialog_hyperlink(), msi_dialog_icon_control(), msi_dialog_line_control(), msi_dialog_list_box(), msi_dialog_listview(), msi_dialog_oncreate(), msi_dialog_pathedit_control(), msi_dialog_progress_bar(), msi_dialog_radiogroup_control(), msi_dialog_selection_tree(), msi_dialog_text_control(), msi_dialog_volumeselect_combo(), msi_load_assembly(), msi_load_media_info(), msi_primary_key_iterator(), MSI_ProcessMessage(), msi_record_to_row(), msi_select_update(), msi_table_load_transform(), MsiRecordGetInteger(), patch_add_media(), patch_offset_get_filepatches(), patch_offset_get_files(), patch_set_offsets(), patch_update_file_sequence(), patch_update_filepatch_sequence(), resolve_keypath(), search_components(), search_dr(), search_ini(), search_reg(), 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 msi_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(), create_diff_row_query(), dialog_create(), dialog_create_window(), dialog_handle_event(), find_feature_children(), find_folder_children(), get_assembly_name_attribute(), get_assembly_record(), get_duplicate_filename(), get_ini_file_name(), get_key_value(), get_link_file(), get_property(), 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(), load_appid(), load_class(), load_extension(), load_file(), load_media(), load_mime(), load_patch(), load_progid(), map_event(), merge_diff_tables(), merge_verify_colnames(), merge_verify_primary_keys(), msi_combobox_add_item(), msi_dialog_add_control(), msi_dialog_add_font(), msi_dialog_checkbox_control(), msi_dialog_combo_control(), msi_dialog_control_event(), msi_dialog_create_controls(), msi_dialog_create_radiobutton(), msi_dialog_directory_combo(), msi_dialog_directory_list(), msi_dialog_edit_control(), msi_dialog_get_uitext(), msi_dialog_hyperlink(), msi_dialog_line_control(), msi_dialog_list_box(), msi_dialog_listview(), msi_dialog_maskedit_control(), msi_dialog_oncreate(), msi_dialog_pathedit_control(), msi_dialog_radiogroup_control(), msi_dialog_scrolltext_control(), msi_dialog_selection_tree(), msi_dialog_seltree_handler(), msi_dialog_set_control_condition(), msi_dialog_text_control(), msi_dialog_vcl_add_columns(), msi_dialog_volumeselect_combo(), MSI_FormatRecordW(), msi_get_deformatted_field(), msi_get_query_columns(), msi_get_query_types(), msi_get_table_labels(), msi_listbox_add_item(), msi_listview_add_item(), msi_load_assembly(), msi_load_media_info(), msi_media_get_disk_info(), msi_primary_key_iterator(), MsiGetProductPropertyW(), patch_set_media_source_prop(), patch_update_file_sequence(), patch_update_filepatch_sequence(), 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 msi_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(), HANDLE_CustomType5_6(), ITERATE_PublishIcon(), msi_export_stream(), 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 msi_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(), construct_record(), copy_remote_record(), deformat_string(), dialog_create(), event_set_target_path(), 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_change_media(), msi_create_table(), MSI_DatabaseExport(), msi_dialog_seltree_handler(), msi_file_update_ui(), MSI_FormatRecordW(), msi_get_property_row(), MSI_OpenPackageW(), msi_primary_key_iterator(), MSI_ProcessMessage(), msi_query_merge_record(), msi_set_record_type_string(), msi_unpublish_feature(), MSI_ViewGetColumnInfo(), MsiRecordSetStringA(), MsiRecordSetStringW(), patch_add_media(), patch_update_filepatch_sequence(), TABLE_add_column(), TABLE_drop(), TABLE_remove_column(), ui_actioninfo(), and ui_actionstart().

◆ 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 {
913 IStream_Release( stm );
914 }
915
916 msiobj_unlock( &rec->hdr );
917
918 return r;
919}
static UINT msi_dump_stream_to_file(IStream *stm, LPCWSTR name)
Definition: record.c:868
UINT MSI_RecordGetIStream(MSIRECORD *rec, UINT iField, IStream **pstm)
Definition: record.c:852

Referenced by msi_load_image().

◆ msi_reduce_to_long_filename()

void msi_reduce_to_long_filename ( WCHAR filename)

Definition at line 1074 of file files.c.

1075{
1076 WCHAR *p = wcschr( filename, '|' );
1077 if (p) memmove( filename, p + 1, (lstrlenW( p + 1 ) + 1) * sizeof(WCHAR) );
1078}
#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:4132
#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()

LPWSTR msi_reg_get_val_str ( HKEY  hkey,
LPCWSTR  name 
)

Definition at line 243 of file registry.c.

244{
245 DWORD len = 0;
246 LPWSTR val;
247 LONG r;
248
249 r = RegQueryValueExW(hkey, name, NULL, NULL, NULL, &len);
250 if (r != ERROR_SUCCESS)
251 return NULL;
252
253 len += sizeof (WCHAR);
254 val = msi_alloc( len );
255 if (!val)
256 return NULL;
257 val[0] = 0;
259 return val;
260}

Referenced by ACTION_PublishProduct(), get_install_location(), get_registered_local_package(), ITERATE_PublishComponent(), MSI_GetComponentPath(), MSI_GetUserInfo(), MSI_OpenProductW(), open_package(), query_feature_state(), reg_get_value(), and set_installer_properties().

◆ 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 msi_publish_install_properties(), msi_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(), msi_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 = msi_realloc( package->unique_actions,
123 package->unique_actions_count * sizeof(WCHAR *) );
124 else newbuf = msi_alloc( sizeof(WCHAR *) );
125
126 newbuf[count] = strdupW( action );
127 package->unique_actions = newbuf;
128 return ERROR_SUCCESS;
129}
static void * msi_realloc(void *mem, size_t len) __WINE_ALLOC_SIZE(2)
Definition: msipriv.h:1154

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 88 of file files.c.

89{
90 BOOL ret;
94 return ret;
95}
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 msi_free( folder->ResolvedSource );
2096 folder->ResolvedSource = NULL;
2097 }
2098}

Referenced by ACTION_CustomAction(), append_productcode(), ITERATE_AppSearch(), msi_dialog_set_property(), 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 528 of file files.c.

529{
530 WCHAR *p, *path;
531
532 TRACE("Working to resolve source of file %s\n", debugstr_w(file->File));
533
534 if (file->IsCompressed) return NULL;
535
536 p = msi_resolve_source_folder( package, file->Component->Directory, NULL );
537 path = msi_build_directory_name( 2, p, file->ShortName );
538
539 if (file->LongName && msi_get_file_attributes( package, path ) == INVALID_FILE_ATTRIBUTES)
540 {
541 msi_free( path );
542 path = msi_build_directory_name( 2, p, file->LongName );
543 }
544 msi_free( p );
545 TRACE("file %s source resolves to %s\n", debugstr_w(file->File), debugstr_w(path));
546 return path;
547}
DWORD msi_get_file_attributes(MSIPACKAGE *package, const WCHAR *path)
Definition: files.c:106
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 = strdupW( 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 = strdupW( path );
401 msi_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 2178 of file action.c.

2179{
2180 FolderList *fl;
2182 WCHAR *path, *normalized_path;
2183
2184 TRACE("resolving %s\n", debugstr_w(name));
2185
2186 if (!(folder = msi_get_loaded_folder( package, name ))) return;
2187
2188 if (!wcscmp( folder->Directory, L"TARGETDIR" )) /* special resolving for target root dir */
2189 {
2190 if (!(path = get_install_location( package )) &&
2191 (!load_prop || !(path = msi_dup_property( package->db, L"TARGETDIR" ))))
2192 {
2193 path = msi_dup_property( package->db, L"ROOTDRIVE" );
2194 }
2195 }
2196 else if (!load_prop || !(path = msi_dup_property( package->db, folder->Directory )))
2197 {
2198 if (folder->Parent && wcscmp( folder->Directory, folder->Parent ))
2199 {
2200 parent = msi_get_loaded_folder( package, folder->Parent );
2201 path = msi_build_directory_name( 3, parent->ResolvedTarget, folder->TargetDefault, NULL );
2202 }
2203 else
2204 path = msi_build_directory_name( 2, folder->TargetDefault, NULL );
2205 }
2206
2207 normalized_path = msi_normalize_path( path );
2208 msi_set_property( package->db, folder->Directory, normalized_path, -1 );
2209 msi_free( path );
2210
2211 msi_free( folder->ResolvedTarget );
2212 folder->ResolvedTarget = normalized_path;
2213
2215 {
2216 child = fl->folder;
2217 msi_resolve_target_folder( package, child->Directory, load_prop );
2218 }
2219 TRACE("%s resolves to %s\n", debugstr_w(name), debugstr_w(folder->ResolvedTarget));
2220}
WCHAR * msi_normalize_path(const WCHAR *in)
Definition: action.c:2118
static WCHAR * get_install_location(MSIPACKAGE *package)
Definition: action.c:2162
_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 = msi_alloc( poolsize );
579 if( ! pool )
580 {
581 WARN("Failed to alloc pool %d bytes\n", poolsize );
582 goto err;
583 }
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 msi_free( data );
666 msi_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 = msi_realloc( package->script_actions[script],
105 package->script_actions_count[script] * sizeof(WCHAR *) );
106 else newbuf = msi_alloc( sizeof(WCHAR *) );
107
108 newbuf[count] = strdupW( 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 452 of file action.c.

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

Referenced by MsiSequenceW().

◆ msi_set_context()

UINT msi_set_context ( MSIPACKAGE package)

Definition at line 396 of file action.c.

397{
398 UINT r = msi_locate_product( package->ProductCode, &package->Context );
399 if (r != ERROR_SUCCESS)
400 {
401 int num = msi_get_property_int( package->db, L"ALLUSERS", 0 );
402 if (num == 1 || num == 2)
404 else
406 }
407 return ERROR_SUCCESS;
408}
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 97 of file files.c.

98{
99 BOOL ret;
101 ret = SetFileAttributesW( filename, attrs );
102 msi_revert_fs_redirection( package );
103 return ret;
104}

Referenced by ACTION_RemoveFiles(), cabinet_copy_file(), copy_file(), 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 = msi_alloc(size * sizeof(WCHAR));
724 if (!buffer)
725 return ERROR_OUTOFMEMORY;
726
728 if (r != ERROR_SUCCESS)
729 {
731 return r;
732 }
733
734 swprintf(buffer, size, L"%c;%d;%s", typechar, index, value);
735
736 size = (lstrlenW(buffer) + 1) * sizeof(WCHAR);
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:1034
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 msi_publish_sourcelist(), and MsiSourceListSetInfoW().

◆ msi_set_original_database_property()

UINT msi_set_original_database_property ( MSIDATABASE db,
const WCHAR package 
)

Definition at line 1311 of file package.c.

1312{
1313 UINT r;
1314
1315 if (UrlIsW( package, URLIS_URL ))
1316 r = msi_set_property( db, L"OriginalDatabase", package, -1 );
1317 else if (package[0] == '#')
1318 r = msi_set_property( db, L"OriginalDatabase", db->path, -1 );
1319 else
1320 {
1321 DWORD len;
1322 WCHAR *path;
1323
1324 if (!(len = GetFullPathNameW( package, 0, NULL, NULL ))) return GetLastError();
1325 if (!(path = msi_alloc( len * sizeof(WCHAR) ))) return ERROR_OUTOFMEMORY;
1326 len = GetFullPathNameW( package, len, path, NULL );
1327 r = msi_set_property( db, L"OriginalDatabase", path, len );
1328 msi_free( path );
1329 }
1330 return r;
1331}
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_record_set_string(MSIRECORD *, UINT, const WCHAR *, int) DECLSPEC_HIDDEN
Definition: record.c:573

Referenced by ACTION_CostFinalize(), ACTION_CostInitialize(), ACTION_CustomAction(), ACTION_DisableRollback(), ACTION_INSTALL(), ACTION_ProcessExecSequence(), append_productcode(), event_add_local(), event_add_source(), event_reinstall(), event_reinstall_mode(), event_remove(), ITERATE_AppSearch(), ITERATE_CCPSearch(), msi_adjust_privilege_properties(), MSI_CreatePackage(), msi_dialog_set_property(), 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 354 of file action.c.

355{
356 WCHAR *source, *check, *p, *db;
357 DWORD len;
358
359 if (!(db = msi_dup_property( package->db, L"OriginalDatabase" )))
360 return ERROR_OUTOFMEMORY;
361
362 if (!(p = wcsrchr( db, '\\' )) && !(p = wcsrchr( db, '/' )))
363 {
364 msi_free(db);
365 return ERROR_SUCCESS;
366 }
367 len = p - db + 2;
368 source = msi_alloc( len * sizeof(WCHAR) );
369 lstrcpynW( source, db, len );
370 msi_free( db );
371
372 check = msi_dup_property( package->db, L"SourceDir" );
373 if (!check || replace)
374 {
375 UINT r = msi_set_property( package->db, L"SourceDir", source, -1 );
376 if (r == ERROR_SUCCESS)
377 msi_reset_source_folders( package );
378 }
379 msi_free( check );
380
381 check = msi_dup_property( package->db, L"SOURCEDIR" );
382 if (!check || replace)
383 msi_set_property( package->db, L"SOURCEDIR", source, -1 );
384
385 msi_free( check );
386 msi_free( source );
387
388 return ERROR_SUCCESS;
389}
#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:47

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 1640 of file action.c.

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

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

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 msi_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 305 of file action.c.

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

Referenced by get_patch_product_codes(), ITERATE_BindImage(), msi_apply_patch_db(), 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
BOOL unicode
Definition: msipriv.h:740
union awstring::@502 str

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 = msi_alloc( (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(), msi_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(), id2string(), msi_commit_streams(), msi_create_table(), msi_get_transform_record(), 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()

LPWSTR msi_suminfo_dup_string ( MSISUMMARYINFO si,
UINT  uiProperty 
)

Definition at line 696 of file suminfo.c.

697{
698 PROPVARIANT *prop;
699
700 if ( uiProperty >= MSI_MAX_PROPS )
701 return NULL;
702 prop = &si->property[uiProperty];
703 if( prop->vt != VT_LPSTR )
704 return NULL;
705 return strdupAtoW( prop->pszVal );
706}
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(), msi_parse_patch_summary(), and parse_suminfo().

◆ msi_suminfo_get_int32()

INT msi_suminfo_get_int32 ( MSISUMMARYINFO si,
UINT  uiProperty 
)

Definition at line 708 of file suminfo.c.

709{
710 PROPVARIANT *prop;
711
712 if ( uiProperty >= MSI_MAX_PROPS )
713 return -1;
714 prop = &si->property[uiProperty];
715 if( prop->vt != VT_I4 )
716 return -1;
717 return prop->lVal;
718}

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 3371 of file table.c.

3372{
3373 struct list transforms;
3374 IEnumSTATSTG *stgenum = NULL;
3376 TRANSFORMDATA *tables = NULL, *columns = NULL;
3377 HRESULT hr;
3378 STATSTG stat;
3381 UINT bytes_per_strref;
3382 BOOL property_update = FALSE;
3384
3385 TRACE("%p %p\n", db, stg );
3386
3387 strings = msi_load_string_table( stg, &bytes_per_strref );
3388 if( !strings )
3389 goto end;
3390
3391 hr = IStorage_EnumElements( stg, 0, NULL, 0, &stgenum );
3392 if (FAILED( hr ))
3393 goto end;
3394
3395 list_init(&transforms);
3396
3397 while ( TRUE )
3398 {
3399 MSITABLEVIEW *tv = NULL;
3400 WCHAR name[0x40];
3401 ULONG count = 0;
3402
3403 hr = IEnumSTATSTG_Next( stgenum, 1, &stat, &count );
3404 if (FAILED( hr ) || !count)
3405 break;
3406
3407 decode_streamname( stat.pwcsName, name );
3408 CoTaskMemFree( stat.pwcsName );
3409 if ( name[0] != 0x4840 )
3410 continue;
3411
3412 if ( !wcscmp( name+1, L"_StringPool" ) ||
3413 !wcscmp( name+1, L"_StringData" ) )
3414 continue;
3415
3417 if ( !transform )
3418 break;
3419
3420 list_add_tail( &transforms, &transform->entry );
3421
3422 transform->name = strdupW( name + 1 );
3423
3424 if ( !wcscmp( transform->name, L"_Tables" ) )
3425 tables = transform;
3426 else if (!wcscmp( transform->name, L"_Columns" ) )
3427 columns = transform;
3428 else if (!wcscmp( transform->name, L"Property" ))
3429 property_update = TRUE;
3430
3431 TRACE("transform contains stream %s\n", debugstr_w(name));
3432
3433 /* load the table */
3434 if (TABLE_CreateView( db, transform->name, (MSIVIEW**) &tv ) != ERROR_SUCCESS)
3435 continue;
3436
3437 if (tv->view.ops->execute( &tv->view, NULL ) != ERROR_SUCCESS)
3438 {
3439 tv->view.ops->delete( &tv->view );
3440 continue;
3441 }
3442
3443 tv->view.ops->delete( &tv->view );
3444 }
3445
3446 if (err_cond & MSITRANSFORM_ERROR_VIEWTRANSFORM)
3447 {
3448 static const WCHAR create_query[] = L"CREATE TABLE `_TransformView` ( "
3449 L"`Table` CHAR(0) NOT NULL TEMPORARY, `Column` CHAR(0) NOT NULL TEMPORARY, "
3450 L"`Row` CHAR(0) TEMPORARY, `Data` CHAR(0) TEMPORARY, `Current` CHAR(0) TEMPORARY "
3451 L"PRIMARY KEY `Table`, `Column`, `Row` ) HOLD";
3452
3453 MSIQUERY *query;
3454 UINT r;
3455
3457 if (r != ERROR_SUCCESS)
3458 goto end;
3459
3461 if (r == ERROR_SUCCESS)
3463 msiobj_release( &query->hdr );
3465 goto end;
3466
3467 if (TABLE_CreateView(db, L"_TransformView", &transform_view) != ERROR_SUCCESS)
3468 goto end;
3469
3471 transform_view->ops->add_ref( transform_view );
3472
3473 r = transform_view->ops->add_column( transform_view, L"new",
3474 MSITYPE_TEMPORARY | MSITYPE_NULLABLE | 0x402 /* INT */, FALSE );
3475 if (r != ERROR_SUCCESS)
3476 goto end;
3477 }
3478
3479 /*
3480 * Apply _Tables and _Columns transforms first so that
3481 * the table metadata is correct, and empty tables exist.
3482 */
3483 ret = msi_table_load_transform( db, stg, strings, tables, bytes_per_strref, err_cond );
3485 goto end;
3486
3487 ret = msi_table_load_transform( db, stg, strings, columns, bytes_per_strref, err_cond );
3489 goto end;
3490
3492
3493 while ( !list_empty( &transforms ) )
3494 {
3495 transform = LIST_ENTRY( list_head( &transforms ), TRANSFORMDATA, entry );
3496
3497 if ( wcscmp( transform->name, L"_Columns" ) &&
3498 wcscmp( transform->name, L"_Tables" ) &&
3499 ret == ERROR_SUCCESS )
3500 {
3501 ret = msi_table_load_transform( db, stg, strings, transform, bytes_per_strref, err_cond );
3502 }
3503
3504 list_remove( &transform->entry );
3505 msi_free( transform->name );
3507 }
3508
3509 if ( ret == ERROR_SUCCESS )
3510 {
3511 append_storage_to_db( db, stg );
3512 if (property_update) msi_clone_properties( db );
3513 }
3514
3515end:
3516 if ( stgenum )
3517 IEnumSTATSTG_Release( stgenum );
3518 if ( strings )
3520 if (transform_view)
3521 {
3522 struct tagMSITABLE *table = ((MSITABLEVIEW*)transform_view)->table;
3523
3524 if (ret != ERROR_SUCCESS)
3525 transform_view->ops->release( transform_view );
3526
3527 if (!wcscmp(table->colinfo[table->col_count - 1].colname, L"new"))
3528 TABLE_remove_column( transform_view, table->colinfo[table->col_count - 1].number );
3529 transform_view->ops->delete( transform_view );
3530 }
3531
3532 return ret;
3533}
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 msi_table_load_transform(MSIDATABASE *db, IStorage *stg, string_table *st, TRANSFORMDATA *transform, UINT bytes_per_strref, int err_cond)
Definition: table.c:3176
static UINT TABLE_remove_column(struct tagMSIVIEW *view, UINT number)
Definition: table.c:1935
UINT TABLE_CreateView(MSIDATABASE *db, LPCWSTR name, MSIVIEW **view)
Definition: table.c:2189
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) DECLSPEC_HIDDEN
Definition: string.c:107
@ MSITRANSFORM_ERROR_VIEWTRANSFORM
Definition: msiquery.h:156
static struct query * create_query(void)
Definition: pdh_main.c:152
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_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 456 of file assembly.c.

457{
458 HRESULT hr;
462
463 if (comp->assembly->feature)
464 feature = msi_get_loaded_feature( package, comp->assembly->feature );
465
466 if (assembly->application)
467 {
468 if (feature) feature->Action = INSTALLSTATE_ABSENT;
469 return ERROR_SUCCESS;
470 }
471 TRACE("removing %s\n", debugstr_w(assembly->display_name));
472
473 if (assembly->attributes == msidbAssemblyAttributesWin32)
474 {
475 cache = package->cache_sxs;
476 hr = IAssemblyCache_UninstallAssembly( cache, 0, assembly->display_name, NULL, NULL );
477 if (FAILED( hr )) WARN( "failed to uninstall assembly %#lx\n", hr );
478 }
479 else
480 {
481 unsigned int i;
482 for (i = 0; i < CLR_VERSION_MAX; i++)
483 {
484 if (!assembly->clr_version[i]) continue;
485 cache = package->cache_net[i];
486 if (cache)
487 {
488 hr = IAssemblyCache_UninstallAssembly( cache, 0, assembly->display_name, NULL, NULL );
489 if (FAILED( hr )) WARN( "failed to uninstall assembly %#lx\n", hr );
490 }
491 }
492 }
493 if (feature) feature->Action = INSTALLSTATE_ABSENT;
494 assembly->installed = FALSE;
495 return ERROR_SUCCESS;
496}

Referenced by ACTION_RemoveFiles().

◆ msi_validate_product_id()

UINT msi_validate_product_id ( MSIPACKAGE package)

Definition at line 7148 of file action.c.

7149{
7150 LPWSTR key, template, id;
7152
7153 id = msi_dup_property( package->db, L"ProductID" );
7154 if (id)
7155 {
7156 msi_free( id );
7157 return ERROR_SUCCESS;
7158 }
7159 template = msi_dup_property( package->db, L"PIDTemplate" );
7160 key = msi_dup_property( package->db, L"PIDKEY" );
7161 if (key && template)
7162 {
7163 FIXME( "partial stub: template %s key %s\n", debugstr_w(template), debugstr_w(key) );
7164#ifdef __REACTOS__
7165 WARN("Product key validation HACK, see CORE-14710\n");
7166#else
7167 r = msi_set_property( package->db, L"ProductID", key, -1 );
7168#endif
7169 }
7170 msi_free( template );
7171 msi_free( key );
7172 return r;
7173}

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(), msi_publish_install_properties(), and msi_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 get_assembly_record(), get_property(), is_uninstallable(), load_file_hash(), load_folder_persistence(), merge_diff_row(), msi_add_records_to_table(), msi_clone_properties(), msi_get_property_row(), 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 603 of file msiquery.c.

604{
606 MSIRECORD *rec;
609 BOOL temporary;
610
611 if( !view )
613
614 if( !view->ops->get_dimensions )
616
617 r = view->ops->get_dimensions( view, NULL, &count );
618 if( r != ERROR_SUCCESS )
619 return r;
620 if( !count )
622
623 rec = MSI_CreateRecord( count );
624 if( !rec )
626
627 for( i=0; i<count; i++ )
628 {
629 name = NULL;
630 r = view->ops->get_column_info( view, i+1, &name, &type, &temporary, NULL );
631 if( r != ERROR_SUCCESS )
632 continue;
633 if (info == MSICOLINFO_NAMES)
634 MSI_RecordSetStringW( rec, i+1, name );
635 else
636 msi_set_record_type_string( rec, i+1, type, temporary );
637 }
638 *prec = rec;
639 return ERROR_SUCCESS;
640}
static UINT msi_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(), merge_verify_colnames(), MSI_DatabaseExport(), msi_get_query_columns(), msi_get_query_types(), and MsiViewGetColumnInfo().

◆ MSI_ViewModify()

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

Definition at line 698 of file msiquery.c.

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

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

◆ MsiCreateAndVerifyInstallerDirectory()

UINT WINAPI MsiCreateAndVerifyInstallerDirectory ( DWORD  dwReserved)

Definition at line 3816 of file msi.c.

3817{
3819
3820 TRACE( "%#lx\n", dwReserved );
3821
3822 if (dwReserved)
3823 {
3824 FIXME( "dwReserved = %#lx\n", dwReserved );
3826 }
3827
3829 return ERROR_FUNCTION_FAILED;
3830
3831 lstrcatW(path, L"\\Installer");
3832
3834 return ERROR_FUNCTION_FAILED;
3835
3836 return ERROR_SUCCESS;
3837}
_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 msi_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( msihandletable[handle].remote)
167 goto out;
168 if( !msihandletable[handle].u.obj )
169 goto out;
170 if( msihandletable[handle].u.obj->magic != MSIHANDLE_MAGIC )
171 goto out;
172 if( type && (msihandletable[handle].u.obj->type != type) )
173 goto out;
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
MSIOBJECTHDR * obj
Definition: handle.c:62

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 2400 of file msi.c.

2402{
2403 LPWSTR bufW;
2404 LANGID r;
2405 INT len;
2406
2407 bufW = msi_alloc(nBufferMax*sizeof(WCHAR));
2408 r = MsiLoadStringW(handle, id, bufW, nBufferMax, lang);
2409 if( r )
2410 {
2411 len = WideCharToMultiByte(CP_ACP, 0, bufW, -1, NULL, 0, NULL, NULL );
2412 if( len <= nBufferMax )
2413 WideCharToMultiByte( CP_ACP, 0, bufW, -1,
2414 lpBuffer, nBufferMax, NULL, NULL );
2415 else
2416 r = 0;
2417 }
2418 msi_free(bufW);
2419 return r;
2420}
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:2362
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 msi_free( info );
260 TRACE("object %p destroyed\n", 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_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_stream(), check_transform_applicable(), construct_record(), copy_remote_record(), CREATE_delete(), create_diff_row_query(), create_temp_binary(), create_temp_property_table(), deformat_string(), dialog_create(), dialog_map_events(), DISTINCT_delete(), free_custom_action_data(), gather_merge_data(), get_assembly_display_name(), get_assembly_record(), get_key_value(), get_property(), get_signature(), 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(), 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_patch_disk_id(), mark_patched_components(), marshal_record(), merge_diff_row(), merge_diff_tables(), merge_free_rows(), merge_verify_colnames(), merge_verify_primary_keys(), msi_add_records_to_table(), msi_add_suminfo(), msi_add_table_to_db(), MSI_ApplicablePatchW(), msi_apply_patch_package(), msi_apply_registered_patch(), msi_arrange_record(), msi_change_media(), msi_clone_properties(), MSI_CloneRecord(), MSI_ClosePreview(), MSI_CloseView(), msi_combobox_add_items(), msi_create_table(), MSI_CreatePackage(), MSI_DatabaseExport(), MSI_DatabaseGetPrimaryKeys(), MSI_DatabaseOpenViewW(), msi_dialog_build_font_list(), msi_dialog_button_handler(), msi_dialog_evaluate_control_conditions(), msi_dialog_fill_controls(), msi_dialog_get_uitext(), msi_dialog_oncreate(), msi_dialog_radiogroup_control(), msi_dialog_seltree_handler(), MSI_EnableUIPreview(), msi_export_suminfo(), msi_file_update_ui(), MSI_FormatRecordW(), MSI_FreePackage(), msi_get_checkbox_value(), msi_get_db_suminfo(), msi_get_error_message(), msi_get_merge_table(), msi_get_package_code(), msi_get_property(), msi_get_property_row(), msi_get_query_columns(), msi_get_query_types(), msi_get_suminfo(), msi_get_suminfo_product(), msi_get_table_labels(), msi_get_transform_record(), MSI_IterateRecords(), msi_listbox_add_items(), msi_listview_add_items(), msi_load_all_components(), msi_load_all_features(), msi_load_assembly(), msi_load_image(), msi_load_media_info(), msi_load_picture(), msi_load_suminfo_properties(), msi_media_get_disk_info(), MSI_OpenDatabaseW(), MSI_OpenPackageW(), msi_publish_icons(), msi_query_merge_record(), MSI_QueryGetRecord(), msi_refresh_record(), MSI_Sequence(), msi_set_property(), msi_table_apply_transform(), msi_table_load_transform(), msi_ui_progress(), msi_unimplemented_action_stub(), msi_unpublish_feature(), msi_unpublish_icons(), 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(), resolve_keypath(), search_components(), search_dr(), search_ini(), search_reg(), SELECT_insert_row(), SELECT_modify(), SELECT_set_row(), TABLE_add_column(), TABLE_drop(), 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(), 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:3362
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:7644

Referenced by ITERATE_MigrateFeatureStates(), msi_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(), msi_unpublish_feature(), and query_feature_state().

◆ 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(), get_install_location(), get_registered_local_package(), msi_comp_find_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(), ITERATE_FindRelatedProducts(), msi_check_product_patches(), msi_comp_find_prod_key(), MSI_GetComponentPath(), MSI_GetProductInfo(), MSI_GetUserInfo(), msi_locate_product(), msi_publish_patches(), MsiEnumPatchesW(), MsiGetPatchInfoExW(), MsiGetProductCodeW(), MsiGetProductInfoExW(), MsiQueryProductStateW(), MsiSourceListAddSourceW(), and OpenSourceKey().

◆ 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(), get_client_counts(), msi_comp_find_prodcode(), 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(), msi_unpublish_feature(), and query_feature_state().

◆ 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 msi_check_product_patches(), msi_publish_patches(), and MsiGetPatchInfoExW().

◆ 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(), msi_check_product_patches(), msi_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 msi_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(), msi_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 232 of file table.c.

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

Referenced by msi_table_load_transform(), and read_table_from_storage().

◆ ready_media()

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

Definition at line 850 of file media.c.

851{
852 UINT rc;
853 WCHAR *cabinet_file = NULL;
854
855 /* media info for continuous cabinet is already loaded */
856 if (mi->is_continuous) return ERROR_SUCCESS;
857
858 if (mi->cabinet)
859 {
861
862 /* cabinet is internal, no checks needed */
863 if (mi->cabinet[0] == '#') return ERROR_SUCCESS;
864
865 if (!(cabinet_file = get_cabinet_filename( mi ))) return ERROR_OUTOFMEMORY;
866
867 /* package should be downloaded */
868 if (compressed && GetFileAttributesW( cabinet_file ) == INVALID_FILE_ATTRIBUTES &&
869 (base_url = get_base_url( package->db )))
870 {
871 WCHAR temppath[MAX_PATH], *p, *url;
872
873 msi_free( cabinet_file );
874 if (!(url = msi_alloc( (lstrlenW( base_url ) + lstrlenW( mi->cabinet ) + 1) * sizeof(WCHAR) )))
875 {
876 return ERROR_OUTOFMEMORY;
877 }
879 lstrcatW( url, mi->cabinet );
880 if ((rc = msi_download_file( url, temppath )) != ERROR_SUCCESS)
881 {
882 ERR("failed to download %s (%u)\n", debugstr_w(url), rc);
883 msi_free( url );
884 return rc;
885 }
886 if ((p = wcsrchr( temppath, '\\' ))) *p = 0;
887 lstrcpyW( mi->sourcedir, temppath );
888 PathAddBackslashW( mi->sourcedir );
889 msi_free( mi->cabinet );
890 mi->cabinet = strdupW( p + 1 );
891
892 msi_free( url );
893 return ERROR_SUCCESS;
894 }
895 }
896 /* check volume matches, change media if not */
897 if (mi->volume_label)
898 {
899 /* assume first volume is in the drive */
900 if (mi->last_volume && wcsicmp( mi->last_volume, mi->volume_label ))
901 {
902 WCHAR *source = msi_dup_property( package->db, L"SourceDir" );
904 msi_free( source );
905
906 if (!match && (mi->type == DRIVE_CDROM || mi->type == DRIVE_REMOVABLE))
907 {
908 if ((rc = msi_change_media( package, mi )) != ERROR_SUCCESS)
909 {
910 msi_free( cabinet_file );
911 return rc;
912 }
913 }
914 }
915
916 msi_free(mi->last_volume);
917 mi->last_volume = strdupW(mi->volume_label);
918 }
919 if (mi->cabinet)
920 {
921 if (compressed && GetFileAttributesW( cabinet_file ) == INVALID_FILE_ATTRIBUTES)
922 {
923 if ((rc = find_published_source( package, mi )) != ERROR_SUCCESS)
924 {
925 ERR("cabinet not found: %s\n", debugstr_w(cabinet_file));
926 msi_free( cabinet_file );
928 }
929 }
930 }
931 msi_free( cabinet_file );
932 return ERROR_SUCCESS;
933}
static WCHAR * get_cabinet_filename(MSIMEDIAINFO *mi)
Definition: media.c:301
static BOOL source_matches_volume(MSIMEDIAINFO *mi, LPCWSTR source_root)
Definition: media.c:55
static UINT msi_change_media(MSIPACKAGE *package, MSIMEDIAINFO *mi)
Definition: media.c:79
static UINT find_published_source(MSIPACKAGE *package, MSIMEDIAINFO *mi)
Definition: media.c:754
static const WCHAR url[]
Definition: encode.c:1432
UINT msi_download_file(LPCWSTR szUrl, LPWSTR filename) DECLSPEC_HIDDEN
Definition: package.c:1027
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}
static ITypeLib * typelib
Definition: apps.c:108

◆ 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(), msi_publish_patches(), msi_publish_product_properties(), msi_publish_upgrade_code(), 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(), and remove_product_upgrade_code().

◆ strdupAtoW()

static LPWSTR strdupAtoW ( LPCSTR  str)
inlinestatic

Definition at line 1177 of file msipriv.h.

1178{
1179 LPWSTR ret = NULL;
1180 DWORD len;
1181
1182 if (!str) return ret;
1183 len = MultiByteToWideChar( CP_ACP, 0, str, -1, NULL, 0 );
1184 ret = msi_alloc( len * sizeof(WCHAR) );
1185 if (ret)
1186 MultiByteToWideChar( CP_ACP, 0, str, -1, ret, len );
1187 return ret;
1188}
#define MultiByteToWideChar
Definition: compat.h:110

◆ strdupW()

static LPWSTR strdupW ( LPCWSTR  src)
inlinestatic

Definition at line 1190 of file msipriv.h.

1191{
1192 LPWSTR dest;
1193 if (!src) return NULL;
1194 dest = msi_alloc( (lstrlenW(src)+1)*sizeof(WCHAR) );
1195 if (dest)
1196 lstrcpyW(dest, src);
1197 return dest;
1198}
GLenum src
Definition: glext.h:6340

◆ strdupWtoA()

static char * strdupWtoA ( LPCWSTR  str)
inlinestatic

Definition at line 1164 of file msipriv.h.

1165{
1166 LPSTR ret = NULL;
1167 DWORD len;
1168
1169 if (!str) return ret;
1170 len = WideCharToMultiByte( CP_ACP, 0, str, -1, NULL, 0, NULL, NULL);
1171 ret = msi_alloc( len );
1172 if (ret)
1173 WideCharToMultiByte( CP_ACP, 0, str, -1, ret, len, NULL, NULL );
1174 return ret;
1175}
char * LPSTR
Definition: xmlstorage.h:182

◆ TABLE_Exists()

BOOL TABLE_Exists ( MSIDATABASE db,
LPCWSTR  name 
)

Definition at line 960 of file table.c.

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

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

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

Variable Documentation

◆ DECLSPEC_HIDDEN

HINSTANCE msi_hInstance DECLSPEC_HIDDEN
extern

Definition at line 981 of file msipriv.h.

◆ is_64bit