2003-08-13 03:27:48 +02:00
|
|
|
/*
|
|
|
|
* Implementation of the Microsoft Installer (msi.dll)
|
|
|
|
*
|
2005-01-28 13:39:57 +01:00
|
|
|
* Copyright 2002-2005 Mike McCormack for CodeWeavers
|
2006-10-10 13:03:52 +02:00
|
|
|
* Copyright 2005 Aric Stewart for CodeWeavers
|
2003-08-13 03:27:48 +02:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2006-05-18 14:49:52 +02:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2003-08-13 03:27:48 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __WINE_MSI_PRIVATE__
|
|
|
|
#define __WINE_MSI_PRIVATE__
|
|
|
|
|
2003-09-06 01:08:26 +02:00
|
|
|
#include <stdarg.h>
|
|
|
|
|
|
|
|
#include "windef.h"
|
|
|
|
#include "winbase.h"
|
2003-08-13 03:27:48 +02:00
|
|
|
#include "msi.h"
|
|
|
|
#include "msiquery.h"
|
2004-08-22 23:38:46 +02:00
|
|
|
#include "objbase.h"
|
2003-08-13 03:27:48 +02:00
|
|
|
#include "objidl.h"
|
2005-06-01 13:02:19 +02:00
|
|
|
#include "winnls.h"
|
2005-05-23 14:08:17 +02:00
|
|
|
#include "wine/list.h"
|
2003-08-13 03:27:48 +02:00
|
|
|
|
|
|
|
#define MSI_DATASIZEMASK 0x00ff
|
|
|
|
#define MSITYPE_VALID 0x0100
|
2005-09-28 13:59:40 +02:00
|
|
|
#define MSITYPE_LOCALIZABLE 0x200
|
2003-08-13 03:27:48 +02:00
|
|
|
#define MSITYPE_STRING 0x0800
|
|
|
|
#define MSITYPE_NULLABLE 0x1000
|
|
|
|
#define MSITYPE_KEY 0x2000
|
|
|
|
|
2006-08-07 20:37:49 +02:00
|
|
|
/* Word Count masks */
|
|
|
|
#define MSIWORDCOUNT_SHORTFILENAMES 0x0001
|
|
|
|
#define MSIWORDCOUNT_COMPRESSED 0x0002
|
|
|
|
#define MSIWORDCOUNT_ADMINISTRATIVE 0x0004
|
|
|
|
#define MSIWORDCOUNT_PRIVILEGES 0x0008
|
|
|
|
|
2007-02-07 06:53:24 +01:00
|
|
|
/* Install UI level mask for AND operation to exclude flags */
|
|
|
|
#define INSTALLUILEVEL_MASK 0x0007
|
|
|
|
|
2005-09-28 13:59:40 +02:00
|
|
|
#define MSITYPE_IS_BINARY(type) (((type) & ~MSITYPE_NULLABLE) == (MSITYPE_STRING|MSITYPE_VALID))
|
2004-06-29 05:44:01 +02:00
|
|
|
|
2003-08-13 03:27:48 +02:00
|
|
|
struct tagMSITABLE;
|
|
|
|
typedef struct tagMSITABLE MSITABLE;
|
|
|
|
|
2004-03-17 21:49:59 +01:00
|
|
|
struct string_table;
|
|
|
|
typedef struct string_table string_table;
|
2003-08-13 03:27:48 +02:00
|
|
|
|
2004-07-10 00:25:34 +02:00
|
|
|
struct tagMSIOBJECTHDR;
|
|
|
|
typedef struct tagMSIOBJECTHDR MSIOBJECTHDR;
|
|
|
|
|
|
|
|
typedef VOID (*msihandledestructor)( MSIOBJECTHDR * );
|
|
|
|
|
|
|
|
struct tagMSIOBJECTHDR
|
|
|
|
{
|
|
|
|
UINT magic;
|
|
|
|
UINT type;
|
2005-07-06 12:33:30 +02:00
|
|
|
LONG refcount;
|
2004-07-10 00:25:34 +02:00
|
|
|
msihandledestructor destructor;
|
|
|
|
};
|
|
|
|
|
2003-08-13 03:27:48 +02:00
|
|
|
typedef struct tagMSIDATABASE
|
|
|
|
{
|
2004-07-10 00:25:34 +02:00
|
|
|
MSIOBJECTHDR hdr;
|
2003-08-13 03:27:48 +02:00
|
|
|
IStorage *storage;
|
2004-03-17 21:49:59 +01:00
|
|
|
string_table *strings;
|
2006-09-26 05:03:31 +02:00
|
|
|
LPWSTR path;
|
2006-09-12 17:47:10 +02:00
|
|
|
LPWSTR deletefile;
|
2005-05-31 11:30:28 +02:00
|
|
|
LPCWSTR mode;
|
2005-09-14 12:07:26 +02:00
|
|
|
struct list tables;
|
2005-10-27 14:25:04 +02:00
|
|
|
struct list transforms;
|
2003-08-13 03:27:48 +02:00
|
|
|
} MSIDATABASE;
|
|
|
|
|
2004-07-10 00:25:34 +02:00
|
|
|
typedef struct tagMSIVIEW MSIVIEW;
|
|
|
|
|
|
|
|
typedef struct tagMSIQUERY
|
|
|
|
{
|
|
|
|
MSIOBJECTHDR hdr;
|
|
|
|
MSIVIEW *view;
|
|
|
|
UINT row;
|
|
|
|
MSIDATABASE *db;
|
2005-05-23 14:08:17 +02:00
|
|
|
struct list mem;
|
2004-07-10 00:25:34 +02:00
|
|
|
} MSIQUERY;
|
|
|
|
|
|
|
|
/* maybe we can use a Variant instead of doing it ourselves? */
|
|
|
|
typedef struct tagMSIFIELD
|
|
|
|
{
|
|
|
|
UINT type;
|
|
|
|
union
|
|
|
|
{
|
|
|
|
INT iVal;
|
|
|
|
LPWSTR szwVal;
|
|
|
|
IStream *stream;
|
|
|
|
} u;
|
|
|
|
} MSIFIELD;
|
|
|
|
|
|
|
|
typedef struct tagMSIRECORD
|
|
|
|
{
|
|
|
|
MSIOBJECTHDR hdr;
|
|
|
|
UINT count; /* as passed to MsiCreateRecord */
|
|
|
|
MSIFIELD fields[1]; /* nb. array size is count+1 */
|
|
|
|
} MSIRECORD;
|
2003-08-13 03:27:48 +02:00
|
|
|
|
2006-11-06 13:02:47 +01:00
|
|
|
typedef const struct tagMSICOLUMNHASHENTRY *MSIITERHANDLE;
|
2006-03-18 17:12:15 +01:00
|
|
|
|
2003-08-13 03:27:48 +02:00
|
|
|
typedef struct tagMSIVIEWOPS
|
|
|
|
{
|
|
|
|
/*
|
|
|
|
* fetch_int - reads one integer from {row,col} in the table
|
|
|
|
*
|
|
|
|
* This function should be called after the execute method.
|
2006-10-10 13:03:52 +02:00
|
|
|
* Data returned by the function should not change until
|
2003-08-13 03:27:48 +02:00
|
|
|
* close or delete is called.
|
|
|
|
* To get a string value, query the database's string table with
|
|
|
|
* the integer value returned from this function.
|
|
|
|
*/
|
|
|
|
UINT (*fetch_int)( struct tagMSIVIEW *, UINT row, UINT col, UINT *val );
|
|
|
|
|
2004-07-06 20:56:12 +02:00
|
|
|
/*
|
2006-03-18 17:12:15 +01:00
|
|
|
* fetch_stream - gets a stream from {row,col} in the table
|
2004-07-06 20:56:12 +02:00
|
|
|
*
|
|
|
|
* This function is similar to fetch_int, except fetches a
|
|
|
|
* stream instead of an integer.
|
|
|
|
*/
|
|
|
|
UINT (*fetch_stream)( struct tagMSIVIEW *, UINT row, UINT col, IStream **stm );
|
|
|
|
|
2004-03-19 02:16:36 +01:00
|
|
|
/*
|
2006-10-26 10:09:47 +02:00
|
|
|
* set_row - sets values in a row as specified by mask
|
2004-03-19 02:16:36 +01:00
|
|
|
*
|
|
|
|
* Similar semantics to fetch_int
|
|
|
|
*/
|
2006-10-26 10:09:47 +02:00
|
|
|
UINT (*set_row)( struct tagMSIVIEW *, UINT row, MSIRECORD *rec, UINT mask );
|
2004-03-19 02:16:36 +01:00
|
|
|
|
|
|
|
/*
|
2005-08-24 13:10:23 +02:00
|
|
|
* Inserts a new row into the database from the records contents
|
2004-03-19 02:16:36 +01:00
|
|
|
*/
|
2005-08-24 13:10:23 +02:00
|
|
|
UINT (*insert_row)( struct tagMSIVIEW *, MSIRECORD * );
|
2004-03-19 02:16:36 +01:00
|
|
|
|
2003-08-13 03:27:48 +02:00
|
|
|
/*
|
|
|
|
* execute - loads the underlying data into memory so it can be read
|
|
|
|
*/
|
2004-07-10 00:25:34 +02:00
|
|
|
UINT (*execute)( struct tagMSIVIEW *, MSIRECORD * );
|
2003-08-13 03:27:48 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
* close - clears the data read by execute from memory
|
|
|
|
*/
|
|
|
|
UINT (*close)( struct tagMSIVIEW * );
|
|
|
|
|
|
|
|
/*
|
|
|
|
* get_dimensions - returns the number of rows or columns in a table.
|
|
|
|
*
|
|
|
|
* The number of rows can only be queried after the execute method
|
|
|
|
* is called. The number of columns can be queried at any time.
|
|
|
|
*/
|
|
|
|
UINT (*get_dimensions)( struct tagMSIVIEW *, UINT *rows, UINT *cols );
|
|
|
|
|
|
|
|
/*
|
|
|
|
* get_column_info - returns the name and type of a specific column
|
|
|
|
*
|
|
|
|
* The name is HeapAlloc'ed by this function and should be freed by
|
|
|
|
* the caller.
|
|
|
|
* The column information can be queried at any time.
|
|
|
|
*/
|
|
|
|
UINT (*get_column_info)( struct tagMSIVIEW *, UINT n, LPWSTR *name, UINT *type );
|
|
|
|
|
|
|
|
/*
|
|
|
|
* modify - not yet implemented properly
|
|
|
|
*/
|
2005-02-08 14:44:25 +01:00
|
|
|
UINT (*modify)( struct tagMSIVIEW *, MSIMODIFY, MSIRECORD * );
|
2003-08-13 03:27:48 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
* delete - destroys the structure completely
|
|
|
|
*/
|
|
|
|
UINT (*delete)( struct tagMSIVIEW * );
|
|
|
|
|
2006-03-18 17:12:15 +01:00
|
|
|
/*
|
|
|
|
* find_matching_rows - iterates through rows that match a value
|
|
|
|
*
|
2006-10-10 13:03:52 +02:00
|
|
|
* If the column type is a string then a string ID should be passed in.
|
2006-03-18 17:12:15 +01:00
|
|
|
* If the value to be looked up is an integer then no transformation of
|
|
|
|
* the input value is required, except if the column is a string, in which
|
|
|
|
* case a string ID should be passed in.
|
|
|
|
* The handle is an input/output parameter that keeps track of the current
|
|
|
|
* position in the iteration. It must be initialised to zero before the
|
|
|
|
* first call and continued to be passed in to subsequent calls.
|
|
|
|
*/
|
|
|
|
UINT (*find_matching_rows)( struct tagMSIVIEW *, UINT col, UINT val, UINT *row, MSIITERHANDLE *handle );
|
2003-08-13 03:27:48 +02:00
|
|
|
} MSIVIEWOPS;
|
|
|
|
|
2004-07-10 00:25:34 +02:00
|
|
|
struct tagMSIVIEW
|
2003-08-13 03:27:48 +02:00
|
|
|
{
|
2004-07-10 00:25:34 +02:00
|
|
|
MSIOBJECTHDR hdr;
|
2006-06-10 12:02:39 +02:00
|
|
|
const MSIVIEWOPS *ops;
|
2004-07-10 00:25:34 +02:00
|
|
|
};
|
2003-08-13 03:27:48 +02:00
|
|
|
|
2005-02-02 10:55:51 +01:00
|
|
|
struct msi_dialog_tag;
|
|
|
|
typedef struct msi_dialog_tag msi_dialog;
|
|
|
|
|
2006-08-25 10:54:29 +02:00
|
|
|
#define PROPERTY_HASH_SIZE 67
|
|
|
|
|
2004-07-04 02:32:48 +02:00
|
|
|
typedef struct tagMSIPACKAGE
|
|
|
|
{
|
2004-07-10 00:25:34 +02:00
|
|
|
MSIOBJECTHDR hdr;
|
|
|
|
MSIDATABASE *db;
|
2005-08-22 11:15:23 +02:00
|
|
|
struct list components;
|
2005-08-22 16:09:17 +02:00
|
|
|
struct list features;
|
2005-08-23 12:03:17 +02:00
|
|
|
struct list files;
|
2005-09-07 13:25:18 +02:00
|
|
|
struct list tempfiles;
|
2005-08-23 20:15:44 +02:00
|
|
|
struct list folders;
|
2004-12-22 16:05:07 +01:00
|
|
|
LPWSTR ActionFormat;
|
|
|
|
LPWSTR LastAction;
|
2005-01-19 20:07:40 +01:00
|
|
|
|
2005-08-25 12:22:32 +02:00
|
|
|
struct list classes;
|
2005-08-29 11:38:39 +02:00
|
|
|
struct list extensions;
|
2005-09-06 11:26:18 +02:00
|
|
|
struct list progids;
|
2005-08-26 10:47:31 +02:00
|
|
|
struct list mimes;
|
2005-08-24 11:45:18 +02:00
|
|
|
struct list appids;
|
2006-08-25 10:54:29 +02:00
|
|
|
|
2005-05-27 21:24:22 +02:00
|
|
|
struct tagMSISCRIPT *script;
|
2005-01-19 20:07:40 +01:00
|
|
|
|
2005-09-08 14:42:07 +02:00
|
|
|
struct list RunningActions;
|
2007-02-12 03:31:41 +01:00
|
|
|
struct list pending_custom_actions;
|
2005-01-25 21:17:09 +01:00
|
|
|
|
2006-11-08 00:13:47 +01:00
|
|
|
LPWSTR BaseURL;
|
2005-01-19 20:07:40 +01:00
|
|
|
LPWSTR PackagePath;
|
2005-07-05 23:00:06 +02:00
|
|
|
LPWSTR ProductCode;
|
2005-01-27 12:12:56 +01:00
|
|
|
|
|
|
|
UINT CurrentInstallState;
|
2005-02-02 10:55:51 +01:00
|
|
|
msi_dialog *dialog;
|
|
|
|
LPWSTR next_dialog;
|
2006-08-31 22:43:01 +02:00
|
|
|
float center_x;
|
|
|
|
float center_y;
|
2006-08-07 20:37:49 +02:00
|
|
|
|
|
|
|
UINT WordCount;
|
2006-08-25 10:54:29 +02:00
|
|
|
|
|
|
|
struct list props[PROPERTY_HASH_SIZE];
|
|
|
|
|
2005-06-06 17:40:15 +02:00
|
|
|
struct list subscriptions;
|
2004-07-04 02:32:48 +02:00
|
|
|
} MSIPACKAGE;
|
|
|
|
|
2005-01-21 11:17:01 +01:00
|
|
|
typedef struct tagMSIPREVIEW
|
|
|
|
{
|
|
|
|
MSIOBJECTHDR hdr;
|
2005-01-28 13:39:57 +01:00
|
|
|
MSIPACKAGE *package;
|
2005-02-02 10:55:51 +01:00
|
|
|
msi_dialog *dialog;
|
2005-01-21 11:17:01 +01:00
|
|
|
} MSIPREVIEW;
|
|
|
|
|
2005-10-26 12:10:50 +02:00
|
|
|
#define MSI_MAX_PROPS 20
|
|
|
|
|
|
|
|
typedef struct tagMSISUMMARYINFO
|
|
|
|
{
|
|
|
|
MSIOBJECTHDR hdr;
|
2006-10-23 18:11:30 +02:00
|
|
|
IStorage *storage;
|
2005-10-26 12:10:50 +02:00
|
|
|
DWORD update_count;
|
|
|
|
PROPVARIANT property[MSI_MAX_PROPS];
|
|
|
|
} MSISUMMARYINFO;
|
|
|
|
|
2006-10-10 13:03:52 +02:00
|
|
|
typedef struct tagMSIFEATURE
|
|
|
|
{
|
|
|
|
struct list entry;
|
|
|
|
LPWSTR Feature;
|
|
|
|
LPWSTR Feature_Parent;
|
|
|
|
LPWSTR Title;
|
|
|
|
LPWSTR Description;
|
|
|
|
INT Display;
|
|
|
|
INT Level;
|
|
|
|
LPWSTR Directory;
|
|
|
|
INT Attributes;
|
|
|
|
INSTALLSTATE Installed;
|
|
|
|
INSTALLSTATE ActionRequest;
|
|
|
|
INSTALLSTATE Action;
|
|
|
|
struct list Children;
|
|
|
|
struct list Components;
|
|
|
|
INT Cost;
|
|
|
|
} MSIFEATURE;
|
|
|
|
|
|
|
|
typedef struct tagMSICOMPONENT
|
|
|
|
{
|
|
|
|
struct list entry;
|
|
|
|
DWORD magic;
|
|
|
|
LPWSTR Component;
|
|
|
|
LPWSTR ComponentId;
|
|
|
|
LPWSTR Directory;
|
|
|
|
INT Attributes;
|
|
|
|
LPWSTR Condition;
|
|
|
|
LPWSTR KeyPath;
|
|
|
|
INSTALLSTATE Installed;
|
|
|
|
INSTALLSTATE ActionRequest;
|
|
|
|
INSTALLSTATE Action;
|
|
|
|
BOOL ForceLocalState;
|
|
|
|
BOOL Enabled;
|
|
|
|
INT Cost;
|
|
|
|
INT RefCount;
|
|
|
|
LPWSTR FullKeypath;
|
|
|
|
LPWSTR AdvertiseString;
|
2006-12-05 10:24:39 +01:00
|
|
|
|
|
|
|
int hasAdvertiseFeature:1;
|
|
|
|
int hasLocalFeature:1;
|
|
|
|
int hasSourceFeature:1;
|
2006-10-10 13:03:52 +02:00
|
|
|
} MSICOMPONENT;
|
|
|
|
|
|
|
|
typedef struct tagComponentList
|
|
|
|
{
|
|
|
|
struct list entry;
|
|
|
|
MSICOMPONENT *component;
|
|
|
|
} ComponentList;
|
|
|
|
|
|
|
|
typedef struct tagFeatureList
|
|
|
|
{
|
|
|
|
struct list entry;
|
|
|
|
MSIFEATURE *feature;
|
|
|
|
} FeatureList;
|
|
|
|
|
|
|
|
typedef struct tagMSIFOLDER
|
|
|
|
{
|
|
|
|
struct list entry;
|
|
|
|
LPWSTR Directory;
|
2006-11-22 07:13:12 +01:00
|
|
|
LPWSTR Parent;
|
2006-10-10 13:03:52 +02:00
|
|
|
LPWSTR TargetDefault;
|
|
|
|
LPWSTR SourceLongPath;
|
|
|
|
LPWSTR SourceShortPath;
|
|
|
|
|
|
|
|
LPWSTR ResolvedTarget;
|
|
|
|
LPWSTR ResolvedSource;
|
|
|
|
LPWSTR Property; /* initially set property */
|
|
|
|
INT State;
|
|
|
|
/* 0 = uninitialized */
|
|
|
|
/* 1 = existing */
|
|
|
|
/* 2 = created remove if empty */
|
|
|
|
/* 3 = created persist if empty */
|
|
|
|
INT Cost;
|
|
|
|
INT Space;
|
|
|
|
} MSIFOLDER;
|
|
|
|
|
|
|
|
typedef enum _msi_file_state {
|
|
|
|
msifs_invalid,
|
|
|
|
msifs_missing,
|
|
|
|
msifs_overwrite,
|
|
|
|
msifs_present,
|
|
|
|
msifs_installed,
|
|
|
|
msifs_skipped,
|
|
|
|
} msi_file_state;
|
|
|
|
|
|
|
|
typedef struct tagMSIFILE
|
|
|
|
{
|
|
|
|
struct list entry;
|
|
|
|
LPWSTR File;
|
|
|
|
MSICOMPONENT *Component;
|
|
|
|
LPWSTR FileName;
|
|
|
|
LPWSTR ShortName;
|
|
|
|
LPWSTR LongName;
|
|
|
|
INT FileSize;
|
|
|
|
LPWSTR Version;
|
|
|
|
LPWSTR Language;
|
|
|
|
INT Attributes;
|
|
|
|
INT Sequence;
|
|
|
|
msi_file_state state;
|
|
|
|
LPWSTR SourcePath;
|
|
|
|
LPWSTR TargetPath;
|
|
|
|
BOOL IsCompressed;
|
|
|
|
} MSIFILE;
|
|
|
|
|
|
|
|
typedef struct tagMSITEMPFILE
|
|
|
|
{
|
|
|
|
struct list entry;
|
|
|
|
LPWSTR Path;
|
|
|
|
} MSITEMPFILE;
|
|
|
|
|
|
|
|
typedef struct tagMSIAPPID
|
|
|
|
{
|
|
|
|
struct list entry;
|
|
|
|
LPWSTR AppID; /* Primary key */
|
|
|
|
LPWSTR RemoteServerName;
|
|
|
|
LPWSTR LocalServer;
|
|
|
|
LPWSTR ServiceParameters;
|
|
|
|
LPWSTR DllSurrogate;
|
|
|
|
BOOL ActivateAtStorage;
|
|
|
|
BOOL RunAsInteractiveUser;
|
|
|
|
} MSIAPPID;
|
|
|
|
|
|
|
|
typedef struct tagMSIPROGID MSIPROGID;
|
|
|
|
|
|
|
|
typedef struct tagMSICLASS
|
|
|
|
{
|
|
|
|
struct list entry;
|
|
|
|
LPWSTR clsid; /* Primary Key */
|
|
|
|
LPWSTR Context; /* Primary Key */
|
|
|
|
MSICOMPONENT *Component;
|
|
|
|
MSIPROGID *ProgID;
|
|
|
|
LPWSTR ProgIDText;
|
|
|
|
LPWSTR Description;
|
|
|
|
MSIAPPID *AppID;
|
|
|
|
LPWSTR FileTypeMask;
|
|
|
|
LPWSTR IconPath;
|
|
|
|
LPWSTR DefInprocHandler;
|
|
|
|
LPWSTR DefInprocHandler32;
|
|
|
|
LPWSTR Argument;
|
|
|
|
MSIFEATURE *Feature;
|
|
|
|
INT Attributes;
|
|
|
|
/* not in the table, set during installation */
|
|
|
|
BOOL Installed;
|
|
|
|
} MSICLASS;
|
|
|
|
|
|
|
|
typedef struct tagMSIMIME MSIMIME;
|
|
|
|
|
|
|
|
typedef struct tagMSIEXTENSION
|
|
|
|
{
|
|
|
|
struct list entry;
|
|
|
|
LPWSTR Extension; /* Primary Key */
|
|
|
|
MSICOMPONENT *Component;
|
|
|
|
MSIPROGID *ProgID;
|
|
|
|
LPWSTR ProgIDText;
|
|
|
|
MSIMIME *Mime;
|
|
|
|
MSIFEATURE *Feature;
|
|
|
|
/* not in the table, set during installation */
|
|
|
|
BOOL Installed;
|
|
|
|
struct list verbs;
|
|
|
|
} MSIEXTENSION;
|
|
|
|
|
|
|
|
struct tagMSIPROGID
|
|
|
|
{
|
|
|
|
struct list entry;
|
|
|
|
LPWSTR ProgID; /* Primary Key */
|
|
|
|
MSIPROGID *Parent;
|
|
|
|
MSICLASS *Class;
|
|
|
|
LPWSTR Description;
|
|
|
|
LPWSTR IconPath;
|
|
|
|
/* not in the table, set during installation */
|
|
|
|
BOOL InstallMe;
|
|
|
|
MSIPROGID *CurVer;
|
|
|
|
MSIPROGID *VersionInd;
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct tagMSIVERB
|
|
|
|
{
|
|
|
|
struct list entry;
|
|
|
|
LPWSTR Verb;
|
|
|
|
INT Sequence;
|
|
|
|
LPWSTR Command;
|
|
|
|
LPWSTR Argument;
|
|
|
|
} MSIVERB;
|
|
|
|
|
|
|
|
struct tagMSIMIME
|
|
|
|
{
|
|
|
|
struct list entry;
|
|
|
|
LPWSTR ContentType; /* Primary Key */
|
|
|
|
MSIEXTENSION *Extension;
|
|
|
|
LPWSTR clsid;
|
|
|
|
MSICLASS *Class;
|
|
|
|
/* not in the table, set during installation */
|
|
|
|
BOOL InstallMe;
|
|
|
|
};
|
|
|
|
|
|
|
|
enum SCRIPTS {
|
|
|
|
INSTALL_SCRIPT = 0,
|
|
|
|
COMMIT_SCRIPT = 1,
|
|
|
|
ROLLBACK_SCRIPT = 2,
|
|
|
|
TOTAL_SCRIPTS = 3
|
|
|
|
};
|
|
|
|
|
|
|
|
#define SEQUENCE_UI 0x1
|
|
|
|
#define SEQUENCE_EXEC 0x2
|
|
|
|
#define SEQUENCE_INSTALL 0x10
|
|
|
|
|
|
|
|
typedef struct tagMSISCRIPT
|
|
|
|
{
|
|
|
|
LPWSTR *Actions[TOTAL_SCRIPTS];
|
|
|
|
UINT ActionCount[TOTAL_SCRIPTS];
|
|
|
|
BOOL ExecuteSequenceRun;
|
|
|
|
BOOL CurrentlyScripting;
|
|
|
|
UINT InWhatSequence;
|
|
|
|
LPWSTR *UniqueActions;
|
|
|
|
UINT UniqueActionsCount;
|
|
|
|
} MSISCRIPT;
|
|
|
|
|
2003-08-13 03:27:48 +02:00
|
|
|
#define MSIHANDLETYPE_ANY 0
|
|
|
|
#define MSIHANDLETYPE_DATABASE 1
|
|
|
|
#define MSIHANDLETYPE_SUMMARYINFO 2
|
|
|
|
#define MSIHANDLETYPE_VIEW 3
|
|
|
|
#define MSIHANDLETYPE_RECORD 4
|
2004-06-30 21:38:36 +02:00
|
|
|
#define MSIHANDLETYPE_PACKAGE 5
|
2005-01-21 11:17:01 +01:00
|
|
|
#define MSIHANDLETYPE_PREVIEW 6
|
2003-08-13 03:27:48 +02:00
|
|
|
|
2006-07-28 00:26:41 +02:00
|
|
|
#define MSI_MAJORVERSION 3
|
|
|
|
#define MSI_MINORVERSION 1
|
|
|
|
#define MSI_BUILDNUMBER 4000
|
2003-08-13 03:27:48 +02:00
|
|
|
|
|
|
|
#define GUID_SIZE 39
|
|
|
|
|
|
|
|
#define MSIHANDLE_MAGIC 0x4d434923
|
|
|
|
|
2004-03-30 22:42:06 +02:00
|
|
|
DEFINE_GUID(CLSID_IMsiServer, 0x000C101C,0x0000,0x0000,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46);
|
|
|
|
DEFINE_GUID(CLSID_IMsiServerX1, 0x000C103E,0x0000,0x0000,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46);
|
|
|
|
DEFINE_GUID(CLSID_IMsiServerX2, 0x000C1090,0x0000,0x0000,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46);
|
|
|
|
DEFINE_GUID(CLSID_IMsiServerX3, 0x000C1094,0x0000,0x0000,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46);
|
|
|
|
|
|
|
|
DEFINE_GUID(CLSID_IMsiServerMessage, 0x000C101D,0x0000,0x0000,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46);
|
|
|
|
|
2005-10-31 15:07:37 +01:00
|
|
|
/* handle unicode/ascii output in the Msi* API functions */
|
2005-09-06 13:05:35 +02:00
|
|
|
typedef struct {
|
|
|
|
BOOL unicode;
|
|
|
|
union {
|
|
|
|
LPSTR a;
|
|
|
|
LPWSTR w;
|
|
|
|
} str;
|
|
|
|
} awstring;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
BOOL unicode;
|
|
|
|
union {
|
|
|
|
LPCSTR a;
|
|
|
|
LPCWSTR w;
|
|
|
|
} str;
|
|
|
|
} awcstring;
|
2003-08-13 03:27:48 +02:00
|
|
|
|
2005-10-31 15:07:37 +01:00
|
|
|
UINT msi_strcpy_to_awstring( LPCWSTR str, awstring *awbuf, DWORD *sz );
|
|
|
|
|
2007-02-08 09:20:55 +01:00
|
|
|
/* msi server interface */
|
|
|
|
extern ITypeLib *get_msi_typelib( LPWSTR *path );
|
|
|
|
|
2004-07-10 00:25:34 +02:00
|
|
|
/* handle functions */
|
|
|
|
extern void *msihandle2msiinfo(MSIHANDLE handle, UINT type);
|
|
|
|
extern MSIHANDLE alloc_msihandle( MSIOBJECTHDR * );
|
|
|
|
extern void *alloc_msiobject(UINT type, UINT size, msihandledestructor destroy );
|
|
|
|
extern void msiobj_addref(MSIOBJECTHDR *);
|
|
|
|
extern int msiobj_release(MSIOBJECTHDR *);
|
2004-12-27 20:29:33 +01:00
|
|
|
extern void msiobj_lock(MSIOBJECTHDR *);
|
|
|
|
extern void msiobj_unlock(MSIOBJECTHDR *);
|
2006-08-29 10:08:01 +02:00
|
|
|
extern void msi_free_handle_table(void);
|
2003-08-13 03:27:48 +02:00
|
|
|
|
|
|
|
extern void free_cached_tables( MSIDATABASE *db );
|
2005-10-27 14:25:04 +02:00
|
|
|
extern void msi_free_transforms( MSIDATABASE *db );
|
2005-09-16 21:01:40 +02:00
|
|
|
extern string_table *load_string_table( IStorage *stg );
|
2004-03-18 05:04:08 +01:00
|
|
|
extern UINT MSI_CommitTables( MSIDATABASE *db );
|
2004-03-19 02:16:36 +01:00
|
|
|
extern HRESULT init_string_table( IStorage *stg );
|
2004-03-18 05:04:08 +01:00
|
|
|
|
2004-03-17 21:49:59 +01:00
|
|
|
|
|
|
|
/* string table functions */
|
2005-07-06 12:33:30 +02:00
|
|
|
extern BOOL msi_addstring( string_table *st, UINT string_no, const CHAR *data, int len, UINT refcount );
|
|
|
|
extern BOOL msi_addstringW( string_table *st, UINT string_no, const WCHAR *data, int len, UINT refcount );
|
2004-03-18 05:04:08 +01:00
|
|
|
extern UINT msi_id2stringW( string_table *st, UINT string_no, LPWSTR buffer, UINT *sz );
|
|
|
|
extern UINT msi_id2stringA( string_table *st, UINT string_no, LPSTR buffer, UINT *sz );
|
2004-03-19 02:16:36 +01:00
|
|
|
|
2004-06-30 20:18:27 +02:00
|
|
|
extern UINT msi_string2idW( string_table *st, LPCWSTR buffer, UINT *id );
|
2004-03-19 02:16:36 +01:00
|
|
|
extern UINT msi_string2idA( string_table *st, LPCSTR str, UINT *id );
|
2004-06-26 02:18:36 +02:00
|
|
|
extern string_table *msi_init_stringtable( int entries, UINT codepage );
|
2004-03-17 21:49:59 +01:00
|
|
|
extern VOID msi_destroy_stringtable( string_table *st );
|
2004-03-18 05:04:08 +01:00
|
|
|
extern UINT msi_string_count( string_table *st );
|
|
|
|
extern UINT msi_id_refcount( string_table *st, UINT i );
|
2006-08-28 09:51:41 +02:00
|
|
|
extern UINT msi_string_totalsize( string_table *st, UINT *datasize, UINT *poolsize );
|
2004-06-26 02:11:08 +02:00
|
|
|
extern UINT msi_strcmp( string_table *st, UINT lval, UINT rval, UINT *res );
|
2004-06-30 20:18:27 +02:00
|
|
|
extern const WCHAR *msi_string_lookup_id( string_table *st, UINT id );
|
2004-06-30 20:24:33 +02:00
|
|
|
extern UINT msi_string_get_codepage( string_table *st );
|
2004-06-26 02:11:08 +02:00
|
|
|
|
2003-08-13 03:27:48 +02:00
|
|
|
|
2004-03-19 02:16:36 +01:00
|
|
|
extern BOOL TABLE_Exists( MSIDATABASE *db, LPWSTR name );
|
2006-09-13 11:46:13 +02:00
|
|
|
extern MSICONDITION MSI_DatabaseIsTablePersistent( MSIDATABASE *db, LPCWSTR table );
|
2004-03-19 02:16:36 +01:00
|
|
|
|
2004-07-10 00:25:34 +02:00
|
|
|
extern UINT read_raw_stream_data( MSIDATABASE*, LPCWSTR stname,
|
2004-06-28 22:34:35 +02:00
|
|
|
USHORT **pdata, UINT *psz );
|
2005-01-26 20:41:13 +01:00
|
|
|
|
2005-10-26 15:56:33 +02:00
|
|
|
/* transform functions */
|
|
|
|
extern UINT msi_table_apply_transform( MSIDATABASE *db, IStorage *stg );
|
2006-10-10 13:03:52 +02:00
|
|
|
extern UINT MSI_DatabaseApplyTransformW( MSIDATABASE *db,
|
2006-01-04 14:51:25 +01:00
|
|
|
LPCWSTR szTransformFile, int iErrorCond );
|
2006-11-01 07:09:23 +01:00
|
|
|
extern void append_storage_to_db( MSIDATABASE *db, IStorage *stg );
|
2005-10-26 15:56:33 +02:00
|
|
|
|
2005-01-26 20:41:13 +01:00
|
|
|
/* action internals */
|
2005-09-30 12:32:41 +02:00
|
|
|
extern UINT MSI_InstallPackage( MSIPACKAGE *, LPCWSTR, LPCWSTR );
|
2005-01-03 15:29:09 +01:00
|
|
|
extern void ACTION_free_package_structures( MSIPACKAGE* );
|
2005-02-02 10:55:51 +01:00
|
|
|
extern UINT ACTION_DialogBox( MSIPACKAGE*, LPCWSTR);
|
2005-09-21 12:55:23 +02:00
|
|
|
extern UINT MSI_Sequence( MSIPACKAGE *package, LPCWSTR szTable, INT iSequenceMode );
|
2006-07-19 20:17:16 +02:00
|
|
|
extern UINT MSI_SetFeatureStates( MSIPACKAGE *package );
|
2004-06-28 22:34:35 +02:00
|
|
|
|
2004-06-30 20:18:27 +02:00
|
|
|
/* record internals */
|
2004-07-10 00:25:34 +02:00
|
|
|
extern UINT MSI_RecordSetIStream( MSIRECORD *, unsigned int, IStream *);
|
2005-04-11 14:47:20 +02:00
|
|
|
extern UINT MSI_RecordGetIStream( MSIRECORD *, unsigned int, IStream **);
|
2004-07-10 00:25:34 +02:00
|
|
|
extern const WCHAR *MSI_RecordGetString( MSIRECORD *, unsigned int );
|
|
|
|
extern MSIRECORD *MSI_CreateRecord( unsigned int );
|
|
|
|
extern UINT MSI_RecordSetInteger( MSIRECORD *, unsigned int, int );
|
|
|
|
extern UINT MSI_RecordSetStringW( MSIRECORD *, unsigned int, LPCWSTR );
|
2005-05-31 11:30:28 +02:00
|
|
|
extern UINT MSI_RecordSetStringA( MSIRECORD *, unsigned int, LPCSTR );
|
2004-07-10 00:25:34 +02:00
|
|
|
extern BOOL MSI_RecordIsNull( MSIRECORD *, unsigned int );
|
|
|
|
extern UINT MSI_RecordGetStringW( MSIRECORD * , unsigned int, LPWSTR, DWORD *);
|
2004-11-28 15:53:46 +01:00
|
|
|
extern UINT MSI_RecordGetStringA( MSIRECORD *, unsigned int, LPSTR, DWORD *);
|
2004-07-10 00:25:34 +02:00
|
|
|
extern int MSI_RecordGetInteger( MSIRECORD *, unsigned int );
|
|
|
|
extern UINT MSI_RecordReadStream( MSIRECORD *, unsigned int, char *, DWORD *);
|
|
|
|
extern unsigned int MSI_RecordGetFieldCount( MSIRECORD *rec );
|
2005-05-31 11:30:28 +02:00
|
|
|
extern UINT MSI_RecordSetStreamW( MSIRECORD *, unsigned int, LPCWSTR );
|
|
|
|
extern UINT MSI_RecordSetStreamA( MSIRECORD *, unsigned int, LPCSTR );
|
|
|
|
extern UINT MSI_RecordDataSize( MSIRECORD *, unsigned int );
|
2005-06-23 18:43:38 +02:00
|
|
|
extern UINT MSI_RecordStreamToFile( MSIRECORD *, unsigned int, LPCWSTR );
|
2006-08-31 10:05:45 +02:00
|
|
|
extern UINT MSI_RecordCopyField( MSIRECORD *, unsigned int, MSIRECORD *, unsigned int );
|
2004-06-30 20:18:27 +02:00
|
|
|
|
|
|
|
/* stream internals */
|
2004-06-29 05:41:28 +02:00
|
|
|
extern UINT get_raw_stream( MSIHANDLE hdb, LPCWSTR stname, IStream **stm );
|
|
|
|
extern UINT db_get_raw_stream( MSIDATABASE *db, LPCWSTR stname, IStream **stm );
|
2004-06-29 05:57:39 +02:00
|
|
|
extern void enum_stream_names( IStorage *stg );
|
2004-06-29 05:41:28 +02:00
|
|
|
|
2004-07-10 00:25:34 +02:00
|
|
|
/* database internals */
|
|
|
|
extern UINT MSI_OpenDatabaseW( LPCWSTR, LPCWSTR, MSIDATABASE ** );
|
|
|
|
extern UINT MSI_DatabaseOpenViewW(MSIDATABASE *, LPCWSTR, MSIQUERY ** );
|
2005-01-21 17:19:11 +01:00
|
|
|
extern UINT MSI_OpenQuery( MSIDATABASE *, MSIQUERY **, LPCWSTR, ... );
|
2005-05-31 11:30:28 +02:00
|
|
|
typedef UINT (*record_func)( MSIRECORD *, LPVOID );
|
2005-02-02 10:55:51 +01:00
|
|
|
extern UINT MSI_IterateRecords( MSIQUERY *, DWORD *, record_func, LPVOID );
|
2005-06-02 12:29:28 +02:00
|
|
|
extern MSIRECORD *MSI_QueryGetRecord( MSIDATABASE *db, LPCWSTR query, ... );
|
2005-05-31 11:30:28 +02:00
|
|
|
extern UINT MSI_DatabaseImport( MSIDATABASE *, LPCWSTR, LPCWSTR );
|
|
|
|
extern UINT MSI_DatabaseExport( MSIDATABASE *, LPCWSTR, LPCWSTR, LPCWSTR );
|
|
|
|
extern UINT MSI_DatabaseGetPrimaryKeys( MSIDATABASE *, LPCWSTR, MSIRECORD ** );
|
2004-07-10 00:25:34 +02:00
|
|
|
|
|
|
|
/* view internals */
|
|
|
|
extern UINT MSI_ViewExecute( MSIQUERY*, MSIRECORD * );
|
|
|
|
extern UINT MSI_ViewFetch( MSIQUERY*, MSIRECORD ** );
|
|
|
|
extern UINT MSI_ViewClose( MSIQUERY* );
|
2006-08-31 12:50:11 +02:00
|
|
|
extern UINT MSI_ViewGetColumnInfo(MSIQUERY *, MSICOLINFO, MSIRECORD **);
|
|
|
|
extern UINT VIEW_find_column( MSIVIEW *, LPCWSTR, UINT * );
|
|
|
|
|
2004-07-10 00:25:34 +02:00
|
|
|
|
2006-07-19 20:17:28 +02:00
|
|
|
/* install internals */
|
|
|
|
extern UINT MSI_SetInstallLevel( MSIPACKAGE *package, int iInstallLevel );
|
|
|
|
|
2004-07-10 00:25:34 +02:00
|
|
|
/* package internals */
|
2006-11-08 00:13:47 +01:00
|
|
|
extern MSIPACKAGE *MSI_CreatePackage( MSIDATABASE *, LPWSTR );
|
2005-01-28 13:39:57 +01:00
|
|
|
extern UINT MSI_OpenPackageW( LPCWSTR szPackage, MSIPACKAGE ** );
|
|
|
|
extern UINT MSI_SetTargetPathW( MSIPACKAGE *, LPCWSTR, LPCWSTR );
|
2004-07-10 00:25:34 +02:00
|
|
|
extern UINT MSI_SetPropertyW( MSIPACKAGE *, LPCWSTR, LPCWSTR );
|
2005-01-28 13:39:57 +01:00
|
|
|
extern INT MSI_ProcessMessage( MSIPACKAGE *, INSTALLMESSAGE, MSIRECORD * );
|
|
|
|
extern UINT MSI_GetPropertyW( MSIPACKAGE *, LPCWSTR, LPWSTR, DWORD * );
|
2005-05-31 11:30:28 +02:00
|
|
|
extern UINT MSI_GetPropertyA(MSIPACKAGE *, LPCSTR, LPSTR, DWORD* );
|
2004-07-10 00:25:34 +02:00
|
|
|
extern MSICONDITION MSI_EvaluateConditionW( MSIPACKAGE *, LPCWSTR );
|
2006-08-04 23:27:42 +02:00
|
|
|
extern UINT MSI_GetComponentStateW( MSIPACKAGE *, LPCWSTR, INSTALLSTATE *, INSTALLSTATE * );
|
|
|
|
extern UINT MSI_GetFeatureStateW( MSIPACKAGE *, LPCWSTR, INSTALLSTATE *, INSTALLSTATE * );
|
2005-05-13 15:56:39 +02:00
|
|
|
extern UINT WINAPI MSI_SetFeatureStateW(MSIPACKAGE*, LPCWSTR, INSTALLSTATE );
|
2006-10-09 09:05:04 +02:00
|
|
|
extern LPCWSTR msi_download_file( LPCWSTR szUrl, LPWSTR filename );
|
2004-07-10 00:25:34 +02:00
|
|
|
|
2005-01-25 21:17:09 +01:00
|
|
|
/* for deformating */
|
2005-06-07 22:29:51 +02:00
|
|
|
extern UINT MSI_FormatRecordW( MSIPACKAGE *, MSIRECORD *, LPWSTR, DWORD * );
|
|
|
|
extern UINT MSI_FormatRecordA( MSIPACKAGE *, MSIRECORD *, LPSTR, DWORD * );
|
2006-10-10 13:03:52 +02:00
|
|
|
|
2004-07-10 00:25:34 +02:00
|
|
|
/* registry data encoding/decoding functions */
|
2005-01-28 13:39:57 +01:00
|
|
|
extern BOOL unsquash_guid(LPCWSTR in, LPWSTR out);
|
|
|
|
extern BOOL squash_guid(LPCWSTR in, LPWSTR out);
|
|
|
|
extern BOOL encode_base85_guid(GUID *,LPWSTR);
|
|
|
|
extern BOOL decode_base85_guid(LPCWSTR,GUID*);
|
|
|
|
extern UINT MSIREG_OpenUninstallKey(LPCWSTR szProduct, HKEY* key, BOOL create);
|
|
|
|
extern UINT MSIREG_OpenUserProductsKey(LPCWSTR szProduct, HKEY* key, BOOL create);
|
|
|
|
extern UINT MSIREG_OpenFeatures(HKEY* key);
|
|
|
|
extern UINT MSIREG_OpenFeaturesKey(LPCWSTR szProduct, HKEY* key, BOOL create);
|
|
|
|
extern UINT MSIREG_OpenComponents(HKEY* key);
|
2005-04-20 14:50:05 +02:00
|
|
|
extern UINT MSIREG_OpenUserComponentsKey(LPCWSTR szComponent, HKEY* key, BOOL create);
|
2005-01-28 13:39:57 +01:00
|
|
|
extern UINT MSIREG_OpenComponentsKey(LPCWSTR szComponent, HKEY* key, BOOL create);
|
|
|
|
extern UINT MSIREG_OpenProductsKey(LPCWSTR szProduct, HKEY* key, BOOL create);
|
|
|
|
extern UINT MSIREG_OpenUserFeaturesKey(LPCWSTR szProduct, HKEY* key, BOOL create);
|
2005-06-01 13:02:19 +02:00
|
|
|
extern UINT MSIREG_OpenUserComponentsKey(LPCWSTR szComponent, HKEY* key, BOOL create);
|
2005-03-10 18:24:05 +01:00
|
|
|
extern UINT MSIREG_OpenUpgradeCodesKey(LPCWSTR szProduct, HKEY* key, BOOL create);
|
2005-06-07 22:02:27 +02:00
|
|
|
extern UINT MSIREG_OpenUserUpgradeCodesKey(LPCWSTR szProduct, HKEY* key, BOOL create);
|
2005-01-28 13:39:57 +01:00
|
|
|
|
2006-07-14 08:19:32 +02:00
|
|
|
extern LPWSTR msi_reg_get_val_str( HKEY hkey, LPCWSTR name );
|
|
|
|
extern BOOL msi_reg_get_val_dword( HKEY hkey, LPCWSTR name, DWORD *val);
|
|
|
|
|
2006-07-14 08:19:08 +02:00
|
|
|
extern DWORD msi_version_str_to_dword(LPCWSTR p);
|
|
|
|
extern LPWSTR msi_version_dword_to_str(DWORD version);
|
|
|
|
|
2005-09-15 16:58:38 +02:00
|
|
|
extern LONG msi_reg_set_val_str( HKEY hkey, LPCWSTR name, LPCWSTR value );
|
|
|
|
extern LONG msi_reg_set_val_multi_str( HKEY hkey, LPCWSTR name, LPCWSTR value );
|
|
|
|
extern LONG msi_reg_set_val_dword( HKEY hkey, LPCWSTR name, DWORD val );
|
2006-07-14 08:18:35 +02:00
|
|
|
extern LONG msi_reg_set_subkey_val( HKEY hkey, LPCWSTR path, LPCWSTR name, LPCWSTR val );
|
2005-09-15 16:58:38 +02:00
|
|
|
|
2005-01-28 13:39:57 +01:00
|
|
|
/* msi dialog interface */
|
2005-06-17 23:31:06 +02:00
|
|
|
typedef UINT (*msi_dialog_event_handler)( MSIPACKAGE*, LPCWSTR, LPCWSTR, msi_dialog* );
|
2006-09-29 01:20:40 +02:00
|
|
|
extern msi_dialog *msi_dialog_create( MSIPACKAGE*, LPCWSTR, msi_dialog*, msi_dialog_event_handler );
|
2005-02-02 10:55:51 +01:00
|
|
|
extern UINT msi_dialog_run_message_loop( msi_dialog* );
|
|
|
|
extern void msi_dialog_end_dialog( msi_dialog* );
|
2005-04-27 12:16:57 +02:00
|
|
|
extern void msi_dialog_check_messages( HANDLE );
|
2005-02-02 10:55:51 +01:00
|
|
|
extern void msi_dialog_do_preview( msi_dialog* );
|
|
|
|
extern void msi_dialog_destroy( msi_dialog* );
|
2005-04-27 12:16:57 +02:00
|
|
|
extern BOOL msi_dialog_register_class( void );
|
2005-01-28 13:39:57 +01:00
|
|
|
extern void msi_dialog_unregister_class( void );
|
2005-06-06 17:40:15 +02:00
|
|
|
extern void msi_dialog_handle_event( msi_dialog*, LPCWSTR, LPCWSTR, MSIRECORD * );
|
2006-01-03 12:12:09 +01:00
|
|
|
extern UINT msi_dialog_reset( msi_dialog *dialog );
|
2006-08-25 23:22:16 +02:00
|
|
|
extern UINT msi_dialog_directorylist_up( msi_dialog *dialog );
|
2006-09-29 01:20:40 +02:00
|
|
|
extern msi_dialog *msi_dialog_get_parent( msi_dialog *dialog );
|
|
|
|
extern LPWSTR msi_dialog_get_name( msi_dialog *dialog );
|
2006-10-27 02:13:52 +02:00
|
|
|
extern UINT msi_spawn_error_dialog( MSIPACKAGE*, LPWSTR, LPWSTR );
|
2004-07-04 02:26:54 +02:00
|
|
|
|
2005-06-07 22:29:51 +02:00
|
|
|
/* preview */
|
|
|
|
extern MSIPREVIEW *MSI_EnableUIPreview( MSIDATABASE * );
|
|
|
|
extern UINT MSI_PreviewDialogW( MSIPREVIEW *, LPCWSTR );
|
|
|
|
|
2005-10-26 12:10:50 +02:00
|
|
|
/* summary information */
|
2006-10-23 18:11:30 +02:00
|
|
|
extern MSISUMMARYINFO *MSI_GetSummaryInformationW( IStorage *stg, UINT uiUpdateCount );
|
2005-10-26 12:10:50 +02:00
|
|
|
extern LPWSTR msi_suminfo_dup_string( MSISUMMARYINFO *si, UINT uiProperty );
|
2006-10-23 18:12:13 +02:00
|
|
|
extern LPWSTR msi_get_suminfo_product( IStorage *stg );
|
2005-10-26 12:10:50 +02:00
|
|
|
|
2005-06-07 22:29:51 +02:00
|
|
|
/* undocumented functions */
|
|
|
|
UINT WINAPI MsiCreateAndVerifyInstallerDirectory( DWORD );
|
|
|
|
UINT WINAPI MsiDecomposeDescriptorW( LPCWSTR, LPWSTR, LPWSTR, LPWSTR, DWORD * );
|
|
|
|
UINT WINAPI MsiDecomposeDescriptorA( LPCSTR, LPSTR, LPSTR, LPSTR, DWORD * );
|
|
|
|
LANGID WINAPI MsiLoadStringW( MSIHANDLE, UINT, LPWSTR, int, LANGID );
|
|
|
|
LANGID WINAPI MsiLoadStringA( MSIHANDLE, UINT, LPSTR, int, LANGID );
|
|
|
|
|
2004-07-04 02:26:54 +02:00
|
|
|
/* UI globals */
|
|
|
|
extern INSTALLUILEVEL gUILevel;
|
|
|
|
extern HWND gUIhwnd;
|
2005-01-24 13:55:31 +01:00
|
|
|
extern INSTALLUI_HANDLERA gUIHandlerA;
|
|
|
|
extern INSTALLUI_HANDLERW gUIHandlerW;
|
2004-07-04 02:31:17 +02:00
|
|
|
extern DWORD gUIFilter;
|
|
|
|
extern LPVOID gUIContext;
|
2004-07-09 21:26:30 +02:00
|
|
|
extern WCHAR gszLogFile[MAX_PATH];
|
2006-07-24 12:47:00 +02:00
|
|
|
extern HINSTANCE msi_hInstance;
|
2004-07-04 02:26:54 +02:00
|
|
|
|
2006-10-10 13:03:52 +02:00
|
|
|
/* action related functions */
|
|
|
|
extern UINT ACTION_PerformAction(MSIPACKAGE *package, const WCHAR *action, BOOL force);
|
|
|
|
extern UINT ACTION_PerformUIAction(MSIPACKAGE *package, const WCHAR *action);
|
|
|
|
extern void ACTION_FinishCustomActions( MSIPACKAGE* package);
|
|
|
|
extern UINT ACTION_CustomAction(MSIPACKAGE *package,const WCHAR *action, BOOL execute);
|
|
|
|
|
2006-10-26 07:09:29 +02:00
|
|
|
static inline void msi_feature_set_state( MSIFEATURE *feature, INSTALLSTATE state )
|
|
|
|
{
|
|
|
|
feature->ActionRequest = state;
|
|
|
|
feature->Action = state;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void msi_component_set_state( MSICOMPONENT *comp, INSTALLSTATE state )
|
|
|
|
{
|
|
|
|
comp->ActionRequest = state;
|
|
|
|
comp->Action = state;
|
|
|
|
}
|
|
|
|
|
2006-10-10 13:03:52 +02:00
|
|
|
/* actions in other modules */
|
|
|
|
extern UINT ACTION_AppSearch(MSIPACKAGE *package);
|
|
|
|
extern UINT ACTION_FindRelatedProducts(MSIPACKAGE *package);
|
|
|
|
extern UINT ACTION_InstallFiles(MSIPACKAGE *package);
|
|
|
|
extern UINT ACTION_RemoveFiles(MSIPACKAGE *package);
|
|
|
|
extern UINT ACTION_DuplicateFiles(MSIPACKAGE *package);
|
|
|
|
extern UINT ACTION_RegisterClassInfo(MSIPACKAGE *package);
|
|
|
|
extern UINT ACTION_RegisterProgIdInfo(MSIPACKAGE *package);
|
|
|
|
extern UINT ACTION_RegisterExtensionInfo(MSIPACKAGE *package);
|
|
|
|
extern UINT ACTION_RegisterMIMEInfo(MSIPACKAGE *package);
|
|
|
|
extern UINT ACTION_RegisterFonts(MSIPACKAGE *package);
|
|
|
|
|
|
|
|
/* Helpers */
|
|
|
|
extern DWORD deformat_string(MSIPACKAGE *package, LPCWSTR ptr, WCHAR** data );
|
|
|
|
extern LPWSTR msi_dup_record_field(MSIRECORD *row, INT index);
|
|
|
|
extern LPWSTR msi_dup_property(MSIPACKAGE *package, LPCWSTR prop);
|
|
|
|
extern int msi_get_property_int( MSIPACKAGE *package, LPCWSTR prop, int def );
|
|
|
|
extern LPWSTR resolve_folder(MSIPACKAGE *package, LPCWSTR name, BOOL source,
|
|
|
|
BOOL set_prop, MSIFOLDER **folder);
|
|
|
|
extern MSICOMPONENT *get_loaded_component( MSIPACKAGE* package, LPCWSTR Component );
|
|
|
|
extern MSIFEATURE *get_loaded_feature( MSIPACKAGE* package, LPCWSTR Feature );
|
|
|
|
extern MSIFILE *get_loaded_file( MSIPACKAGE* package, LPCWSTR file );
|
|
|
|
extern MSIFOLDER *get_loaded_folder( MSIPACKAGE *package, LPCWSTR dir );
|
2006-11-14 04:42:27 +01:00
|
|
|
extern int track_tempfile(MSIPACKAGE *package, LPCWSTR path);
|
2006-10-10 13:03:52 +02:00
|
|
|
extern UINT schedule_action(MSIPACKAGE *package, UINT script, LPCWSTR action);
|
2006-11-02 10:12:43 +01:00
|
|
|
extern void msi_free_action_script(MSIPACKAGE *package, UINT script);
|
2006-10-10 13:03:52 +02:00
|
|
|
extern LPWSTR build_icon_path(MSIPACKAGE *, LPCWSTR);
|
|
|
|
extern LPWSTR build_directory_name(DWORD , ...);
|
|
|
|
extern BOOL create_full_pathW(const WCHAR *path);
|
|
|
|
extern BOOL ACTION_VerifyComponentForAction(MSICOMPONENT*, INSTALLSTATE);
|
|
|
|
extern BOOL ACTION_VerifyFeatureForAction(MSIFEATURE*, INSTALLSTATE);
|
|
|
|
extern void reduce_to_longfilename(WCHAR*);
|
|
|
|
extern void reduce_to_shortfilename(WCHAR*);
|
|
|
|
extern LPWSTR create_component_advertise_string(MSIPACKAGE*, MSICOMPONENT*, LPCWSTR);
|
|
|
|
extern void ACTION_UpdateComponentStates(MSIPACKAGE *package, LPCWSTR szFeature);
|
|
|
|
extern UINT register_unique_action(MSIPACKAGE *, LPCWSTR);
|
|
|
|
extern BOOL check_unique_action(MSIPACKAGE *, LPCWSTR);
|
|
|
|
extern WCHAR* generate_error_string(MSIPACKAGE *, UINT, DWORD, ... );
|
|
|
|
extern UINT msi_create_component_directories( MSIPACKAGE *package );
|
|
|
|
extern void msi_ui_error( DWORD msg_id, DWORD type );
|
|
|
|
|
|
|
|
/* control event stuff */
|
|
|
|
extern VOID ControlEvent_FireSubscribedEvent(MSIPACKAGE *package, LPCWSTR event,
|
|
|
|
MSIRECORD *data);
|
|
|
|
extern VOID ControlEvent_CleanupSubscriptions(MSIPACKAGE *package);
|
|
|
|
extern VOID ControlEvent_SubscribeToEvent(MSIPACKAGE *package, msi_dialog *dialog,
|
|
|
|
LPCWSTR event, LPCWSTR control, LPCWSTR attribute);
|
|
|
|
extern VOID ControlEvent_UnSubscribeToEvent( MSIPACKAGE *package, LPCWSTR event,
|
|
|
|
LPCWSTR control, LPCWSTR attribute );
|
|
|
|
|
|
|
|
/* User Interface messages from the actions */
|
|
|
|
extern void ui_progress(MSIPACKAGE *, int, int, int, int);
|
|
|
|
extern void ui_actiondata(MSIPACKAGE *, LPCWSTR, MSIRECORD *);
|
|
|
|
|
|
|
|
/* string consts use a number of places and defined in helpers.c*/
|
|
|
|
extern const WCHAR cszSourceDir[];
|
2006-10-10 22:39:50 +02:00
|
|
|
extern const WCHAR cszSOURCEDIR[];
|
2006-10-10 13:03:52 +02:00
|
|
|
extern const WCHAR szProductCode[];
|
|
|
|
extern const WCHAR cszRootDrive[];
|
|
|
|
extern const WCHAR cszbs[];
|
|
|
|
|
2005-09-20 13:57:19 +02:00
|
|
|
/* memory allocation macro functions */
|
|
|
|
static inline void *msi_alloc( size_t len )
|
|
|
|
{
|
|
|
|
return HeapAlloc( GetProcessHeap(), 0, len );
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void *msi_alloc_zero( size_t len )
|
|
|
|
{
|
|
|
|
return HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, len );
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void *msi_realloc( void *mem, size_t len )
|
|
|
|
{
|
|
|
|
return HeapReAlloc( GetProcessHeap(), 0, mem, len );
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void *msi_realloc_zero( void *mem, size_t len )
|
|
|
|
{
|
|
|
|
return HeapReAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, mem, len );
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline BOOL msi_free( void *mem )
|
|
|
|
{
|
|
|
|
return HeapFree( GetProcessHeap(), 0, mem );
|
|
|
|
}
|
|
|
|
|
2005-03-16 12:31:35 +01:00
|
|
|
inline static char *strdupWtoA( LPCWSTR str )
|
|
|
|
{
|
|
|
|
LPSTR ret = NULL;
|
2005-09-20 13:57:19 +02:00
|
|
|
DWORD len;
|
|
|
|
|
|
|
|
if (!str) return ret;
|
|
|
|
len = WideCharToMultiByte( CP_ACP, 0, str, -1, NULL, 0, NULL, NULL);
|
|
|
|
ret = msi_alloc( len );
|
|
|
|
if (ret)
|
|
|
|
WideCharToMultiByte( CP_ACP, 0, str, -1, ret, len, NULL, NULL );
|
2005-03-16 12:31:35 +01:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline static LPWSTR strdupAtoW( LPCSTR str )
|
|
|
|
{
|
|
|
|
LPWSTR ret = NULL;
|
2005-09-20 13:57:19 +02:00
|
|
|
DWORD len;
|
|
|
|
|
|
|
|
if (!str) return ret;
|
|
|
|
len = MultiByteToWideChar( CP_ACP, 0, str, -1, NULL, 0 );
|
|
|
|
ret = msi_alloc( len * sizeof(WCHAR) );
|
|
|
|
if (ret)
|
|
|
|
MultiByteToWideChar( CP_ACP, 0, str, -1, ret, len );
|
2005-03-16 12:31:35 +01:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline static LPWSTR strdupW( LPCWSTR src )
|
|
|
|
{
|
|
|
|
LPWSTR dest;
|
|
|
|
if (!src) return NULL;
|
2005-09-20 13:57:19 +02:00
|
|
|
dest = msi_alloc( (lstrlenW(src)+1)*sizeof(WCHAR) );
|
|
|
|
if (dest)
|
|
|
|
lstrcpyW(dest, src);
|
2005-03-16 12:31:35 +01:00
|
|
|
return dest;
|
|
|
|
}
|
|
|
|
|
2003-08-13 03:27:48 +02:00
|
|
|
#endif /* __WINE_MSI_PRIVATE__ */
|