ReactOS  0.4.15-dev-4921-g25fcdc5
package.c File Reference
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winreg.h"
#include "winnls.h"
#include "winternl.h"
#include "shlwapi.h"
#include "wingdi.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 "objbase.h"
#include "msidefs.h"
#include "sddl.h"
#include "wine/debug.h"
#include "wine/exception.h"
#include "msipriv.h"
#include "winemsi_s.h"
#include "resource.h"
Include dependency graph for package.c:

Go to the source code of this file.

Classes

struct  tagLANGANDCODEPAGE
 

Macros

#define NONAMELESSUNION
 
#define NONAMELESSSTRUCT
 
#define COBJMACROS
 

Typedefs

typedef struct tagLANGANDCODEPAGE LANGANDCODEPAGE
 

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)
 
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_property (MSIDATABASE *db, const WCHAR *prop)
 
static WCHARget_product_code (MSIDATABASE *db)
 
static WCHARget_product_version (MSIDATABASE *db)
 
static UINT get_registered_local_package (const WCHAR *product, WCHAR *localfile)
 
WCHARmsi_get_package_code (MSIDATABASE *db)
 
static UINT get_local_package (MSIDATABASE *db, WCHAR *localfile)
 
UINT msi_set_original_database_property (MSIDATABASE *db, const WCHAR *package)
 
UINT MSI_OpenPackageW (LPCWSTR szPackage, DWORD dwOptions, MSIPACKAGE **pPackage)
 
UINT WINAPI MsiOpenPackageExW (const WCHAR *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_source_folders (MSIPACKAGE *package)
 
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)
 
UINT WINAPI MsiGetPropertyA (MSIHANDLE hinst, const char *name, char *buf, DWORD *sz)
 
UINT WINAPI MsiGetPropertyW (MSIHANDLE hinst, const WCHAR *name, WCHAR *buf, DWORD *sz)
 
MSIHANDLE __cdecl s_remote_GetActiveDatabase (MSIHANDLE hinst)
 
UINT __cdecl s_remote_GetProperty (MSIHANDLE hinst, LPCWSTR property, LPWSTR *value, DWORD *size)
 
UINT __cdecl s_remote_SetProperty (MSIHANDLE hinst, LPCWSTR property, LPCWSTR value)
 
int __cdecl s_remote_ProcessMessage (MSIHANDLE hinst, INSTALLMESSAGE message, struct wire_record *remote_rec)
 
UINT __cdecl s_remote_DoAction (MSIHANDLE hinst, LPCWSTR action)
 
UINT __cdecl s_remote_Sequence (MSIHANDLE hinst, LPCWSTR table, int sequence)
 
UINT __cdecl s_remote_GetTargetPath (MSIHANDLE hinst, LPCWSTR folder, LPWSTR *value)
 
UINT __cdecl s_remote_SetTargetPath (MSIHANDLE hinst, LPCWSTR folder, LPCWSTR value)
 
UINT __cdecl s_remote_GetSourcePath (MSIHANDLE hinst, LPCWSTR folder, LPWSTR *value)
 
BOOL __cdecl s_remote_GetMode (MSIHANDLE hinst, MSIRUNMODE mode)
 
UINT __cdecl s_remote_SetMode (MSIHANDLE hinst, MSIRUNMODE mode, BOOL state)
 
UINT __cdecl s_remote_GetFeatureState (MSIHANDLE hinst, LPCWSTR feature, INSTALLSTATE *installed, INSTALLSTATE *action)
 
UINT __cdecl s_remote_SetFeatureState (MSIHANDLE hinst, LPCWSTR feature, INSTALLSTATE state)
 
UINT __cdecl s_remote_GetComponentState (MSIHANDLE hinst, LPCWSTR component, INSTALLSTATE *installed, INSTALLSTATE *action)
 
UINT __cdecl s_remote_SetComponentState (MSIHANDLE hinst, LPCWSTR component, INSTALLSTATE state)
 
LANGID __cdecl s_remote_GetLanguage (MSIHANDLE hinst)
 
UINT __cdecl s_remote_SetInstallLevel (MSIHANDLE hinst, int level)
 
UINT __cdecl s_remote_FormatRecord (MSIHANDLE hinst, struct wire_record *remote_rec, LPWSTR *value)
 
MSICONDITION __cdecl s_remote_EvaluateCondition (MSIHANDLE hinst, LPCWSTR condition)
 
UINT __cdecl s_remote_GetFeatureCost (MSIHANDLE hinst, LPCWSTR feature, MSICOSTTREE cost_tree, INSTALLSTATE state, INT *cost)
 
UINT __cdecl s_remote_EnumComponentCosts (MSIHANDLE hinst, LPCWSTR component, DWORD index, INSTALLSTATE state, LPWSTR drive, INT *cost, INT *temp)
 
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

struct {
   int   id
 
   const WCHAR *   text
 
internal_errors []
 

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

Function Documentation

◆ create_temp_property_table()

static UINT create_temp_property_table ( MSIPACKAGE package)
static

Definition at line 366 of file package.c.

367 {
368  MSIQUERY *view;
369  UINT rc;
370 
371  rc = MSI_DatabaseOpenViewW(package->db, L"CREATE TABLE `_Property` ( `_Property` CHAR(56) NOT NULL TEMPORARY, "
372  L"`Value` CHAR(98) NOT NULL TEMPORARY PRIMARY KEY `_Property`) HOLD", &view);
373  if (rc != ERROR_SUCCESS)
374  return rc;
375 
376  rc = MSI_ViewExecute(view, 0);
378  msiobj_release(&view->hdr);
379  return rc;
380 }
#define ERROR_SUCCESS
Definition: deptool.c:10
UINT MSI_ViewExecute(MSIQUERY *, MSIRECORD *) DECLSPEC_HIDDEN
Definition: msiquery.c:502
#define L(x)
Definition: ntvdm.h:50
UINT MSI_ViewClose(MSIQUERY *) DECLSPEC_HIDDEN
Definition: msiquery.c:454
MSIDATABASE * db
Definition: msipriv.h:394
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:241
unsigned int UINT
Definition: ndis.h:50
static IOleDocumentView * view
Definition: activex.c:1749
UINT MSI_DatabaseOpenViewW(MSIDATABASE *, LPCWSTR, MSIQUERY **) DECLSPEC_HIDDEN

Referenced by MSI_CreatePackage().

◆ free_assembly()

static void free_assembly ( MSIASSEMBLY assembly)
static

Definition at line 127 of file package.c.

128 {
129  msi_free( assembly->feature );
131  msi_free( assembly->application );
132  msi_free( assembly->display_name );
133  if (assembly->tempdir) RemoveDirectoryW( assembly->tempdir );
134  msi_free( assembly->tempdir );
135  msi_free( assembly );
136 }
struct file_info manifest
Definition: actctx.c:469
static void msi_free(void *mem)
Definition: msipriv.h:1159
BOOL WINAPI RemoveDirectoryW(IN LPCWSTR lpPathName)
Definition: dir.c:732

Referenced by free_package_structures().

◆ free_extension()

static void free_extension ( MSIEXTENSION ext)
static

Definition at line 107 of file package.c.

108 {
109  struct list *item, *cursor;
110 
111  LIST_FOR_EACH_SAFE( item, cursor, &ext->verbs )
112  {
113  MSIVERB *verb = LIST_ENTRY( item, MSIVERB, entry );
114 
115  list_remove( &verb->entry );
116  msi_free( verb->Verb );
117  msi_free( verb->Command );
118  msi_free( verb->Argument );
119  msi_free( verb );
120  }
121 
122  msi_free( ext->Extension );
123  msi_free( ext->ProgIDText );
124  msi_free( ext );
125 }
LPWSTR Argument
Definition: msipriv.h:705
#define LIST_FOR_EACH_SAFE(cursor, cursor2, list)
Definition: list.h:192
static void msi_free(void *mem)
Definition: msipriv.h:1159
struct list entry
Definition: msipriv.h:701
LPWSTR Command
Definition: msipriv.h:704
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
LPWSTR Verb
Definition: msipriv.h:702
#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 62 of file package.c.

63 {
64  struct list *item, *cursor;
65 
66  LIST_FOR_EACH_SAFE( item, cursor, &feature->Children )
67  {
69  list_remove( &fl->entry );
70  msi_free( fl );
71  }
72 
73  LIST_FOR_EACH_SAFE( item, cursor, &feature->Components )
74  {
76  list_remove( &cl->entry );
77  msi_free( cl );
78  }
79  msi_free( feature->Feature );
80  msi_free( feature->Feature_Parent );
81  msi_free( feature->Directory );
82  msi_free( feature->Description );
83  msi_free( feature->Title );
84  msi_free( feature );
85 }
INTERNETFEATURELIST feature
Definition: misc.c:1719
#define LIST_FOR_EACH_SAFE(cursor, cursor2, list)
Definition: list.h:192
static void msi_free(void *mem)
Definition: msipriv.h:1159
struct list entry
Definition: msipriv.h:553
_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
#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 87 of file package.c.

88 {
89  struct list *item, *cursor;
90 
91  LIST_FOR_EACH_SAFE( item, cursor, &folder->children )
92  {
94  list_remove( &fl->entry );
95  msi_free( fl );
96  }
97  msi_free( folder->Parent );
98  msi_free( folder->Directory );
99  msi_free( folder->TargetDefault );
100  msi_free( folder->SourceLongPath );
101  msi_free( folder->SourceShortPath );
102  msi_free( folder->ResolvedTarget );
103  msi_free( folder->ResolvedSource );
104  msi_free( folder );
105 }
#define LIST_FOR_EACH_SAFE(cursor, cursor2, list)
Definition: list.h:192
Definition: fci.c:115
static void msi_free(void *mem)
Definition: msipriv.h:1159
_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
#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 149 of file package.c.

150 {
151  struct list *item, *cursor;
152  int i;
153 
154  LIST_FOR_EACH_SAFE( item, cursor, &package->features )
155  {
157  list_remove( &feature->entry );
159  }
160 
161  LIST_FOR_EACH_SAFE( item, cursor, &package->folders )
162  {
164  list_remove( &folder->entry );
165  free_folder( folder );
166  }
167 
168  LIST_FOR_EACH_SAFE( item, cursor, &package->files )
169  {
171 
172  list_remove( &file->entry );
173  msi_free( file->File );
174  msi_free( file->FileName );
175  msi_free( file->ShortName );
176  msi_free( file->LongName );
177  msi_free( file->Version );
178  msi_free( file->Language );
179  if (msi_is_global_assembly( file->Component )) DeleteFileW( file->TargetPath );
180  msi_free( file->TargetPath );
181  msi_free( file );
182  }
183 
185  {
187 
188  list_remove( &comp->entry );
189  msi_free( comp->Component );
190  msi_free( comp->ComponentId );
191  msi_free( comp->Directory );
192  msi_free( comp->Condition );
193  msi_free( comp->KeyPath );
194  msi_free( comp->FullKeypath );
195  if (comp->assembly) free_assembly( comp->assembly );
196  msi_free( comp );
197  }
198 
200  {
202 
203  list_remove( &patch->entry );
204  msi_free( patch->path );
205  msi_free( patch );
206  }
207 
208  /* clean up extension, progid, class and verb structures */
209  LIST_FOR_EACH_SAFE( item, cursor, &package->classes )
210  {
211  MSICLASS *cls = LIST_ENTRY( item, MSICLASS, entry );
212 
213  list_remove( &cls->entry );
214  msi_free( cls->clsid );
215  msi_free( cls->Context );
216  msi_free( cls->Description );
217  msi_free( cls->FileTypeMask );
218  msi_free( cls->IconPath );
219  msi_free( cls->DefInprocHandler );
221  msi_free( cls->Argument );
222  msi_free( cls->ProgIDText );
223  msi_free( cls );
224  }
225 
227  {
229 
230  list_remove( &ext->entry );
231  free_extension( ext );
232  }
233 
234  LIST_FOR_EACH_SAFE( item, cursor, &package->progids )
235  {
237 
238  list_remove( &progid->entry );
239  msi_free( progid->ProgID );
240  msi_free( progid->Description );
241  msi_free( progid->IconPath );
242  msi_free( progid );
243  }
244 
245  LIST_FOR_EACH_SAFE( item, cursor, &package->mimes )
246  {
247  MSIMIME *mt = LIST_ENTRY( item, MSIMIME, entry );
248 
249  list_remove( &mt->entry );
250  msi_free( mt->suffix );
251  msi_free( mt->clsid );
252  msi_free( mt->ContentType );
253  msi_free( mt );
254  }
255 
256  LIST_FOR_EACH_SAFE( item, cursor, &package->appids )
257  {
259 
260  list_remove( &appid->entry );
261  msi_free( appid->AppID );
262  msi_free( appid->RemoteServerName );
263  msi_free( appid->LocalServer );
264  msi_free( appid->ServiceParameters );
265  msi_free( appid->DllSurrogate );
266  msi_free( appid );
267  }
268 
270  {
272 
273  list_remove( &info->entry );
274  msi_free( info->value );
275  msi_free( info );
276  }
277 
279  {
281 
282  list_remove( &info->entry );
283  msi_free( info->volume_label );
284  msi_free( info->disk_prompt );
285  msi_free( info );
286  }
287 
288  for (i = 0; i < SCRIPT_MAX; i++)
289  msi_free_action_script( package, i );
290 
291  for (i = 0; i < package->unique_actions_count; i++)
292  msi_free( package->unique_actions[i] );
293  msi_free( package->unique_actions);
294 
295  LIST_FOR_EACH_SAFE( item, cursor, &package->binaries )
296  {
298 
299  list_remove( &binary->entry );
300  if (!DeleteFileW( binary->tmpfile ))
301  ERR( "failed to delete %s (%lu)\n", debugstr_w(binary->tmpfile), GetLastError() );
302  msi_free( binary->source );
303  msi_free( binary->tmpfile );
304  msi_free( binary );
305  }
306 
308  {
310 
311  list_remove( &cab->entry );
312  IStorage_Release( cab->storage );
313  msi_free( cab->stream );
314  msi_free( cab );
315  }
316 
317  LIST_FOR_EACH_SAFE( item, cursor, &package->patches )
318  {
320 
321  list_remove( &patch->entry );
322  if (patch->delete_on_close && !DeleteFileW( patch->localfile ))
323  {
324  ERR( "failed to delete %s (%lu)\n", debugstr_w(patch->localfile), GetLastError() );
325  }
326  msi_free_patchinfo( patch );
327  }
328 
329  msi_free( package->PackagePath );
330  msi_free( package->ProductCode );
331  msi_free( package->ActionFormat );
332  msi_free( package->LastAction );
333  msi_free( package->LastActionTemplate );
334  msi_free( package->langids );
335 
336  /* cleanup control event subscriptions */
338 }
LPWSTR ProductCode
Definition: msipriv.h:448
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:540
struct list entry
Definition: msipriv.h:524
struct list entry
Definition: msipriv.h:710
LPWSTR * unique_actions
Definition: msipriv.h:435
LPWSTR IconPath
Definition: msipriv.h:660
LPWSTR PackagePath
Definition: msipriv.h:447
LPWSTR LastAction
Definition: msipriv.h:410
void msi_free_action_script(MSIPACKAGE *package, UINT script)
Definition: package.c:138
BOOL msi_is_global_assembly(MSICOMPONENT *comp)
Definition: action.c:2037
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1040
static void msi_free(void *mem)
Definition: msipriv.h:1159
struct list folders
Definition: msipriv.h:406
static void free_folder(MSIFOLDER *folder)
Definition: package.c:87
LPWSTR KeyPath
Definition: msipriv.h:530
static void free_assembly(MSIASSEMBLY *assembly)
Definition: package.c:127
LPWSTR FileTypeMask
Definition: msipriv.h:659
struct list files
Definition: msipriv.h:403
LPWSTR suffix
Definition: msipriv.h:713
LPWSTR clsid
Definition: msipriv.h:714
void msi_event_cleanup_all_subscriptions(MSIPACKAGE *package)
Definition: dialog.c:4173
IStorage * storage
Definition: msipriv.h:194
struct list entry
Definition: msipriv.h:192
struct list sourcelist_info
Definition: msipriv.h:463
#define debugstr_w
Definition: kernel32.h:32
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
Definition: delete.c:39
struct list sourcelist_media
Definition: msipriv.h:464
char * appid
Definition: mkisofs.c:161
WCHAR * path
Definition: msipriv.h:632
struct list binaries
Definition: msipriv.h:407
char ext[3]
Definition: mkdosfs.c:358
void msi_free_patchinfo(MSIPATCHINFO *patch) DECLSPEC_HIDDEN
Definition: patch.c:865
struct list mimes
Definition: msipriv.h:429
LPWSTR DefInprocHandler
Definition: msipriv.h:661
__WINE_SERVER_LIST_INLINE void list_remove(struct list *elem)
Definition: list.h:108
LPWSTR Context
Definition: msipriv.h:653
struct list features
Definition: msipriv.h:402
LPWSTR LastActionTemplate
Definition: msipriv.h:411
LPWSTR Directory
Definition: msipriv.h:527
struct list classes
Definition: msipriv.h:426
LPWSTR ProgIDText
Definition: msipriv.h:656
struct list appids
Definition: msipriv.h:430
LPWSTR Description
Definition: msipriv.h:657
struct list progids
Definition: msipriv.h:428
const GLuint GLenum const GLvoid * binary
Definition: glext.h:7538
int unique_actions_count
Definition: msipriv.h:436
static void free_extension(MSIEXTENSION *ext)
Definition: package.c:107
LANGID * langids
Definition: msipriv.h:398
LPWSTR Component
Definition: msipriv.h:525
struct list components
Definition: msipriv.h:401
uint32_t entry
Definition: isohybrid.c:63
Definition: _list.h:228
struct list entry
Definition: msipriv.h:200
struct list entry
Definition: msipriv.h:625
LPWSTR Condition
Definition: msipriv.h:529
struct list extensions
Definition: msipriv.h:427
struct list cabinet_streams
Definition: msipriv.h:408
#define ERR(fmt,...)
Definition: debug.h:110
LPWSTR ComponentId
Definition: msipriv.h:526
LPWSTR clsid
Definition: msipriv.h:652
LPWSTR ActionFormat
Definition: msipriv.h:409
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:205
BOOL delete_on_close
Definition: msipriv.h:208
LPWSTR FullKeypath
Definition: msipriv.h:538
static void free_feature(MSIFEATURE *feature)
Definition: package.c:62
#define progid(str)
Definition: exdisp.idl:31
LPWSTR DefInprocHandler32
Definition: msipriv.h:662
#define LIST_ENTRY(type)
Definition: queue.h:175
struct list filepatches
Definition: msipriv.h:404
LPWSTR Argument
Definition: msipriv.h:663
LPWSTR ContentType
Definition: msipriv.h:711
struct list patches
Definition: msipriv.h:400
struct list entry
Definition: msipriv.h:651
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 522 of file package.c.

523 {
524  HKEY netsetup, hkey;
525  LONG res;
526  DWORD size, len, type;
527  WCHAR windir[MAX_PATH], path[MAX_PATH], *filename = NULL;
528 
529  res = RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\NET Framework Setup\\NDP", 0, KEY_CREATE_SUB_KEY,
530  &netsetup);
531  if (res != ERROR_SUCCESS)
532  return NULL;
533 
534  if (!RegCreateKeyExW(netsetup, L"v4\\Client", 0, NULL, 0, KEY_QUERY_VALUE, NULL, &hkey, NULL))
535  {
536  size = sizeof(path);
537  if (!RegQueryValueExW(hkey, L"InstallPath", NULL, &type, (BYTE *)path, &size))
538  {
539  len = lstrlenW(path) + lstrlenW(L"fusion.dll") + 2;
540  if (!(filename = msi_alloc(len * sizeof(WCHAR)))) return NULL;
541 
543  lstrcatW(filename, L"\\");
544  lstrcatW(filename, L"fusion.dll");
546  {
547  TRACE( "found %s\n", debugstr_w(filename) );
548  RegCloseKey(hkey);
549  RegCloseKey(netsetup);
550  return filename;
551  }
552  }
553  RegCloseKey(hkey);
554  }
555 
556  if (!RegCreateKeyExW(netsetup, L"v2.0.50727", 0, NULL, 0, KEY_QUERY_VALUE, NULL, &hkey, NULL))
557  {
558  RegCloseKey(hkey);
560  len = lstrlenW(windir) + lstrlenW(L"Microsoft.NET\\Framework\\") + lstrlenW(L"v2.0.50727") +
561  lstrlenW(L"fusion.dll") + 3;
563  if (!(filename = msi_alloc(len * sizeof(WCHAR)))) return NULL;
564 
565  lstrcpyW(filename, windir);
566  lstrcatW(filename, L"\\");
567  lstrcatW(filename, L"Microsoft.NET\\Framework\\");
568  lstrcatW(filename, L"v2.0.50727");
569  lstrcatW(filename, L"\\");
570  lstrcatW(filename, L"fusion.dll");
572  {
573  TRACE( "found %s\n", debugstr_w(filename) );
574  RegCloseKey(netsetup);
575  return filename;
576  }
577  }
578 
579  RegCloseKey(netsetup);
580  return filename;
581 }
#define ERROR_SUCCESS
Definition: deptool.c:10
GLsizei const GLchar ** path
Definition: glext.h:7234
static void msi_free(void *mem)
Definition: msipriv.h:1159
const char * filename
Definition: ioapi.h:135
#define lstrlenW
Definition: compat.h:609
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:2352
#define L(x)
Definition: ntvdm.h:50
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
#define lstrcpyW
Definition: compat.h:608
#define KEY_QUERY_VALUE
Definition: nt_native.h:1016
#define NULL
Definition: types.h:112
GLuint res
Definition: glext.h:9613
static void * msi_alloc(size_t len) __WINE_ALLOC_SIZE(1)
Definition: msipriv.h:1142
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3356
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:274
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:47
#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 1751 of file package.c.

1752 {
1753  int i = 0;
1754 
1755  while (internal_errors[i].id != 0)
1756  {
1757  if (internal_errors[i].id == error)
1758  return internal_errors[i].text;
1759  i++;
1760  }
1761 
1762  FIXME("missing error message %d\n", error);
1763  return NULL;
1764 }
#define error(str)
Definition: mkdosfs.c:1605
#define FIXME(fmt,...)
Definition: debug.h:111
static const struct @489 internal_errors[]
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

Referenced by MSI_ProcessMessage().

◆ get_local_package()

static UINT get_local_package ( MSIDATABASE db,
WCHAR localfile 
)
static

Definition at line 1299 of file package.c.

1300 {
1301  WCHAR *product_code;
1302  UINT r;
1303 
1304  if (!(product_code = get_product_code( db )))
1306  r = get_registered_local_package( product_code, localfile );
1307  msi_free( product_code );
1308  return r;
1309 }
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
static UINT get_registered_local_package(const WCHAR *product, WCHAR *localfile)
Definition: package.c:1253
static void msi_free(void *mem)
Definition: msipriv.h:1159
static WCHAR * get_product_code(MSIDATABASE *db)
Definition: package.c:1243
#define ERROR_INSTALL_PACKAGE_INVALID
Definition: winerror.h:978
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned int UINT
Definition: ndis.h:50

Referenced by MSI_OpenPackageW().

◆ get_product_code()

static WCHAR* get_product_code ( MSIDATABASE db)
static

Definition at line 1243 of file package.c.

1244 {
1245  return get_property( db, L"ProductCode" );
1246 }
#define L(x)
Definition: ntvdm.h:50
static WCHAR * get_property(MSIDATABASE *db, const WCHAR *prop)
Definition: package.c:1215

Referenced by get_local_package(), and MSI_OpenPackageW().

◆ get_product_version()

static WCHAR* get_product_version ( MSIDATABASE db)
static

Definition at line 1248 of file package.c.

1249 {
1250  return get_property( db, L"ProductVersion" );
1251 }
#define L(x)
Definition: ntvdm.h:50
static WCHAR * get_property(MSIDATABASE *db, const WCHAR *prop)
Definition: package.c:1215

Referenced by MSI_OpenPackageW().

◆ get_property()

static WCHAR* get_property ( MSIDATABASE db,
const WCHAR prop 
)
static

Definition at line 1215 of file package.c.

1216 {
1217  WCHAR query[MAX_PATH];
1218  MSIQUERY *view;
1219  MSIRECORD *rec;
1220  WCHAR *ret = NULL;
1221 
1222  swprintf(query, ARRAY_SIZE(query), L"SELECT `Value` FROM `Property` WHERE `Property`='%s'", prop);
1224  {
1225  return NULL;
1226  }
1227  if (MSI_ViewExecute( view, 0 ) != ERROR_SUCCESS)
1228  {
1229  MSI_ViewClose( view );
1230  msiobj_release( &view->hdr );
1231  return NULL;
1232  }
1233  if (MSI_ViewFetch( view, &rec ) == ERROR_SUCCESS)
1234  {
1235  ret = strdupW( MSI_RecordGetString( rec, 1 ) );
1236  msiobj_release( &rec->hdr );
1237  }
1238  MSI_ViewClose( view );
1239  msiobj_release( &view->hdr );
1240  return ret;
1241 }
#define ERROR_SUCCESS
Definition: deptool.c:10
static WCHAR * strdupW(const WCHAR *src)
Definition: main.c:92
MSIOBJECTHDR hdr
Definition: msipriv.h:151
UINT MSI_ViewExecute(MSIQUERY *, MSIRECORD *) DECLSPEC_HIDDEN
Definition: msiquery.c:502
#define L(x)
Definition: ntvdm.h:50
UINT MSI_ViewFetch(MSIQUERY *, MSIRECORD **) DECLSPEC_HIDDEN
Definition: msiquery.c:377
const WCHAR * MSI_RecordGetString(const MSIRECORD *, UINT) DECLSPEC_HIDDEN
Definition: record.c:433
UINT MSI_ViewClose(MSIQUERY *) DECLSPEC_HIDDEN
Definition: msiquery.c:454
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:34
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:241
int ret
int _cdecl swprintf(const WCHAR *,...)
#define ARRAY_SIZE(a)
Definition: main.h:24
#define NULL
Definition: types.h:112
static IOleDocumentView * view
Definition: activex.c:1749
UINT MSI_DatabaseOpenViewW(MSIDATABASE *, LPCWSTR, MSIQUERY **) DECLSPEC_HIDDEN

Referenced by get_product_code(), and get_product_version().

◆ get_registered_local_package()

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

Definition at line 1253 of file package.c.

1254 {
1256  WCHAR *filename;
1257  HKEY props_key;
1258  UINT r;
1259 
1260  r = msi_locate_product( product, &context );
1261  if (r != ERROR_SUCCESS)
1262  return r;
1263 
1264  r = MSIREG_OpenInstallProps( product, context, NULL, &props_key, FALSE );
1265  if (r != ERROR_SUCCESS)
1266  return r;
1267 
1269  RegCloseKey( props_key );
1270  if (!filename)
1271  return ERROR_FUNCTION_FAILED;
1272 
1273  lstrcpyW( localfile, filename );
1274  msi_free( filename );
1275  return ERROR_SUCCESS;
1276 }
#define ERROR_SUCCESS
Definition: deptool.c:10
enum tagMSIINSTALLCONTEXT MSIINSTALLCONTEXT
Definition: action.c:49
LPWSTR msi_reg_get_val_str(HKEY hkey, LPCWSTR name) DECLSPEC_HIDDEN
Definition: registry.c:243
Definition: http.c:7251
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
static void msi_free(void *mem)
Definition: msipriv.h:1159
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:692
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
#define FALSE
Definition: types.h:117
__wchar_t WCHAR
Definition: xmlstorage.h:180
UINT msi_locate_product(LPCWSTR szProduct, MSIINSTALLCONTEXT *context)
Definition: msi.c:56
_In_opt_ PVOID _In_ ULONG _In_ PVOID context
Definition: wdfdriver.h:113
#define lstrcpyW
Definition: compat.h:608
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
#define RegCloseKey(hKey)
Definition: registry.h:47

Referenced by get_local_package().

◆ internal_ui_handler()

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

Definition at line 1649 of file package.c.

1650 {
1651  if (!package || (package->ui_level & INSTALLUILEVEL_MASK) == INSTALLUILEVEL_NONE)
1652  return 0;
1653 
1654  /* todo: check if message needs additional styles (topmost/foreground/modality?) */
1655 
1656  switch (eMessageType & 0xff000000)
1657  {
1659  case INSTALLMESSAGE_ERROR:
1661  if (package->ui_level & INSTALLUILEVEL_PROGRESSONLY) return 0;
1662  if (!(eMessageType & MB_ICONMASK))
1663  eMessageType |= MB_ICONEXCLAMATION;
1664  return MessageBoxW(gUIhwnd, message, L"Windows Installer", eMessageType & 0x00ffffff);
1666  if (package->ui_level & INSTALLUILEVEL_PROGRESSONLY) return 0;
1667  if (!(eMessageType & MB_ICONMASK))
1668  eMessageType |= MB_ICONASTERISK;
1669  return MessageBoxW(gUIhwnd, message, L"Windows Installer", eMessageType & 0x00ffffff);
1670  case INSTALLMESSAGE_USER:
1671  if (package->ui_level & INSTALLUILEVEL_PROGRESSONLY) return 0;
1672  if (!(eMessageType & MB_ICONMASK))
1673  eMessageType |= MB_USERICON;
1674  return MessageBoxW(gUIhwnd, message, L"Windows Installer", eMessageType & 0x00ffffff);
1675  case INSTALLMESSAGE_INFO:
1680  return 0;
1682  {
1684  INT rc = ACTION_DialogBox(package, dialog);
1685  msi_free(dialog);
1686  return rc;
1687  }
1689  {
1690  LPWSTR deformatted;
1691  MSIRECORD *uirow = MSI_CreateRecord(1);
1692  if (!uirow) return -1;
1693  deformat_string(package, MSI_RecordGetString(record, 2), &deformatted);
1694  MSI_RecordSetStringW(uirow, 1, deformatted);
1695  msi_event_fire(package, L"ActionText", uirow);
1696 
1697  msi_free(deformatted);
1698  msiobj_release(&uirow->hdr);
1699  return 1;
1700  }
1702  {
1703  MSIRECORD *uirow = MSI_CreateRecord(1);
1704  if (!uirow) return -1;
1705  MSI_RecordSetStringW(uirow, 1, message);
1706  msi_event_fire(package, L"ActionData", uirow);
1707  msiobj_release(&uirow->hdr);
1708 
1709  if (package->action_progress_increment)
1710  {
1711  uirow = MSI_CreateRecord(2);
1712  if (!uirow) return -1;
1713  MSI_RecordSetInteger(uirow, 1, 2);
1714  MSI_RecordSetInteger(uirow, 2, package->action_progress_increment);
1715  msi_event_fire(package, L"SetProgress", uirow);
1716  msiobj_release(&uirow->hdr);
1717  }
1718  return 1;
1719  }
1721  msi_event_fire(package, L"SetProgress", record);
1722  return 1;
1724  switch (MSI_RecordGetInteger(record, 1))
1725  {
1726  case 0:
1727  case 1:
1728  /* do nothing */
1729  return 0;
1730  default:
1731  /* fall through */
1732  ;
1733  }
1734  default:
1735  FIXME("internal UI not implemented for message 0x%08x (UI level = %x)\n", eMessageType, package->ui_level);
1736  return 0;
1737  }
1738 }
#define MB_ICONMASK
Definition: winuser.h:813
Definition: tftpd.h:59
UINT MSI_RecordSetStringW(MSIRECORD *, UINT, LPCWSTR) DECLSPEC_HIDDEN
Definition: record.c:597
MSIOBJECTHDR hdr
Definition: msipriv.h:151
INT ACTION_DialogBox(MSIPACKAGE *package, const WCHAR *dialog)
Definition: dialog.c:4548
static void msi_free(void *mem)
Definition: msipriv.h:1159
int32_t INT
Definition: typedefs.h:58
#define MB_ICONEXCLAMATION
Definition: winuser.h:779
#define L(x)
Definition: ntvdm.h:50
UINT MSI_RecordSetInteger(MSIRECORD *, UINT, int) DECLSPEC_HIDDEN
Definition: record.c:280
#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:4483
const WCHAR * MSI_RecordGetString(const MSIRECORD *, UINT) DECLSPEC_HIDDEN
Definition: record.c:433
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)
INSTALLUILEVEL ui_level
Definition: msipriv.h:452
HWND gUIhwnd
Definition: msi_main.c:42
#define MB_ICONASTERISK
Definition: winuser.h:778
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:241
MSIRECORD * MSI_CreateRecord(UINT) DECLSPEC_HIDDEN
Definition: record.c:76
#define INSTALLUILEVEL_MASK
Definition: msipriv.h:60
int MSI_RecordGetInteger(MSIRECORD *, UINT) DECLSPEC_HIDDEN
Definition: record.c:213
WCHAR * msi_dup_record_field(MSIRECORD *row, INT index) DECLSPEC_HIDDEN
Definition: record.c:1002
static HWND dialog
Definition: gui.c:33
UINT action_progress_increment
Definition: msipriv.h:413
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by MSI_ProcessMessageVerbatim().

◆ msi_adjust_privilege_properties()

void msi_adjust_privilege_properties ( MSIPACKAGE package)

Definition at line 965 of file package.c.

966 {
967  /* FIXME: this should depend on the user's privileges */
968  if (msi_get_property_int( package->db, L"ALLUSERS", 0 ) == 2)
969  {
970  TRACE("resetting ALLUSERS property from 2 to 1\n");
971  msi_set_property( package->db, L"ALLUSERS", L"1", -1 );
972  }
973  msi_set_property( package->db, L"AdminUser", L"1", -1 );
974  msi_set_property( package->db, L"Privileged", L"1", -1 );
975  msi_set_property( package->db, L"MsiRunningElevated", L"1", -1 );
976 }
int msi_get_property_int(MSIDATABASE *db, LPCWSTR prop, int def)
Definition: package.c:2249
#define L(x)
Definition: ntvdm.h:50
#define TRACE(s)
Definition: solgame.cpp:4
MSIDATABASE * db
Definition: msipriv.h:394
UINT msi_set_property(MSIDATABASE *db, const WCHAR *name, const WCHAR *value, int len)
Definition: package.c:2044

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

◆ msi_alloc_package()

static MSIPACKAGE* msi_alloc_package ( void  )
static

Definition at line 919 of file package.c.

920 {
921  MSIPACKAGE *package;
922 
923  package = alloc_msiobject( MSIHANDLETYPE_PACKAGE, sizeof (MSIPACKAGE),
924  MSI_FreePackage );
925  if( package )
926  {
927  list_init( &package->components );
928  list_init( &package->features );
929  list_init( &package->files );
930  list_init( &package->filepatches );
931  list_init( &package->tempfiles );
932  list_init( &package->folders );
933  list_init( &package->subscriptions );
934  list_init( &package->appids );
935  list_init( &package->classes );
936  list_init( &package->mimes );
937  list_init( &package->extensions );
938  list_init( &package->progids );
939  list_init( &package->RunningActions );
940  list_init( &package->sourcelist_info );
941  list_init( &package->sourcelist_media );
942  list_init( &package->patches );
943  list_init( &package->binaries );
944  list_init( &package->cabinet_streams );
945  }
946 
947  return package;
948 }
struct list RunningActions
Definition: msipriv.h:440
struct list folders
Definition: msipriv.h:406
struct list files
Definition: msipriv.h:403
struct list tempfiles
Definition: msipriv.h:405
struct list sourcelist_info
Definition: msipriv.h:463
struct list sourcelist_media
Definition: msipriv.h:464
struct list binaries
Definition: msipriv.h:407
struct list mimes
Definition: msipriv.h:429
struct list features
Definition: msipriv.h:402
struct list classes
Definition: msipriv.h:426
struct list appids
Definition: msipriv.h:430
struct list progids
Definition: msipriv.h:428
struct list components
Definition: msipriv.h:401
struct list extensions
Definition: msipriv.h:427
struct list cabinet_streams
Definition: msipriv.h:408
struct list subscriptions
Definition: msipriv.h:461
__WINE_SERVER_LIST_INLINE void list_init(struct list *list)
Definition: list.h:149
struct list filepatches
Definition: msipriv.h:404
struct list patches
Definition: msipriv.h:400

◆ msi_clone_properties()

UINT msi_clone_properties ( MSIDATABASE db)

Definition at line 382 of file package.c.

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

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

1064 {
1065  DWORD time, len, i, offset;
1066  HANDLE handle;
1067 
1068  time = GetTickCount();
1070  lstrcatW( path, L"\\Installer\\" );
1072 
1073  len = lstrlenW(path);
1074  for (i = 0; i < 0x10000; i++)
1075  {
1076  offset = swprintf( path + len, MAX_PATH - len, L"%x", (time + i) & 0xffff );
1077  memcpy( path + len + offset, suffix, (lstrlenW( suffix ) + 1) * sizeof(WCHAR) );
1081  {
1083  break;
1084  }
1085  if (GetLastError() != ERROR_FILE_EXISTS &&
1087  return ERROR_FUNCTION_FAILED;
1088  }
1089 
1090  return ERROR_SUCCESS;
1091 }
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 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
#define lstrlenW
Definition: compat.h:609
UINT WINAPI GetWindowsDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2352
#define L(x)
Definition: ntvdm.h:50
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
int _cdecl swprintf(const WCHAR *,...)
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
#define CreateFileW
Definition: compat.h:600
#define CREATE_NEW
Definition: disk.h:69
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:274

Referenced by msi_apply_patch_package(), and MSI_OpenPackageW().

◆ MSI_CreatePackage()

MSIPACKAGE* MSI_CreatePackage ( MSIDATABASE db)

Definition at line 978 of file package.c.

979 {
980  MSIPACKAGE *package;
981  WCHAR uilevel[11];
982  int len;
983  UINT r;
984 
985  TRACE("%p\n", db);
986 
987  package = msi_alloc_package();
988  if (package)
989  {
990  msiobj_addref( &db->hdr );
991  package->db = db;
992 
993  package->LastAction = NULL;
994  package->LastActionTemplate = NULL;
996  package->WordCount = 0;
997  package->PackagePath = strdupW( db->path );
998 
999  create_temp_property_table( package );
1000  msi_clone_properties( package->db );
1002 
1003  package->ProductCode = msi_dup_property( package->db, L"ProductCode" );
1004 
1005  set_installer_properties( package );
1006 
1007  package->ui_level = gUILevel;
1008  len = swprintf( uilevel, ARRAY_SIZE(uilevel), L"%u", gUILevel & INSTALLUILEVEL_MASK );
1009  msi_set_property( package->db, L"UILevel", uilevel, len );
1010 
1011  r = msi_load_suminfo_properties( package );
1012  if (r != ERROR_SUCCESS)
1013  {
1014  msiobj_release( &package->hdr );
1015  return NULL;
1016  }
1017 
1019  msi_load_admin_properties( package );
1020 
1021  package->log_file = INVALID_HANDLE_VALUE;
1022  package->script = SCRIPT_NONE;
1023  }
1024  return package;
1025 }
void msiobj_addref(MSIOBJECTHDR *info)
Definition: handle.c:217
LPWSTR ProductCode
Definition: msipriv.h:448
enum script script
Definition: msipriv.h:432
#define ERROR_SUCCESS
Definition: deptool.c:10
MSIOBJECTHDR hdr
Definition: msipriv.h:393
UINT LastActionResult
Definition: msipriv.h:412
static WCHAR * strdupW(const WCHAR *src)
Definition: main.c:92
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
LPWSTR PackagePath
Definition: msipriv.h:447
HANDLE log_file
Definition: msipriv.h:414
LPWSTR LastAction
Definition: msipriv.h:410
#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:965
#define L(x)
Definition: ntvdm.h:50
LPWSTR path
Definition: msipriv.h:112
static UINT msi_load_admin_properties(MSIPACKAGE *package)
Definition: package.c:950
UINT WordCount
Definition: msipriv.h:458
LPWSTR msi_dup_property(MSIDATABASE *db, LPCWSTR prop)
Definition: package.c:2227
#define TRACE(s)
Definition: solgame.cpp:4
LPWSTR LastActionTemplate
Definition: msipriv.h:411
__wchar_t WCHAR
Definition: xmlstorage.h:180
INSTALLUILEVEL ui_level
Definition: msipriv.h:452
MSIDATABASE * db
Definition: msipriv.h:394
UINT msi_clone_properties(MSIDATABASE *db)
Definition: package.c:382
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:241
static VOID set_installer_properties(MSIPACKAGE *package)
Definition: package.c:632
#define INSTALLUILEVEL_MASK
Definition: msipriv.h:60
GLenum GLsizei len
Definition: glext.h:6722
int _cdecl swprintf(const WCHAR *,...)
UINT msi_set_property(MSIDATABASE *db, const WCHAR *name, const WCHAR *value, int len)
Definition: package.c:2044
#define ARRAY_SIZE(a)
Definition: main.h:24
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
static UINT create_temp_property_table(MSIPACKAGE *package)
Definition: package.c:366
MSIOBJECTHDR hdr
Definition: msipriv.h:108
UINT msi_load_suminfo_properties(MSIPACKAGE *package) DECLSPEC_HIDDEN
Definition: suminfo.c:1262

◆ msi_download_file()

UINT msi_download_file ( LPCWSTR  szUrl,
LPWSTR  filename 
)

Definition at line 1027 of file package.c.

1028 {
1030  DWORD size = 0;
1031  HRESULT hr;
1032 
1033  /* call will always fail, because size is 0,
1034  * but will return ERROR_FILE_NOT_FOUND first
1035  * if the file doesn't exist
1036  */
1037  GetUrlCacheEntryInfoW( szUrl, NULL, &size );
1039  {
1040  cache_entry = msi_alloc( size );
1041  if ( !GetUrlCacheEntryInfoW( szUrl, cache_entry, &size ) )
1042  {
1043  UINT error = GetLastError();
1044  msi_free( cache_entry );
1045  return error;
1046  }
1047 
1048  lstrcpyW( filename, cache_entry->lpszLocalFileName );
1049  msi_free( cache_entry );
1050  return ERROR_SUCCESS;
1051  }
1052 
1054  if ( FAILED(hr) )
1055  {
1056  WARN("failed to download %s to cache file\n", debugstr_w(szUrl));
1057  return ERROR_FUNCTION_FAILED;
1058  }
1059 
1060  return ERROR_SUCCESS;
1061 }
#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
static void msi_free(void *mem)
Definition: msipriv.h:1159
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 void * msi_alloc(size_t len) __WINE_ALLOC_SIZE(1)
Definition: msipriv.h:1142
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 2227 of file package.c.

2228 {
2229  DWORD sz = 0;
2230  LPWSTR str;
2231  UINT r;
2232 
2233  r = msi_get_property(db, prop, NULL, &sz);
2234  if (r != ERROR_SUCCESS && r != ERROR_MORE_DATA)
2235  return NULL;
2236 
2237  sz++;
2238  str = msi_alloc(sz * sizeof(WCHAR));
2239  r = msi_get_property(db, prop, str, &sz);
2240  if (r != ERROR_SUCCESS)
2241  {
2242  msi_free(str);
2243  str = NULL;
2244  }
2245 
2246  return str;
2247 }
#define ERROR_SUCCESS
Definition: deptool.c:10
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
static void msi_free(void *mem)
Definition: msipriv.h:1159
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:2194
#define ERROR_MORE_DATA
Definition: dderror.h:13
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
static void * msi_alloc(size_t len) __WINE_ALLOC_SIZE(1)
Definition: msipriv.h:1142
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_base_url(), get_duplicate_filename(), get_ini_file_name(), get_source_root(), HANDLE_CustomType23(), HANDLE_CustomType50(), HANDLE_CustomType53_54(), ITERATE_MoveFiles(), ITERATE_RemoveExistingProducts(), ITERATE_RemoveFiles(), MSI_ApplicablePatchXML(), msi_apply_patches(), msi_apply_transforms(), msi_build_icon_path(), msi_change_media(), msi_check_patch_applicable(), MSI_CreatePackage(), msi_dialog_combobox_update(), msi_dialog_dup_property(), msi_dialog_edit_control(), msi_dialog_maskedit_control(), msi_dialog_oncreate(), msi_dialog_radiogroup_control(), msi_get_checkbox_value(), msi_get_property_int(), MSI_InstallPackage(), msi_load_media_info(), MSI_OpenPackageW(), msi_publish_install_properties(), msi_publish_product_properties(), msi_publish_upgrade_code(), msi_resolve_target_folder(), msi_set_sourcedir_props(), msi_validate_product_id(), MsiSetFeatureAttributesW(), patch_set_media_source_prop(), process_state_property(), ready_media(), remove_product_upgrade_code(), and set_installer_properties().

◆ msi_free_action_script()

void msi_free_action_script ( MSIPACKAGE package,
UINT  script 
)

Definition at line 138 of file package.c.

139 {
140  UINT i;
141  for (i = 0; i < package->script_actions_count[script]; i++)
142  msi_free( package->script_actions[script][i] );
143 
144  msi_free( package->script_actions[script] );
145  package->script_actions[script] = NULL;
146  package->script_actions_count[script] = 0;
147 }
static void msi_free(void *mem)
Definition: msipriv.h:1159
script
Definition: msipriv.h:382
LPWSTR * script_actions[SCRIPT_MAX]
Definition: msipriv.h:433
int script_actions_count[SCRIPT_MAX]
Definition: msipriv.h:434
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

Referenced by execute_script(), and free_package_structures().

◆ MSI_FreePackage()

static void MSI_FreePackage ( MSIOBJECTHDR arg)
static

Definition at line 340 of file package.c.

341 {
342  MSIPACKAGE *package = (MSIPACKAGE *)arg;
343 
344  msi_destroy_assembly_caches( package );
345 
346  if( package->dialog )
347  msi_dialog_destroy( package->dialog );
348 
349  msiobj_release( &package->db->hdr );
350  free_package_structures(package);
351  CloseHandle( package->log_file );
352  if (package->rpc_server_started)
353  RpcServerUnregisterIf(s_IWineMsiRemote_v0_0_s_ifspec, NULL, FALSE);
354  if (rpc_handle)
355  RpcBindingFree(&rpc_handle);
356  if (package->custom_server_32_process)
357  custom_stop_server(package->custom_server_32_process, package->custom_server_32_pipe);
358  if (package->custom_server_64_process)
359  custom_stop_server(package->custom_server_64_process, package->custom_server_64_pipe);
360 
361  if (package->delete_on_close) DeleteFileW( package->localfile );
362  msi_free( package->localfile );
364 }
RPC_STATUS WINAPI RpcBindingFree(RPC_BINDING_HANDLE *Binding)
Definition: rpc_binding.c:783
#define CloseHandle
Definition: compat.h:598
void msi_dialog_destroy(msi_dialog *dialog)
Definition: dialog.c:4120
static void msi_free(void *mem)
Definition: msipriv.h:1159
RPC_STATUS WINAPI RpcServerUnregisterIf(RPC_IF_HANDLE IfSpec, UUID *MgrTypeUuid, UINT WaitForCallsToComplete)
Definition: rpc_server.c:1202
static void free_package_structures(MSIPACKAGE *package)
Definition: package.c:149
#define FALSE
Definition: types.h:117
INT MSI_ProcessMessage(MSIPACKAGE *package, INSTALLMESSAGE eMessageType, MSIRECORD *record)
Definition: package.c:1858
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
Definition: delete.c:39
void msi_destroy_assembly_caches(MSIPACKAGE *package)
Definition: assembly.c:92
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:241
void custom_stop_server(HANDLE process, HANDLE pipe)
Definition: custom.c:681
#define NULL
Definition: types.h:112

◆ msi_get_error_message()

LPWSTR msi_get_error_message ( MSIDATABASE db,
int  error 
)

Definition at line 1767 of file package.c.

1768 {
1769  MSIRECORD *record;
1770  LPWSTR ret = NULL;
1771 
1772  if ((record = MSI_QueryGetRecord(db, L"SELECT `Message` FROM `Error` WHERE `Error` = %d", error)))
1773  {
1775  msiobj_release(&record->hdr);
1776  }
1777  else if (error < 2000)
1778  {
1780  if (len)
1781  {
1782  ret = msi_alloc((len + 1) * sizeof(WCHAR));
1784  }
1785  else
1786  ret = NULL;
1787  }
1788 
1789  return ret;
1790 }
#define error(str)
Definition: mkdosfs.c:1605
#define IDS_ERROR_BASE
Definition: resource.h:33
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
#define L(x)
Definition: ntvdm.h:50
MSIRECORD *WINAPIV MSI_QueryGetRecord(MSIDATABASE *db, LPCWSTR query,...) DECLSPEC_HIDDEN
Definition: msiquery.c:201
__wchar_t WCHAR
Definition: xmlstorage.h:180
HINSTANCE msi_hInstance
Definition: msi_main.c:51
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:241
int ret
GLenum GLsizei len
Definition: glext.h:6722
WCHAR * msi_dup_record_field(MSIRECORD *row, INT index) DECLSPEC_HIDDEN
Definition: record.c:1002
#define NULL
Definition: types.h:112
static void * msi_alloc(size_t len) __WINE_ALLOC_SIZE(1)
Definition: msipriv.h:1142
WCHAR * LPWSTR
Definition: xmlstorage.h:184

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

◆ msi_get_package_code()

WCHAR* msi_get_package_code ( MSIDATABASE db)

Definition at line 1278 of file package.c.

1279 {
1280  WCHAR *ret;
1281  MSISUMMARYINFO *si;
1282  UINT r;
1283 
1284  r = msi_get_suminfo( db->storage, 0, &si );
1285  if (r != ERROR_SUCCESS)
1286  {
1287  r = msi_get_db_suminfo( db, 0, &si );
1288  if (r != ERROR_SUCCESS)
1289  {
1290  WARN("failed to load summary info %u\n", r);
1291  return NULL;
1292  }
1293  }
1295  msiobj_release( &si->hdr );
1296  return ret;
1297 }
LPWSTR msi_suminfo_dup_string(MSISUMMARYINFO *si, UINT uiProperty) DECLSPEC_HIDDEN
Definition: suminfo.c:696
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:486
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:241
int ret
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
IStorage * storage
Definition: msipriv.h:109

Referenced by ACTION_PublishProduct(), and msi_publish_product_properties().

◆ msi_get_property()

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

Definition at line 2194 of file package.c.

2196 {
2197  MSIRECORD *row;
2199 
2200  TRACE("%p %s %p %p\n", db, debugstr_w(szName), szValueBuf, pchValueBuf);
2201 
2202  row = msi_get_property_row( db, szName );
2203 
2204  if (*pchValueBuf > 0)
2205  szValueBuf[0] = 0;
2206 
2207  if (row)
2208  {
2209  rc = MSI_RecordGetStringW(row, 1, szValueBuf, pchValueBuf);
2210  msiobj_release(&row->hdr);
2211  }
2212 
2213  if (rc == ERROR_SUCCESS)
2214  TRACE("returning %s for property %s\n", debugstr_wn(szValueBuf, *pchValueBuf),
2215  debugstr_w(szName));
2216  else if (rc == ERROR_MORE_DATA)
2217  TRACE( "need %lu sized buffer for %s\n", *pchValueBuf, debugstr_w(szName) );
2218  else
2219  {
2220  *pchValueBuf = 0;
2221  TRACE("property %s not found\n", debugstr_w(szName));
2222  }
2223 
2224  return rc;
2225 }
static const WCHAR szName[]
Definition: powrprof.c:45
#define ERROR_SUCCESS
Definition: deptool.c:10
UINT MSI_RecordGetStringW(MSIRECORD *, UINT, LPWSTR, LPDWORD) DECLSPEC_HIDDEN
#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:241
#define ERROR_MORE_DATA
Definition: dderror.h:13
#define debugstr_wn
Definition: kernel32.h:33
unsigned int UINT
Definition: ndis.h:50
static MSIRECORD * msi_get_property_row(MSIDATABASE *db, LPCWSTR name)
Definition: package.c:2127
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 2249 of file package.c.

2250 {
2251  LPWSTR str = msi_dup_property( db, prop );
2252  int val = str ? wcstol(str, NULL, 10) : def;
2253  msi_free(str);
2254  return val;
2255 }
static void msi_free(void *mem)
Definition: msipriv.h:1159
_Check_return_ long __cdecl wcstol(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)
const WCHAR * str
LPWSTR msi_dup_property(MSIDATABASE *db, LPCWSTR prop)
Definition: package.c:2227
GLuint GLfloat * val
Definition: glext.h:7180
#define NULL
Definition: types.h:112
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by ACTION_AllocateRegistrySpace(), ACTION_CostFinalize(), ACTION_FindRelatedProducts(), ACTION_InstallFiles(), ACTION_MigrateFeatureStates(), ACTION_RegisterProduct(), 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 2127 of file package.c.

2128 {
2129  MSIRECORD *rec, *row = NULL;
2130  MSIQUERY *view;
2131  UINT r;
2132  WCHAR *buffer;
2133  int length;
2134 
2135  if (!name || !*name)
2136  return NULL;
2137 
2138  if (!wcscmp(name, L"Date"))
2139  {
2141  if (!length)
2142  return NULL;
2143  buffer = msi_alloc(length * sizeof(WCHAR));
2145 
2146  row = MSI_CreateRecord(1);
2147  if (!row)
2148  {
2149  msi_free(buffer);
2150  return NULL;
2151  }
2153  msi_free(buffer);
2154  return row;
2155  }
2156  else if (!wcscmp(name, L"Time"))
2157  {
2159  if (!length)
2160  return NULL;
2161  buffer = msi_alloc(length * sizeof(WCHAR));
2163 
2164  row = MSI_CreateRecord(1);
2165  if (!row)
2166  {
2167  msi_free(buffer);
2168  return NULL;
2169  }
2171  msi_free(buffer);
2172  return row;
2173  }
2174 
2175  rec = MSI_CreateRecord(1);
2176  if (!rec)
2177  return NULL;
2178 
2179  MSI_RecordSetStringW(rec, 1, name);
2180 
2181  r = MSI_DatabaseOpenViewW(db, L"SELECT `Value` FROM `_Property` WHERE `_Property`=?", &view);
2182  if (r == ERROR_SUCCESS)
2183  {
2184  MSI_ViewExecute(view, rec);
2185  MSI_ViewFetch(view, &row);
2187  msiobj_release(&view->hdr);
2188  }
2189  msiobj_release(&rec->hdr);
2190  return row;
2191 }
UINT MSI_RecordSetStringW(MSIRECORD *, UINT, LPCWSTR) DECLSPEC_HIDDEN
Definition: record.c:597
#define ERROR_SUCCESS
Definition: deptool.c:10
MSIOBJECTHDR hdr
Definition: msipriv.h:151
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:502
GLuint buffer
Definition: glext.h:5915
static void msi_free(void *mem)
Definition: msipriv.h:1159
#define L(x)
Definition: ntvdm.h:50
UINT MSI_ViewFetch(MSIQUERY *, MSIRECORD **) DECLSPEC_HIDDEN
Definition: msiquery.c:377
GLenum GLuint GLenum GLsizei length
Definition: glext.h:5579
UINT MSI_ViewClose(MSIQUERY *) DECLSPEC_HIDDEN
Definition: msiquery.c:454
__wchar_t WCHAR
Definition: xmlstorage.h:180
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:241
MSIRECORD * MSI_CreateRecord(UINT) DECLSPEC_HIDDEN
Definition: record.c:76
INT WINAPI GetDateFormatW(LCID lcid, DWORD dwFlags, const SYSTEMTIME *lpTime, LPCWSTR lpFormat, LPWSTR lpDateStr, INT cchOut)
Definition: lcformat.c:979
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
Definition: name.c:38
static void * msi_alloc(size_t len) __WINE_ALLOC_SIZE(1)
Definition: msipriv.h:1142
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

Referenced by msi_get_property(), MsiGetPropertyA(), and MsiGetPropertyW().

◆ msi_load_admin_properties()

static UINT msi_load_admin_properties ( MSIPACKAGE package)
static

Definition at line 950 of file package.c.

951 {
952  BYTE *data;
953  UINT r, sz;
954 
955  r = read_stream_data(package->db->storage, L"AdminProperties", FALSE, &data, &sz);
956  if (r != ERROR_SUCCESS)
957  return r;
958 
959  r = msi_parse_command_line(package, (WCHAR *)data, TRUE);
960 
961  msi_free(data);
962  return r;
963 }
#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:214
static void msi_free(void *mem)
Definition: msipriv.h:1159
#define L(x)
Definition: ntvdm.h:50
#define FALSE
Definition: types.h:117
__wchar_t WCHAR
Definition: xmlstorage.h:180
MSIDATABASE * db
Definition: msipriv.h:394
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
IStorage * storage
Definition: msipriv.h:109
static HRESULT read_stream_data(nsChannelBSC *This, IStream *stream)
Definition: navigate.c:960

Referenced by MSI_CreatePackage().

◆ MSI_OpenPackageW()

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

Definition at line 1333 of file package.c.

1334 {
1335  MSIDATABASE *db;
1336  MSIPACKAGE *package;
1337  MSIHANDLE handle;
1338  MSIRECORD *data_row, *info_row;
1339  UINT r;
1340  WCHAR localfile[MAX_PATH], cachefile[MAX_PATH];
1341  LPCWSTR file = szPackage;
1342  DWORD index = 0;
1343  MSISUMMARYINFO *si;
1344  BOOL delete_on_close = FALSE;
1345  WCHAR *info_template, *productname, *product_code;
1347 
1348  TRACE("%s %p\n", debugstr_w(szPackage), pPackage);
1349 
1351 
1352  localfile[0] = 0;
1353  if( szPackage[0] == '#' )
1354  {
1355  handle = wcstol(&szPackage[1], NULL, 10);
1357  return ERROR_INVALID_HANDLE;
1358  }
1359  else
1360  {
1361  WCHAR *product_version = NULL;
1362 
1363  if ( UrlIsW( szPackage, URLIS_URL ) )
1364  {
1365  r = msi_download_file( szPackage, cachefile );
1366  if (r != ERROR_SUCCESS)
1367  return r;
1368 
1369  file = cachefile;
1370  }
1372  if (r != ERROR_SUCCESS)
1373  {
1375  return ERROR_FILE_NOT_FOUND;
1376  return r;
1377  }
1378  r = get_local_package( db, localfile );
1379  if (r != ERROR_SUCCESS || GetFileAttributesW( localfile ) == INVALID_FILE_ATTRIBUTES)
1380  {
1381  DWORD localfile_attr;
1382 
1383  r = msi_create_empty_local_file( localfile, L".msi" );
1384  if (r != ERROR_SUCCESS)
1385  {
1386  msiobj_release( &db->hdr );
1387  return r;
1388  }
1389 
1390  if (!CopyFileW( file, localfile, FALSE ))
1391  {
1392  r = GetLastError();
1393  WARN("unable to copy package %s to %s (%u)\n", debugstr_w(file), debugstr_w(localfile), r);
1394  DeleteFileW( localfile );
1395  msiobj_release( &db->hdr );
1396  return r;
1397  }
1398  delete_on_close = TRUE;
1399 
1400  /* Remove read-only bit, we are opening it with write access in MSI_OpenDatabaseW below. */
1401  localfile_attr = GetFileAttributesW( localfile );
1402  if (localfile_attr & FILE_ATTRIBUTE_READONLY)
1403  SetFileAttributesW( localfile, localfile_attr & ~FILE_ATTRIBUTE_READONLY);
1404  }
1406  {
1407  if (!CopyFileW( file, localfile, FALSE ))
1408  {
1409  r = GetLastError();
1410  WARN("unable to update cached package (%u)\n", r);
1411  msiobj_release( &db->hdr );
1412  return r;
1413  }
1414  }
1415  else
1416  product_version = get_product_version( db );
1417  msiobj_release( &db->hdr );
1418  TRACE("opening package %s\n", debugstr_w( localfile ));
1419  r = MSI_OpenDatabaseW( localfile, MSIDBOPEN_TRANSACT, &db );
1420  if (r != ERROR_SUCCESS)
1421  return r;
1422 
1423  if (product_version)
1424  {
1425  WCHAR *cache_version = get_product_version( db );
1426  if (!product_version != !cache_version ||
1427  (product_version && wcscmp(product_version, cache_version)))
1428  {
1429  msiobj_release( &db->hdr );
1430  msi_free(product_version);
1431  msi_free(cache_version);
1432  return ERROR_PRODUCT_VERSION;
1433  }
1434  msi_free(product_version);
1435  msi_free(cache_version);
1436  }
1437  }
1438  package = MSI_CreatePackage( db );
1439  msiobj_release( &db->hdr );
1440  if (!package) return ERROR_INSTALL_PACKAGE_INVALID;
1441  package->localfile = strdupW( localfile );
1442  package->delete_on_close = delete_on_close;
1443 
1444  r = msi_get_suminfo( db->storage, 0, &si );
1445  if (r != ERROR_SUCCESS)
1446  {
1447  r = msi_get_db_suminfo( db, 0, &si );
1448  if (r != ERROR_SUCCESS)
1449  {
1450  WARN("failed to load summary info\n");
1451  msiobj_release( &package->hdr );
1453  }
1454  }
1455  r = parse_suminfo( si, package );
1456  msiobj_release( &si->hdr );
1457  if (r != ERROR_SUCCESS)
1458  {
1459  WARN("failed to parse summary info %u\n", r);
1460  msiobj_release( &package->hdr );
1461  return r;
1462  }
1463  r = validate_package( package );
1464  if (r != ERROR_SUCCESS)
1465  {
1466  msiobj_release( &package->hdr );
1467  return r;
1468  }
1469  msi_set_property( package->db, L"DATABASE", db->path, -1 );
1470  set_installed_prop( package );
1471  msi_set_context( package );
1472 
1473  product_code = get_product_code( db );
1474  if (msi_locate_product( product_code, &context ) == ERROR_SUCCESS)
1475  {
1476  TRACE("product already registered\n");
1477  msi_set_property( package->db, L"ProductToBeRegistered", L"1", -1 );
1478  }
1479  msi_free(product_code);
1480 
1481  while (1)
1482  {
1483  WCHAR patch_code[GUID_SIZE];
1484  r = MsiEnumPatchesExW( package->ProductCode, NULL, package->Context,
1485  MSIPATCHSTATE_APPLIED, index, patch_code, NULL, NULL, NULL, NULL );
1486  if (r != ERROR_SUCCESS)
1487  break;
1488 
1489  TRACE("found registered patch %s\n", debugstr_w(patch_code));
1490 
1491  r = msi_apply_registered_patch( package, patch_code );
1492  if (r != ERROR_SUCCESS)
1493  {
1494  ERR("registered patch failed to apply %u\n", r);
1495  msiobj_release( &package->hdr );
1496  return r;
1497  }
1498  index++;
1499  }
1500  if (index) msi_adjust_privilege_properties( package );
1501 
1502  r = msi_set_original_database_property( package->db, szPackage );
1503  if (r != ERROR_SUCCESS)
1504  {
1505  msiobj_release( &package->hdr );
1506  return r;
1507  }
1508  if (gszLogFile)
1511 
1512  if (!msi_init_assembly_caches( package ))
1513  {
1514  ERR("can't initialize assembly caches\n");
1515  msiobj_release( &package->hdr );
1516  return ERROR_FUNCTION_FAILED;
1517  }
1518 
1519  /* FIXME: when should these messages be sent? */
1520  data_row = MSI_CreateRecord(3);
1521  if (!data_row)
1522  return ERROR_OUTOFMEMORY;
1523  MSI_RecordSetStringW(data_row, 0, NULL);
1524  MSI_RecordSetInteger(data_row, 1, 0);
1525  MSI_RecordSetInteger(data_row, 2, package->num_langids ? package->langids[0] : 0);
1528 
1529  info_row = MSI_CreateRecord(0);
1530  if (!info_row)
1531  {
1532  msiobj_release(&data_row->hdr);
1533  return ERROR_OUTOFMEMORY;
1534  }
1535  info_template = msi_get_error_message(package->db, MSIERR_INFO_LOGGINGSTART);
1536  MSI_RecordSetStringW(info_row, 0, info_template);
1537  msi_free(info_template);
1539 
1540  MSI_ProcessMessage(package, INSTALLMESSAGE_COMMONDATA, data_row);
1541 
1542  productname = msi_dup_property(package->db, INSTALLPROPERTY_PRODUCTNAMEW);
1543  MSI_RecordSetInteger(data_row, 1, 1);
1544  MSI_RecordSetStringW(data_row, 2, productname);
1545  MSI_RecordSetStringW(data_row, 3, NULL);
1546  MSI_ProcessMessage(package, INSTALLMESSAGE_COMMONDATA, data_row);
1547 
1548  msi_free(productname);
1549  msiobj_release(&info_row->hdr);
1550  msiobj_release(&data_row->hdr);
1551 
1552  *pPackage = package;
1553  return ERROR_SUCCESS;
1554 }
BOOL WINAPI SetFileAttributesW(LPCWSTR lpFileName, DWORD dwFileAttributes)
Definition: fileinfo.c:794
LPWSTR ProductCode
Definition: msipriv.h:448
#define MB_ICONHAND
Definition: winuser.h:782
UINT msi_get_db_suminfo(MSIDATABASE *db, UINT uiUpdateCount, MSISUMMARYINFO **si) DECLSPEC_HIDDEN
Definition: suminfo.c:487
DWORD dwOptions
Definition: solitaire.cpp:24
#define MSIDBOPEN_READONLY
Definition: msiquery.h:66
UINT MSI_RecordSetStringW(MSIRECORD *, UINT, LPCWSTR) DECLSPEC_HIDDEN
Definition: record.c:597
UINT msi_apply_registered_patch(MSIPACKAGE *package, LPCWSTR patch_code) DECLSPEC_HIDDEN
Definition: patch.c:990
#define WINE_OPENPACKAGEFLAGS_RECACHE
Definition: msipriv.h:883
#define ERROR_SUCCESS
Definition: deptool.c:10
enum tagMSIINSTALLCONTEXT MSIINSTALLCONTEXT
Definition: action.c:49
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
Definition: http.c:7251
MSIOBJECTHDR hdr
Definition: msipriv.h:393
#define TRUE
Definition: types.h:120
static WCHAR * strdupW(const WCHAR *src)
Definition: main.c:92
MSIOBJECTHDR hdr
Definition: msipriv.h:151
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
UINT MSI_OpenDatabaseW(LPCWSTR szDBPath, LPCWSTR szPersist, MSIDATABASE **pdb)
Definition: database.c:140
#define WARN(fmt,...)
Definition: debug.h:112
HANDLE log_file
Definition: msipriv.h:414
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1040
static void msi_free(void *mem)
Definition: msipriv.h:1159
UINT msi_set_context(MSIPACKAGE *package)
Definition: action.c:396
_Check_return_ long __cdecl wcstol(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)
#define FILE_SHARE_WRITE
Definition: nt_native.h:681
#define MSIHANDLETYPE_DATABASE
Definition: msipriv.h:722
void msi_adjust_privilege_properties(MSIPACKAGE *package)
Definition: package.c:965
#define L(x)
Definition: ntvdm.h:50
UINT MSI_RecordSetInteger(MSIRECORD *, UINT, int) DECLSPEC_HIDDEN
Definition: record.c:280
static UINT get_local_package(MSIDATABASE *db, WCHAR *localfile)
Definition: package.c:1299
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:112
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
string_table * strings
Definition: msipriv.h:110
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
Definition: fileinfo.c:652
#define GENERIC_WRITE
Definition: nt_native.h:90
unsigned long MSIHANDLE
Definition: winemsi.idl:24
INT MSI_ProcessMessage(MSIPACKAGE *package, INSTALLMESSAGE eMessageType, MSIRECORD *record)
Definition: package.c:1858
#define debugstr_w
Definition: kernel32.h:32
static WCHAR * get_product_code(MSIDATABASE *db)
Definition: package.c:1243
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
UINT WINAPI MsiEnumPatchesExW(const WCHAR *szProductCode, const WCHAR *szUserSid, DWORD dwContext, DWORD dwFilter, DWORD dwIndex, WCHAR *szPatchCode, WCHAR *szTargetProductCode, MSIINSTALLCONTEXT *pdwTargetProductContext, WCHAR *szTargetUserSid, DWORD *pcchTargetUserSid)
Definition: registry.c:1963
GLuint index
Definition: glext.h:6031
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
#define OPEN_EXISTING
Definition: compat.h:634
LPWSTR msi_dup_property(MSIDATABASE *db, LPCWSTR prop)
Definition: package.c:2227
UINT msi_download_file(LPCWSTR szUrl, LPWSTR filename)
Definition: package.c:1027
#define TRACE(s)
Definition: solgame.cpp:4
#define ERROR_INSTALL_PACKAGE_INVALID
Definition: winerror.h:978
#define MSIERR_INFO_LOGGINGSTART
Definition: resource.h:24
BOOL msi_init_assembly_caches(MSIPACKAGE *package)
Definition: assembly.c:56
__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:449
#define MAX_PATH
Definition: compat.h:34
#define FILE_ATTRIBUTE_READONLY
Definition: nt_native.h:702
UINT msi_locate_product(LPCWSTR szProduct, MSIINSTALLCONTEXT *context)
Definition: msi.c:56
UINT msi_create_empty_local_file(LPWSTR path, LPCWSTR suffix)
Definition: package.c:1063
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:394
static UINT validate_package(MSIPACKAGE *package)
Definition: package.c:1172
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23
LANGID * langids
Definition: msipriv.h:398
_In_opt_ PVOID _In_ ULONG _In_ PVOID context
Definition: wdfdriver.h:113
MSIOBJECTHDR hdr
Definition: msipriv.h:486
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:241
MSIRECORD * MSI_CreateRecord(UINT) DECLSPEC_HIDDEN
Definition: record.c:76
#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:1792
#define ERR(fmt,...)
Definition: debug.h:110
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
UINT num_langids
Definition: msipriv.h:397
UINT msi_set_property(MSIDATABASE *db, const WCHAR *name, const WCHAR *value, int len)
Definition: package.c:2044
#define ERROR_PRODUCT_VERSION
Definition: winerror.h:996
static UINT parse_suminfo(MSISUMMARYINFO *si, MSIPACKAGE *package)
Definition: package.c:1103
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:1767
UINT Context
Definition: msipriv.h:459
#define CreateFileW
Definition: compat.h:600
UINT msi_set_original_database_property(MSIDATABASE *db, const WCHAR *package)
Definition: package.c:1311
IStorage * storage
Definition: msipriv.h:109
void * msihandle2msiinfo(MSIHANDLE handle, UINT type)
Definition: handle.c:158
#define GUID_SIZE
Definition: msipriv.h:733
BOOL delete_on_close
Definition: msipriv.h:450
static UINT set_installed_prop(MSIPACKAGE *package)
Definition: package.c:458
static WCHAR * get_product_version(MSIDATABASE *db)
Definition: package.c:1248
MSIOBJECTHDR hdr
Definition: msipriv.h:108
UINT msi_get_string_table_codepage(const string_table *st) DECLSPEC_HIDDEN
Definition: string.c:671
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13
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 2569 of file package.c.

2571 {
2573 
2575  {
2576  if (!wcscmp( info->value, value )) return ERROR_SUCCESS;
2577  }
2578 
2579  info = msi_alloc(sizeof(MSISOURCELISTINFO));
2580  if (!info)
2581  return ERROR_OUTOFMEMORY;
2582 
2583  info->context = context;
2584  info->options = options;
2585  info->property = property;
2586  info->value = strdupW(value);
2587  list_add_head(&package->sourcelist_info, &info->entry);
2588 
2589  return ERROR_SUCCESS;
2590 }
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:463
static struct _test_info info[]
Definition: SetCursorPos.c:19
int options
Definition: main.c:106
_In_opt_ PVOID _In_ ULONG _In_ PVOID context
Definition: wdfdriver.h:113
uint32_t entry
Definition: isohybrid.c:63
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
static void * msi_alloc(size_t len) __WINE_ALLOC_SIZE(1)
Definition: msipriv.h:1142
#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 2592 of file package.c.

2594 {
2595  MSIMEDIADISK *disk;
2596 
2598  {
2599  if (disk->disk_id == disk_id) return ERROR_SUCCESS;
2600  }
2601 
2602  disk = msi_alloc(sizeof(MSIMEDIADISK));
2603  if (!disk)
2604  return ERROR_OUTOFMEMORY;
2605 
2606  disk->context = context;
2607  disk->options = options;
2608  disk->disk_id = disk_id;
2610  disk->disk_prompt = strdupW(disk_prompt);
2611  list_add_head(&package->sourcelist_media, &disk->entry);
2612 
2613  return ERROR_SUCCESS;
2614 }
DWORD disk_id
Definition: msipriv.h:171
#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
__u8 volume_label[11]
Definition: mkdosfs.c:362
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
struct list sourcelist_media
Definition: msipriv.h:464
int options
Definition: main.c:106
DWORD context
Definition: msipriv.h:169
DWORD options
Definition: msipriv.h:170
_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:173
struct list entry
Definition: msipriv.h:168
static void * msi_alloc(size_t len) __WINE_ALLOC_SIZE(1)
Definition: msipriv.h:1142
LPWSTR volume_label
Definition: msipriv.h:172
#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 1858 of file package.c.

1859 {
1860  switch (eMessageType & 0xff000000)
1861  {
1863  case INSTALLMESSAGE_ERROR:
1865  case INSTALLMESSAGE_USER:
1866  case INSTALLMESSAGE_INFO:
1869  {
1870  /* error message */
1871 
1872  LPWSTR template;
1873  LPWSTR template_rec = NULL, template_prefix = NULL;
1874  int error = MSI_RecordGetInteger(record, 1);
1875 
1876  if (MSI_RecordIsNull(record, 0))
1877  {
1878  if (error >= 32)
1879  {
1880  template_rec = msi_get_error_message(package->db, error);
1881 
1882  if (!template_rec && error >= 2000)
1883  {
1884  /* internal error, not localized */
1885  if ((template_rec = (LPWSTR) get_internal_error_message(error)))
1886  {
1887  MSI_RecordSetStringW(record, 0, template_rec);
1889  }
1890  template_rec = msi_get_error_message(package->db, MSIERR_INSTALLERROR);
1891  MSI_RecordSetStringW(record, 0, template_rec);
1892  MSI_ProcessMessageVerbatim(package, eMessageType, record);
1893  msi_free(template_rec);
1894  return 0;
1895  }
1896  }
1897  }
1898  else
1899  template_rec = msi_dup_record_field(record, 0);
1900 
1901  template_prefix = msi_get_error_message(package->db, eMessageType >> 24);
1902  if (!template_prefix) template_prefix = strdupW(L"");
1903 
1904  if (!template_rec)
1905  {
1906  /* always returns 0 */
1907  MSI_RecordSetStringW(record, 0, template_prefix);
1908  MSI_ProcessMessageVerbatim(package, eMessageType, record);
1909  msi_free(template_prefix);
1910  return 0;
1911  }
1912 
1913  template = msi_alloc((lstrlenW(template_rec) + lstrlenW(template_prefix) + 1) * sizeof(WCHAR));
1914  if (!template) return ERROR_OUTOFMEMORY;
1915 
1916  lstrcpyW(template, template_prefix);
1917  lstrcatW(template, template_rec);
1918  MSI_RecordSetStringW(record, 0, template);
1919 
1920  msi_free(template_prefix);
1921  msi_free(template_rec);
1922  msi_free(template);
1923  }
1924  break;
1926  {
1927  WCHAR *template = msi_get_error_message(package->db, MSIERR_ACTIONSTART);
1928  MSI_RecordSetStringW(record, 0, template);
1929  msi_free(template);
1930 
1931  msi_free(package->LastAction);
1932  msi_free(package->LastActionTemplate);
1933  package->LastAction = msi_dup_record_field(record, 1);
1934  if (!package->LastAction) package->LastAction = strdupW(L"");
1936  break;
1937  }
1939  if (package->LastAction && package->LastActionTemplate)
1940  {
1941  size_t len = lstrlenW(package->LastAction) + lstrlenW(package->LastActionTemplate) + 7;
1942  WCHAR *template = msi_alloc(len * sizeof(WCHAR));
1943  if (!template) return ERROR_OUTOFMEMORY;
1944  swprintf(template, len, L"{{%s: }}%s", package->LastAction, package->LastActionTemplate);
1945  MSI_RecordSetStringW(record, 0, template);
1946  msi_free(template);
1947  }
1948  break;
1950  {
1951  WCHAR *template = msi_get_error_message(package->db, MSIERR_COMMONDATA);
1952  MSI_RecordSetStringW(record, 0, template);
1953  msi_free(template);
1954  }
1955  break;
1956  }
1957 
1958  return MSI_ProcessMessageVerbatim(package, eMessageType, record);
1959 }
UINT MSI_RecordSetStringW(MSIRECORD *, UINT, LPCWSTR) DECLSPEC_HIDDEN
Definition: record.c:597
#define error(str)
Definition: mkdosfs.c:1605
static WCHAR * strdupW(const WCHAR *src)
Definition: main.c:92
LPWSTR LastAction
Definition: msipriv.h:410
#define MSI_NULL_INTEGER
Definition: msiquery.h:32
static void msi_free(void *mem)
Definition: msipriv.h:1159
#define lstrlenW
Definition: compat.h:609
static LPCWSTR get_internal_error_message(int error)
Definition: package.c:1751
#define L(x)
Definition: ntvdm.h:50
BOOL MSI_RecordIsNull(MSIRECORD *, UINT) DECLSPEC_HIDDEN
Definition: record.c:321
LPWSTR LastActionTemplate
Definition: msipriv.h:411
__wchar_t WCHAR
Definition: xmlstorage.h:180
MSIDATABASE * db
Definition: msipriv.h:394
#define MSIERR_INSTALLERROR
Definition: resource.h:21
GLenum GLsizei len
Definition: glext.h:6722
int _cdecl swprintf(const WCHAR *,...)
INT MSI_ProcessMessageVerbatim(MSIPACKAGE *package, INSTALLMESSAGE eMessageType, MSIRECORD *record)
Definition: package.c:1792
int MSI_RecordGetInteger(MSIRECORD *, UINT) DECLSPEC_HIDDEN
Definition: record.c:213
#define lstrcpyW
Definition: compat.h:608
WCHAR * msi_dup_record_field(MSIRECORD *row, INT index) DECLSPEC_HIDDEN
Definition: record.c:1002
#define NULL
Definition: types.h:112
LPWSTR msi_get_error_message(MSIDATABASE *db, int error)
Definition: package.c:1767
#define MSIERR_ACTIONSTART
Definition: resource.h:22
static void * msi_alloc(size_t len) __WINE_ALLOC_SIZE(1)
Definition: msipriv.h:1142
#define MSIERR_COMMONDATA
Definition: resource.h:23
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:274
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 1792 of file package.c.

1793 {
1794  LPWSTR message = {0};
1795  DWORD len;
1796  DWORD log_type = 1 << (eMessageType >> 24);
1797  UINT res;
1798  INT rc = 0;
1799  char *msg;
1800 
1801  TRACE("%x\n", eMessageType);
1802  if (TRACE_ON(msi)) dump_record(record);
1803 
1804  if (!package || !record)
1805  message = NULL;
1806  else {
1807  res = MSI_FormatRecordW(package, record, message, &len);
1808  if (res != ERROR_SUCCESS && res != ERROR_MORE_DATA)
1809  return res;
1810  len++;
1811  message = msi_alloc(len * sizeof(WCHAR));
1812  if (!message) return ERROR_OUTOFMEMORY;
1813  MSI_FormatRecordW(package, record, message, &len);
1814  }
1815 
1816  /* convert it to ANSI */
1817  len = WideCharToMultiByte( CP_ACP, 0, message, -1, NULL, 0, NULL, NULL );
1818  msg = msi_alloc( len );
1820 
1821  if (gUIHandlerRecord && (gUIFilterRecord & log_type))
1822  {
1823  MSIHANDLE rec = alloc_msihandle(&record->hdr);
1824  TRACE( "calling UI handler %p(pvContext = %p, iMessageType = %#x, hRecord = %lu)\n",
1825  gUIHandlerRecord, gUIContextRecord, eMessageType, rec );
1826  rc = gUIHandlerRecord( gUIContextRecord, eMessageType, rec );
1827  MsiCloseHandle( rec );
1828  }
1829  if (!rc && gUIHandlerW && (gUIFilter & log_type))
1830  {
1831  TRACE( "calling UI handler %p(pvContext = %p, iMessageType = %#x, szMessage = %s)\n",
1832  gUIHandlerW, gUIContext, eMessageType, debugstr_w(message) );
1833  rc = gUIHandlerW( gUIContext, eMessageType, message );
1834  }
1835  else if (!rc && gUIHandlerA && (gUIFilter & log_type))
1836  {
1837  TRACE( "calling UI handler %p(pvContext = %p, iMessageType = %#x, szMessage = %s)\n",
1838  gUIHandlerA, gUIContext, eMessageType, debugstr_a(msg) );
1839  rc = gUIHandlerA( gUIContext, eMessageType, msg );
1840  }
1841 
1842  if (!rc)
1843  rc = internal_ui_handler(package, eMessageType, record, message);
1844 
1845  if (!rc && package && package->log_file != INVALID_HANDLE_VALUE &&
1846  (eMessageType & 0xff000000) != INSTALLMESSAGE_PROGRESS)
1847  {
1848  DWORD written;
1849  WriteFile( package->log_file, msg, len - 1, &written, NULL );
1850  WriteFile( package->log_file, "\n", 1, &written, NULL );
1851  }
1852  msi_free( msg );
1853  msi_free( message );
1854 
1855  return rc;
1856 }
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: rw.c:24
Definition: tftpd.h:59
#define ERROR_SUCCESS
Definition: deptool.c:10
#define WideCharToMultiByte
Definition: compat.h:111
#define CP_ACP
Definition: compat.h:109
HANDLE log_file
Definition: msipriv.h:414
INSTALLUI_HANDLERW gUIHandlerW
Definition: msi_main.c:44
#define INVALID_HANDLE_VALUE
Definition: compat.h:590
UINT MSI_FormatRecordW(MSIPACKAGE *package, MSIRECORD *record, LPWSTR buffer, LPDWORD size)
Definition: format.c:838
static void msi_free(void *mem)
Definition: msipriv.h:1159
int32_t INT
Definition: typedefs.h:58
unsigned long MSIHANDLE
Definition: winemsi.idl:24
#define debugstr_w
Definition: kernel32.h:32
INSTALLUI_HANDLER_RECORD gUIHandlerRecord
Definition: msi_main.c:45
void dump_record(MSIRECORD *) DECLSPEC_HIDDEN
Definition: record.c:1028
#define TRACE(s)
Definition: solgame.cpp:4
static INT internal_ui_handler(MSIPACKAGE *package, INSTALLMESSAGE eMessageType, MSIRECORD *record, LPCWSTR message)
Definition: package.c:1649
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define debugstr_a
Definition: kernel32.h:31
LPVOID gUIContext
Definition: msi_main.c:48
unsigned long DWORD
Definition: ntddk_ex.h:95
INSTALLUI_HANDLERA gUIHandlerA
Definition: msi_main.c:43
LPVOID gUIContextRecord
Definition: msi_main.c:49
GLenum GLsizei len
Definition: glext.h:6722
#define ERROR_MORE_DATA
Definition: dderror.h:13
UINT WINAPI MsiCloseHandle(MSIHANDLE handle)
Definition: handle.c:269
DWORD gUIFilterRecord
Definition: msi_main.c:47
MSIHANDLE alloc_msihandle(MSIOBJECTHDR *obj)
Definition: handle.c:111
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
#define msg(x)
Definition: auth_time.c:54
GLuint res
Definition: glext.h:9613
static void * msi_alloc(size_t len) __WINE_ALLOC_SIZE(1)
Definition: msipriv.h:1142
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define TRACE_ON(x)
Definition: compat.h:75
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13
DWORD gUIFilter
Definition: msi_main.c:46

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

◆ msi_reset_source_folders()

void msi_reset_source_folders ( MSIPACKAGE package)

Definition at line 2033 of file package.c.

2034 {
2035  MSIFOLDER *folder;
2036 
2038  {
2039  msi_free( folder->ResolvedSource );
2040  folder->ResolvedSource = NULL;
2041  }
2042 }
Definition: fci.c:115
static void msi_free(void *mem)
Definition: msipriv.h:1159
struct list folders
Definition: msipriv.h:406
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
struct CFFOLDER folder
Definition: fdi.c:102
uint32_t entry
Definition: isohybrid.c:63
#define NULL
Definition: types.h:112

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

◆ msi_set_original_database_property()

UINT msi_set_original_database_property ( MSIDATABASE db,
const WCHAR package 
)

Definition at line 1311 of file package.c.

1312 {
1313  UINT r;
1314 
1315  if (UrlIsW( package, URLIS_URL ))
1316  r = msi_set_property( db, L"OriginalDatabase", package, -1 );
1317  else if (package[0] == '#')
1318  r = msi_set_property( db, L"OriginalDatabase", db->path, -1 );
1319  else
1320  {
1321  DWORD len;
1322  WCHAR *path;
1323 
1324  if (!(len = GetFullPathNameW( package, 0, NULL, NULL ))) return GetLastError();
1325  if (!(path = msi_alloc( len * sizeof(WCHAR) ))) return ERROR_OUTOFMEMORY;
1326  len = GetFullPathNameW( package, len, path, NULL );
1327  r = msi_set_property( db, L"OriginalDatabase", path, len );
1328  msi_free( path );
1329  }
1330  return r;
1331 }
GLsizei const GLchar ** path
Definition: glext.h:7234
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1040
DWORD WINAPI GetFullPathNameW(IN LPCWSTR lpFileName, IN DWORD nBufferLength, OUT LPWSTR lpBuffer, OUT LPWSTR *lpFilePart)
Definition: path.c:1106
static void msi_free(void *mem)
Definition: msipriv.h:1159
#define L(x)
Definition: ntvdm.h:50
LPWSTR path
Definition: msipriv.h:112
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
GLenum GLsizei len
Definition: glext.h:6722
BOOL WINAPI UrlIsW(LPCWSTR pszUrl, URLIS Urlis)
Definition: url.c:1933
UINT msi_set_property(MSIDATABASE *db, const WCHAR *name, const WCHAR *value, int len)
Definition: package.c:2044
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
static void * msi_alloc(size_t len) __WINE_ALLOC_SIZE(1)
Definition: msipriv.h:1142
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13

Referenced by MSI_InstallPackage(), and MSI_OpenPackageW().

◆ msi_set_property()

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

Definition at line 2044 of file package.c.

2045 {
2046  MSIQUERY *view;
2047  MSIRECORD *row = NULL;
2048  DWORD sz = 0;
2049  WCHAR query[1024];
2050  UINT rc;
2051 
2052  TRACE("%p %s %s %d\n", db, debugstr_w(name), debugstr_wn(value, len), len);
2053 
2054  if (!name)
2055  return ERROR_INVALID_PARAMETER;
2056 
2057  /* this one is weird... */
2058  if (!name[0])
2060 
2061  if (value && len < 0) len = lstrlenW( value );
2062 
2063  rc = msi_get_property( db, name, 0, &sz );
2064  if (!value || (!*value && !len))
2065  {
2066  swprintf( query, ARRAY_SIZE(query), L"DELETE FROM `_Property` WHERE `_Property` = '%s'", name );
2067  }
2068  else if (rc == ERROR_MORE_DATA || rc == ERROR_SUCCESS)
2069  {
2070  swprintf( query, ARRAY_SIZE(query), L"UPDATE `_Property` SET `Value` = ? WHERE `_Property` = '%s'", name );
2071  row = MSI_CreateRecord(1);
2073  }
2074  else
2075  {
2076  lstrcpyW( query, L"INSERT INTO `_Property` (`_Property`,`Value`) VALUES (?,?)" );
2077  row = MSI_CreateRecord(2);
2078  msi_record_set_string( row, 1, name, -1 );
2080  }
2081 
2082  rc = MSI_DatabaseOpenViewW(db, query, &view);
2083  if (rc == ERROR_SUCCESS)
2084  {
2085  rc = MSI_ViewExecute(view, row);
2087  msiobj_release(&view->hdr);
2088  }
2089  if (row) msiobj_release(&row->hdr);
2090  return rc;
2091 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
Definition: pdh_main.c:93
#define ERROR_SUCCESS
Definition: deptool.c:10
UINT MSI_ViewExecute(MSIQUERY *, MSIRECORD *) DECLSPEC_HIDDEN
Definition: msiquery.c:502
#define lstrlenW
Definition: compat.h:609
#define L(x)
Definition: ntvdm.h:50
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
#define debugstr_w
Definition: kernel32.h:32
UINT MSI_ViewClose(MSIQUERY *) DECLSPEC_HIDDEN
Definition: msiquery.c:454
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:241
MSIRECORD * MSI_CreateRecord(UINT) DECLSPEC_HIDDEN
Definition: record.c:76
GLenum GLsizei len
Definition: glext.h:6722
int _cdecl swprintf(const WCHAR *,...)
UINT msi_get_property(MSIDATABASE *db, LPCWSTR szName, LPWSTR szValueBuf, LPDWORD pchValueBuf)
Definition: package.c:2194
#define ERROR_MORE_DATA
Definition: dderror.h:13
#define debugstr_wn
Definition: kernel32.h:33
#define lstrcpyW
Definition: compat.h:608
#define ARRAY_SIZE(a)
Definition: main.h:24
unsigned int UINT
Definition: ndis.h:50
UINT msi_record_set_string(MSIRECORD *, UINT, const WCHAR *, int) DECLSPEC_HIDDEN
Definition: record.c:573
#define NULL
Definition: types.h:112
Definition: name.c:38
static IOleDocumentView * view
Definition: activex.c:1749
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

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

◆ MsiGetActiveDatabase()

MSIHANDLE WINAPI MsiGetActiveDatabase ( MSIHANDLE  hInstall)

Definition at line 1618 of file package.c.

1619 {
1620  MSIPACKAGE *package;
1621  MSIHANDLE handle = 0;
1622  MSIHANDLE remote;
1623 
1624  TRACE( "%lu\n", hInstall );
1625 
1626  package = msihandle2msiinfo( hInstall, MSIHANDLETYPE_PACKAGE);
1627  if( package)
1628  {
1629  handle = alloc_msihandle( &package->db->hdr );
1630  msiobj_release( &package->hdr );
1631  }
1632  else if ((remote = msi_get_remote(hInstall)))
1633  {
1634  __TRY
1635  {
1636  handle = remote_GetActiveDatabase(remote);
1638  }
1640  {
1641  handle = 0;
1642  }
1643  __ENDTRY
1644  }
1645 
1646  return handle;
1647 }
#define __EXCEPT(func)
Definition: exception.h:84
MSIHANDLE msi_get_remote(MSIHANDLE handle)
Definition: handle.c:183
MSIOBJECTHDR hdr
Definition: msipriv.h:393
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
Definition: sock.c:82
unsigned long MSIHANDLE
Definition: winemsi.idl:24
LONG WINAPI rpc_filter(EXCEPTION_POINTERS *eptr)
Definition: custom.c:85
#define __TRY
Definition: compat.h:80
#define TRACE(s)
Definition: solgame.cpp:4
MSIDATABASE * db
Definition: msipriv.h:394
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:241
#define __ENDTRY
Definition: compat.h:82
MSIHANDLE alloc_msihandle(MSIOBJECTHDR *obj)
Definition: handle.c:111
MSIOBJECTHDR hdr
Definition: msipriv.h:108
MSIHANDLE alloc_msi_remote_handle(MSIHANDLE remote)
Definition: handle.c:135

Referenced by s_remote_GetActiveDatabase(), session_invoke(), test_db(), test_emptypackage(), test_invalid_functions(), test_MsiSetProperty(), test_property_table(), test_simple_patch(), test_system_tables(), and test_view_get_error().

◆ MsiGetPropertyA()

UINT WINAPI MsiGetPropertyA ( MSIHANDLE  hinst,
const char name,
char buf,
DWORD sz 
)

Definition at line 2257 of file package.c.

2258 {
2259  const WCHAR *value = L"";
2260  MSIPACKAGE *package;
2261  MSIRECORD *row;
2262  WCHAR *nameW;
2263  int len = 0;
2264  UINT r;
2265 
2266  if (!name)
2267  return ERROR_INVALID_PARAMETER;
2268 
2269  if (!(nameW = strdupAtoW(name)))
2270  return ERROR_OUTOFMEMORY;
2271 
2272  package = msihandle2msiinfo(hinst, MSIHANDLETYPE_PACKAGE);
2273  if (!package)
2274  {
2275  WCHAR *value = NULL, *tmp;
2276  MSIHANDLE remote;
2277  DWORD len;
2278 
2279  if (!(remote = msi_get_remote(hinst)))
2280  {
2281  free(nameW);
2282  return ERROR_INVALID_HANDLE;
2283  }
2284 
2285  __TRY
2286  {
2287  r = remote_GetProperty(remote, nameW, &value, &len);
2288  }
2290  {
2291  r = GetExceptionCode();
2292  }
2293  __ENDTRY
2294 
2295  free(nameW);
2296 
2297  if (!r)
2298  {
2299  /* String might contain embedded nulls.
2300  * Native returns the correct size but truncates the string. */
2301  tmp = calloc(1, (len + 1) * sizeof(WCHAR));
2302  if (!tmp)
2303  {
2305  return ERROR_OUTOFMEMORY;
2306  }
2307  lstrcpyW(tmp, value);
2308 
2309  r = msi_strncpyWtoA(tmp, len, buf, sz, TRUE);
2310 
2311  free(tmp);
2312  }
2314  return r;
2315  }
2316 
2317  row = msi_get_property_row(package->db, nameW);
2318  if (row)
2320 
2321  r = msi_strncpyWtoA(value, len, buf, sz, FALSE);
2322 
2323  free(nameW);
2324  if (row) msiobj_release(&row->hdr);
2325  msiobj_release(&package->hdr);
2326  return r;
2327 }
#define __EXCEPT(func)
Definition: exception.h:84
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
MSIHANDLE msi_get_remote(MSIHANDLE handle)
Definition: handle.c:183
#define midl_user_free
Definition: rpc.h:45
Definition: pdh_main.c:93
MSIOBJECTHDR hdr
Definition: msipriv.h:393
#define TRUE
Definition: types.h:120
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define free
Definition: debug_ros.c:5
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
UINT msi_strncpyWtoA(const WCHAR *str, int lenW, char *buf, DWORD *sz, BOOL remote)
Definition: install.c:190
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define L(x)
Definition: ntvdm.h:50
#define FALSE
Definition: types.h:117
unsigned long MSIHANDLE
Definition: winemsi.idl:24
LONG WINAPI rpc_filter(EXCEPTION_POINTERS *eptr)
Definition: custom.c:85
#define __TRY
Definition: compat.h:80
static const WCHAR nameW[]
Definition: main.c:46
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
MSIDATABASE * db
Definition: msipriv.h:394
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:241
#define __ENDTRY
Definition: compat.h:82
GLenum GLsizei len
Definition: glext.h:6722
const WCHAR * msi_record_get_string(const MSIRECORD *, UINT, int *) DECLSPEC_HIDDEN
Definition: record.c:420
#define lstrcpyW
Definition: compat.h:608
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
Definition: name.c:38
#define calloc
Definition: rosglue.h:14
static HINSTANCE hinst
Definition: edit.c:551
static MSIRECORD * msi_get_property_row(MSIDATABASE *db, LPCWSTR name)
Definition: package.c:2127
#define GetExceptionCode()
Definition: seh.h:27
static WCHAR * strdupAtoW(const char *str)
Definition: main.c:65
#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 check_prop(), da_deferred(), da_immediate(), test_appsearch(), test_appsearch_complocator(), test_appsearch_drlocator(), test_appsearch_inilocator(), test_appsearch_reglocator(), test_ccpsearch(), test_complocator(), test_dbtopackage(), test_formatrecord_tables(), test_installprops(), test_MsiDatabaseCommit(), test_MsiGetSourcePath(), test_MsiOpenProduct(), test_MsiSetProperty(), test_property_table(), test_props(), test_retval(), test_settargetpath(), test_simple_patch(), test_sourcedir(), test_states(), and test_try_transform().

◆ MsiGetPropertyW()

UINT WINAPI MsiGetPropertyW ( MSIHANDLE  hinst,
const WCHAR name,
WCHAR buf,
DWORD sz 
)

Definition at line 2329 of file package.c.

2330 {
2331  const WCHAR *value = L"";
2332  MSIPACKAGE *package;
2333  MSIRECORD *row;
2334  int len = 0;
2335  UINT r;
2336 
2337  if (!name)
2338  return ERROR_INVALID_PARAMETER;
2339 
2340  package = msihandle2msiinfo(hinst, MSIHANDLETYPE_PACKAGE);
2341  if (!package)
2342  {
2343  WCHAR *value = NULL, *tmp;
2344  MSIHANDLE remote;
2345  DWORD len;
2346 
2347  if (!(remote = msi_get_remote(hinst)))
2348  return ERROR_INVALID_HANDLE;
2349 
2350  __TRY
2351  {
2352  r = remote_GetProperty(remote, name, &value, &len);
2353  }
2355  {
2356  r = GetExceptionCode();
2357  }
2358  __ENDTRY
2359 
2360  if (!r)
2361  {
2362  /* String might contain embedded nulls.
2363  * Native returns the correct size but truncates the string. */
2364  tmp = calloc(1, (len + 1) * sizeof(WCHAR));
2365  if (!tmp)
2366  {
2368  return ERROR_OUTOFMEMORY;
2369  }
2370  lstrcpyW(tmp, value);
2371 
2372  r = msi_strncpyW(tmp, len, buf, sz);
2373 
2374  free(tmp);
2375  }
2377  return r;
2378  }
2379 
2380  row = msi_get_property_row(package->db, name);
2381  if (row)
2383 
2384  r = msi_strncpyW(value, len, buf, sz);
2385 
2386  if (row) msiobj_release(&row->hdr);
2387  msiobj_release(&package->hdr);
2388  return r;
2389 }
#define __EXCEPT(func)
Definition: exception.h:84
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
MSIHANDLE msi_get_remote(MSIHANDLE handle)
Definition: handle.c:183
#define midl_user_free
Definition: rpc.h:45
Definition: pdh_main.c:93
MSIOBJECTHDR hdr
Definition: msipriv.h:393
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define free
Definition: debug_ros.c:5
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
UINT msi_strncpyW(const WCHAR *str, int len, WCHAR *buf, DWORD *sz)
Definition: install.c:213
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define L(x)
Definition: ntvdm.h:50
unsigned long MSIHANDLE
Definition: winemsi.idl:24
LONG WINAPI rpc_filter(EXCEPTION_POINTERS *eptr)
Definition: custom.c:85
#define __TRY
Definition: compat.h:80
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
MSIDATABASE * db
Definition: msipriv.h:394
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:241
#define __ENDTRY
Definition: compat.h:82
GLenum GLsizei len
Definition: glext.h:6722
const WCHAR * msi_record_get_string(const MSIRECORD *, UINT, int *) DECLSPEC_HIDDEN
Definition: record.c:420
#define lstrcpyW
Definition: compat.h:608
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
Definition: name.c:38
#define calloc
Definition: rosglue.h:14
static HINSTANCE hinst
Definition: edit.c:551
static MSIRECORD * msi_get_property_row(MSIDATABASE *db, LPCWSTR name)
Definition: package.c:2127
#define GetExceptionCode()
Definition: seh.h:27
#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 s_remote_GetProperty(), session_invoke(), and test_props().

◆ MsiOpenPackageA()

UINT WINAPI MsiOpenPackageA ( LPCSTR  szPackage,
MSIHANDLE phPackage 
)

◆ MsiOpenPackageExA()

UINT WINAPI MsiOpenPackageExA ( LPCSTR  szPackage,
DWORD  dwOptions,
MSIHANDLE phPackage 
)

Definition at line 1594 of file package.c.

1595 {
1596  LPWSTR szwPack = NULL;
1597  UINT ret;
1598 
1599  if( szPackage )
1600  {
1601  szwPack = strdupAtoW( szPackage );
1602  if( !szwPack )
1603  return ERROR_OUTOFMEMORY;
1604  }
1605 
1606  ret = MsiOpenPackageExW( szwPack, dwOptions, phPackage );
1607 
1608  msi_free( szwPack );
1609 
1610  return ret;
1611 }
DWORD dwOptions
Definition: solitaire.cpp:24
static void msi_free(void *mem)
Definition: msipriv.h:1159
int ret
UINT WINAPI MsiOpenPackageExW(const WCHAR *szPackage, DWORD dwOptions, MSIHANDLE *phPackage)
Definition: package.c:1556
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
WCHAR * LPWSTR
Definition: xmlstorage.h:184
static WCHAR * strdupAtoW(const char *str)
Definition: main.c:65
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13

Referenced by init_functionpointers(), and MsiOpenPackageA().

◆ MsiOpenPackageExW()

UINT WINAPI MsiOpenPackageExW ( const WCHAR szPackage,
DWORD  dwOptions,
MSIHANDLE phPackage 
)

Definition at line 1556 of file package.c.

1557 {
1558  MSIPACKAGE *package = NULL;
1559  UINT ret;
1560 
1561  TRACE( "%s, %#lx, %p\n", debugstr_w(szPackage), dwOptions, phPackage );
1562 
1563  if( !szPackage || !phPackage )
1564  return ERROR_INVALID_PARAMETER;
1565 
1566  if ( !*szPackage )
1567  {
1568  FIXME("Should create an empty database and package\n");
1569  return ERROR_FUNCTION_FAILED;
1570  }
1571 
1572  if( dwOptions )
1573  FIXME( "dwOptions %#lx not supported\n", dwOptions );
1574 
1575  ret = MSI_OpenPackageW( szPackage, 0, &package );
1576  if( ret == ERROR_SUCCESS )
1577  {
1578  *phPackage = alloc_msihandle( &package->hdr );
1579  if (! *phPackage)
1581  msiobj_release( &package->hdr );
1582  }
1583  else
1585 
1586  return ret;
1587 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
DWORD dwOptions
Definition: solitaire.cpp:24
#define ERROR_SUCCESS
Definition: deptool.c:10
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
INT MSI_ProcessMessage(MSIPACKAGE *package, INSTALLMESSAGE eMessageType, MSIRECORD *record)
Definition: package.c:1858
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:111
#define TRACE(s)
Definition: solgame.cpp:4
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:241
int ret
UINT MSI_OpenPackageW(LPCWSTR szPackage, DWORD dwOptions, MSIPACKAGE **pPackage)
Definition: package.c:1333
MSIHANDLE alloc_msihandle(MSIOBJECTHDR *obj)
Definition: handle.c:111
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112

Referenced by init_functionpointers(), InstallerImpl_OpenPackage(), MsiOpenPackageExA(), and MsiOpenPackageW().

◆ MsiOpenPackageW()

UINT WINAPI MsiOpenPackageW ( LPCWSTR  szPackage,
MSIHANDLE phPackage 
)

Definition at line 1589 of file package.c.

1590 {
1591  return MsiOpenPackageExW( szPackage, 0, phPackage );
1592 }
UINT WINAPI MsiOpenPackageExW(const WCHAR *szPackage, DWORD dwOptions, MSIHANDLE *phPackage)
Definition: package.c:1556

◆ MsiProcessMessage()

INT WINAPI MsiProcessMessage ( MSIHANDLE  hInstall,
INSTALLMESSAGE  eMessageType,
MSIHANDLE  hRecord 
)

Definition at line 1961 of file package.c.

1963 {
1965  MSIPACKAGE *package = NULL;
1966  MSIRECORD *record = NULL;
1967 
1968  if ((eMessageType & 0xff000000) == INSTALLMESSAGE_INITIALIZE ||
1969  (eMessageType & 0xff000000) == INSTALLMESSAGE_TERMINATE)
1970  return -1;
1971 
1972  if ((eMessageType & 0xff000000) == INSTALLMESSAGE_COMMONDATA &&
1973  MsiRecordGetInteger(hRecord, 1) != 2)
1974  return -1;
1975 
1977  if (!record)
1978  return ERROR_INVALID_HANDLE;
1979 
1980  package = msihandle2msiinfo( hInstall, MSIHANDLETYPE_PACKAGE );
1981  if( !package )
1982  {
1983  MSIHANDLE remote;
1984 
1985  if (!(remote = msi_get_remote(hInstall)))
1986  return ERROR_INVALID_HANDLE;
1987 
1988  __TRY
1989  {
1990  ret = remote_ProcessMessage(remote, eMessageType, (struct wire_record *)&record->count);
1991  }
1993  {
1994  ret = GetExceptionCode();
1995  }
1996  __ENDTRY
1997 
1998  msiobj_release(&record->hdr);
1999  return ret;
2000  }
2001 
2002  ret = MSI_ProcessMessage( package, eMessageType, record );
2003 
2004  msiobj_release( &record->hdr );
2005  msiobj_release( &package->hdr );
2006  return ret;
2007 }
#define __EXCEPT(func)
Definition: exception.h:84
MSIHANDLE msi_get_remote(MSIHANDLE handle)
Definition: handle.c:183
int WINAPI MsiRecordGetInteger(MSIHANDLE handle, UINT iField)
Definition: record.c:237
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
unsigned long MSIHANDLE
Definition: winemsi.idl:24
INT MSI_ProcessMessage(MSIPACKAGE *package, INSTALLMESSAGE eMessageType, MSIRECORD *record)
Definition: package.c:1858
LONG WINAPI rpc_filter(EXCEPTION_POINTERS *eptr)
Definition: custom.c:85
#define MSIHANDLETYPE_RECORD
Definition: msipriv.h:725
#define __TRY
Definition: compat.h:80
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:241
#define __ENDTRY
Definition: compat.h:82
int ret
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
#define GetExceptionCode()
Definition: seh.h:27
void * msihandle2msiinfo(MSIHANDLE handle, UINT type)
Definition: handle.c:158

Referenced by ok_(), s_remote_ProcessMessage(), session_invoke(), test_externalui(), and test_externalui_message().

◆ MsiSetPropertyA()

UINT WINAPI MsiSetPropertyA ( MSIHANDLE  hInstall,
LPCSTR  szName,
LPCSTR  szValue 
)

Definition at line 2011 of file package.c.

2012 {
2013  LPWSTR szwName = NULL, szwValue = NULL;
2015 
2016  szwName = strdupAtoW( szName );
2017  if( szName && !szwName )
2018  goto end;
2019 
2020  szwValue = strdupAtoW( szValue );
2021  if( szValue && !szwValue )
2022  goto end;
2023 
2024  r = MsiSetPropertyW( hInstall, szwName, szwValue);
2025 
2026 end:
2027  msi_free( szwName );
2028  msi_free( szwValue );
2029 
2030  return r;
2031 }
static const WCHAR szName[]
Definition: powrprof.c:45
UINT WINAPI MsiSetPropertyW(MSIHANDLE hInstall, LPCWSTR szName, LPCWSTR szValue)
Definition: package.c:2093
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
static void msi_free(void *mem)
Definition: msipriv.h:1159
GLuint GLuint end
Definition: gl.h:1545
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
WCHAR * LPWSTR
Definition: xmlstorage.h:184
static WCHAR * strdupAtoW(const char *str)
Definition: main.c:65
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13

Referenced by nested(), test_appsearch_complocator(), test_condition(), test_format_record(), test_formatrecord2(), test_formatrecord_tables(), test_launchconditions(), test_misc(), test_MsiDatabaseCommit(), test_MsiGetProductProperty(), test_MsiGetSourcePath(), test_MsiSetProperty(), test_property_table(), test_props(), test_removefiles(), and test_top_level_action().

◆ MsiSetPropertyW()

UINT WINAPI MsiSetPropertyW ( MSIHANDLE  hInstall,
LPCWSTR  szName,
LPCWSTR  szValue 
)

Definition at line 2093 of file package.c.

2094 {
2095  MSIPACKAGE *package;
2096  UINT ret;
2097 
2098  package = msihandle2msiinfo( hInstall, MSIHANDLETYPE_PACKAGE);
2099  if( !package )
2100  {
2101  MSIHANDLE remote;
2102 
2103  if (!(remote = msi_get_remote(hInstall)))
2104  return ERROR_INVALID_HANDLE;
2105 
2106  __TRY
2107  {
2108  ret = remote_SetProperty(remote, szName, szValue);
2109  }
2111  {
2112  ret = GetExceptionCode();
2113  }
2114  __ENDTRY
2115 
2116  return ret;
2117  }
2118 
2119  ret = msi_set_property( package->db, szName, szValue, -1 );
2120  if (ret == ERROR_SUCCESS && !wcscmp( szName, L"SourceDir" ))
2121  msi_reset_source_folders( package );
2122 
2123  msiobj_release( &package->hdr );
2124  return ret;
2125 }
#define __EXCEPT(func)
Definition: exception.h:84
MSIHANDLE msi_get_remote(MSIHANDLE handle)
Definition: handle.c:183
static const WCHAR szName[]
Definition: powrprof.c:45
#define ERROR_SUCCESS
Definition: deptool.c:10
MSIOBJECTHDR hdr
Definition: msipriv.h:393
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
void msi_reset_source_folders(MSIPACKAGE *package)
Definition: package.c:2033
#define L(x)
Definition: ntvdm.h:50
unsigned long MSIHANDLE
Definition: winemsi.idl:24
LONG WINAPI rpc_filter(EXCEPTION_POINTERS *eptr)
Definition: custom.c:85
#define __TRY
Definition: compat.h:80
MSIDATABASE * db
Definition: msipriv.h:394
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:241
#define __ENDTRY
Definition: compat.h:82
int ret
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
UINT msi_set_property(MSIDATABASE *db, const WCHAR *name, const WCHAR *value, int len)
Definition: package.c:2044
unsigned int UINT
Definition: ndis.h:50
#define GetExceptionCode()
Definition: seh.h:27

Referenced by MsiSetPropertyA(), s_remote_SetProperty(), and session_invoke().

◆ parse_platform()

static enum platform parse_platform ( const WCHAR str)
static

Definition at line 1093 of file package.c.

1094 {
1095  if (!str[0] || !wcscmp( str, L"Intel" )) return PLATFORM_INTEL;
1096  else if (!wcscmp( str, L"Intel64" )) return PLATFORM_INTEL64;
1097  else if (!wcscmp( str, L"x64" ) || !wcscmp( str, L"AMD64" )) return PLATFORM_X64;
1098  else if (!wcscmp( str, L"Arm" )) return PLATFORM_ARM;
1099  else if (!wcscmp( str, L"Arm64" )) return PLATFORM_ARM64;
1100  return PLATFORM_UNRECOGNIZED;
1101 }
#define L(x)
Definition: ntvdm.h:50
const WCHAR * str
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)

Referenced by parse_suminfo().

◆ parse_suminfo()

static UINT parse_suminfo ( MSISUMMARYINFO si,
MSIPACKAGE package 
)
static

Definition at line 1103 of file package.c.

1104 {
1105  WCHAR *template, *p, *q, *platform;
1106  DWORD i, count;
1107 
1108  package->version = msi_suminfo_get_int32( si, PID_PAGECOUNT );
1109  TRACE("version: %d\n", package->version);
1110 
1111  template = msi_suminfo_dup_string( si, PID_TEMPLATE );
1112  if (!template)
1113  return ERROR_SUCCESS; /* native accepts missing template property */
1114 
1115  TRACE("template: %s\n", debugstr_w(template));
1116 
1117  p = wcschr( template, ';' );
1118  if (!p)
1119  {
1120  WARN("invalid template string %s\n", debugstr_w(template));
1121  msi_free( template );
1123  }
1124  *p = 0;
1125  platform = template;
1126  if ((q = wcschr( platform, ',' ))) *q = 0;
1127  package->platform = parse_platform( platform );
1128  while (package->platform == PLATFORM_UNRECOGNIZED && q)
1129  {
1130  platform = q + 1;
1131  if ((q = wcschr( platform, ',' ))) *q = 0;
1132  package->platform = parse_platform( platform );
1133  }
1134  if (package->platform == PLATFORM_UNRECOGNIZED)
1135  {
1136  WARN("unknown platform %s\n", debugstr_w(template));
1137  msi_free( template );
1139  }
1140  p++;
1141  if (!*p)
1142  {
1143  msi_free( template );
1144  return ERROR_SUCCESS;
1145  }
1146  count = 1;
1147  for (q = p; (q = wcschr( q, ',' )); q++) count++;
1148 
1149  package->langids = msi_alloc( count * sizeof(LANGID) );
1150  if (!package->langids)
1151  {
1152  msi_free( template );
1153  return ERROR_OUTOFMEMORY;
1154  }
1155 
1156  i = 0;
1157  while (*p)
1158  {
1159  q = wcschr( p, ',' );
1160  if (q) *q = 0;
1161  package->langids[i] = wcstol( p, NULL, 10 );
1162  if (!q) break;
1163  p = q + 1;
1164  i++;
1165  }
1166  package->num_langids = i + 1;
1167 
1168  msi_free( template );
1169  return ERROR_SUCCESS;
1170 }
LPWSTR msi_suminfo_dup_string(MSISUMMARYINFO *si, UINT uiProperty) DECLSPEC_HIDDEN
Definition: suminfo.c:696
#define PID_TEMPLATE
Definition: suminfo.c:49
enum platform platform
Definition: msipriv.h:396
#define ERROR_SUCCESS
Definition: deptool.c:10
static enum platform parse_platform(const WCHAR *str)
Definition: package.c:1093
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define WARN(fmt,...)
Definition: debug.h:112
static void msi_free(void *mem)
Definition: msipriv.h:1159
WORD LANGID
Definition: typedefs.h:81
_Check_return_ long __cdecl wcstol(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)
#define ERROR_INSTALL_PLATFORM_UNSUPPORTED
Definition: winerror.h:991
#define debugstr_w
Definition: kernel32.h:32
#define ERROR_PATCH_PACKAGE_INVALID
Definition: winerror.h:994
platform
Definition: msipriv.h:363
#define TRACE(s)
Definition: solgame.cpp:4
_CONST_RETURN wchar_t *__cdecl wcschr(_In_z_ const wchar_t *_Str, wchar_t _Ch)