2 * Common prototypes for Action handlers
4 * Copyright 2005 Aric Stewart for CodeWeavers
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 typedef struct tagMSIFEATURE
24 WCHAR Feature_Parent
[96];
26 WCHAR Description
[0x100];
32 INSTALLSTATE Installed
;
33 INSTALLSTATE ActionRequest
;
37 INT Components
[1024]; /* yes hardcoded limit.... I am bad */
41 typedef struct tagMSICOMPONENT
44 WCHAR ComponentId
[96];
47 WCHAR Condition
[0x100];
50 INSTALLSTATE Installed
;
51 INSTALLSTATE ActionRequest
;
58 typedef struct tagMSIFOLDER
64 LPWSTR ResolvedTarget
;
65 LPWSTR ResolvedSource
;
66 LPWSTR Property
; /* initially set property */
69 /* 0 = uninitialized */
71 /* 2 = created remove if empty */
72 /* 3 = created persist if empty */
77 typedef struct tagMSIFILE
89 /* 0 = uninitialize */
91 /* 2 = present but replace */
92 /* 3 = present do not replace */
100 void ACTION_FinishCustomActions( MSIPACKAGE
* package
);
101 UINT
ACTION_CustomAction(MSIPACKAGE
*package
,const WCHAR
*action
, BOOL execute
);
104 DWORD
deformat_string(MSIPACKAGE
*package
, LPCWSTR ptr
, WCHAR
** data
);
105 WCHAR
*load_dynamic_stringW(MSIRECORD
*row
, INT index
);
106 LPWSTR
load_dynamic_property(MSIPACKAGE
*package
, LPCWSTR prop
, UINT
* rc
);
107 LPWSTR
resolve_folder(MSIPACKAGE
*package
, LPCWSTR name
, BOOL source
,
108 BOOL set_prop
, MSIFOLDER
**folder
);
109 int get_loaded_component(MSIPACKAGE
* package
, LPCWSTR Component
);
110 int get_loaded_feature(MSIPACKAGE
* package
, LPCWSTR Feature
);
111 int get_loaded_file(MSIPACKAGE
* package
, LPCWSTR file
);
112 int track_tempfile(MSIPACKAGE
*package
, LPCWSTR name
, LPCWSTR path
);
116 inline static char *strdupWtoA( const WCHAR
*str
)
121 DWORD len
= WideCharToMultiByte( CP_ACP
, 0, str
, -1, NULL
, 0, NULL
, NULL
123 if ((ret
= HeapAlloc( GetProcessHeap(), 0, len
)))
124 WideCharToMultiByte( CP_ACP
, 0, str
, -1, ret
, len
, NULL
, NULL
);
129 inline static WCHAR
*strdupAtoW( const char *str
)
134 DWORD len
= MultiByteToWideChar( CP_ACP
, 0, str
, -1, NULL
, 0 );
135 if ((ret
= HeapAlloc( GetProcessHeap(), 0, len
* sizeof(WCHAR
) )))
136 MultiByteToWideChar( CP_ACP
, 0, str
, -1, ret
, len
);
141 inline static LPWSTR
dupstrW(LPCWSTR src
)
144 if (!src
) return NULL
;
145 dest
= HeapAlloc(GetProcessHeap(), 0, (strlenW(src
)+1)*sizeof(WCHAR
));