ReactOS  0.4.15-dev-3723-g8d70159
package.c File Reference
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winreg.h"
#include "winnls.h"
#include "shlwapi.h"
#include "wingdi.h"
#include "wine/debug.h"
#include "msi.h"
#include "msiquery.h"
#include "objidl.h"
#include "wincrypt.h"
#include "winuser.h"
#include "wininet.h"
#include "winver.h"
#include "urlmon.h"
#include "shlobj.h"
#include "wine/unicode.h"
#include "objbase.h"
#include "msidefs.h"
#include "sddl.h"
#include "msipriv.h"
#include "msiserver.h"
#include "resource.h"
Include dependency graph for package.c:

Go to the source code of this file.

Classes

struct  tagLANGANDCODEPAGE
 
struct  _msi_remote_package_impl
 

Macros

#define NONAMELESSUNION
 
#define NONAMELESSSTRUCT
 
#define COBJMACROS
 

Typedefs

typedef struct tagLANGANDCODEPAGE LANGANDCODEPAGE
 
typedef struct _msi_remote_package_impl msi_remote_package_impl
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (msi)
 
static void free_feature (MSIFEATURE *feature)
 
static void free_folder (MSIFOLDER *folder)
 
static void free_extension (MSIEXTENSION *ext)
 
static void free_assembly (MSIASSEMBLY *assembly)
 
void msi_free_action_script (MSIPACKAGE *package, UINT script)
 
static void free_package_structures (MSIPACKAGE *package)
 
static void MSI_FreePackage (MSIOBJECTHDR *arg)
 
static UINT create_temp_property_table (MSIPACKAGE *package)
 
UINT msi_clone_properties (MSIDATABASE *db)
 
static UINT set_installed_prop (MSIPACKAGE *package)
 
static UINT set_user_sid_prop (MSIPACKAGE *package)
 
static LPWSTR get_fusion_filename (MSIPACKAGE *package)
 
static void set_msi_assembly_prop (MSIPACKAGE *package)
 
static VOID set_installer_properties (MSIPACKAGE *package)
 
static MSIPACKAGEmsi_alloc_package (void)
 
static UINT msi_load_admin_properties (MSIPACKAGE *package)
 
void msi_adjust_privilege_properties (MSIPACKAGE *package)
 
MSIPACKAGEMSI_CreatePackage (MSIDATABASE *db, LPCWSTR base_url)
 
UINT msi_download_file (LPCWSTR szUrl, LPWSTR filename)
 
UINT msi_create_empty_local_file (LPWSTR path, LPCWSTR suffix)
 
static enum platform parse_platform (const WCHAR *str)
 
static UINT parse_suminfo (MSISUMMARYINFO *si, MSIPACKAGE *package)
 
static UINT validate_package (MSIPACKAGE *package)
 
static WCHARget_product_code (MSIDATABASE *db)
 
static UINT get_registered_local_package (const WCHAR *product, const WCHAR *package, WCHAR *localfile)
 
static WCHARget_package_code (MSIDATABASE *db)
 
static UINT get_local_package (const WCHAR *filename, WCHAR *localfile)
 
UINT msi_set_original_database_property (MSIDATABASE *db, const WCHAR *package)
 
UINT MSI_OpenPackageW (LPCWSTR szPackage, MSIPACKAGE **pPackage)
 
UINT WINAPI MsiOpenPackageExW (LPCWSTR szPackage, DWORD dwOptions, MSIHANDLE *phPackage)
 
UINT WINAPI MsiOpenPackageW (LPCWSTR szPackage, MSIHANDLE *phPackage)
 
UINT WINAPI MsiOpenPackageExA (LPCSTR szPackage, DWORD dwOptions, MSIHANDLE *phPackage)
 
UINT WINAPI MsiOpenPackageA (LPCSTR szPackage, MSIHANDLE *phPackage)
 
MSIHANDLE WINAPI MsiGetActiveDatabase (MSIHANDLE hInstall)
 
static INT internal_ui_handler (MSIPACKAGE *package, INSTALLMESSAGE eMessageType, MSIRECORD *record, LPCWSTR message)
 
static LPCWSTR get_internal_error_message (int error)
 
LPWSTR msi_get_error_message (MSIDATABASE *db, int error)
 
INT MSI_ProcessMessageVerbatim (MSIPACKAGE *package, INSTALLMESSAGE eMessageType, MSIRECORD *record)
 
INT MSI_ProcessMessage (MSIPACKAGE *package, INSTALLMESSAGE eMessageType, MSIRECORD *record)
 
INT WINAPI MsiProcessMessage (MSIHANDLE hInstall, INSTALLMESSAGE eMessageType, MSIHANDLE hRecord)
 
UINT WINAPI MsiSetPropertyA (MSIHANDLE hInstall, LPCSTR szName, LPCSTR szValue)
 
void msi_reset_folders (MSIPACKAGE *package, BOOL source)
 
UINT msi_set_property (MSIDATABASE *db, const WCHAR *name, const WCHAR *value, int len)
 
UINT WINAPI MsiSetPropertyW (MSIHANDLE hInstall, LPCWSTR szName, LPCWSTR szValue)
 
static MSIRECORDmsi_get_property_row (MSIDATABASE *db, LPCWSTR name)
 
UINT msi_get_property (MSIDATABASE *db, LPCWSTR szName, LPWSTR szValueBuf, LPDWORD pchValueBuf)
 
LPWSTR msi_dup_property (MSIDATABASE *db, LPCWSTR prop)
 
int msi_get_property_int (MSIDATABASE *db, LPCWSTR prop, int def)
 
static UINT MSI_GetProperty (MSIHANDLE handle, LPCWSTR name, awstring *szValueBuf, LPDWORD pchValueBuf)
 
UINT WINAPI MsiGetPropertyA (MSIHANDLE hInstall, LPCSTR szName, LPSTR szValueBuf, LPDWORD pchValueBuf)
 
UINT WINAPI MsiGetPropertyW (MSIHANDLE hInstall, LPCWSTR szName, LPWSTR szValueBuf, LPDWORD pchValueBuf)
 
static msi_remote_package_implimpl_from_IWineMsiRemotePackage (IWineMsiRemotePackage *iface)
 
static HRESULT WINAPI mrp_QueryInterface (IWineMsiRemotePackage *iface, REFIID riid, LPVOID *ppobj)
 
static ULONG WINAPI mrp_AddRef (IWineMsiRemotePackage *iface)
 
static ULONG WINAPI mrp_Release (IWineMsiRemotePackage *iface)
 
static HRESULT WINAPI mrp_SetMsiHandle (IWineMsiRemotePackage *iface, MSIHANDLE handle)
 
static HRESULT WINAPI mrp_GetActiveDatabase (IWineMsiRemotePackage *iface, MSIHANDLE *handle)
 
static HRESULT WINAPI mrp_GetProperty (IWineMsiRemotePackage *iface, BSTR property, BSTR value, DWORD *size)
 
static HRESULT WINAPI mrp_SetProperty (IWineMsiRemotePackage *iface, BSTR property, BSTR value)
 
static HRESULT WINAPI mrp_ProcessMessage (IWineMsiRemotePackage *iface, INSTALLMESSAGE message, MSIHANDLE record)
 
static HRESULT WINAPI mrp_DoAction (IWineMsiRemotePackage *iface, BSTR action)
 
static HRESULT WINAPI mrp_Sequence (IWineMsiRemotePackage *iface, BSTR table, int sequence)
 
static HRESULT WINAPI mrp_GetTargetPath (IWineMsiRemotePackage *iface, BSTR folder, BSTR value, DWORD *size)
 
static HRESULT WINAPI mrp_SetTargetPath (IWineMsiRemotePackage *iface, BSTR folder, BSTR value)
 
static HRESULT WINAPI mrp_GetSourcePath (IWineMsiRemotePackage *iface, BSTR folder, BSTR value, DWORD *size)
 
static HRESULT WINAPI mrp_GetMode (IWineMsiRemotePackage *iface, MSIRUNMODE mode, BOOL *ret)
 
static HRESULT WINAPI mrp_SetMode (IWineMsiRemotePackage *iface, MSIRUNMODE mode, BOOL state)
 
static HRESULT WINAPI mrp_GetFeatureState (IWineMsiRemotePackage *iface, BSTR feature, INSTALLSTATE *installed, INSTALLSTATE *action)
 
static HRESULT WINAPI mrp_SetFeatureState (IWineMsiRemotePackage *iface, BSTR feature, INSTALLSTATE state)
 
static HRESULT WINAPI mrp_GetComponentState (IWineMsiRemotePackage *iface, BSTR component, INSTALLSTATE *installed, INSTALLSTATE *action)
 
static HRESULT WINAPI mrp_SetComponentState (IWineMsiRemotePackage *iface, BSTR component, INSTALLSTATE state)
 
static HRESULT WINAPI mrp_GetLanguage (IWineMsiRemotePackage *iface, LANGID *language)
 
static HRESULT WINAPI mrp_SetInstallLevel (IWineMsiRemotePackage *iface, int level)
 
static HRESULT WINAPI mrp_FormatRecord (IWineMsiRemotePackage *iface, MSIHANDLE record, BSTR *value)
 
static HRESULT WINAPI mrp_EvaluateCondition (IWineMsiRemotePackage *iface, BSTR condition)
 
static HRESULT WINAPI mrp_GetFeatureCost (IWineMsiRemotePackage *iface, BSTR feature, INT cost_tree, INSTALLSTATE state, INT *cost)
 
static HRESULT WINAPI mrp_EnumComponentCosts (IWineMsiRemotePackage *iface, BSTR component, DWORD index, INSTALLSTATE state, BSTR drive, DWORD *buflen, INT *cost, INT *temp)
 
HRESULT create_msi_remote_package (IUnknown *pOuter, LPVOID *ppObj)
 
UINT msi_package_add_info (MSIPACKAGE *package, DWORD context, DWORD options, LPCWSTR property, LPWSTR value)
 
UINT msi_package_add_media_disk (MSIPACKAGE *package, DWORD context, DWORD options, DWORD disk_id, LPWSTR volume_label, LPWSTR disk_prompt)
 

Variables

static const WCHAR szActionNotFound [] = {'D','E','B','U','G',':',' ','E','r','r','o','r',' ','[','1',']',':',' ',' ','A','c','t','i','o','n',' ','n','o','t',' ','f','o','u','n','d',':',' ','[','2',']',0}
 
struct {
   int   id
 
   const WCHAR *   text
 
internal_errors []
 
static const IWineMsiRemotePackageVtbl msi_remote_package_vtbl
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 23 of file package.c.

◆ NONAMELESSSTRUCT

#define NONAMELESSSTRUCT

Definition at line 22 of file package.c.

◆ NONAMELESSUNION

#define NONAMELESSUNION

Definition at line 21 of file package.c.

Typedef Documentation

◆ LANGANDCODEPAGE

◆ msi_remote_package_impl

Function Documentation

◆ create_msi_remote_package()

HRESULT create_msi_remote_package ( IUnknown pOuter,
LPVOID ppObj 
)

Definition at line 2790 of file package.c.

2791 {
2793 
2794  This = msi_alloc( sizeof *This );
2795  if (!This)
2796  return E_OUTOFMEMORY;
2797 
2798  This->IWineMsiRemotePackage_iface.lpVtbl = &msi_remote_package_vtbl;
2799  This->package = 0;
2800  This->refs = 1;
2801 
2802  *ppObj = &This->IWineMsiRemotePackage_iface;
2803 
2804  return S_OK;
2805 }
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
static const IWineMsiRemotePackageVtbl msi_remote_package_vtbl
Definition: package.c:2761
#define S_OK
Definition: intsafe.h:52
static void * msi_alloc(size_t len) __WINE_ALLOC_SIZE(1)
Definition: msipriv.h:1204

Referenced by mcr_GetActionInfo().

◆ create_temp_property_table()

static UINT create_temp_property_table ( MSIPACKAGE package)
static

Definition at line 352 of file package.c.

353 {
354  static const WCHAR query[] = {
355  'C','R','E','A','T','E',' ','T','A','B','L','E',' ',
356  '`','_','P','r','o','p','e','r','t','y','`',' ','(',' ',
357  '`','_','P','r','o','p','e','r','t','y','`',' ',
358  'C','H','A','R','(','5','6',')',' ','N','O','T',' ','N','U','L','L',' ',
359  'T','E','M','P','O','R','A','R','Y',',',' ',
360  '`','V','a','l','u','e','`',' ','C','H','A','R','(','9','8',')',' ',
361  'N','O','T',' ','N','U','L','L',' ','T','E','M','P','O','R','A','R','Y',
362  ' ','P','R','I','M','A','R','Y',' ','K','E','Y',' ',
363  '`','_','P','r','o','p','e','r','t','y','`',')',' ','H','O','L','D',0};
364  MSIQUERY *view;
365  UINT rc;
366 
367  rc = MSI_DatabaseOpenViewW(package->db, query, &view);
368  if (rc != ERROR_SUCCESS)
369  return rc;
370 
371  rc = MSI_ViewExecute(view, 0);
373  msiobj_release(&view->hdr);
374  return rc;
375 }
#define ERROR_SUCCESS
Definition: deptool.c:10
UINT MSI_ViewExecute(MSIQUERY *, MSIRECORD *) DECLSPEC_HIDDEN
Definition: msiquery.c:443
UINT MSI_ViewClose(MSIQUERY *) DECLSPEC_HIDDEN
Definition: msiquery.c:412
__wchar_t WCHAR
Definition: xmlstorage.h:180
MSIDATABASE * db
Definition: msipriv.h:386
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
unsigned int UINT
Definition: ndis.h:50
static IOleDocumentView * view
Definition: activex.c:1749
UINT MSI_DatabaseOpenViewW(MSIDATABASE *, LPCWSTR, MSIQUERY **) DECLSPEC_HIDDEN
Definition: msiquery.c:111

Referenced by MSI_CreatePackage().

◆ free_assembly()

static void free_assembly ( MSIASSEMBLY assembly)
static

Definition at line 118 of file package.c.

119 {
120  msi_free( assembly->feature );
122  msi_free( assembly->application );
123  msi_free( assembly->display_name );
124  if (assembly->tempdir) RemoveDirectoryW( assembly->tempdir );
125  msi_free( assembly->tempdir );
126  msi_free( assembly );
127 }
struct file_info manifest
Definition: actctx.c:469
BOOL WINAPI RemoveDirectoryW(IN LPCWSTR lpPathName)
Definition: dir.c:732
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227

Referenced by free_package_structures().

◆ free_extension()

static void free_extension ( MSIEXTENSION ext)
static

Definition at line 98 of file package.c.

99 {
100  struct list *item, *cursor;
101 
102  LIST_FOR_EACH_SAFE( item, cursor, &ext->verbs )
103  {
104  MSIVERB *verb = LIST_ENTRY( item, MSIVERB, entry );
105 
106  list_remove( &verb->entry );
107  msi_free( verb->Verb );
108  msi_free( verb->Command );
109  msi_free( verb->Argument );
110  msi_free( verb );
111  }
112 
113  msi_free( ext->Extension );
114  msi_free( ext->ProgIDText );
115  msi_free( ext );
116 }
LPWSTR Argument
Definition: msipriv.h:682
#define LIST_FOR_EACH_SAFE(cursor, cursor2, list)
Definition: list.h:192
struct list entry
Definition: msipriv.h:678
LPWSTR Command
Definition: msipriv.h:681
char ext[3]
Definition: mkdosfs.c:358
__WINE_SERVER_LIST_INLINE void list_remove(struct list *elem)
Definition: list.h:108
uint32_t entry
Definition: isohybrid.c:63
Definition: _list.h:228
static ATOM item
Definition: dde.c:856
const char cursor[]
Definition: icontest.c:13
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
LPWSTR Verb
Definition: msipriv.h:679
#define LIST_ENTRY(type)
Definition: queue.h:175

Referenced by free_package_structures().

◆ free_feature()

static void free_feature ( MSIFEATURE feature)
static

Definition at line 53 of file package.c.

54 {
55  struct list *item, *cursor;
56 
57  LIST_FOR_EACH_SAFE( item, cursor, &feature->Children )
58  {
60  list_remove( &fl->entry );
61  msi_free( fl );
62  }
63 
64  LIST_FOR_EACH_SAFE( item, cursor, &feature->Components )
65  {
67  list_remove( &cl->entry );
68  msi_free( cl );
69  }
70  msi_free( feature->Feature );
71  msi_free( feature->Feature_Parent );
72  msi_free( feature->Directory );
73  msi_free( feature->Description );
74  msi_free( feature->Title );
75  msi_free( feature );
76 }
INTERNETFEATURELIST feature
Definition: misc.c:1719
#define LIST_FOR_EACH_SAFE(cursor, cursor2, list)
Definition: list.h:192
struct list entry
Definition: msipriv.h:528
_In_ FLONG fl
Definition: winddi.h:1279
__WINE_SERVER_LIST_INLINE void list_remove(struct list *elem)
Definition: list.h:108
uint32_t entry
Definition: isohybrid.c:63
Definition: _list.h:228
static ATOM item
Definition: dde.c:856
const char cursor[]
Definition: icontest.c:13
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
#define LIST_ENTRY(type)
Definition: queue.h:175

Referenced by free_package_structures().

◆ free_folder()

static void free_folder ( MSIFOLDER folder)
static

Definition at line 78 of file package.c.

79 {
80  struct list *item, *cursor;
81 
82  LIST_FOR_EACH_SAFE( item, cursor, &folder->children )
83  {
85  list_remove( &fl->entry );
86  msi_free( fl );
87  }
88  msi_free( folder->Parent );
89  msi_free( folder->Directory );
90  msi_free( folder->TargetDefault );
91  msi_free( folder->SourceLongPath );
92  msi_free( folder->SourceShortPath );
93  msi_free( folder->ResolvedTarget );
94  msi_free( folder->ResolvedSource );
95  msi_free( folder );
96 }
#define LIST_FOR_EACH_SAFE(cursor, cursor2, list)
Definition: list.h:192
Definition: fci.c:115
_In_ FLONG fl
Definition: winddi.h:1279
__WINE_SERVER_LIST_INLINE void list_remove(struct list *elem)
Definition: list.h:108
uint32_t entry
Definition: isohybrid.c:63
Definition: _list.h:228
static ATOM item
Definition: dde.c:856
const char cursor[]
Definition: icontest.c:13
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
#define LIST_ENTRY(type)
Definition: queue.h:175

Referenced by free_package_structures().

◆ free_package_structures()

static void free_package_structures ( MSIPACKAGE package)
static

Definition at line 140 of file package.c.

141 {
142  struct list *item, *cursor;
143  int i;
144 
145  LIST_FOR_EACH_SAFE( item, cursor, &package->features )
146  {
148  list_remove( &feature->entry );
150  }
151 
152  LIST_FOR_EACH_SAFE( item, cursor, &package->folders )
153  {
155  list_remove( &folder->entry );
156  free_folder( folder );
157  }
158 
159  LIST_FOR_EACH_SAFE( item, cursor, &package->files )
160  {
162 
163  list_remove( &file->entry );
164  msi_free( file->File );
165  msi_free( file->FileName );
166  msi_free( file->ShortName );
167  msi_free( file->LongName );
168  msi_free( file->Version );
169  msi_free( file->Language );
170  if (msi_is_global_assembly( file->Component )) DeleteFileW( file->TargetPath );
171  msi_free( file->TargetPath );
172  msi_free( file );
173  }
174 
176  {
178 
179  list_remove( &comp->entry );
180  msi_free( comp->Component );
181  msi_free( comp->ComponentId );
182  msi_free( comp->Directory );
183  msi_free( comp->Condition );
184  msi_free( comp->KeyPath );
185  msi_free( comp->FullKeypath );
186  if (comp->assembly) free_assembly( comp->assembly );
187  msi_free( comp );
188  }
189 
191  {
193 
194  list_remove( &patch->entry );
195  msi_free( patch->path );
196  msi_free( patch );
197  }
198 
199  /* clean up extension, progid, class and verb structures */
200  LIST_FOR_EACH_SAFE( item, cursor, &package->classes )
201  {
202  MSICLASS *cls = LIST_ENTRY( item, MSICLASS, entry );
203 
204  list_remove( &cls->entry );
205  msi_free( cls->clsid );
206  msi_free( cls->Context );
207  msi_free( cls->Description );
208  msi_free( cls->FileTypeMask );
209  msi_free( cls->IconPath );
210  msi_free( cls->DefInprocHandler );
212  msi_free( cls->Argument );
213  msi_free( cls->ProgIDText );
214  msi_free( cls );
215  }
216 
218  {
220 
221  list_remove( &ext->entry );
222  free_extension( ext );
223  }
224 
225  LIST_FOR_EACH_SAFE( item, cursor, &package->progids )
226  {
228 
229  list_remove( &progid->entry );
230  msi_free( progid->ProgID );
231  msi_free( progid->Description );
232  msi_free( progid->IconPath );
233  msi_free( progid );
234  }
235 
236  LIST_FOR_EACH_SAFE( item, cursor, &package->mimes )
237  {
238  MSIMIME *mt = LIST_ENTRY( item, MSIMIME, entry );
239 
240  list_remove( &mt->entry );
241  msi_free( mt->suffix );
242  msi_free( mt->clsid );
243  msi_free( mt->ContentType );
244  msi_free( mt );
245  }
246 
247  LIST_FOR_EACH_SAFE( item, cursor, &package->appids )
248  {
250 
251  list_remove( &appid->entry );
252  msi_free( appid->AppID );
253  msi_free( appid->RemoteServerName );
254  msi_free( appid->LocalServer );
255  msi_free( appid->ServiceParameters );
256  msi_free( appid->DllSurrogate );
257  msi_free( appid );
258  }
259 
261  {
263 
264  list_remove( &info->entry );
265  msi_free( info->value );
266  msi_free( info );
267  }
268 
270  {
272 
273  list_remove( &info->entry );
274  msi_free( info->volume_label );
275  msi_free( info->disk_prompt );
276  msi_free( info );
277  }
278 
279  for (i = 0; i < SCRIPT_MAX; i++)
280  msi_free_action_script( package, i );
281 
282  for (i = 0; i < package->unique_actions_count; i++)
283  msi_free( package->unique_actions[i] );
284  msi_free( package->unique_actions);
285 
286  LIST_FOR_EACH_SAFE( item, cursor, &package->binaries )
287  {
289 
290  list_remove( &binary->entry );
291  if (binary->module)
292  FreeLibrary( binary->module );
293  if (!DeleteFileW( binary->tmpfile ))
294  ERR("failed to delete %s (%u)\n", debugstr_w(binary->tmpfile), GetLastError());
295  msi_free( binary->source );
296  msi_free( binary->tmpfile );
297  msi_free( binary );
298  }
299 
301  {
303 
304  list_remove( &cab->entry );
305  IStorage_Release( cab->storage );
306  msi_free( cab->stream );
307  msi_free( cab );
308  }
309 
310  LIST_FOR_EACH_SAFE( item, cursor, &package->patches )
311  {
313 
314  list_remove( &patch->entry );
315  if (patch->delete_on_close && !DeleteFileW( patch->localfile ))
316  {
317  ERR("failed to delete %s (%u)\n", debugstr_w(patch->localfile), GetLastError());
318  }
319  msi_free_patchinfo( patch );
320  }
321 
322  msi_free( package->BaseURL );
323  msi_free( package->PackagePath );
324  msi_free( package->ProductCode );
325  msi_free( package->ActionFormat );
326  msi_free( package->LastAction );
327  msi_free( package->LastActionTemplate );
328  msi_free( package->langids );
329 
330  /* cleanup control event subscriptions */
332 }
LPWSTR ProductCode
Definition: msipriv.h:426
INTERNETFEATURELIST feature
Definition: misc.c:1719
#define LIST_FOR_EACH_SAFE(cursor, cursor2, list)
Definition: list.h:192
Definition: fci.c:115
MSIASSEMBLY * assembly
Definition: msipriv.h:517
struct list entry
Definition: msipriv.h:501
struct list entry
Definition: msipriv.h:687
LPWSTR * unique_actions
Definition: msipriv.h:417
LPWSTR IconPath
Definition: msipriv.h:637
LPWSTR PackagePath
Definition: msipriv.h:425
LPWSTR LastAction
Definition: msipriv.h:401
void msi_free_action_script(MSIPACKAGE *package, UINT script)
Definition: package.c:129
BOOL msi_is_global_assembly(MSICOMPONENT *comp)
Definition: action.c:2193
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1040
struct list folders
Definition: msipriv.h:397
static void free_folder(MSIFOLDER *folder)
Definition: package.c:78
LPWSTR KeyPath
Definition: msipriv.h:507
static void free_assembly(MSIASSEMBLY *assembly)
Definition: package.c:118
LPWSTR FileTypeMask
Definition: msipriv.h:636
struct list files
Definition: msipriv.h:394
LPWSTR suffix
Definition: msipriv.h:690
LPWSTR clsid
Definition: msipriv.h:691
void msi_event_cleanup_all_subscriptions(MSIPACKAGE *package)
Definition: dialog.c:4110
IStorage * storage
Definition: msipriv.h:182
struct list entry
Definition: msipriv.h:180
struct list sourcelist_info
Definition: msipriv.h:441
#define debugstr_w
Definition: kernel32.h:32
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
Definition: delete.c:39
struct list sourcelist_media
Definition: msipriv.h:442
char * appid
Definition: mkisofs.c:161
WCHAR * path
Definition: msipriv.h:609
struct list binaries
Definition: msipriv.h:398
char ext[3]
Definition: mkdosfs.c:358
void msi_free_patchinfo(MSIPATCHINFO *patch) DECLSPEC_HIDDEN
Definition: patch.c:902
struct list mimes
Definition: msipriv.h:412
LPWSTR DefInprocHandler
Definition: msipriv.h:638
__WINE_SERVER_LIST_INLINE void list_remove(struct list *elem)
Definition: list.h:108
#define FreeLibrary(x)
Definition: compat.h:607
LPWSTR Context
Definition: msipriv.h:630
struct list features
Definition: msipriv.h:393
LPWSTR LastActionTemplate
Definition: msipriv.h:402
LPWSTR Directory
Definition: msipriv.h:504
struct list classes
Definition: msipriv.h:409
LPWSTR ProgIDText
Definition: msipriv.h:633
struct list appids
Definition: msipriv.h:413
LPWSTR Description
Definition: msipriv.h:634
struct list progids
Definition: msipriv.h:411
const GLuint GLenum const GLvoid * binary
Definition: glext.h:7538
int unique_actions_count
Definition: msipriv.h:418
static void free_extension(MSIEXTENSION *ext)
Definition: package.c:98
LANGID * langids
Definition: msipriv.h:390
LPWSTR Component
Definition: msipriv.h:502
struct list components
Definition: msipriv.h:392
uint32_t entry
Definition: isohybrid.c:63
Definition: _list.h:228
struct list entry
Definition: msipriv.h:188
struct list entry
Definition: msipriv.h:602
LPWSTR Condition
Definition: msipriv.h:506
struct list extensions
Definition: msipriv.h:410
struct list cabinet_streams
Definition: msipriv.h:399
#define ERR(fmt,...)
Definition: debug.h:110
LPWSTR ComponentId
Definition: msipriv.h:503
LPWSTR clsid
Definition: msipriv.h:629
LPWSTR ActionFormat
Definition: msipriv.h:400
static ATOM item
Definition: dde.c:856
const char cursor[]
Definition: icontest.c:13
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
struct list entry
Definition: fci.c:128
LPWSTR localfile
Definition: msipriv.h:193
BOOL delete_on_close
Definition: msipriv.h:196
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
LPWSTR FullKeypath
Definition: msipriv.h:515
static void free_feature(MSIFEATURE *feature)
Definition: package.c:53
LPWSTR BaseURL
Definition: msipriv.h:424
#define progid(str)
Definition: exdisp.idl:31
LPWSTR DefInprocHandler32
Definition: msipriv.h:639
#define LIST_ENTRY(type)
Definition: queue.h:175
struct list filepatches
Definition: msipriv.h:395
LPWSTR Argument
Definition: msipriv.h:640
LPWSTR ContentType
Definition: msipriv.h:688
struct list patches
Definition: msipriv.h:391
struct list entry
Definition: msipriv.h:628
Definition: fci.c:126
struct list entry
Definition: fci.c:117

Referenced by MSI_FreePackage().

◆ get_fusion_filename()

static LPWSTR get_fusion_filename ( MSIPACKAGE package)
static

Definition at line 529 of file package.c.

530 {
531  static const WCHAR fusion[] =
532  {'f','u','s','i','o','n','.','d','l','l',0};
533  static const WCHAR subkey[] =
534  {'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\',
535  'N','E','T',' ','F','r','a','m','e','w','o','r','k',' ','S','e','t','u','p','\\','N','D','P',0};
536  static const WCHAR subdir[] =
537  {'M','i','c','r','o','s','o','f','t','.','N','E','T','\\','F','r','a','m','e','w','o','r','k','\\',0};
538  static const WCHAR v2050727[] =
539  {'v','2','.','0','.','5','0','7','2','7',0};
540  static const WCHAR v4client[] =
541  {'v','4','\\','C','l','i','e','n','t',0};
542  static const WCHAR installpath[] =
543  {'I','n','s','t','a','l','l','P','a','t','h',0};
544  HKEY netsetup, hkey;
545  LONG res;
546  DWORD size, len, type;
547  WCHAR windir[MAX_PATH], path[MAX_PATH], *filename = NULL;
548 
549  res = RegOpenKeyExW(HKEY_LOCAL_MACHINE, subkey, 0, KEY_CREATE_SUB_KEY, &netsetup);
550  if (res != ERROR_SUCCESS)
551  return NULL;
552 
553  if (!RegCreateKeyExW(netsetup, v4client, 0, NULL, 0, KEY_QUERY_VALUE, NULL, &hkey, NULL))
554  {
555  size = sizeof(path)/sizeof(path[0]);
556  if (!RegQueryValueExW(hkey, installpath, NULL, &type, (BYTE *)path, &size))
557  {
558  len = strlenW(path) + strlenW(fusion) + 2;
559  if (!(filename = msi_alloc(len * sizeof(WCHAR)))) return NULL;
560 
563  strcatW(filename, fusion);
565  {
566  TRACE( "found %s\n", debugstr_w(filename) );
567  RegCloseKey(hkey);
568  RegCloseKey(netsetup);
569  return filename;
570  }
571  }
572  RegCloseKey(hkey);
573  }
574 
575  if (!RegCreateKeyExW(netsetup, v2050727, 0, NULL, 0, KEY_QUERY_VALUE, NULL, &hkey, NULL))
576  {
577  RegCloseKey(hkey);
579  len = strlenW(windir) + strlenW(subdir) + strlenW(v2050727) + strlenW(fusion) + 3;
580  if (!(filename = msi_alloc(len * sizeof(WCHAR)))) return NULL;
581 
582  strcpyW(filename, windir);
584  strcatW(filename, subdir);
585  strcatW(filename, v2050727);
587  strcatW(filename, fusion);
589  {
590  TRACE( "found %s\n", debugstr_w(filename) );
591  RegCloseKey(netsetup);
592  return filename;
593  }
594  }
595 
596  RegCloseKey(netsetup);
597  return filename;
598 }
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
#define ERROR_SUCCESS
Definition: deptool.c:10
GLsizei const GLchar ** path
Definition: glext.h:7234
const char * filename
Definition: ioapi.h:135
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:1091
UINT WINAPI GetWindowsDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2351
long LONG
Definition: pedump.c:60
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
Definition: fileinfo.c:652
#define debugstr_w
Definition: kernel32.h:32
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4120
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:34
unsigned long DWORD
Definition: ntddk_ex.h:95
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23
GLenum GLsizei len
Definition: glext.h:6722
unsigned char BYTE
Definition: xxhash.c:193
WINE_UNICODE_INLINE WCHAR * strcpyW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:219
#define KEY_QUERY_VALUE
Definition: nt_native.h:1016
WINE_UNICODE_INLINE WCHAR * strcatW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:242
#define NULL
Definition: types.h:112
static const WCHAR szBackSlash[]
Definition: msipriv.h:1111
GLuint res
Definition: glext.h:9613
static void * msi_alloc(size_t len) __WINE_ALLOC_SIZE(1)
Definition: msipriv.h:1204
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3356
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define KEY_CREATE_SUB_KEY
Definition: nt_native.h:1018
#define RegCloseKey(hKey)
Definition: registry.h:40
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

Referenced by set_msi_assembly_prop().

◆ get_internal_error_message()

static LPCWSTR get_internal_error_message ( int  error)
static

Definition at line 1842 of file package.c.

1843 {
1844  int i = 0;
1845 
1846  while (internal_errors[i].id != 0)
1847  {
1848  if (internal_errors[i].id == error)
1849  return internal_errors[i].text;
1850  i++;
1851  }
1852 
1853  FIXME("missing error message %d\n", error);
1854  return NULL;
1855 }
#define error(str)
Definition: mkdosfs.c:1605
#define FIXME(fmt,...)
Definition: debug.h:111
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
#define NULL
Definition: types.h:112
static const struct @488 internal_errors[]

Referenced by MSI_ProcessMessage().

◆ get_local_package()

static UINT get_local_package ( const WCHAR filename,
WCHAR localfile 
)
static

Definition at line 1389 of file package.c.

1390 {
1391  WCHAR *product_code, *package_code;
1392  MSIDATABASE *db;
1393  UINT r;
1394 
1396  {
1398  return ERROR_FILE_NOT_FOUND;
1399  return r;
1400  }
1401  if (!(product_code = get_product_code( db )))
1402  {
1403  msiobj_release( &db->hdr );
1405  }
1406  if (!(package_code = get_package_code( db )))
1407  {
1408  msi_free( product_code );
1409  msiobj_release( &db->hdr );
1411  }
1412  r = get_registered_local_package( product_code, package_code, localfile );
1413  msi_free( package_code );
1414  msi_free( product_code );
1415  msiobj_release( &db->hdr );
1416  return r;
1417 }
#define MSIDBOPEN_READONLY
Definition: msiquery.h:66
#define ERROR_SUCCESS
Definition: deptool.c:10
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
UINT MSI_OpenDatabaseW(LPCWSTR szDBPath, LPCWSTR szPersist, MSIDATABASE **pdb)
Definition: database.c:149
static WCHAR * get_package_code(MSIDATABASE *db)
Definition: package.c:1368
const char * filename
Definition: ioapi.h:135
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
Definition: fileinfo.c:652
static WCHAR * get_product_code(MSIDATABASE *db)
Definition: package.c:1293
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
#define ERROR_INSTALL_PACKAGE_INVALID
Definition: winerror.h:978
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
static UINT get_registered_local_package(const WCHAR *product, const WCHAR *package, WCHAR *localfile)
Definition: package.c:1324
unsigned int UINT
Definition: ndis.h:50
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
MSIOBJECTHDR hdr
Definition: msipriv.h:97

Referenced by MSI_OpenPackageW().

◆ get_package_code()

static WCHAR* get_package_code ( MSIDATABASE db)
static

Definition at line 1368 of file package.c.

1369 {
1370  WCHAR *ret;
1371  MSISUMMARYINFO *si;
1372  UINT r;
1373 
1374  r = msi_get_suminfo( db->storage, 0, &si );
1375  if (r != ERROR_SUCCESS)
1376  {
1377  r = msi_get_db_suminfo( db, 0, &si );
1378  if (r != ERROR_SUCCESS)
1379  {
1380  WARN("failed to load summary info %u\n", r);
1381  return NULL;
1382  }
1383  }
1385  msiobj_release( &si->hdr );
1386  return ret;
1387 }
LPWSTR msi_suminfo_dup_string(MSISUMMARYINFO *si, UINT uiProperty) DECLSPEC_HIDDEN
Definition: suminfo.c:681
UINT msi_get_db_suminfo(MSIDATABASE *db, UINT uiUpdateCount, MSISUMMARYINFO **si) DECLSPEC_HIDDEN
Definition: suminfo.c:487
#define ERROR_SUCCESS
Definition: deptool.c:10
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define WARN(fmt,...)
Definition: debug.h:112
#define PID_REVNUMBER
Definition: suminfo.c:51
UINT msi_get_suminfo(IStorage *stg, UINT uiUpdateCount, MSISUMMARYINFO **si) DECLSPEC_HIDDEN
Definition: suminfo.c:457
__wchar_t WCHAR
Definition: xmlstorage.h:180
MSIOBJECTHDR hdr
Definition: msipriv.h:463
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
int ret
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
IStorage * storage
Definition: msipriv.h:98

Referenced by get_local_package().

◆ get_product_code()

static WCHAR* get_product_code ( MSIDATABASE db)
static

Definition at line 1293 of file package.c.

1294 {
1295  static const WCHAR query[] = {
1296  'S','E','L','E','C','T',' ','`','V','a','l','u','e','`',' ',
1297  'F','R','O','M',' ','`','P','r','o','p','e','r','t','y','`',' ',
1298  'W','H','E','R','E',' ','`','P','r','o','p','e','r','t','y','`','=',
1299  '\'','P','r','o','d','u','c','t','C','o','d','e','\'',0};
1300  MSIQUERY *view;
1301  MSIRECORD *rec;
1302  WCHAR *ret = NULL;
1303 
1305  {
1306  return NULL;
1307  }
1308  if (MSI_ViewExecute( view, 0 ) != ERROR_SUCCESS)
1309  {
1310  MSI_ViewClose( view );
1311  msiobj_release( &view->hdr );
1312  return NULL;
1313  }
1314  if (MSI_ViewFetch( view, &rec ) == ERROR_SUCCESS)
1315  {
1316  ret = strdupW( MSI_RecordGetString( rec, 1 ) );
1317  msiobj_release( &rec->hdr );
1318  }
1319  MSI_ViewClose( view );
1320  msiobj_release( &view->hdr );
1321  return ret;
1322 }
#define ERROR_SUCCESS
Definition: deptool.c:10
static WCHAR * strdupW(const WCHAR *src)
Definition: main.c:92
MSIOBJECTHDR hdr
Definition: msipriv.h:141
UINT MSI_ViewExecute(MSIQUERY *, MSIRECORD *) DECLSPEC_HIDDEN
Definition: msiquery.c:443
UINT MSI_ViewFetch(MSIQUERY *, MSIRECORD **) DECLSPEC_HIDDEN
Definition: msiquery.c:364
const WCHAR * MSI_RecordGetString(const MSIRECORD *, UINT) DECLSPEC_HIDDEN
Definition: record.c:482
UINT MSI_ViewClose(MSIQUERY *) DECLSPEC_HIDDEN
Definition: msiquery.c:412
__wchar_t WCHAR
Definition: xmlstorage.h:180
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
int ret
#define NULL
Definition: types.h:112
static IOleDocumentView * view
Definition: activex.c:1749
UINT MSI_DatabaseOpenViewW(MSIDATABASE *, LPCWSTR, MSIQUERY **) DECLSPEC_HIDDEN
Definition: msiquery.c:111

Referenced by get_local_package().

◆ get_registered_local_package()

static UINT get_registered_local_package ( const WCHAR product,
const WCHAR package,
WCHAR localfile 
)
static

Definition at line 1324 of file package.c.

1325 {
1327  HKEY product_key, props_key;
1328  WCHAR *registered_package = NULL, unsquashed[GUID_SIZE];
1329  UINT r;
1330 
1331  r = msi_locate_product( product, &context );
1332  if (r != ERROR_SUCCESS)
1333  return r;
1334 
1335  r = MSIREG_OpenProductKey( product, NULL, context, &product_key, FALSE );
1336  if (r != ERROR_SUCCESS)
1337  return r;
1338 
1339  r = MSIREG_OpenInstallProps( product, context, NULL, &props_key, FALSE );
1340  if (r != ERROR_SUCCESS)
1341  {
1342  RegCloseKey( product_key );
1343  return r;
1344  }
1346  registered_package = msi_reg_get_val_str( product_key, INSTALLPROPERTY_PACKAGECODEW );
1347  if (!registered_package)
1348  goto done;
1349 
1350  unsquash_guid( registered_package, unsquashed );
1351  if (!strcmpiW( package, unsquashed ))
1352  {
1354  if (!filename)
1355  goto done;
1356 
1357  strcpyW( localfile, filename );
1358  msi_free( filename );
1359  r = ERROR_SUCCESS;
1360  }
1361 done:
1362  msi_free( registered_package );
1363  RegCloseKey( props_key );
1364  RegCloseKey( product_key );
1365  return r;
1366 }
#define ERROR_SUCCESS
Definition: deptool.c:10
enum tagMSIINSTALLCONTEXT MSIINSTALLCONTEXT
Definition: action.c:41
LPWSTR msi_reg_get_val_str(HKEY hkey, LPCWSTR name) DECLSPEC_HIDDEN
Definition: registry.c:394
Definition: http.c:7251
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
const char * filename
Definition: ioapi.h:135
static const WCHAR INSTALLPROPERTY_LOCALPACKAGEW[]
Definition: msi.h:343
UINT MSIREG_OpenInstallProps(LPCWSTR szProduct, MSIINSTALLCONTEXT dwContext, LPCWSTR szUserSid, HKEY *key, BOOL create) DECLSPEC_HIDDEN
Definition: registry.c:830
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
#define FALSE
Definition: types.h:117
UINT MSIREG_OpenProductKey(LPCWSTR szProduct, LPCWSTR szUserSid, MSIINSTALLCONTEXT context, HKEY *key, BOOL create) DECLSPEC_HIDDEN
Definition: registry.c:492
static const WCHAR INSTALLPROPERTY_PACKAGECODEW[]
Definition: msi.h:285
__wchar_t WCHAR
Definition: xmlstorage.h:180
UINT msi_locate_product(LPCWSTR szProduct, MSIINSTALLCONTEXT *context)
Definition: msi.c:55
_In_opt_ PVOID _In_ ULONG _In_ PVOID context
Definition: wdfdriver.h:113
#define strcmpiW(s1, s2)
Definition: unicode.h:39
WINE_UNICODE_INLINE WCHAR * strcpyW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:219
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
BOOL unsquash_guid(LPCWSTR in, LPWSTR out) DECLSPEC_HIDDEN
Definition: registry.c:192
#define GUID_SIZE
Definition: msipriv.h:710
#define RegCloseKey(hKey)
Definition: registry.h:40

Referenced by get_local_package().

◆ impl_from_IWineMsiRemotePackage()

static msi_remote_package_impl* impl_from_IWineMsiRemotePackage ( IWineMsiRemotePackage iface)
inlinestatic

Definition at line 2531 of file package.c.

2532 {
2533  return CONTAINING_RECORD(iface, msi_remote_package_impl, IWineMsiRemotePackage_iface);
2534 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

Referenced by mrp_AddRef(), mrp_DoAction(), mrp_EnumComponentCosts(), mrp_EvaluateCondition(), mrp_FormatRecord(), mrp_GetActiveDatabase(), mrp_GetComponentState(), mrp_GetFeatureCost(), mrp_GetFeatureState(), mrp_GetLanguage(), mrp_GetMode(), mrp_GetProperty(), mrp_GetSourcePath(), mrp_GetTargetPath(), mrp_ProcessMessage(), mrp_Release(), mrp_Sequence(), mrp_SetComponentState(), mrp_SetFeatureState(), mrp_SetInstallLevel(), mrp_SetMode(), mrp_SetMsiHandle(), mrp_SetProperty(), and mrp_SetTargetPath().

◆ internal_ui_handler()

static INT internal_ui_handler ( MSIPACKAGE package,
INSTALLMESSAGE  eMessageType,
MSIRECORD record,
LPCWSTR  message 
)
static

Definition at line 1732 of file package.c.

1733 {
1734  static const WCHAR szActionData[] = {'A','c','t','i','o','n','D','a','t','a',0};
1735  static const WCHAR szActionText[] = {'A','c','t','i','o','n','T','e','x','t',0};
1736  static const WCHAR szSetProgress[] = {'S','e','t','P','r','o','g','r','e','s','s',0};
1737  static const WCHAR szWindows_Installer[] =
1738  {'W','i','n','d','o','w','s',' ','I','n','s','t','a','l','l','e','r',0};
1739 
1740  if (!package || (package->ui_level & INSTALLUILEVEL_MASK) == INSTALLUILEVEL_NONE)
1741  return 0;
1742 
1743  /* todo: check if message needs additional styles (topmost/foreground/modality?) */
1744 
1745  switch (eMessageType & 0xff000000)
1746  {
1748  case INSTALLMESSAGE_ERROR:
1750  if (package->ui_level & INSTALLUILEVEL_PROGRESSONLY) return 0;
1751  if (!(eMessageType & MB_ICONMASK))
1752  eMessageType |= MB_ICONEXCLAMATION;
1753  return MessageBoxW(gUIhwnd, message, szWindows_Installer, eMessageType & 0x00ffffff);
1755  if (package->ui_level & INSTALLUILEVEL_PROGRESSONLY) return 0;
1756  if (!(eMessageType & MB_ICONMASK))
1757  eMessageType |= MB_ICONASTERISK;
1758  return MessageBoxW(gUIhwnd, message, szWindows_Installer, eMessageType & 0x00ffffff);
1759  case INSTALLMESSAGE_USER:
1760  if (package->ui_level & INSTALLUILEVEL_PROGRESSONLY) return 0;
1761  if (!(eMessageType & MB_ICONMASK))
1762  eMessageType |= MB_USERICON;
1763  return MessageBoxW(gUIhwnd, message, szWindows_Installer, eMessageType & 0x00ffffff);
1764  case INSTALLMESSAGE_INFO:
1769  return 0;
1771  {
1773  INT rc = ACTION_DialogBox(package, dialog);
1774  msi_free(dialog);
1775  return rc;
1776  }
1778  {
1779  LPWSTR deformatted;
1780  MSIRECORD *uirow = MSI_CreateRecord(1);
1781  if (!uirow) return -1;
1782  deformat_string(package, MSI_RecordGetString(record, 2), &deformatted);
1783  MSI_RecordSetStringW(uirow, 1, deformatted);
1784  msi_event_fire(package, szActionText, uirow);
1785 
1786  msi_free(deformatted);
1787  msiobj_release(&uirow->hdr);
1788  return 1;
1789  }
1791  {
1792  MSIRECORD *uirow = MSI_CreateRecord(1);
1793  if (!uirow) return -1;
1794  MSI_RecordSetStringW(uirow, 1, message);
1795  msi_event_fire(package, szActionData, uirow);
1796  msiobj_release(&uirow->hdr);
1797 
1798  if (package->action_progress_increment)
1799  {
1800  uirow = MSI_CreateRecord(2);
1801  if (!uirow) return -1;
1802  MSI_RecordSetInteger(uirow, 1, 2);
1803  MSI_RecordSetInteger(uirow, 2, package->action_progress_increment);
1804  msi_event_fire(package, szSetProgress, uirow);
1805  msiobj_release(&uirow->hdr);
1806  }
1807  return 1;
1808  }
1810  msi_event_fire(package, szSetProgress, record);
1811  return 1;
1813  switch (MSI_RecordGetInteger(record, 1))
1814  {
1815  case 0:
1816  case 1:
1817  /* do nothing */
1818  return 0;
1819  default:
1820  /* fall through */
1821  ;
1822  }
1823  default:
1824  FIXME("internal UI not implemented for message 0x%08x (UI level = %x)\n", eMessageType, package->ui_level);
1825  return 0;
1826  }
1827 }
#define MB_ICONMASK
Definition: winuser.h:813
Definition: tftpd.h:59
UINT MSI_RecordSetStringW(MSIRECORD *, UINT, LPCWSTR) DECLSPEC_HIDDEN
Definition: record.c:649
MSIOBJECTHDR hdr
Definition: msipriv.h:141
INT ACTION_DialogBox(MSIPACKAGE *package, const WCHAR *dialog)
Definition: dialog.c:4504
int32_t INT
Definition: typedefs.h:58
#define MB_ICONEXCLAMATION
Definition: winuser.h:779
UINT MSI_RecordSetInteger(MSIRECORD *, UINT, int) DECLSPEC_HIDDEN
Definition: record.c:328
#define MB_USERICON
Definition: winuser.h:777
#define FIXME(fmt,...)
Definition: debug.h:111
void msi_event_fire(MSIPACKAGE *package, const WCHAR *event, MSIRECORD *rec)
Definition: dialog.c:4438
const WCHAR * MSI_RecordGetString(const MSIRECORD *, UINT) DECLSPEC_HIDDEN
Definition: record.c:482
DWORD deformat_string(MSIPACKAGE *package, const WCHAR *fmt, WCHAR **data)
Definition: format.c:1016
int WINAPI MessageBoxW(_In_opt_ HWND, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_ UINT)
__wchar_t WCHAR
Definition: xmlstorage.h:180
INSTALLUILEVEL ui_level
Definition: msipriv.h:430
static const WCHAR szSetProgress[]
Definition: dialog.c:150
HWND gUIhwnd
Definition: msi_main.c:42
#define MB_ICONASTERISK
Definition: winuser.h:778
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
MSIRECORD * MSI_CreateRecord(UINT) DECLSPEC_HIDDEN
Definition: record.c:79
#define INSTALLUILEVEL_MASK
Definition: msipriv.h:57
int MSI_RecordGetInteger(MSIRECORD *, UINT) DECLSPEC_HIDDEN
Definition: record.c:245
WCHAR * msi_dup_record_field(MSIRECORD *row, INT index) DECLSPEC_HIDDEN
Definition: record.c:1055
static HWND dialog
Definition: gui.c:33
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
UINT action_progress_increment
Definition: msipriv.h:404
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by MSI_ProcessMessageVerbatim().

◆ mrp_AddRef()

static ULONG WINAPI mrp_AddRef ( IWineMsiRemotePackage iface)
static

Definition at line 2550 of file package.c.

2551 {
2553 
2554  return InterlockedIncrement( &This->refs );
2555 }
#define InterlockedIncrement
Definition: armddk.h:53
static msi_remote_package_impl * impl_from_IWineMsiRemotePackage(IWineMsiRemotePackage *iface)
Definition: package.c:2531

◆ mrp_DoAction()

static HRESULT WINAPI mrp_DoAction ( IWineMsiRemotePackage iface,
BSTR  action 
)
static

Definition at line 2627 of file package.c.

2628 {
2630  UINT r = MsiDoActionW(This->package, action);
2631  return HRESULT_FROM_WIN32(r);
2632 }
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
UINT WINAPI MsiDoActionW(MSIHANDLE hInstall, LPCWSTR szAction)
Definition: install.c:64
const WCHAR * action
Definition: action.c:7783
unsigned int UINT
Definition: ndis.h:50
static msi_remote_package_impl * impl_from_IWineMsiRemotePackage(IWineMsiRemotePackage *iface)
Definition: package.c:2531

◆ mrp_EnumComponentCosts()

static HRESULT WINAPI mrp_EnumComponentCosts ( IWineMsiRemotePackage iface,
BSTR  component,
DWORD  index,
INSTALLSTATE  state,
BSTR  drive,
DWORD buflen,
INT cost,
INT temp 
)
static

Definition at line 2752 of file package.c.

2755 {
2757  UINT r = MsiEnumComponentCostsW(This->package, component, index, state, drive, buflen, cost, temp);
2758  return HRESULT_FROM_WIN32(r);
2759 }
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLuint index
Definition: glext.h:6031
static int state
Definition: maze.c:121
static calc_node_t temp
Definition: rpn_ieee.c:38
unsigned int UINT
Definition: ndis.h:50
static msi_remote_package_impl * impl_from_IWineMsiRemotePackage(IWineMsiRemotePackage *iface)
Definition: package.c:2531
UINT WINAPI MsiEnumComponentCostsW(MSIHANDLE handle, LPCWSTR component, DWORD index, INSTALLSTATE state, LPWSTR drive, DWORD *buflen, int *cost, int *temp)
Definition: msi.c:1990

◆ mrp_EvaluateCondition()

static HRESULT WINAPI mrp_EvaluateCondition ( IWineMsiRemotePackage iface,
BSTR  condition 
)
static

Definition at line 2737 of file package.c.

2738 {
2740  UINT r = MsiEvaluateConditionW(This->package, condition);
2741  return HRESULT_FROM_WIN32(r);
2742 }
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
MSICONDITION WINAPI MsiEvaluateConditionW(MSIHANDLE, LPCWSTR)
GLenum condition
Definition: glext.h:9255
unsigned int UINT
Definition: ndis.h:50
static msi_remote_package_impl * impl_from_IWineMsiRemotePackage(IWineMsiRemotePackage *iface)
Definition: package.c:2531

◆ mrp_FormatRecord()

static HRESULT WINAPI mrp_FormatRecord ( IWineMsiRemotePackage iface,
MSIHANDLE  record,
BSTR value 
)
static

Definition at line 2720 of file package.c.

2722 {
2723  DWORD size = 0;
2725  UINT r = MsiFormatRecordW(This->package, record, NULL, &size);
2726  if (r == ERROR_SUCCESS)
2727  {
2729  if (!*value)
2730  return E_OUTOFMEMORY;
2731  size++;
2732  r = MsiFormatRecordW(This->package, record, *value, &size);
2733  }
2734  return HRESULT_FROM_WIN32(r);
2735 }
Definition: pdh_main.c:93
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
#define ERROR_SUCCESS
Definition: deptool.c:10
BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
Definition: oleaut.c:339
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
GLsizeiptr size
Definition: glext.h:5919
unsigned long DWORD
Definition: ntddk_ex.h:95
UINT WINAPI MsiFormatRecordW(MSIHANDLE hInstall, MSIHANDLE hRecord, LPWSTR szResult, LPDWORD sz)
Definition: format.c:901
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
static msi_remote_package_impl * impl_from_IWineMsiRemotePackage(IWineMsiRemotePackage *iface)
Definition: package.c:2531

◆ mrp_GetActiveDatabase()

static HRESULT WINAPI mrp_GetActiveDatabase ( IWineMsiRemotePackage iface,
MSIHANDLE handle 
)
static

Definition at line 2578 of file package.c.

2579 {
2582  HRESULT hr;
2583  MSIHANDLE hdb;
2584 
2585  hr = create_msi_remote_database( NULL, (LPVOID *)&rdb );
2586  if (FAILED(hr) || !rdb)
2587  {
2588  ERR("Failed to create remote database\n");
2589  return hr;
2590  }
2591 
2592  hdb = MsiGetActiveDatabase(This->package);
2593 
2594  hr = IWineMsiRemoteDatabase_SetMsiHandle( rdb, hdb );
2595  if (FAILED(hr))
2596  {
2597  ERR("Failed to set the database handle\n");
2598  return hr;
2599  }
2600 
2602  return S_OK;
2603 }
HRESULT hr
Definition: shlfolder.c:183
HRESULT create_msi_remote_database(IUnknown *pOuter, LPVOID *ppObj)
Definition: database.c:2119
unsigned long MSIHANDLE
Definition: msiserver.idl:25
MSIHANDLE WINAPI MsiGetActiveDatabase(MSIHANDLE hInstall)
Definition: package.c:1699
MSIHANDLE alloc_msi_remote_handle(IUnknown *unk)
Definition: handle.c:133
LONG HRESULT
Definition: typedefs.h:79
#define ERR(fmt,...)
Definition: debug.h:110
#define S_OK
Definition: intsafe.h:52
#define NULL
Definition: types.h:112
static msi_remote_package_impl * impl_from_IWineMsiRemotePackage(IWineMsiRemotePackage *iface)
Definition: package.c:2531

◆ mrp_GetComponentState()

static HRESULT WINAPI mrp_GetComponentState ( IWineMsiRemotePackage iface,
BSTR  component,
INSTALLSTATE installed,
INSTALLSTATE action 
)
static

Definition at line 2691 of file package.c.

2693 {
2695  UINT r = MsiGetComponentStateW(This->package, component, installed, action);
2696  return HRESULT_FROM_WIN32(r);
2697 }
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
UINT WINAPI MsiGetComponentStateW(MSIHANDLE hInstall, LPCWSTR szComponent, INSTALLSTATE *piInstalled, INSTALLSTATE *piAction)
Definition: install.c:1563
const WCHAR * action
Definition: action.c:7783
unsigned int UINT
Definition: ndis.h:50
static msi_remote_package_impl * impl_from_IWineMsiRemotePackage(IWineMsiRemotePackage *iface)
Definition: package.c:2531

◆ mrp_GetFeatureCost()

static HRESULT WINAPI mrp_GetFeatureCost ( IWineMsiRemotePackage iface,
BSTR  feature,
INT  cost_tree,
INSTALLSTATE  state,
INT cost 
)
static

Definition at line 2744 of file package.c.

2746 {
2748  UINT r = MsiGetFeatureCostW(This->package, feature, cost_tree, state, cost);
2749  return HRESULT_FROM_WIN32(r);
2750 }
INTERNETFEATURELIST feature
Definition: misc.c:1719
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
static int state
Definition: maze.c:121
UINT WINAPI MsiGetFeatureCostW(MSIHANDLE hInstall, LPCWSTR szFeature, MSICOSTTREE iCostTree, INSTALLSTATE iState, LPINT piCost)
Definition: install.c:1253
unsigned int UINT
Definition: ndis.h:50
static msi_remote_package_impl * impl_from_IWineMsiRemotePackage(IWineMsiRemotePackage *iface)
Definition: package.c:2531

◆ mrp_GetFeatureState()

static HRESULT WINAPI mrp_GetFeatureState ( IWineMsiRemotePackage iface,
BSTR  feature,
INSTALLSTATE installed,
INSTALLSTATE action 
)
static

Definition at line 2676 of file package.c.

2678 {
2680  UINT r = MsiGetFeatureStateW(This->package, feature, installed, action);
2681  return HRESULT_FROM_WIN32(r);
2682 }
INTERNETFEATURELIST feature
Definition: misc.c:1719
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
UINT WINAPI MsiGetFeatureStateW(MSIHANDLE hInstall, LPCWSTR szFeature, INSTALLSTATE *piInstalled, INSTALLSTATE *piAction)
Definition: install.c:1123
const WCHAR * action
Definition: action.c:7783
unsigned int UINT
Definition: ndis.h:50
static msi_remote_package_impl * impl_from_IWineMsiRemotePackage(IWineMsiRemotePackage *iface)
Definition: package.c:2531

◆ mrp_GetLanguage()

static HRESULT WINAPI mrp_GetLanguage ( IWineMsiRemotePackage iface,
LANGID language 
)
static

Definition at line 2706 of file package.c.

2707 {
2709  *language = MsiGetLanguage(This->package);
2710  return S_OK;
2711 }
#define S_OK
Definition: intsafe.h:52
LANGID WINAPI MsiGetLanguage(MSIHANDLE hInstall)
Definition: install.c:1615
static msi_remote_package_impl * impl_from_IWineMsiRemotePackage(IWineMsiRemotePackage *iface)
Definition: package.c:2531

◆ mrp_GetMode()

static HRESULT WINAPI mrp_GetMode ( IWineMsiRemotePackage iface,
MSIRUNMODE  mode,
BOOL ret 
)
static

Definition at line 2662 of file package.c.

2663 {
2665  *ret = MsiGetMode(This->package, mode);
2666  return S_OK;
2667 }
BOOL WINAPI MsiGetMode(MSIHANDLE hInstall, MSIRUNMODE iRunMode)
Definition: install.c:690
int ret
GLenum mode
Definition: glext.h:6217
#define S_OK
Definition: intsafe.h:52
static msi_remote_package_impl * impl_from_IWineMsiRemotePackage(IWineMsiRemotePackage *iface)
Definition: package.c:2531

◆ mrp_GetProperty()

static HRESULT WINAPI mrp_GetProperty ( IWineMsiRemotePackage iface,
BSTR  property,
BSTR  value,
DWORD size 
)
static

Definition at line 2605 of file package.c.

2606 {
2608  UINT r = MsiGetPropertyW(This->package, property, value, size);
2609  if (r != ERROR_SUCCESS) return HRESULT_FROM_WIN32(r);
2610  return S_OK;
2611 }
Definition: pdh_main.c:93
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
#define ERROR_SUCCESS
Definition: deptool.c:10
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLsizeiptr size
Definition: glext.h:5919
UINT WINAPI MsiGetPropertyW(MSIHANDLE hInstall, LPCWSTR szName, LPWSTR szValueBuf, LPDWORD pchValueBuf)
Definition: package.c:2514
#define S_OK
Definition: intsafe.h:52
unsigned int UINT
Definition: ndis.h:50
static msi_remote_package_impl * impl_from_IWineMsiRemotePackage(IWineMsiRemotePackage *iface)
Definition: package.c:2531

◆ mrp_GetSourcePath()

static HRESULT WINAPI mrp_GetSourcePath ( IWineMsiRemotePackage iface,
BSTR  folder,
BSTR  value,
DWORD size 
)
static

Definition at line 2655 of file package.c.

2656 {
2658  UINT r = MsiGetSourcePathW(This->package, folder, value, size);
2659  return HRESULT_FROM_WIN32(r);
2660 }
Definition: pdh_main.c:93
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
Definition: fci.c:115
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
UINT WINAPI MsiGetSourcePathW(MSIHANDLE hInstall, LPCWSTR szFolder, LPWSTR szPathBuf, LPDWORD pcchPathBuf)
Definition: install.c:506
GLsizeiptr size
Definition: glext.h:5919
unsigned int UINT
Definition: ndis.h:50
static msi_remote_package_impl * impl_from_IWineMsiRemotePackage(IWineMsiRemotePackage *iface)
Definition: package.c:2531

◆ mrp_GetTargetPath()

static HRESULT WINAPI mrp_GetTargetPath ( IWineMsiRemotePackage iface,
BSTR  folder,
BSTR  value,
DWORD size 
)
static

Definition at line 2641 of file package.c.

2642 {
2644  UINT r = MsiGetTargetPathW(This->package, folder, value, size);
2645  return HRESULT_FROM_WIN32(r);
2646 }
Definition: pdh_main.c:93
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
Definition: fci.c:115
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLsizeiptr size
Definition: glext.h:5919
unsigned int UINT
Definition: ndis.h:50
UINT WINAPI MsiGetTargetPathW(MSIHANDLE hInstall, LPCWSTR szFolder, LPWSTR szPathBuf, LPDWORD pcchPathBuf)
Definition: install.c:332
static msi_remote_package_impl * impl_from_IWineMsiRemotePackage(IWineMsiRemotePackage *iface)
Definition: package.c:2531

◆ mrp_ProcessMessage()

static HRESULT WINAPI mrp_ProcessMessage ( IWineMsiRemotePackage iface,
INSTALLMESSAGE  message,
MSIHANDLE  record 
)
static

Definition at line 2620 of file package.c.

2621 {
2623  UINT r = MsiProcessMessage(This->package, message, record);
2624  return HRESULT_FROM_WIN32(r);
2625 }
Definition: tftpd.h:59
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
INT WINAPI MsiProcessMessage(MSIHANDLE hInstall, INSTALLMESSAGE eMessageType, MSIHANDLE hRecord)
Definition: package.c:2059
unsigned int UINT
Definition: ndis.h:50
static msi_remote_package_impl * impl_from_IWineMsiRemotePackage(IWineMsiRemotePackage *iface)
Definition: package.c:2531

◆ mrp_QueryInterface()

static HRESULT WINAPI mrp_QueryInterface ( IWineMsiRemotePackage iface,
REFIID  riid,
LPVOID ppobj 
)
static

Definition at line 2536 of file package.c.

2538 {
2539  if( IsEqualCLSID( riid, &IID_IUnknown ) ||
2540  IsEqualCLSID( riid, &IID_IWineMsiRemotePackage ) )
2541  {
2542  IWineMsiRemotePackage_AddRef( iface );
2543  *ppobj = iface;
2544  return S_OK;
2545  }
2546 
2547  return E_NOINTERFACE;
2548 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:52
#define IsEqualCLSID(rclsid1, rclsid2)
Definition: guiddef.h:96

◆ mrp_Release()

static ULONG WINAPI mrp_Release ( IWineMsiRemotePackage iface)
static

Definition at line 2557 of file package.c.

2558 {
2560  ULONG r;
2561 
2562  r = InterlockedDecrement( &This->refs );
2563  if (r == 0)
2564  {
2565  MsiCloseHandle( This->package );
2566  msi_free( This );
2567  }
2568  return r;
2569 }
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define InterlockedDecrement
Definition: armddk.h:52
UINT WINAPI MsiCloseHandle(MSIHANDLE handle)
Definition: handle.c:270
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
unsigned int ULONG
Definition: retypes.h:1
static msi_remote_package_impl * impl_from_IWineMsiRemotePackage(IWineMsiRemotePackage *iface)
Definition: package.c:2531

◆ mrp_Sequence()

static HRESULT WINAPI mrp_Sequence ( IWineMsiRemotePackage iface,
BSTR  table,
int  sequence 
)
static

Definition at line 2634 of file package.c.

2635 {
2637  UINT r = MsiSequenceW(This->package, table, sequence);
2638  return HRESULT_FROM_WIN32(r);
2639 }
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
static struct externalui_message * sequence
Definition: package.c:8862
UINT WINAPI MsiSequenceW(MSIHANDLE hInstall, LPCWSTR szTable, INT iSequenceMode)
Definition: install.c:136
unsigned int UINT
Definition: ndis.h:50
static msi_remote_package_impl * impl_from_IWineMsiRemotePackage(IWineMsiRemotePackage *iface)
Definition: package.c:2531

◆ mrp_SetComponentState()

static HRESULT WINAPI mrp_SetComponentState ( IWineMsiRemotePackage iface,
BSTR  component,
INSTALLSTATE  state 
)
static

Definition at line 2699 of file package.c.

2700 {
2702  UINT r = MsiSetComponentStateW(This->package, component, state);
2703  return HRESULT_FROM_WIN32(r);
2704 }
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
UINT WINAPI MsiSetComponentStateW(MSIHANDLE hInstall, LPCWSTR szComponent, INSTALLSTATE iState)
Definition: install.c:1515
static int state
Definition: maze.c:121
unsigned int UINT
Definition: ndis.h:50
static msi_remote_package_impl * impl_from_IWineMsiRemotePackage(IWineMsiRemotePackage *iface)
Definition: package.c:2531

◆ mrp_SetFeatureState()

static HRESULT WINAPI mrp_SetFeatureState ( IWineMsiRemotePackage iface,
BSTR  feature,
INSTALLSTATE  state 
)
static

Definition at line 2684 of file package.c.

2685 {
2687  UINT r = MsiSetFeatureStateW(This->package, feature, state);
2688  return HRESULT_FROM_WIN32(r);
2689 }
INTERNETFEATURELIST feature
Definition: misc.c:1719
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
static int state
Definition: maze.c:121
unsigned int UINT
Definition: ndis.h:50
UINT WINAPI MsiSetFeatureStateW(MSIHANDLE hInstall, LPCWSTR szFeature, INSTALLSTATE iState)
Definition: install.c:972
static msi_remote_package_impl * impl_from_IWineMsiRemotePackage(IWineMsiRemotePackage *iface)
Definition: package.c:2531

◆ mrp_SetInstallLevel()

static HRESULT WINAPI mrp_SetInstallLevel ( IWineMsiRemotePackage iface,
int  level 
)
static

Definition at line 2713 of file package.c.

2714 {
2716  UINT r = MsiSetInstallLevel(This->package, level);
2717  return HRESULT_FROM_WIN32(r);
2718 }
GLint level
Definition: gl.h:1546
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
UINT WINAPI MsiSetInstallLevel(MSIHANDLE hInstall, int iInstallLevel)
Definition: install.c:1670
unsigned int UINT
Definition: ndis.h:50
static msi_remote_package_impl * impl_from_IWineMsiRemotePackage(IWineMsiRemotePackage *iface)
Definition: package.c:2531

◆ mrp_SetMode()

static HRESULT WINAPI mrp_SetMode ( IWineMsiRemotePackage iface,
MSIRUNMODE  mode,
BOOL  state 
)
static

Definition at line 2669 of file package.c.

2670 {
2672  UINT r = MsiSetMode(This->package, mode, state);
2673  return HRESULT_FROM_WIN32(r);
2674 }
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
UINT WINAPI MsiSetMode(MSIHANDLE hInstall, MSIRUNMODE iRunMode, BOOL fState)
Definition: install.c:782
static int state
Definition: maze.c:121
GLenum mode
Definition: glext.h:6217
unsigned int UINT
Definition: ndis.h:50
static msi_remote_package_impl * impl_from_IWineMsiRemotePackage(IWineMsiRemotePackage *iface)
Definition: package.c:2531

◆ mrp_SetMsiHandle()

static HRESULT WINAPI mrp_SetMsiHandle ( IWineMsiRemotePackage iface,
MSIHANDLE  handle 
)
static

Definition at line 2571 of file package.c.

2572 {
2574  This->package = handle;
2575  return S_OK;
2576 }
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
Definition: sock.c:82
#define S_OK
Definition: intsafe.h:52
static msi_remote_package_impl * impl_from_IWineMsiRemotePackage(IWineMsiRemotePackage *iface)
Definition: package.c:2531

◆ mrp_SetProperty()

static HRESULT WINAPI mrp_SetProperty ( IWineMsiRemotePackage iface,
BSTR  property,
BSTR  value 
)
static

Definition at line 2613 of file package.c.

2614 {
2616  UINT r = MsiSetPropertyW(This->package, property, value);
2617  return HRESULT_FROM_WIN32(r);
2618 }
UINT WINAPI MsiSetPropertyW(MSIHANDLE hInstall, LPCWSTR szName, LPCWSTR szValue)
Definition: package.c:2218
Definition: pdh_main.c:93
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
unsigned int UINT
Definition: ndis.h:50
static msi_remote_package_impl * impl_from_IWineMsiRemotePackage(IWineMsiRemotePackage *iface)
Definition: package.c:2531

◆ mrp_SetTargetPath()

static HRESULT WINAPI mrp_SetTargetPath ( IWineMsiRemotePackage iface,
BSTR  folder,
BSTR  value 
)
static

Definition at line 2648 of file package.c.

2649 {
2651  UINT r = MsiSetTargetPathW(This->package, folder, value);
2652  return HRESULT_FROM_WIN32(r);
2653 }
Definition: pdh_main.c:93
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
Definition: fci.c:115
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
UINT WINAPI MsiSetTargetPathW(MSIHANDLE hInstall, LPCWSTR szFolder, LPCWSTR szFolderPath)
Definition: install.c:603
unsigned int UINT
Definition: ndis.h:50
static msi_remote_package_impl * impl_from_IWineMsiRemotePackage(IWineMsiRemotePackage *iface)
Definition: package.c:2531

◆ msi_adjust_privilege_properties()

void msi_adjust_privilege_properties ( MSIPACKAGE package)

Definition at line 1046 of file package.c.

1047 {
1048  /* FIXME: this should depend on the user's privileges */
1049  if (msi_get_property_int( package->db, szAllUsers, 0 ) == 2)
1050  {
1051  TRACE("resetting ALLUSERS property from 2 to 1\n");
1052  msi_set_property( package->db, szAllUsers, szOne, -1 );
1053  }
1054  msi_set_property( package->db, szAdminUser, szOne, -1 );
1055 }
int msi_get_property_int(MSIDATABASE *db, LPCWSTR prop, int def)
Definition: package.c:2399
#define TRACE(s)
Definition: solgame.cpp:4
static const WCHAR szAllUsers[]
Definition: msipriv.h:1138
MSIDATABASE * db
Definition: msipriv.h:386
UINT msi_set_property(MSIDATABASE *db, const WCHAR *name, const WCHAR *value, int len)
Definition: package.c:2156
static const WCHAR szAdminUser[]
Definition: msipriv.h:1171
static const WCHAR szOne[]
Definition: msipriv.h:1108

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

◆ msi_alloc_package()

static MSIPACKAGE* msi_alloc_package ( void  )
static

Definition at line 998 of file package.c.

999 {
1000  MSIPACKAGE *package;
1001 
1002  package = alloc_msiobject( MSIHANDLETYPE_PACKAGE, sizeof (MSIPACKAGE),
1003  MSI_FreePackage );
1004  if( package )
1005  {
1006  list_init( &package->components );
1007  list_init( &package->features );
1008  list_init( &package->files );
1009  list_init( &package->filepatches );
1010  list_init( &package->tempfiles );
1011  list_init( &package->folders );
1012  list_init( &package->subscriptions );
1013  list_init( &package->appids );
1014  list_init( &package->classes );
1015  list_init( &package->mimes );
1016  list_init( &package->extensions );
1017  list_init( &package->progids );
1018  list_init( &package->RunningActions );
1019  list_init( &package->sourcelist_info );
1020  list_init( &package->sourcelist_media );
1021  list_init( &package->patches );
1022  list_init( &package->binaries );
1023  list_init( &package->cabinet_streams );
1024  }
1025 
1026  return package;
1027 }
struct list RunningActions
Definition: msipriv.h:422
struct list folders
Definition: msipriv.h:397
struct list files
Definition: msipriv.h:394
struct list tempfiles
Definition: msipriv.h:396
struct list sourcelist_info
Definition: msipriv.h:441
struct list sourcelist_media
Definition: msipriv.h:442
struct list binaries
Definition: msipriv.h:398
struct list mimes
Definition: msipriv.h:412
struct list features
Definition: msipriv.h:393
struct list classes
Definition: msipriv.h:409
struct list appids
Definition: msipriv.h:413
struct list progids
Definition: msipriv.h:411
struct list components
Definition: msipriv.h:392
struct list extensions
Definition: msipriv.h:410
struct list cabinet_streams
Definition: msipriv.h:399
struct list subscriptions
Definition: msipriv.h:439
__WINE_SERVER_LIST_INLINE void list_init(struct list *list)
Definition: list.h:149
struct list filepatches
Definition: msipriv.h:395
struct list patches
Definition: msipriv.h:391

◆ msi_clone_properties()

UINT msi_clone_properties ( MSIDATABASE db)

Definition at line 377 of file package.c.

378 {
379  static const WCHAR query_select[] = {
380  'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
381  '`','P','r','o','p','e','r','t','y','`',0};
382  static const WCHAR query_insert[] = {
383  'I','N','S','E','R','T',' ','I','N','T','O',' ',
384  '`','_','P','r','o','p','e','r','t','y','`',' ',
385  '(','`','_','P','r','o','p','e','r','t','y','`',',','`','V','a','l','u','e','`',')',' ',
386  'V','A','L','U','E','S',' ','(','?',',','?',')',0};
387  static const WCHAR query_update[] = {
388  'U','P','D','A','T','E',' ','`','_','P','r','o','p','e','r','t','y','`',' ',
389  'S','E','T',' ','`','V','a','l','u','e','`',' ','=',' ','?',' ',
390  'W','H','E','R','E',' ','`','_','P','r','o','p','e','r','t','y','`',' ','=',' ','?',0};
391  MSIQUERY *view_select;
392  UINT rc;
393 
394  rc = MSI_DatabaseOpenViewW( db, query_select, &view_select );
395  if (rc != ERROR_SUCCESS)
396  return rc;
397 
398  rc = MSI_ViewExecute( view_select, 0 );
399  if (rc != ERROR_SUCCESS)
400  {
401  MSI_ViewClose( view_select );
402  msiobj_release( &view_select->hdr );
403  return rc;
404  }
405 
406  while (1)
407  {
408  MSIQUERY *view_insert, *view_update;
409  MSIRECORD *rec_select;
410 
411  rc = MSI_ViewFetch( view_select, &rec_select );
412  if (rc != ERROR_SUCCESS)
413  break;
414 
415  rc = MSI_DatabaseOpenViewW( db, query_insert, &view_insert );
416  if (rc != ERROR_SUCCESS)
417  {
418  msiobj_release( &rec_select->hdr );
419  continue;
420  }
421 
422  rc = MSI_ViewExecute( view_insert, rec_select );
423  MSI_ViewClose( view_insert );
424  msiobj_release( &view_insert->hdr );
425  if (rc != ERROR_SUCCESS)
426  {
427  MSIRECORD *rec_update;
428 
429  TRACE("insert failed, trying update\n");
430 
431  rc = MSI_DatabaseOpenViewW( db, query_update, &view_update );
432  if (rc != ERROR_SUCCESS)
433  {
434  WARN("open view failed %u\n", rc);
435  msiobj_release( &rec_select->hdr );
436  continue;
437  }
438 
439  rec_update = MSI_CreateRecord( 2 );
440  MSI_RecordCopyField( rec_select, 1, rec_update, 2 );
441  MSI_RecordCopyField( rec_select, 2, rec_update, 1 );
442  rc = MSI_ViewExecute( view_update, rec_update );
443  if (rc != ERROR_SUCCESS)
444  WARN("update failed %u\n", rc);
445 
446  MSI_ViewClose( view_update );
447  msiobj_release( &view_update->hdr );
448  msiobj_release( &rec_update->hdr );
449  }
450 
451  msiobj_release( &rec_select->hdr );
452  }
453 
454  MSI_ViewClose( view_select );
455  msiobj_release( &view_select->hdr );
456  return rc;
457 }
UINT MSI_RecordCopyField(MSIRECORD *, UINT, MSIRECORD *, UINT) DECLSPEC_HIDDEN
Definition: record.c:169
#define ERROR_SUCCESS
Definition: deptool.c:10
MSIOBJECTHDR hdr
Definition: msipriv.h:141
#define WARN(fmt,...)
Definition: debug.h:112
UINT MSI_ViewExecute(MSIQUERY *, MSIRECORD *) DECLSPEC_HIDDEN
Definition: msiquery.c:443
UINT MSI_ViewFetch(MSIQUERY *, MSIRECORD **) DECLSPEC_HIDDEN
Definition: msiquery.c:364
UINT MSI_ViewClose(MSIQUERY *) DECLSPEC_HIDDEN
Definition: msiquery.c:412
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
MSIOBJECTHDR hdr
Definition: msipriv.h:118
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
MSIRECORD * MSI_CreateRecord(UINT) DECLSPEC_HIDDEN
Definition: record.c:79
unsigned int UINT
Definition: ndis.h:50
UINT MSI_DatabaseOpenViewW(MSIDATABASE *, LPCWSTR, MSIQUERY **) DECLSPEC_HIDDEN
Definition: msiquery.c:111

Referenced by MSI_CreatePackage(), and msi_table_apply_transform().

◆ msi_create_empty_local_file()

UINT msi_create_empty_local_file ( LPWSTR  path,
LPCWSTR  suffix 
)

Definition at line 1143 of file package.c.

1144 {
1145  static const WCHAR szInstaller[] = {
1146  '\\','I','n','s','t','a','l','l','e','r','\\',0};
1147  static const WCHAR fmt[] = {'%','x',0};
1148  DWORD time, len, i, offset;
1149  HANDLE handle;
1150 
1151  time = GetTickCount();
1153  strcatW( path, szInstaller );
1155 
1156  len = strlenW(path);
1157  for (i = 0; i < 0x10000; i++)
1158  {
1159  offset = snprintfW( path + len, MAX_PATH - len, fmt, (time + i) & 0xffff );
1160  memcpy( path + len + offset, suffix, (strlenW( suffix ) + 1) * sizeof(WCHAR) );
1164  {
1166  break;
1167  }
1168  if (GetLastError() != ERROR_FILE_EXISTS &&
1170  return ERROR_FUNCTION_FAILED;
1171  }
1172 
1173  return ERROR_SUCCESS;
1174 }
BOOL WINAPI CreateDirectoryW(IN LPCWSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
Definition: dir.c:90
#define ERROR_FILE_EXISTS
Definition: winerror.h:165
#define CloseHandle
Definition: compat.h:598
#define snprintfW
Definition: unicode.h:60
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
#define ERROR_SUCCESS
Definition: deptool.c:10
DWORD WINAPI GetTickCount(VOID)
Definition: time.c:455
#define INVALID_HANDLE_VALUE
Definition: compat.h:590
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1040
__u16 time
Definition: mkdosfs.c:366
UINT WINAPI GetWindowsDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2351
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
Definition: sock.c:82
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
#define GENERIC_WRITE
Definition: nt_native.h:90
__wchar_t WCHAR
Definition: xmlstorage.h:180
GLintptr offset
Definition: glext.h:5920
#define MAX_PATH
Definition: compat.h:34
unsigned long DWORD
Definition: ntddk_ex.h:95
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:137
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
#define ERROR_SHARING_VIOLATION
Definition: winerror.h:135
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
WINE_UNICODE_INLINE WCHAR * strcatW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:242
#define NULL
Definition: types.h:112
#define CreateFileW
Definition: compat.h:600
#define CREATE_NEW
Definition: disk.h:69
Definition: dsound.c:943

Referenced by msi_apply_patch_package(), and MSI_OpenPackageW().

◆ MSI_CreatePackage()

MSIPACKAGE* MSI_CreatePackage ( MSIDATABASE db,
LPCWSTR  base_url 
)

Definition at line 1057 of file package.c.

1058 {
1059  static const WCHAR fmtW[] = {'%','u',0};
1060  MSIPACKAGE *package;
1061  WCHAR uilevel[11];
1062  int len;
1063  UINT r;
1064 
1065  TRACE("%p\n", db);
1066 
1067  package = msi_alloc_package();
1068  if (package)
1069  {
1070  msiobj_addref( &db->hdr );
1071  package->db = db;
1072 
1073  package->LastAction = NULL;
1074  package->LastActionTemplate = NULL;
1076  package->WordCount = 0;
1077  package->PackagePath = strdupW( db->path );
1078  package->BaseURL = strdupW( base_url );
1079 
1080  create_temp_property_table( package );
1081  msi_clone_properties( package->db );
1083 
1084  package->ProductCode = msi_dup_property( package->db, szProductCode );
1085 
1086  set_installer_properties( package );
1087 
1088  package->ui_level = gUILevel;
1089  len = sprintfW( uilevel, fmtW, gUILevel & INSTALLUILEVEL_MASK );
1090  msi_set_property( package->db, szUILevel, uilevel, len );
1091 
1092  r = msi_load_suminfo_properties( package );
1093  if (r != ERROR_SUCCESS)
1094  {
1095  msiobj_release( &package->hdr );
1096  return NULL;
1097  }
1098 
1100  msi_load_admin_properties( package );
1101 
1102  package->log_file = INVALID_HANDLE_VALUE;
1103  }
1104  return package;
1105 }
void msiobj_addref(MSIOBJECTHDR *info)
Definition: handle.c:218
LPWSTR ProductCode
Definition: msipriv.h:426
#define ERROR_SUCCESS
Definition: deptool.c:10
MSIOBJECTHDR hdr
Definition: msipriv.h:385
UINT LastActionResult
Definition: msipriv.h:403
static WCHAR * strdupW(const WCHAR *src)
Definition: main.c:92
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
LPWSTR PackagePath
Definition: msipriv.h:425
HANDLE log_file
Definition: msipriv.h:405
LPWSTR LastAction
Definition: msipriv.h:401
#define INVALID_HANDLE_VALUE
Definition: compat.h:590
#define MSI_NULL_INTEGER
Definition: msiquery.h:32
INSTALLUILEVEL gUILevel
Definition: msi_main.c:41
void msi_adjust_privilege_properties(MSIPACKAGE *package)
Definition: package.c:1046
LPWSTR path
Definition: msipriv.h:101
static UINT msi_load_admin_properties(MSIPACKAGE *package)
Definition: package.c:1029
UINT WordCount
Definition: msipriv.h:436
LPWSTR msi_dup_property(MSIDATABASE *db, LPCWSTR prop)
Definition: package.c:2377
#define TRACE(s)
Definition: solgame.cpp:4
LPWSTR LastActionTemplate
Definition: msipriv.h:402
static const WCHAR szProductCode[]
Definition: msipriv.h:1127
__wchar_t WCHAR
Definition: xmlstorage.h:180
INSTALLUILEVEL ui_level
Definition: msipriv.h:430
MSIDATABASE * db
Definition: msipriv.h:386
UINT msi_clone_properties(MSIDATABASE *db)
Definition: package.c:377
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
static VOID set_installer_properties(MSIPACKAGE *package)
Definition: package.c:661
#define INSTALLUILEVEL_MASK
Definition: msipriv.h:57
GLenum GLsizei len
Definition: glext.h:6722
UINT msi_set_property(MSIDATABASE *db, const WCHAR *name, const WCHAR *value, int len)
Definition: package.c:2156
#define sprintfW
Definition: unicode.h:58
const char * base_url
Definition: mimeole.c:1466
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
LPWSTR BaseURL
Definition: msipriv.h:424
static UINT create_temp_property_table(MSIPACKAGE *package)
Definition: package.c:352
MSIOBJECTHDR hdr
Definition: msipriv.h:97
static const WCHAR szUILevel[]
Definition: msipriv.h:1140
UINT msi_load_suminfo_properties(MSIPACKAGE *package) DECLSPEC_HIDDEN
Definition: suminfo.c:1190

◆ msi_download_file()

UINT msi_download_file ( LPCWSTR  szUrl,
LPWSTR  filename 
)

Definition at line 1107 of file package.c.

1108 {
1110  DWORD size = 0;
1111  HRESULT hr;
1112 
1113  /* call will always fail, because size is 0,
1114  * but will return ERROR_FILE_NOT_FOUND first
1115  * if the file doesn't exist
1116  */
1117  GetUrlCacheEntryInfoW( szUrl, NULL, &size );
1119  {
1120  cache_entry = msi_alloc( size );
1121  if ( !GetUrlCacheEntryInfoW( szUrl, cache_entry, &size ) )
1122  {
1123  UINT error = GetLastError();
1124  msi_free( cache_entry );
1125  return error;
1126  }
1127 
1128  lstrcpyW( filename, cache_entry->lpszLocalFileName );
1129  msi_free( cache_entry );
1130  return ERROR_SUCCESS;
1131  }
1132 
1134  if ( FAILED(hr) )
1135  {
1136  WARN("failed to download %s to cache file\n", debugstr_w(szUrl));
1137  return ERROR_FUNCTION_FAILED;
1138  }
1139 
1140  return ERROR_SUCCESS;
1141 }
#define ERROR_SUCCESS
Definition: deptool.c:10
HRESULT hr
Definition: shlfolder.c:183
#define error(str)
Definition: mkdosfs.c:1605
#define WARN(fmt,...)
Definition: debug.h:112
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1040
Definition: svc_auth_des.c:77
const char * filename
Definition: ioapi.h:135
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
#define debugstr_w
Definition: kernel32.h:32
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
GLsizeiptr size
Definition: glext.h:5919
LONG HRESULT
Definition: typedefs.h:79
#define MAX_PATH
Definition: compat.h:34
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL WINAPI GetUrlCacheEntryInfoW(LPCWSTR lpszUrl, LPINTERNET_CACHE_ENTRY_INFOW lpCacheEntryInfo, LPDWORD lpdwCacheEntryInfoBufferSize)
Definition: urlcache.c:2012
#define lstrcpyW
Definition: compat.h:608
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
static void * msi_alloc(size_t len) __WINE_ALLOC_SIZE(1)
Definition: msipriv.h:1204
HRESULT WINAPI URLDownloadToCacheFileW(LPUNKNOWN lpUnkCaller, LPCWSTR szURL, LPWSTR szFileName, DWORD dwBufLength, DWORD dwReserved, LPBINDSTATUSCALLBACK pBSC)
Definition: umon.c:853
Definition: wininet.h:2127

Referenced by MSI_OpenPackageW(), and ready_media().

◆ msi_dup_property()

LPWSTR msi_dup_property ( MSIDATABASE db,
LPCWSTR  prop 
)

Definition at line 2377 of file package.c.

2378 {
2379  DWORD sz = 0;
2380  LPWSTR str;
2381  UINT r;
2382 
2383  r = msi_get_property(db, prop, NULL, &sz);
2384  if (r != ERROR_SUCCESS && r != ERROR_MORE_DATA)
2385  return NULL;
2386 
2387  sz++;
2388  str = msi_alloc(sz * sizeof(WCHAR));
2389  r = msi_get_property(db, prop, str, &sz);
2390  if (r != ERROR_SUCCESS)
2391  {
2392  msi_free(str);
2393  str = NULL;
2394  }
2395 
2396  return str;
2397 }
#define ERROR_SUCCESS
Definition: deptool.c:10
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
const WCHAR * str
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
UINT msi_get_property(MSIDATABASE *db, LPCWSTR szName, LPWSTR szValueBuf, LPDWORD pchValueBuf)
Definition: package.c:2343
#define ERROR_MORE_DATA
Definition: dderror.h:13
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
static void * msi_alloc(size_t len) __WINE_ALLOC_SIZE(1)
Definition: msipriv.h:1204
WCHAR * LPWSTR
Definition: xmlstorage.h:184

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_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_free_action_script()

void msi_free_action_script ( MSIPACKAGE package,
UINT  script 
)

Definition at line 129 of file package.c.

130 {
131  UINT i;
132  for (i = 0; i < package->script_actions_count[script]; i++)
133  msi_free( package->script_actions[script][i] );
134 
135  msi_free( package->script_actions[script] );
136  package->script_actions[script] = NULL;
137  package->script_actions_count[script] = 0;
138 }
script
Definition: msipriv.h:374
LPWSTR * script_actions[SCRIPT_MAX]
Definition: msipriv.h:415
int script_actions_count[SCRIPT_MAX]
Definition: msipriv.h:416
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
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227

Referenced by execute_script(), and free_package_structures().

◆ MSI_FreePackage()

static void MSI_FreePackage ( MSIOBJECTHDR arg)
static

Definition at line 334 of file package.c.

335 {
336  MSIPACKAGE *package = (MSIPACKAGE *)arg;
337 
338  msi_destroy_assembly_caches( package );
339 
340  if( package->dialog )
341  msi_dialog_destroy( package->dialog );
342 
343  msiobj_release( &package->db->hdr );
344  free_package_structures(package);
345  CloseHandle( package->log_file );
346 
347  if (package->delete_on_close) DeleteFileW( package->localfile );
348  msi_free( package->localfile );
350 }
#define CloseHandle
Definition: compat.h:598
void msi_dialog_destroy(msi_dialog *dialog)
Definition: dialog.c:4057
static void free_package_structures(MSIPACKAGE *package)
Definition: package.c:140
INT MSI_ProcessMessage(MSIPACKAGE *package, INSTALLMESSAGE eMessageType, MSIRECORD *record)
Definition: package.c:1953
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
Definition: delete.c:39
void msi_destroy_assembly_caches(MSIPACKAGE *package)
Definition: assembly.c:103
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
#define NULL
Definition: types.h:112
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227

◆ msi_get_error_message()

LPWSTR msi_get_error_message ( MSIDATABASE db,
int  error 
)

Definition at line 1858 of file package.c.

1859 {
1860  static const WCHAR query[] =
1861  {'S','E','L','E','C','T',' ','`','M','e','s','s','a','g','e','`',' ',
1862  'F','R','O','M',' ','`','E','r','r','o','r','`',' ','W','H','E','R','E',' ',
1863  '`','E','r','r','o','r','`',' ','=',' ','%','i',0};
1864  MSIRECORD *record;
1865  LPWSTR ret = NULL;
1866 
1867  if ((record = MSI_QueryGetRecord(db, query, error)))
1868  {
1870  msiobj_release(&record->hdr);
1871  }
1872  else if (error < 2000)
1873  {
1875  if (len)
1876  {
1877  ret = msi_alloc((len + 1) * sizeof(WCHAR));
1879  }
1880  else
1881  ret = NULL;
1882  }
1883 
1884  return ret;
1885 }
#define error(str)
Definition: mkdosfs.c:1605
#define IDS_ERROR_BASE
Definition: resource.h:31
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
__wchar_t WCHAR
Definition: xmlstorage.h:180
MSIRECORD * MSI_QueryGetRecord(MSIDATABASE *db, LPCWSTR query,...) DECLSPEC_HIDDEN
Definition: msiquery.c:206
HINSTANCE msi_hInstance
Definition: msi_main.c:51
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
int ret
GLenum GLsizei len
Definition: glext.h:6722
WCHAR * msi_dup_record_field(MSIRECORD *row, INT index) DECLSPEC_HIDDEN
Definition: record.c:1055
#define NULL
Definition: types.h:112
static void * msi_alloc(size_t len) __WINE_ALLOC_SIZE(1)
Definition: msipriv.h:1204
WCHAR * LPWSTR
Definition: xmlstorage.h:184

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

◆ msi_get_property()

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

Definition at line 2343 of file package.c.

2345 {
2346  MSIRECORD *row;
2348 
2349  TRACE("%p %s %p %p\n", db, debugstr_w(szName), szValueBuf, pchValueBuf);
2350 
2351  row = msi_get_property_row( db, szName );
2352 
2353  if (*pchValueBuf > 0)
2354  szValueBuf[0] = 0;
2355 
2356  if (row)
2357  {
2358  rc = MSI_RecordGetStringW(row, 1, szValueBuf, pchValueBuf);
2359  msiobj_release(&row->hdr);
2360  }
2361 
2362  if (rc == ERROR_SUCCESS)
2363  TRACE("returning %s for property %s\n", debugstr_wn(szValueBuf, *pchValueBuf),
2364  debugstr_w(szName));
2365  else if (rc == ERROR_MORE_DATA)
2366  TRACE("need %d sized buffer for %s\n", *pchValueBuf,
2367  debugstr_w(szName));
2368  else
2369  {
2370  *pchValueBuf = 0;
2371  TRACE("property %s not found\n", debugstr_w(szName));
2372  }
2373 
2374  return rc;
2375 }
#define ERROR_SUCCESS
Definition: deptool.c:10
UINT MSI_RecordGetStringW(MSIRECORD *, UINT, LPWSTR, LPDWORD) DECLSPEC_HIDDEN
Definition: record.c:487
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
#define debugstr_w
Definition: kernel32.h:32
#define TRACE(s)
Definition: solgame.cpp:4
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
#define ERROR_MORE_DATA
Definition: dderror.h:13
#define debugstr_wn
Definition: kernel32.h:33
unsigned int UINT
Definition: ndis.h:50
static const WCHAR szName[]
Definition: msipriv.h:1194
static MSIRECORD * msi_get_property_row(MSIDATABASE *db, LPCWSTR name)
Definition: package.c:2269
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

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

int msi_get_property_int ( MSIDATABASE db,
LPCWSTR  prop,
int  def 
)

Definition at line 2399 of file package.c.

2400 {
2401  LPWSTR str = msi_dup_property( db, prop );
2402  int val = str ? atoiW(str) : def;
2403  msi_free(str);
2404  return val;
2405 }
const WCHAR * str
LPWSTR msi_dup_property(MSIDATABASE *db, LPCWSTR prop)
Definition: package.c:2377
GLuint GLfloat * val
Definition: glext.h:7180
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
WCHAR * LPWSTR
Definition: xmlstorage.h:184
WINE_UNICODE_INLINE int atoiW(const WCHAR *str)
Definition: unicode.h:315

Referenced by ACTION_AllocateRegistrySpace(), ACTION_CostFinalize(), ACTION_FindRelatedProducts(), ACTION_InstallFiles(), ACTION_MigrateFeatureStates(), get_root_key(), is_obsoleted_by_patch(), msi_adjust_privilege_properties(), msi_dialog_adjust_dialog_pos(), MSI_InstallPackage(), msi_publish_install_properties(), msi_publish_product_properties(), msi_set_context(), MSI_SetFeatureStates(), MsiEnumComponentCostsW(), MsiGetLanguage(), and MsiGetMode().

◆ msi_get_property_row()

static MSIRECORD* msi_get_property_row ( MSIDATABASE db,
LPCWSTR  name 
)
static

Definition at line 2269 of file package.c.

2270 {
2271  static const WCHAR query[]= {
2272  'S','E','L','E','C','T',' ','`','V','a','l','u','e','`',' ',
2273  'F','R','O','M',' ' ,'`','_','P','r','o','p','e','r','t','y','`',' ',
2274  'W','H','E','R','E',' ' ,'`','_','P','r','o','p','e','r','t','y','`','=','?',0};
2275  MSIRECORD *rec, *row = NULL;
2276  MSIQUERY *view;
2277  UINT r;
2278 
2279  static const WCHAR szDate[] = {'D','a','t','e',0};
2280  static const WCHAR szTime[] = {'T','i','m','e',0};
2281  WCHAR *buffer;
2282  int length;
2283 
2284  if (!name || !*name)
2285  return NULL;
2286 
2287  if (!strcmpW(name, szDate))
2288  {
2290  if (!length)
2291  return NULL;
2292  buffer = msi_alloc(length * sizeof(WCHAR));
2294 
2295  row = MSI_CreateRecord(1);
2296  if (!row)
2297  {
2298  msi_free(buffer);
2299  return NULL;
2300  }
2302  msi_free(buffer);
2303  return row;
2304  }
2305  else if (!strcmpW(name, szTime))
2306  {
2308  if (!length)
2309  return NULL;
2310  buffer = msi_alloc(length * sizeof(WCHAR));
2312 
2313  row = MSI_CreateRecord(1);
2314  if (!row)
2315  {
2316  msi_free(buffer);
2317  return NULL;
2318  }
2320  msi_free(buffer);
2321  return row;
2322  }
2323 
2324  rec = MSI_CreateRecord(1);
2325  if (!rec)
2326  return NULL;
2327 
2328  MSI_RecordSetStringW(rec, 1, name);
2329 
2330  r = MSI_DatabaseOpenViewW(db, query, &view);
2331  if (r == ERROR_SUCCESS)
2332  {
2333  MSI_ViewExecute(view, rec);
2334  MSI_ViewFetch(view, &row);
2336  msiobj_release(&view->hdr);
2337  }
2338  msiobj_release(&rec->hdr);
2339  return row;
2340 }
UINT MSI_RecordSetStringW(MSIRECORD *, UINT, LPCWSTR) DECLSPEC_HIDDEN
Definition: record.c:649
#define ERROR_SUCCESS
Definition: deptool.c:10
TCHAR szTime[64]
Definition: solitaire.cpp:19
MSIOBJECTHDR hdr
Definition: msipriv.h:141
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define LOCALE_USER_DEFAULT
#define DATE_SHORTDATE
Definition: winnls.h:196
UINT MSI_ViewExecute(MSIQUERY *, MSIRECORD *) DECLSPEC_HIDDEN
Definition: msiquery.c:443
GLuint buffer
Definition: glext.h:5915
UINT MSI_ViewFetch(MSIQUERY *, MSIRECORD **) DECLSPEC_HIDDEN
Definition: msiquery.c:364
GLenum GLuint GLenum GLsizei length
Definition: glext.h:5579
UINT MSI_ViewClose(MSIQUERY *) DECLSPEC_HIDDEN
Definition: msiquery.c:412
__wchar_t WCHAR
Definition: xmlstorage.h:180
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
MSIRECORD * MSI_CreateRecord(UINT) DECLSPEC_HIDDEN
Definition: record.c:79
INT WINAPI GetDateFormatW(LCID lcid, DWORD dwFlags, const SYSTEMTIME *lpTime, LPCWSTR lpFormat, LPWSTR lpDateStr, INT cchOut)
Definition: lcformat.c:979
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
Definition: name.c:38
WINE_UNICODE_INLINE int strcmpW(const WCHAR *str1, const WCHAR *str2)
Definition: unicode.h:229
static void * msi_alloc(size_t len) __WINE_ALLOC_SIZE(1)
Definition: msipriv.h:1204
static IOleDocumentView * view
Definition: activex.c:1749
INT WINAPI GetTimeFormatW(LCID lcid, DWORD dwFlags, const SYSTEMTIME *lpTime, LPCWSTR lpFormat, LPWSTR lpTimeStr, INT cchOut)
Definition: lcformat.c:1079
#define TIME_NOTIMEMARKER
Definition: winnls.h:279
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
UINT MSI_DatabaseOpenViewW(MSIDATABASE *, LPCWSTR, MSIQUERY **) DECLSPEC_HIDDEN
Definition: msiquery.c:111

Referenced by msi_get_property(), and MSI_GetProperty().

◆ MSI_GetProperty()

static UINT MSI_GetProperty ( MSIHANDLE  handle,
LPCWSTR  name,
awstring szValueBuf,
LPDWORD  pchValueBuf 
)
static

Definition at line 2407 of file package.c.

2409 {
2410  MSIPACKAGE *package;
2411  MSIRECORD *row = NULL;
2413  LPCWSTR val = NULL;
2414  DWORD len = 0;
2415 
2416  TRACE("%u %s %p %p\n", handle, debugstr_w(name),
2417  szValueBuf->str.w, pchValueBuf );
2418 
2419  if (!name)
2420  return ERROR_INVALID_PARAMETER;
2421 
2422  package = msihandle2msiinfo( handle, MSIHANDLETYPE_PACKAGE );
2423  if (!package)
2424  {
2425  HRESULT hr;
2426  IWineMsiRemotePackage *remote_package;
2427  LPWSTR value = NULL;
2428  BSTR bname;
2429 
2430  remote_package = (IWineMsiRemotePackage *)msi_get_remote( handle );
2431  if (!remote_package)
2432  return ERROR_INVALID_HANDLE;
2433 
2434  bname = SysAllocString( name );
2435  if (!bname)
2436  {
2437  IWineMsiRemotePackage_Release( remote_package );
2438  return ERROR_OUTOFMEMORY;
2439  }
2440 
2441  hr = IWineMsiRemotePackage_GetProperty( remote_package, bname, NULL, &len );
2442  if (FAILED(hr))
2443  goto done;
2444 
2445  len++;
2446  value = msi_alloc(len * sizeof(WCHAR));
2447  if (!value)
2448  {
2449  r = ERROR_OUTOFMEMORY;
2450  goto done;
2451  }
2452 
2453  hr = IWineMsiRemotePackage_GetProperty( remote_package, bname, value, &len );
2454  if (FAILED(hr))
2455  goto done;
2456 
2457  r = msi_strcpy_to_awstring( value, len, szValueBuf, pchValueBuf );
2458 
2459  /* Bug required by Adobe installers */
2460  if (!szValueBuf->unicode && !szValueBuf->str.a)
2461  *pchValueBuf *= sizeof(WCHAR);
2462 
2463 done:
2464  IWineMsiRemotePackage_Release(remote_package);
2465  SysFreeString(bname);
2466  msi_free(value);
2467 
2468  if (FAILED(hr))
2469  {
2471  return HRESULT_CODE(hr);
2472 
2473  return ERROR_FUNCTION_FAILED;
2474  }
2475 
2476  return r;
2477  }
2478 
2479  row = msi_get_property_row( package->db, name );
2480  if (row)
2481  val = msi_record_get_string( row, 1, (int *)&len );
2482 
2483  if (!val)
2484  val = szEmpty;
2485 
2486  r = msi_strcpy_to_awstring( val, len, szValueBuf, pchValueBuf );
2487 
2488  if (row)
2489  msiobj_release( &row->hdr );
2490  msiobj_release( &package->hdr );
2491 
2492  return r;
2493 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
Definition: pdh_main.c:93
HRESULT hr
Definition: shlfolder.c:183
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
MSIOBJECTHDR hdr
Definition: msipriv.h:385
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
OLECHAR * BSTR
Definition: compat.h:2152
LPWSTR w
Definition: msipriv.h:720
UINT msi_strcpy_to_awstring(const WCHAR *str, int len, awstring *awbuf, DWORD *sz)
Definition: install.c:181
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
#define HRESULT_FACILITY(hr)
Definition: winerror.h:79
#define debugstr_w
Definition: kernel32.h:32
LPSTR a
Definition: msipriv.h:719
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
GLuint GLfloat * val
Definition: glext.h:7180
static const WCHAR szEmpty[]
Definition: provider.c:50
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:79
unsigned long DWORD
Definition: ntddk_ex.h:95
MSIDATABASE * db
Definition: msipriv.h:386
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
GLenum GLsizei len
Definition: glext.h:6722
const WCHAR * msi_record_get_string(const MSIRECORD *, UINT, int *) DECLSPEC_HIDDEN
Definition: record.c:469
#define FACILITY_WIN32
Definition: winerror.h:27
BOOL unicode
Definition: msipriv.h:717
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:271
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
#define HRESULT_CODE(hr)
Definition: winerror.h:76
Definition: name.c:38
static void * msi_alloc(size_t len) __WINE_ALLOC_SIZE(1)
Definition: msipriv.h:1204
union awstring::@486 str
IUnknown * msi_get_remote(MSIHANDLE handle)
Definition: handle.c:182
static MSIRECORD * msi_get_property_row(MSIDATABASE *db, LPCWSTR name)
Definition: package.c:2269
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13
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

Referenced by MsiGetPropertyA(), and MsiGetPropertyW().

◆ msi_load_admin_properties()

static UINT msi_load_admin_properties ( MSIPACKAGE package)
static

Definition at line 1029 of file package.c.

1030 {
1031  BYTE *data;
1032  UINT r, sz;
1033 
1034  static const WCHAR stmname[] = {'A','d','m','i','n','P','r','o','p','e','r','t','i','e','s',0};
1035 
1036  r = read_stream_data(package->db->storage, stmname, FALSE, &data, &sz);
1037  if (r != ERROR_SUCCESS)
1038  return r;
1039 
1040  r = msi_parse_command_line(package, (WCHAR *)data, TRUE);
1041 
1042  msi_free(data);
1043  return r;
1044 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define TRUE
Definition: types.h:120
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
UINT msi_parse_command_line(MSIPACKAGE *package, LPCWSTR szCommandLine, BOOL preserve_case)
Definition: action.c:328
#define FALSE
Definition: types.h:117
__wchar_t WCHAR
Definition: xmlstorage.h:180
MSIDATABASE * db
Definition: msipriv.h:386
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
unsigned char BYTE
Definition: xxhash.c:193
unsigned int UINT
Definition: ndis.h:50
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
IStorage * storage
Definition: msipriv.h:98
static HRESULT read_stream_data(nsChannelBSC *This, IStream *stream)
Definition: navigate.c:960

Referenced by MSI_CreatePackage().

◆ MSI_OpenPackageW()

UINT MSI_OpenPackageW ( LPCWSTR  szPackage,
MSIPACKAGE **  pPackage 
)

Definition at line 1441 of file package.c.

1442 {
1443  static const WCHAR dotmsi[] = {'.','m','s','i',0};
1444  MSIDATABASE *db;
1445  MSIPACKAGE *package;
1446  MSIHANDLE handle;
1447  MSIRECORD *data_row, *info_row;
1448  LPWSTR ptr, base_url = NULL;
1449  UINT r;
1450  WCHAR localfile[MAX_PATH], cachefile[MAX_PATH];
1451  LPCWSTR file = szPackage;
1452  DWORD index = 0;
1453  MSISUMMARYINFO *si;
1454  BOOL delete_on_close = FALSE;
1455  LPWSTR productname;
1456  WCHAR *info_template;
1457 
1458  TRACE("%s %p\n", debugstr_w(szPackage), pPackage);
1459 
1461 
1462  localfile[0] = 0;
1463  if( szPackage[0] == '#' )
1464  {
1465  handle = atoiW(&szPackage[1]);
1467  if( !db )
1468  {
1469  IWineMsiRemoteDatabase *remote_database;
1470 
1471  remote_database = (IWineMsiRemoteDatabase *)msi_get_remote( handle );
1472  if ( !remote_database )
1473  return ERROR_INVALID_HANDLE;
1474 
1475  IWineMsiRemoteDatabase_Release( remote_database );
1476  WARN("MsiOpenPackage not allowed during a custom action!\n");
1477 
1478  return ERROR_FUNCTION_FAILED;
1479  }
1480  }
1481  else
1482  {
1483  if ( UrlIsW( szPackage, URLIS_URL ) )
1484  {
1485  r = msi_download_file( szPackage, cachefile );
1486  if (r != ERROR_SUCCESS)
1487  return r;
1488 
1489  file = cachefile;
1490 
1491  base_url = strdupW( szPackage );
1492  if (!base_url)
1493  return ERROR_OUTOFMEMORY;
1494 
1495  ptr = strrchrW( base_url, '/' );
1496  if (ptr) *(ptr + 1) = '\0';
1497  }
1498  r = get_local_package( file, localfile );
1499  if (r != ERROR_SUCCESS || GetFileAttributesW( localfile ) == INVALID_FILE_ATTRIBUTES)
1500  {
1501  DWORD localfile_attr;
1502 
1503  r = msi_create_empty_local_file( localfile, dotmsi );
1504  if (r != ERROR_SUCCESS)
1505  {
1506  msi_free ( base_url );
1507  return r;
1508  }
1509 
1510  if (!CopyFileW( file, localfile, FALSE ))
1511  {
1512  r = GetLastError();
1513  WARN("unable to copy package %s to %s (%u)\n", debugstr_w(file), debugstr_w(localfile), r);
1514  DeleteFileW( localfile );
1515  msi_free ( base_url );
1516  return r;
1517  }
1518  delete_on_close = TRUE;
1519 
1520  /* Remove read-only bit, we are opening it with write access in MSI_OpenDatabaseW below. */
1521  localfile_attr = GetFileAttributesW( localfile );
1522  if (localfile_attr & FILE_ATTRIBUTE_READONLY)
1523  SetFileAttributesW( localfile, localfile_attr & ~FILE_ATTRIBUTE_READONLY);
1524  }
1525  TRACE("opening package %s\n", debugstr_w( localfile ));
1526  r = MSI_OpenDatabaseW( localfile, MSIDBOPEN_TRANSACT, &db );
1527  if (r != ERROR_SUCCESS)
1528  {
1529  msi_free ( base_url );
1530  return r;
1531  }
1532  }
1533  package = MSI_CreatePackage( db, base_url );
1534  msi_free( base_url );
1535  msiobj_release( &db->hdr );
1536  if (!package) return ERROR_INSTALL_PACKAGE_INVALID;
1537  package->localfile = strdupW( localfile );
1538  package->delete_on_close = delete_on_close;
1539 
1540  r = msi_get_suminfo( db->storage, 0, &si );
1541  if (r != ERROR_SUCCESS)
1542  {
1543  r = msi_get_db_suminfo( db, 0, &si );
1544  if (r != ERROR_SUCCESS)
1545  {
1546  WARN("failed to load summary info\n");
1547  msiobj_release( &package->hdr );
1549  }
1550  }
1551  r = parse_suminfo( si, package );
1552  msiobj_release( &si->hdr );
1553  if (r != ERROR_SUCCESS)
1554  {
1555  WARN("failed to parse summary info %u\n", r);
1556  msiobj_release( &package->hdr );
1557  return r;
1558  }
1559  r = validate_package( package );
1560  if (r != ERROR_SUCCESS)
1561  {
1562  msiobj_release( &package->hdr );
1563  return r;
1564  }
1565  msi_set_property( package->db, szDatabase, db->path, -1 );
1566  set_installed_prop( package );
1567  msi_set_context( package );
1568 
1569  while (1)
1570  {
1571  WCHAR patch_code[GUID_SIZE];
1572  r = MsiEnumPatchesExW( package->ProductCode, NULL, package->Context,
1573  MSIPATCHSTATE_APPLIED, index, patch_code, NULL, NULL, NULL, NULL );
1574  if (r != ERROR_SUCCESS)
1575  break;
1576 
1577  TRACE("found registered patch %s\n", debugstr_w(patch_code));
1578 
1579  r = msi_apply_registered_patch( package, patch_code );
1580  if (r != ERROR_SUCCESS)
1581  {
1582  ERR("registered patch failed to apply %u\n", r);
1583  msiobj_release( &package->hdr );
1584  return r;
1585  }
1586  index++;
1587  }
1588  if (index) msi_adjust_privilege_properties( package );
1589 
1590  r = msi_set_original_database_property( package->db, szPackage );
1591  if (r != ERROR_SUCCESS)
1592  {
1593  msiobj_release( &package->hdr );
1594  return r;
1595  }
1596  if (gszLogFile)
1599 
1600  /* FIXME: when should these messages be sent? */
1601  data_row = MSI_CreateRecord(3);
1602  if (!data_row)
1603  return ERROR_OUTOFMEMORY;
1604  MSI_RecordSetStringW(data_row, 0, NULL);
1605  MSI_RecordSetInteger(data_row, 1, 0);
1606  MSI_RecordSetInteger(data_row, 2, package->num_langids ? package->langids[0] : 0);
1609 
1610  info_row = MSI_CreateRecord(0);
1611  if (!info_row)
1612  {
1613  msiobj_release(&data_row->hdr);
1614  return ERROR_OUTOFMEMORY;
1615  }
1616  info_template = msi_get_error_message(package->db, MSIERR_INFO_LOGGINGSTART);
1617  MSI_RecordSetStringW(info_row, 0, info_template);
1618  msi_free(info_template);
1620 
1621  MSI_ProcessMessage(package, INSTALLMESSAGE_COMMONDATA, data_row);
1622 
1623  productname = msi_dup_property(package->db, INSTALLPROPERTY_PRODUCTNAMEW);
1624  MSI_RecordSetInteger(data_row, 1, 1);
1625  MSI_RecordSetStringW(data_row, 2, productname);
1626  MSI_RecordSetStringW(data_row, 3, NULL);
1627  MSI_ProcessMessage(package, INSTALLMESSAGE_COMMONDATA, data_row);
1628 
1629  msi_free(productname);
1630  msiobj_release(&info_row->hdr);
1631  msiobj_release(&data_row->hdr);
1632 
1633  *pPackage = package;
1634  return ERROR_SUCCESS;
1635 }
BOOL WINAPI SetFileAttributesW(LPCWSTR lpFileName, DWORD dwFileAttributes)
Definition: fileinfo.c:794
LPWSTR ProductCode
Definition: msipriv.h:426
#define MB_ICONHAND
Definition: winuser.h:782
UINT msi_get_db_suminfo(MSIDATABASE *db, UINT uiUpdateCount, MSISUMMARYINFO **si) DECLSPEC_HIDDEN
Definition: suminfo.c:487
UINT MSI_RecordSetStringW(MSIRECORD *, UINT, LPCWSTR) DECLSPEC_HIDDEN
Definition: record.c:649
UINT msi_apply_registered_patch(MSIPACKAGE *package, LPCWSTR patch_code) DECLSPEC_HIDDEN
Definition: patch.c:1029
static UINT get_local_package(const WCHAR *filename, WCHAR *localfile)
Definition: package.c:1389
#define ERROR_SUCCESS
Definition: deptool.c:10
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
MSIOBJECTHDR hdr
Definition: msipriv.h:385
#define TRUE
Definition: types.h:120
static WCHAR * strdupW(const WCHAR *src)
Definition: main.c:92
MSIOBJECTHDR hdr
Definition: msipriv.h:141
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
UINT MSI_OpenDatabaseW(LPCWSTR szDBPath, LPCWSTR szPersist, MSIDATABASE **pdb)
Definition: database.c:149
#define WARN(fmt,...)
Definition: debug.h:112
HANDLE log_file
Definition: msipriv.h:405
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
UINT WINAPI MsiEnumPatchesExW(LPCWSTR szProductCode, LPCWSTR szUserSid, DWORD dwContext, DWORD dwFilter, DWORD dwIndex, LPWSTR szPatchCode, LPWSTR szTargetProductCode, MSIINSTALLCONTEXT *pdwTargetProductContext, LPWSTR szTargetUserSid, LPDWORD pcchTargetUserSid)
Definition: registry.c:2118
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1040
UINT msi_set_context(MSIPACKAGE *package)
Definition: action.c:483
#define FILE_SHARE_WRITE
Definition: nt_native.h:681
#define MSIHANDLETYPE_DATABASE
Definition: msipriv.h:699
unsigned long MSIHANDLE
Definition: msiserver.idl:25
void msi_adjust_privilege_properties(MSIPACKAGE *package)
Definition: package.c:1046
UINT MSI_RecordSetInteger(MSIRECORD *, UINT, int) DECLSPEC_HIDDEN
Definition: record.c:328
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
Definition: sock.c:82
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
LPWSTR path
Definition: msipriv.h:101
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
string_table * strings
Definition: msipriv.h:99
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
Definition: fileinfo.c:652
#define GENERIC_WRITE
Definition: nt_native.h:90
INT MSI_ProcessMessage(MSIPACKAGE *package, INSTALLMESSAGE eMessageType, MSIRECORD *record)
Definition: package.c:1953
#define debugstr_w
Definition: kernel32.h:32
static PVOID ptr
Definition: dispmode.c:27
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
Definition: delete.c:39
UINT msi_get_suminfo(IStorage *stg, UINT uiUpdateCount, MSISUMMARYINFO **si) DECLSPEC_HIDDEN
Definition: suminfo.c:457
GLuint index
Definition: glext.h:6031
#define OPEN_EXISTING
Definition: compat.h:634
LPWSTR msi_dup_property(MSIDATABASE *db, LPCWSTR prop)
Definition: package.c:2377
UINT msi_download_file(LPCWSTR szUrl, LPWSTR filename)
Definition: package.c:1107
#define TRACE(s)
Definition: solgame.cpp:4
#define ERROR_INSTALL_PACKAGE_INVALID
Definition: winerror.h:978
#define MSIERR_INFO_LOGGINGSTART
Definition: resource.h:24
__wchar_t WCHAR
Definition: xmlstorage.h:180
BOOL WINAPI CopyFileW(IN LPCWSTR lpExistingFileName, IN LPCWSTR lpNewFileName, IN BOOL bFailIfExists)
Definition: copy.c:439
LPWSTR localfile
Definition: msipriv.h:427
#define MAX_PATH
Definition: compat.h:34
#define FILE_ATTRIBUTE_READONLY
Definition: nt_native.h:702
UINT msi_create_empty_local_file(LPWSTR path, LPCWSTR suffix)
Definition: package.c:1143
unsigned long DWORD
Definition: ntddk_ex.h:95
WCHAR * gszLogFile
Definition: msi_main.c:50
#define MSIDBOPEN_TRANSACT
Definition: msiquery.h:67
MSIDATABASE * db
Definition: msipriv.h:386
static UINT validate_package(MSIPACKAGE *package)
Definition: package.c:1254
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23
LANGID * langids
Definition: msipriv.h:390
MSIOBJECTHDR hdr
Definition: msipriv.h:463
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
MSIRECORD * MSI_CreateRecord(UINT) DECLSPEC_HIDDEN
Definition: record.c:79
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:137
BOOL WINAPI UrlIsW(LPCWSTR pszUrl, URLIS Urlis)
Definition: url.c:1933
static const WCHAR INSTALLPROPERTY_PRODUCTNAMEW[]
Definition: msi.h:277
INT MSI_ProcessMessageVerbatim(MSIPACKAGE *package, INSTALLMESSAGE eMessageType, MSIRECORD *record)
Definition: package.c:1887
WINE_UNICODE_INLINE WCHAR * strrchrW(const WCHAR *str, WCHAR ch)
Definition: unicode.h:254
static const WCHAR szDatabase[]
Definition: msipriv.h:1183
#define ERR(fmt,...)
Definition: debug.h:110
UINT num_langids
Definition: msipriv.h:389
UINT msi_set_property(MSIDATABASE *db, const WCHAR *name, const WCHAR *value, int len)
Definition: package.c:2156
static UINT parse_suminfo(MSISUMMARYINFO *si, MSIPACKAGE *package)
Definition: package.c:1185
const char * base_url
Definition: mimeole.c:1466
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
LPWSTR msi_get_error_message(MSIDATABASE *db, int error)
Definition: package.c:1858
UINT Context
Definition: msipriv.h:437
#define CreateFileW
Definition: compat.h:600
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
UINT msi_set_original_database_property(MSIDATABASE *db, const WCHAR *package)
Definition: package.c:1419
IUnknown * msi_get_remote(MSIHANDLE handle)
Definition: handle.c:182
IStorage * storage
Definition: msipriv.h:98
WCHAR * LPWSTR
Definition: xmlstorage.h:184
void * msihandle2msiinfo(MSIHANDLE handle, UINT type)
Definition: handle.c:157
#define GUID_SIZE
Definition: msipriv.h:710
BOOL delete_on_close
Definition: msipriv.h:428
static UINT set_installed_prop(MSIPACKAGE *package)
Definition: package.c:465
MSIOBJECTHDR hdr
Definition: msipriv.h:97
UINT msi_get_string_table_codepage(const string_table *st) DECLSPEC_HIDDEN
Definition: string.c:675
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13
WINE_UNICODE_INLINE int atoiW(const WCHAR *str)
Definition: unicode.h:315
Definition: fci.c:126

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

◆ msi_package_add_info()

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

Definition at line 2807 of file package.c.

2809 {
2811 
2813  {
2814  if (!strcmpW( info->value, value )) return ERROR_SUCCESS;
2815  }
2816 
2817  info = msi_alloc(sizeof(MSISOURCELISTINFO));
2818  if (!info)
2819  return ERROR_OUTOFMEMORY;
2820 
2821  info->context = context;
2822  info->options = options;
2823  info->property = property;
2824  info->value = strdupW(value);
2825  list_add_head(&package->sourcelist_info, &info->entry);
2826 
2827  return ERROR_SUCCESS;
2828 }
Definition: pdh_main.c:93
#define ERROR_SUCCESS
Definition: deptool.c:10
static WCHAR * strdupW(const WCHAR *src)
Definition: main.c:92
__WINE_SERVER_LIST_INLINE void list_add_head(struct list *list, struct list *elem)
Definition: list.h:96
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
struct list sourcelist_info
Definition: msipriv.h:441
int options
Definition: main.c:106
_In_opt_ PVOID _In_ ULONG _In_ PVOID context
Definition: wdfdriver.h:113
struct _test_info info[]
Definition: SetCursorPos.c:19
uint32_t entry
Definition: isohybrid.c:63
WINE_UNICODE_INLINE int strcmpW(const WCHAR *str1, const WCHAR *str2)
Definition: unicode.h:229
static void * msi_alloc(size_t len) __WINE_ALLOC_SIZE(1)
Definition: msipriv.h:1204
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13

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

2832 {
2833  MSIMEDIADISK *disk;
2834 
2836  {
2837  if (disk->disk_id == disk_id) return ERROR_SUCCESS;
2838  }
2839 
2840  disk = msi_alloc(sizeof(MSIMEDIADISK));
2841  if (!disk)
2842  return ERROR_OUTOFMEMORY;
2843 
2844  disk->context = context;
2845  disk->options = options;
2846  disk->disk_id = disk_id;
2848  disk->disk_prompt = strdupW(disk_prompt);
2849  list_add_head(&package->sourcelist_media, &disk->entry);
2850 
2851  return ERROR_SUCCESS;
2852 }
DWORD disk_id
Definition: msipriv.h:160
#define ERROR_SUCCESS
Definition: deptool.c:10
static WCHAR * strdupW(const WCHAR *src)
Definition: main.c:92
__WINE_SERVER_LIST_INLINE void list_add_head(struct list *list, struct list *elem)
Definition: list.h:96
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
struct list sourcelist_media
Definition: msipriv.h:442
int options
Definition: main.c:106
DWORD context
Definition: msipriv.h:158
DWORD options
Definition: msipriv.h:159
_In_opt_ PVOID _In_ ULONG _In_ PVOID context
Definition: wdfdriver.h:113
uint32_t entry
Definition: isohybrid.c:63
LPWSTR disk_prompt
Definition: msipriv.h:162
char volume_label[32]
Definition: cdmake.c:185
struct list entry
Definition: msipriv.h:157
static void * msi_alloc(size_t len) __WINE_ALLOC_SIZE(1)
Definition: msipriv.h:1204
LPWSTR volume_label
Definition: msipriv.h:161
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13

Referenced by msi_load_media_info().

◆ MSI_ProcessMessage()

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

Definition at line 1953 of file package.c.

1954 {
1955  switch (eMessageType & 0xff000000)
1956  {
1958  case INSTALLMESSAGE_ERROR:
1960  case INSTALLMESSAGE_USER:
1961  case INSTALLMESSAGE_INFO:
1964  {
1965  /* error message */
1966 
1967  LPWSTR template;
1968  LPWSTR template_rec = NULL, template_prefix = NULL;
1969  int error = MSI_RecordGetInteger(record, 1);
1970 
1971  if (MSI_RecordIsNull(record, 0))
1972  {
1973  if (error >= 32)
1974  {
1975  template_rec = msi_get_error_message(package->db, error);
1976 
1977  if (!template_rec && error >= 2000)
1978  {
1979  /* internal error, not localized */
1980  if ((template_rec = (LPWSTR) get_internal_error_message(error)))
1981  {
1982  MSI_RecordSetStringW(record, 0, template_rec);
1984  }
1985  template_rec = msi_get_error_message(package->db, MSIERR_INSTALLERROR);
1986  MSI_RecordSetStringW(record, 0, template_rec);
1987  MSI_ProcessMessageVerbatim(package, eMessageType, record);
1988  msi_free(template_rec);
1989  return 0;
1990  }
1991  }
1992  }
1993  else
1994  template_rec = msi_dup_record_field(record, 0);
1995 
1996  template_prefix = msi_get_error_message(package->db, eMessageType >> 24);
1997  if (!template_prefix) template_prefix = strdupW(szEmpty);
1998 
1999  if (!template_rec)
2000  {
2001  /* always returns 0 */
2002  MSI_RecordSetStringW(record, 0, template_prefix);
2003  MSI_ProcessMessageVerbatim(package, eMessageType, record);
2004  msi_free(template_prefix);
2005  return 0;
2006  }
2007 
2008  template = msi_alloc((strlenW(template_rec) + strlenW(template_prefix) + 1) * sizeof(WCHAR));
2009  if (!template) return ERROR_OUTOFMEMORY;
2010 
2011  strcpyW(template, template_prefix);
2012  strcatW(template, template_rec);
2013  MSI_RecordSetStringW(record, 0, template);
2014 
2015  msi_free(template_prefix);
2016  msi_free(template_rec);
2017  msi_free(template);
2018  }
2019  break;
2021  {
2022  WCHAR *template = msi_get_error_message(package->db, MSIERR_ACTIONSTART);
2023  MSI_RecordSetStringW(record, 0, template);
2024  msi_free(template);
2025 
2026  msi_free(package->LastAction);
2027  msi_free(package->LastActionTemplate);
2028  package->LastAction = msi_dup_record_field(record, 1);
2029  if (!package->LastAction) package->LastAction = strdupW(szEmpty);
2031  break;
2032  }
2034  if (package->LastAction && package->LastActionTemplate)
2035  {
2036  static const WCHAR template_s[] =
2037  {'{','{','%','s',':',' ','}','}','%','s',0};
2038  WCHAR *template;
2039 
2040  template = msi_alloc((strlenW(package->LastAction) + strlenW(package->LastActionTemplate) + 7) * sizeof(WCHAR));
2041  if (!template) return ERROR_OUTOFMEMORY;
2042  sprintfW(template, template_s, package->LastAction, package->LastActionTemplate);
2043  MSI_RecordSetStringW(record, 0, template);
2044  msi_free(template);
2045  }
2046  break;
2048  {
2049  WCHAR *template = msi_get_error_message(package->db, MSIERR_COMMONDATA);
2050  MSI_RecordSetStringW(record, 0, template);
2051  msi_free(template);
2052  }
2053  break;
2054  }
2055 
2056  return MSI_ProcessMessageVerbatim(package, eMessageType, record);
2057 }
UINT MSI_RecordSetStringW(MSIRECORD *, UINT, LPCWSTR) DECLSPEC_HIDDEN
Definition: record.c:649
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
#define error(str)
Definition: mkdosfs.c:1605
static WCHAR * strdupW(const WCHAR *src)
Definition: main.c:92
LPWSTR LastAction
Definition: msipriv.h:401
#define MSI_NULL_INTEGER
Definition: msiquery.h:32
static LPCWSTR get_internal_error_message(int error)
Definition: package.c:1842
BOOL MSI_RecordIsNull(MSIRECORD *, UINT) DECLSPEC_HIDDEN
Definition: record.c:369
static const WCHAR szEmpty[]
Definition: provider.c:50
LPWSTR LastActionTemplate
Definition: msipriv.h:402
__wchar_t WCHAR
Definition: xmlstorage.h:180
MSIDATABASE * db
Definition: msipriv.h:386
#define MSIERR_INSTALLERROR
Definition: resource.h:21
INT MSI_ProcessMessageVerbatim(MSIPACKAGE *package, INSTALLMESSAGE eMessageType, MSIRECORD *record)
Definition: package.c:1887
int MSI_RecordGetInteger(MSIRECORD *, UINT) DECLSPEC_HIDDEN
Definition: record.c:245
WINE_UNICODE_INLINE WCHAR * strcpyW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:219
WCHAR * msi_dup_record_field(MSIRECORD *row, INT index) DECLSPEC_HIDDEN
Definition: record.c:1055
#define sprintfW
Definition: unicode.h:58
WINE_UNICODE_INLINE WCHAR * strcatW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:242
#define NULL
Definition: types.h:112
LPWSTR msi_get_error_message(MSIDATABASE *db, int error)
Definition: package.c:1858
#define MSIERR_ACTIONSTART
Definition: resource.h:22
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
static void * msi_alloc(size_t len) __WINE_ALLOC_SIZE(1)
Definition: msipriv.h:1204
#define MSIERR_COMMONDATA
Definition: resource.h:23
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13

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

1888 {
1889  LPWSTR message = {0};
1890  DWORD len;
1891  DWORD log_type = 1 << (eMessageType >> 24);
1892  UINT res;
1893  INT rc = 0;
1894  char *msg;
1895 
1896  TRACE("%x\n", eMessageType);
1897  if (TRACE_ON(msi)) dump_record(record);
1898 
1899  if (!package || !record)
1900  message = NULL;
1901  else {
1902  res = MSI_FormatRecordW(package, record, message, &len);
1903  if (res != ERROR_SUCCESS && res != ERROR_MORE_DATA)
1904  return res;
1905  len++;
1906  message = msi_alloc(len * sizeof(WCHAR));
1907  if (!message) return ERROR_OUTOFMEMORY;
1908  MSI_FormatRecordW(package, record, message, &len);
1909  }
1910 
1911  /* convert it to ASCII */
1912  len = WideCharToMultiByte( CP_ACP, 0, message, -1, NULL, 0, NULL, NULL );
1913  msg = msi_alloc( len );
1915 
1916  if (gUIHandlerRecord && (gUIFilterRecord & log_type))
1917  {
1918  MSIHANDLE rec = alloc_msihandle(&record->hdr);
1919  TRACE("Calling UI handler %p(pvContext=%p, iMessageType=%08x, hRecord=%u)\n",
1920  gUIHandlerRecord, gUIContextRecord, eMessageType, rec);
1921  rc = gUIHandlerRecord( gUIContextRecord, eMessageType, rec );
1922  MsiCloseHandle( rec );
1923  }
1924  if (!rc && gUIHandlerW && (gUIFilter & log_type))
1925  {
1926  TRACE("Calling UI handler %p(pvContext=%p, iMessageType=%08x, szMessage=%s)\n",
1927  gUIHandlerW, gUIContext, eMessageType, debugstr_w(message));
1928  rc = gUIHandlerW( gUIContext, eMessageType, message );
1929  }
1930  else if (!rc && gUIHandlerA && (gUIFilter & log_type))
1931  {
1932  TRACE("Calling UI handler %p(pvContext=%p, iMessageType=%08x, szMessage=%s)\n",
1933  gUIHandlerA, gUIContext, eMessageType, debugstr_a(msg));
1934  rc = gUIHandlerA( gUIContext, eMessageType, msg );
1935  }
1936 
1937  if (!rc)
1938  rc = internal_ui_handler(package, eMessageType, record, message);
1939 
1940  if (!rc && package && package->log_file != INVALID_HANDLE_VALUE &&
1941  (eMessageType & 0xff000000) != INSTALLMESSAGE_PROGRESS)
1942  {
1943  DWORD written;
1944  WriteFile( package->log_file, msg, len - 1, &written, NULL );
1945  WriteFile( package->log_file, "\n", 1, &written, NULL );