ReactOS 0.4.16-dev-197-g92996da
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  lang_codepage
 

Macros

#define COBJMACROS
 

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 MSIPACKAGEalloc_package (void)
 
static UINT 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 MSIRECORDget_property_row (MSIDATABASE *db, const WCHAR *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 21 of file package.c.

Function Documentation

◆ alloc_package()

static MSIPACKAGE * alloc_package ( void  )
static

Definition at line 918 of file package.c.

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

◆ create_temp_property_table()

static UINT create_temp_property_table ( MSIPACKAGE package)
static

Definition at line 365 of file package.c.

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

Referenced by MSI_CreatePackage().

◆ free_assembly()

static void free_assembly ( MSIASSEMBLY assembly)
static

Definition at line 126 of file package.c.

127{
128 free( assembly->feature );
130 free( assembly->application );
131 free( assembly->display_name );
132 if (assembly->tempdir) RemoveDirectoryW( assembly->tempdir );
133 free( assembly->tempdir );
134 free( assembly );
135}
#define free
Definition: debug_ros.c:5
BOOL WINAPI RemoveDirectoryW(IN LPCWSTR lpPathName)
Definition: dir.c:732
struct file_info manifest
Definition: actctx.c:530

Referenced by free_package_structures().

◆ free_extension()

static void free_extension ( MSIEXTENSION ext)
static

Definition at line 106 of file package.c.

107{
108 struct list *item, *cursor;
109
110 LIST_FOR_EACH_SAFE( item, cursor, &ext->verbs )
111 {
112 MSIVERB *verb = LIST_ENTRY( item, MSIVERB, entry );
113
114 list_remove( &verb->entry );
115 free( verb->Verb );
116 free( verb->Command );
117 free( verb->Argument );
118 free( verb );
119 }
120
121 free( ext->Extension );
122 free( ext->ProgIDText );
123 free( ext );
124}
static void list_remove(struct list_entry *entry)
Definition: list.h:90
Definition: list.h:37
static const WCHAR *const ext[]
Definition: module.c:53
const char cursor[]
Definition: icontest.c:13
uint32_t entry
Definition: isohybrid.c:63
static ATOM item
Definition: dde.c:856
#define LIST_FOR_EACH_SAFE(cursor, cursor2, list)
Definition: list.h:192
LPWSTR Command
Definition: msipriv.h:704
struct list entry
Definition: msipriv.h:701
LPWSTR Argument
Definition: msipriv.h:705
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 61 of file package.c.

62{
63 struct list *item, *cursor;
64
66 {
68 list_remove( &fl->entry );
69 free( fl );
70 }
71
72 LIST_FOR_EACH_SAFE( item, cursor, &feature->Components )
73 {
75 list_remove( &cl->entry );
76 free( cl );
77 }
78 free( feature->Feature );
79 free( feature->Feature_Parent );
80 free( feature->Directory );
81 free( feature->Description );
82 free( feature->Title );
83 free( feature );
84}
INTERNETFEATURELIST feature
Definition: misc.c:1719
struct list entry
Definition: msipriv.h:553
_In_ FLONG fl
Definition: winddi.h:1279

Referenced by free_package_structures().

◆ free_folder()

static void free_folder ( MSIFOLDER folder)
static

Definition at line 86 of file package.c.

87{
88 struct list *item, *cursor;
89
90 LIST_FOR_EACH_SAFE( item, cursor, &folder->children )
91 {
93 list_remove( &fl->entry );
94 free( fl );
95 }
96 free( folder->Parent );
97 free( folder->Directory );
98 free( folder->TargetDefault );
99 free( folder->SourceLongPath );
100 free( folder->SourceShortPath );
101 free( folder->ResolvedTarget );
102 free( folder->ResolvedSource );
103 free( folder );
104}
Definition: fci.c:116

Referenced by free_package_structures().

◆ free_package_structures()

static void free_package_structures ( MSIPACKAGE package)
static

Definition at line 148 of file package.c.

149{
150 struct list *item, *cursor;
151 int i;
152
154 {
156 list_remove( &feature->entry );
158 }
159
161 {
165 }
166
167 LIST_FOR_EACH_SAFE( item, cursor, &package->files )
168 {
170
172 free( file->File );
173 free( file->FileName );
174 free( file->ShortName );
175 free( file->LongName );
176 free( file->Version );
177 free( file->Language );
178 if (msi_is_global_assembly( file->Component )) DeleteFileW( file->TargetPath );
179 free( file->TargetPath );
180 free( file );
181 }
182
184 {
186
187 list_remove( &comp->entry );
188 free( comp->Component );
189 free( comp->ComponentId );
190 free( comp->Directory );
191 free( comp->Condition );
192 free( comp->KeyPath );
193 free( comp->FullKeypath );
194 if (comp->assembly) free_assembly( comp->assembly );
195 free( comp );
196 }
197
199 {
201
202 list_remove( &patch->entry );
203 free( patch->path );
204 free( patch );
205 }
206
207 /* clean up extension, progid, class and verb structures */
209 {
211
212 list_remove( &cls->entry );
213 free( cls->clsid );
214 free( cls->Context );
215 free( cls->Description );
216 free( cls->FileTypeMask );
217 free( cls->IconPath );
218 free( cls->DefInprocHandler );
219 free( cls->DefInprocHandler32 );
220 free( cls->Argument );
221 free( cls->ProgIDText );
222 free( cls );
223 }
224
226 {
228
229 list_remove( &ext->entry );
231 }
232
234 {
236
237 list_remove( &progid->entry );
238 free( progid->ProgID );
239 free( progid->Description );
240 free( progid->IconPath );
241 free( progid );
242 }
243
244 LIST_FOR_EACH_SAFE( item, cursor, &package->mimes )
245 {
247
248 list_remove( &mt->entry );
249 free( mt->suffix );
250 free( mt->clsid );
251 free( mt->ContentType );
252 free( mt );
253 }
254
255 LIST_FOR_EACH_SAFE( item, cursor, &package->appids )
256 {
258
259 list_remove( &appid->entry );
260 free( appid->AppID );
261 free( appid->RemoteServerName );
262 free( appid->LocalServer );
263 free( appid->ServiceParameters );
264 free( appid->DllSurrogate );
265 free( appid );
266 }
267
269 {
271
272 list_remove( &info->entry );
273 free( info->value );
274 free( info );
275 }
276
278 {
280
281 list_remove( &info->entry );
282 free( info->volume_label );
283 free( info->disk_prompt );
284 free( info );
285 }
286
287 for (i = 0; i < SCRIPT_MAX; i++)
288 msi_free_action_script( package, i );
289
290 for (i = 0; i < package->unique_actions_count; i++)
291 free( package->unique_actions[i] );
292 free( package->unique_actions );
293
295 {
297
298 list_remove( &binary->entry );
299 if (!DeleteFileW( binary->tmpfile ))
300 ERR( "failed to delete %s (%lu)\n", debugstr_w(binary->tmpfile), GetLastError() );
301 free( binary->source );
302 free( binary->tmpfile );
303 free( binary );
304 }
305
307 {
309
310 list_remove( &cab->entry );
311 IStorage_Release( cab->storage );
312 free( cab->stream );
313 free( cab );
314 }
315
317 {
319
320 list_remove( &patch->entry );
321 if (patch->delete_on_close && !DeleteFileW( patch->localfile ))
322 {
323 ERR( "failed to delete %s (%lu)\n", debugstr_w(patch->localfile), GetLastError() );
324 }
325 msi_free_patchinfo( patch );
326 }
327
328 free( package->PackagePath );
329 free( package->ProductCode );
330 free( package->ActionFormat );
331 free( package->LastAction );
332 free( package->LastActionTemplate );
333 free( package->langids );
334
335 /* cleanup control event subscriptions */
337}
#define ERR(fmt,...)
Definition: precomp.h:57
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
Definition: delete.c:39
BOOL msi_is_global_assembly(MSICOMPONENT *comp)
Definition: action.c:2036
void msi_event_cleanup_all_subscriptions(MSIPACKAGE *package)
Definition: dialog.c:4107
static void free_folder(MSIFOLDER *folder)
Definition: package.c:86
static void free_extension(MSIEXTENSION *ext)
Definition: package.c:106
static void free_feature(MSIFEATURE *feature)
Definition: package.c:61
void msi_free_action_script(MSIPACKAGE *package, UINT script)
Definition: package.c:137
static void free_assembly(MSIASSEMBLY *assembly)
Definition: package.c:126
#define progid(str)
Definition: exdisp.idl:31
const GLuint GLenum const GLvoid * binary
Definition: glext.h:7538
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 debugstr_w
Definition: kernel32.h:32
char * appid
Definition: mkisofs.c:161
@ SCRIPT_MAX
Definition: msipriv.h:388
void msi_free_patchinfo(MSIPATCHINFO *patch)
Definition: patch.c:865
Definition: fci.c:127
struct list entry
Definition: fci.c:128
struct list entry
Definition: fci.c:117
struct list entry
Definition: msipriv.h:192
IStorage * storage
Definition: msipriv.h:194
LPWSTR clsid
Definition: msipriv.h:652
LPWSTR IconPath
Definition: msipriv.h:660
LPWSTR Argument
Definition: msipriv.h:663
LPWSTR ProgIDText
Definition: msipriv.h:656
LPWSTR DefInprocHandler
Definition: msipriv.h:661
LPWSTR FileTypeMask
Definition: msipriv.h:659
struct list entry
Definition: msipriv.h:651
LPWSTR Description
Definition: msipriv.h:657
LPWSTR DefInprocHandler32
Definition: msipriv.h:662
LPWSTR Context
Definition: msipriv.h:653
LPWSTR Component
Definition: msipriv.h:524
LPWSTR ComponentId
Definition: msipriv.h:525
MSIASSEMBLY * assembly
Definition: msipriv.h:540
struct list entry
Definition: msipriv.h:523
LPWSTR KeyPath
Definition: msipriv.h:529
LPWSTR Condition
Definition: msipriv.h:528
LPWSTR Directory
Definition: msipriv.h:526
LPWSTR FullKeypath
Definition: msipriv.h:538
WCHAR * path
Definition: msipriv.h:632
struct list entry
Definition: msipriv.h:625
LPWSTR ContentType
Definition: msipriv.h:711
LPWSTR clsid
Definition: msipriv.h:714
struct list entry
Definition: msipriv.h:710
LPWSTR suffix
Definition: msipriv.h:713
int unique_actions_count
Definition: msipriv.h:436
LPWSTR LastAction
Definition: msipriv.h:410
LPWSTR * unique_actions
Definition: msipriv.h:435
LPWSTR ProductCode
Definition: msipriv.h:448
LPWSTR PackagePath
Definition: msipriv.h:447
LANGID * langids
Definition: msipriv.h:398
LPWSTR LastActionTemplate
Definition: msipriv.h:411
LPWSTR ActionFormat
Definition: msipriv.h:409
struct list entry
Definition: msipriv.h:200
LPWSTR localfile
Definition: msipriv.h:205
BOOL delete_on_close
Definition: msipriv.h:208
DWORD WINAPI GetLastError(void)
Definition: except.c:1042

Referenced by MSI_FreePackage().

◆ get_fusion_filename()

static LPWSTR get_fusion_filename ( MSIPACKAGE package)
static

Definition at line 521 of file package.c.

522{
523 HKEY netsetup, hkey;
524 LONG res;
525 DWORD size, len, type;
526 WCHAR windir[MAX_PATH], path[MAX_PATH], *filename = NULL;
527
528 res = RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\NET Framework Setup\\NDP", 0, KEY_CREATE_SUB_KEY,
529 &netsetup);
530 if (res != ERROR_SUCCESS)
531 return NULL;
532
533 if (!RegCreateKeyExW(netsetup, L"v4\\Client", 0, NULL, 0, KEY_QUERY_VALUE, NULL, &hkey, NULL))
534 {
535 size = sizeof(path);
536 if (!RegQueryValueExW(hkey, L"InstallPath", NULL, &type, (BYTE *)path, &size))
537 {
538 len = lstrlenW(path) + lstrlenW(L"fusion.dll") + 2;
539 if (!(filename = malloc(len * sizeof(WCHAR)))) return NULL;
540
542 lstrcatW(filename, L"\\");
543 lstrcatW(filename, L"fusion.dll");
545 {
546 TRACE( "found %s\n", debugstr_w(filename) );
547 RegCloseKey(hkey);
548 RegCloseKey(netsetup);
549 return filename;
550 }
551 }
552 RegCloseKey(hkey);
553 }
554
555 if (!RegCreateKeyExW(netsetup, L"v2.0.50727", 0, NULL, 0, KEY_QUERY_VALUE, NULL, &hkey, NULL))
556 {
557 RegCloseKey(hkey);
559 len = lstrlenW(windir) + lstrlenW(L"Microsoft.NET\\Framework\\") + lstrlenW(L"v2.0.50727") +
560 lstrlenW(L"fusion.dll") + 3;
561 free(filename);
562 if (!(filename = malloc(len * sizeof(WCHAR)))) return NULL;
563
564 lstrcpyW(filename, windir);
565 lstrcatW(filename, L"\\");
566 lstrcatW(filename, L"Microsoft.NET\\Framework\\");
567 lstrcatW(filename, L"v2.0.50727");
568 lstrcatW(filename, L"\\");
569 lstrcatW(filename, L"fusion.dll");
571 {
572 TRACE( "found %s\n", debugstr_w(filename) );
573 RegCloseKey(netsetup);
574 return filename;
575 }
576 }
577
578 RegCloseKey(netsetup);
579 return filename;
580}
#define RegCloseKey(hKey)
Definition: registry.h:49
#define malloc
Definition: debug_ros.c:4
#define NULL
Definition: types.h:112
LONG WINAPI RegCreateKeyExW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey, _In_ DWORD Reserved, _In_opt_ LPWSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_opt_ LPDWORD lpdwDisposition)
Definition: reg.c:1096
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3333
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4103
#define MAX_PATH
Definition: compat.h:34
#define lstrcpyW
Definition: compat.h:749
#define lstrlenW
Definition: compat.h:750
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
Definition: fileinfo.c:652
UINT WINAPI GetWindowsDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2352
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLsizeiptr size
Definition: glext.h:5919
GLuint res
Definition: glext.h:9613
GLenum GLsizei len
Definition: glext.h:6722
const char * filename
Definition: ioapi.h:137
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:274
#define KEY_CREATE_SUB_KEY
Definition: nt_native.h:1018
#define KEY_QUERY_VALUE
Definition: nt_native.h:1016
long LONG
Definition: pedump.c:60
#define TRACE(s)
Definition: solgame.cpp:4
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned char BYTE
Definition: xxhash.c:193

Referenced by set_msi_assembly_prop().

◆ get_internal_error_message()

static LPCWSTR get_internal_error_message ( int  error)
static

Definition at line 1802 of file package.c.

1803{
1804 int i = 0;
1805
1806 while (internal_errors[i].id != 0)
1807 {
1808 if (internal_errors[i].id == error)
1809 return internal_errors[i].text;
1810 i++;
1811 }
1812
1813 FIXME("missing error message %d\n", error);
1814 return NULL;
1815}
#define FIXME(fmt,...)
Definition: precomp.h:53
static const struct @503 internal_errors[]
#define error(str)
Definition: mkdosfs.c:1605

Referenced by MSI_ProcessMessage().

◆ get_local_package()

static UINT get_local_package ( MSIDATABASE db,
WCHAR localfile 
)
static

Definition at line 1298 of file package.c.

1299{
1300 WCHAR *product_code;
1301 UINT r;
1302
1303 if (!(product_code = get_product_code( db )))
1305 r = get_registered_local_package( product_code, localfile );
1306 free( product_code );
1307 return r;
1308}
static UINT get_registered_local_package(const WCHAR *product, WCHAR *localfile)
Definition: package.c:1252
static WCHAR * get_product_code(MSIDATABASE *db)
Definition: package.c:1242
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define ERROR_INSTALL_PACKAGE_INVALID
Definition: winerror.h:978

Referenced by MSI_OpenPackageW().

◆ get_product_code()

static WCHAR * get_product_code ( MSIDATABASE db)
static

Definition at line 1242 of file package.c.

1243{
1244 return get_property( db, L"ProductCode" );
1245}
static WCHAR * get_property(MSIDATABASE *db, const WCHAR *prop)
Definition: package.c:1214

Referenced by get_local_package(), and MSI_OpenPackageW().

◆ get_product_version()

static WCHAR * get_product_version ( MSIDATABASE db)
static

Definition at line 1247 of file package.c.

1248{
1249 return get_property( db, L"ProductVersion" );
1250}

Referenced by MSI_OpenPackageW().

◆ get_property()

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

Definition at line 1214 of file package.c.

1215{
1217 MSIQUERY *view;
1218 MSIRECORD *rec;
1219 WCHAR *ret = NULL;
1220
1221 swprintf(query, ARRAY_SIZE(query), L"SELECT `Value` FROM `Property` WHERE `Property`='%s'", prop);
1223 {
1224 return NULL;
1225 }
1226 if (MSI_ViewExecute( view, 0 ) != ERROR_SUCCESS)
1227 {
1229 msiobj_release( &view->hdr );
1230 return NULL;
1231 }
1232 if (MSI_ViewFetch( view, &rec ) == ERROR_SUCCESS)
1233 {
1234 ret = wcsdup( MSI_RecordGetString( rec, 1 ) );
1235 msiobj_release( &rec->hdr );
1236 }
1238 msiobj_release( &view->hdr );
1239 return ret;
1240}
#define ARRAY_SIZE(A)
Definition: main.h:20
#define swprintf
Definition: precomp.h:40
const WCHAR * MSI_RecordGetString(const MSIRECORD *, UINT)
Definition: record.c:433
UINT MSI_ViewFetch(MSIQUERY *, MSIRECORD **)
Definition: msiquery.c:377
_Check_return_ _CRTIMP wchar_t *__cdecl wcsdup(_In_z_ const wchar_t *_Str)
MSIOBJECTHDR hdr
Definition: msipriv.h:151
int ret

Referenced by get_product_code(), and get_product_version().

◆ get_property_row()

static MSIRECORD * get_property_row ( MSIDATABASE db,
const WCHAR name 
)
static

Definition at line 2183 of file package.c.

2184{
2185 MSIRECORD *rec, *row = NULL;
2186 MSIQUERY *view;
2187 UINT r;
2188 WCHAR *buffer;
2189 int length;
2190
2191 if (!name || !*name)
2192 return NULL;
2193
2194 if (!wcscmp(name, L"Date"))
2195 {
2197 if (!length)
2198 return NULL;
2199 buffer = malloc(length * sizeof(WCHAR));
2201
2202 row = MSI_CreateRecord(1);
2203 if (!row)
2204 {
2205 free(buffer);
2206 return NULL;
2207 }
2209 free(buffer);
2210 return row;
2211 }
2212 else if (!wcscmp(name, L"Time"))
2213 {
2215 if (!length)
2216 return NULL;
2217 buffer = malloc(length * sizeof(WCHAR));
2219
2220 row = MSI_CreateRecord(1);
2221 if (!row)
2222 {
2223 free(buffer);
2224 return NULL;
2225 }
2227 free(buffer);
2228 return row;
2229 }
2230
2231 rec = MSI_CreateRecord(1);
2232 if (!rec)
2233 return NULL;
2234
2235 MSI_RecordSetStringW(rec, 1, name);
2236
2237 r = MSI_DatabaseOpenViewW(db, L"SELECT `Value` FROM `_Property` WHERE `_Property`=?", &view);
2238 if (r == ERROR_SUCCESS)
2239 {
2240 MSI_ViewExecute(view, rec);
2243 msiobj_release(&view->hdr);
2244 }
2245 msiobj_release(&rec->hdr);
2246 return row;
2247}
struct png_info_def *typedef unsigned char **typedef struct png_info_def *typedef struct png_info_def *typedef struct png_info_def *typedef unsigned char ** row
Definition: typeof.h:78
GLuint buffer
Definition: glext.h:5915
GLuint GLsizei GLsizei * length
Definition: glext.h:6040
INT WINAPI GetTimeFormatW(LCID lcid, DWORD dwFlags, const SYSTEMTIME *lpTime, LPCWSTR lpFormat, LPWSTR lpTimeStr, INT cchOut)
Definition: lcformat.c:1093
INT WINAPI GetDateFormatW(LCID lcid, DWORD dwFlags, const SYSTEMTIME *lpTime, LPCWSTR lpFormat, LPWSTR lpDateStr, INT cchOut)
Definition: lcformat.c:993
UINT MSI_RecordSetStringW(MSIRECORD *, UINT, LPCWSTR)
Definition: record.c:597
MSIRECORD * MSI_CreateRecord(UINT)
Definition: record.c:76
#define LOCALE_USER_DEFAULT
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
Definition: name.c:39
#define TIME_NOTIMEMARKER
Definition: winnls.h:279
#define DATE_SHORTDATE
Definition: winnls.h:196

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

◆ get_registered_local_package()

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

Definition at line 1252 of file package.c.

1253{
1255 WCHAR *filename;
1256 HKEY props_key;
1257 UINT r;
1258
1259 r = msi_locate_product( product, &context );
1260 if (r != ERROR_SUCCESS)
1261 return r;
1262
1263 r = MSIREG_OpenInstallProps( product, context, NULL, &props_key, FALSE );
1264 if (r != ERROR_SUCCESS)
1265 return r;
1266
1268 RegCloseKey( props_key );
1269 if (!filename)
1270 return ERROR_FUNCTION_FAILED;
1271
1272 lstrcpyW( localfile, filename );
1273 free( filename );
1274 return ERROR_SUCCESS;
1275}
#define FALSE
Definition: types.h:117
UINT msi_locate_product(LPCWSTR szProduct, MSIINSTALLCONTEXT *context)
Definition: msi.c:54
enum tagMSIINSTALLCONTEXT MSIINSTALLCONTEXT
static const WCHAR INSTALLPROPERTY_LOCALPACKAGEW[]
Definition: msi.h:343
UINT MSIREG_OpenInstallProps(LPCWSTR szProduct, MSIINSTALLCONTEXT dwContext, LPCWSTR szUserSid, HKEY *key, BOOL create)
Definition: registry.c:692
WCHAR * msi_reg_get_val_str(HKEY hkey, const WCHAR *name)
Definition: http.c:7252
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985

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

1701{
1702 if (!package || (package->ui_level & INSTALLUILEVEL_MASK) == INSTALLUILEVEL_NONE)
1703 return 0;
1704
1705 /* todo: check if message needs additional styles (topmost/foreground/modality?) */
1706
1707 switch (eMessageType & 0xff000000)
1708 {
1712 if (package->ui_level & INSTALLUILEVEL_PROGRESSONLY) return 0;
1713 if (!(eMessageType & MB_ICONMASK))
1714 eMessageType |= MB_ICONEXCLAMATION;
1715 return MessageBoxW(gUIhwnd, message, L"Windows Installer", eMessageType & 0x00ffffff);
1717 if (package->ui_level & INSTALLUILEVEL_PROGRESSONLY) return 0;
1718 if (!(eMessageType & MB_ICONMASK))
1719 eMessageType |= MB_ICONASTERISK;
1720 return MessageBoxW(gUIhwnd, message, L"Windows Installer", eMessageType & 0x00ffffff);
1722 if (package->ui_level & INSTALLUILEVEL_PROGRESSONLY) return 0;
1723 if (!(eMessageType & MB_ICONMASK))
1724 eMessageType |= MB_USERICON;
1725 return MessageBoxW(gUIhwnd, message, L"Windows Installer", eMessageType & 0x00ffffff);
1731 return 0;
1733 {
1735 INT rc = ACTION_DialogBox(package, dialog);
1736 free(dialog);
1737 return rc;
1738 }
1740 {
1741 LPWSTR deformatted;
1742 MSIRECORD *uirow = MSI_CreateRecord(1);
1743 if (!uirow) return -1;
1744 deformat_string(package, MSI_RecordGetString(record, 2), &deformatted);
1745 MSI_RecordSetStringW(uirow, 1, deformatted);
1746 msi_event_fire(package, L"ActionText", uirow);
1747
1748 free(deformatted);
1749 msiobj_release(&uirow->hdr);
1750 return 1;
1751 }
1753 {
1754 MSIRECORD *uirow = MSI_CreateRecord(1);
1755 if (!uirow) return -1;
1756 MSI_RecordSetStringW(uirow, 1, message);
1757 msi_event_fire(package, L"ActionData", uirow);
1758 msiobj_release(&uirow->hdr);
1759
1760 if (package->action_progress_increment)
1761 {
1762 uirow = MSI_CreateRecord(2);
1763 if (!uirow) return -1;
1764 MSI_RecordSetInteger(uirow, 1, 2);
1766 msi_event_fire(package, L"SetProgress", uirow);
1767 msiobj_release(&uirow->hdr);
1768 }
1769 return 1;
1770 }
1772 msi_event_fire(package, L"SetProgress", record);
1773 return 1;
1775 switch (MSI_RecordGetInteger(record, 1))
1776 {
1777 case 0:
1778 case 1:
1779 /* do nothing */
1780 return 0;
1781 default:
1782 /* fall through */
1783 ;
1784 }
1785 default:
1786 FIXME("internal UI not implemented for message 0x%08x (UI level = %x)\n", eMessageType, package->ui_level);
1787 return 0;
1788 }
1789}
void msi_event_fire(MSIPACKAGE *package, const WCHAR *event, MSIRECORD *rec)
Definition: dialog.c:4417
INT ACTION_DialogBox(MSIPACKAGE *package, const WCHAR *dialog)
Definition: dialog.c:4482
DWORD deformat_string(MSIPACKAGE *package, const WCHAR *fmt, WCHAR **data)
Definition: format.c:1016
static HWND dialog
Definition: gui.c:33
@ INSTALLMESSAGE_WARNING
Definition: msi.h:96
@ INSTALLMESSAGE_ACTIONSTART
Definition: msi.h:102
@ INSTALLMESSAGE_ERROR
Definition: msi.h:95
@ INSTALLMESSAGE_USER
Definition: msi.h:97
@ INSTALLMESSAGE_PROGRESS
Definition: msi.h:104
@ INSTALLMESSAGE_TERMINATE
Definition: msi.h:107
@ INSTALLMESSAGE_ACTIONDATA
Definition: msi.h:103
@ INSTALLMESSAGE_COMMONDATA
Definition: msi.h:105
@ INSTALLMESSAGE_OUTOFDISKSPACE
Definition: msi.h:101
@ INSTALLMESSAGE_INFO
Definition: msi.h:98
@ INSTALLMESSAGE_FATALEXIT
Definition: msi.h:94
@ INSTALLMESSAGE_INITIALIZE
Definition: msi.h:106
@ INSTALLMESSAGE_INSTALLSTART
Definition: msi.h:110
@ INSTALLMESSAGE_SHOWDIALOG
Definition: msi.h:108
@ INSTALLMESSAGE_INSTALLEND
Definition: msi.h:111
@ INSTALLUILEVEL_NONE
Definition: msi.h:66
@ INSTALLUILEVEL_PROGRESSONLY
Definition: msi.h:71
HWND gUIhwnd
Definition: msi_main.c:42
int MSI_RecordGetInteger(MSIRECORD *, UINT)
Definition: record.c:213
#define INSTALLUILEVEL_MASK
Definition: msipriv.h:60
UINT MSI_RecordSetInteger(MSIRECORD *, UINT, int)
Definition: record.c:280
WCHAR * msi_dup_record_field(MSIRECORD *row, INT index)
Definition: record.c:1002
Definition: tftpd.h:60
INSTALLUILEVEL ui_level
Definition: msipriv.h:452
UINT action_progress_increment
Definition: msipriv.h:413
int32_t INT
Definition: typedefs.h:58
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
#define MB_ICONMASK
Definition: winuser.h:822
#define MB_ICONEXCLAMATION
Definition: winuser.h:788
#define MB_USERICON
Definition: winuser.h:786
#define MB_ICONASTERISK
Definition: winuser.h:787
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by MSI_ProcessMessageVerbatim().

◆ load_admin_properties()

static UINT load_admin_properties ( MSIPACKAGE package)
static

Definition at line 949 of file package.c.

950{
951 BYTE *data;
952 UINT r, sz;
953
954 r = read_stream_data(package->db->storage, L"AdminProperties", FALSE, &data, &sz);
955 if (r != ERROR_SUCCESS)
956 return r;
957
958 r = msi_parse_command_line(package, (WCHAR *)data, TRUE);
959
960 free(data);
961 return r;
962}
#define TRUE
Definition: types.h:120
UINT msi_parse_command_line(MSIPACKAGE *package, LPCWSTR szCommandLine, BOOL preserve_case)
Definition: action.c:213
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
static HRESULT read_stream_data(nsChannelBSC *This, IStream *stream)
Definition: navigate.c:960
IStorage * storage
Definition: msipriv.h:109

Referenced by MSI_CreatePackage().

◆ msi_adjust_privilege_properties()

void msi_adjust_privilege_properties ( MSIPACKAGE package)

Definition at line 964 of file package.c.

965{
966 /* FIXME: this should depend on the user's privileges */
967 if (msi_get_property_int( package->db, L"ALLUSERS", 0 ) == 2)
968 {
969 TRACE("resetting ALLUSERS property from 2 to 1\n");
970 msi_set_property( package->db, L"ALLUSERS", L"1", -1 );
971 }
972 msi_set_property( package->db, L"AdminUser", L"1", -1 );
973 msi_set_property( package->db, L"Privileged", L"1", -1 );
974 msi_set_property( package->db, L"MsiRunningElevated", L"1", -1 );
975}
UINT msi_set_property(MSIDATABASE *db, const WCHAR *name, const WCHAR *value, int len)
Definition: package.c:2100
int msi_get_property_int(MSIDATABASE *db, LPCWSTR prop, int def)
Definition: package.c:2305

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

◆ msi_clone_properties()

UINT msi_clone_properties ( MSIDATABASE db)

Definition at line 381 of file package.c.

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

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

1063{
1064 DWORD time, len, i, offset;
1065 HANDLE handle;
1066
1067 time = GetTickCount();
1069 lstrcatW( path, L"\\Installer\\" );
1071
1072 len = lstrlenW(path);
1073 for (i = 0; i < 0x10000; i++)
1074 {
1075 offset = swprintf( path + len, MAX_PATH - len, L"%x", (time + i) & 0xffff );
1076 memcpy( path + len + offset, suffix, (lstrlenW( suffix ) + 1) * sizeof(WCHAR) );
1080 {
1082 break;
1083 }
1086 return ERROR_FUNCTION_FAILED;
1087 }
1088
1089 return ERROR_SUCCESS;
1090}
#define CloseHandle
Definition: compat.h:739
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define CreateFileW
Definition: compat.h:741
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:137
BOOL WINAPI CreateDirectoryW(IN LPCWSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
Definition: dir.c:90
DWORD WINAPI GetTickCount(VOID)
Definition: time.c:455
GLintptr offset
Definition: glext.h:5920
__u16 time
Definition: mkdosfs.c:8
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define CREATE_NEW
Definition: disk.h:69
#define GENERIC_WRITE
Definition: nt_native.h:90
#define ERROR_SHARING_VIOLATION
Definition: winerror.h:135
#define ERROR_FILE_EXISTS
Definition: winerror.h:165

Referenced by apply_patch_package(), and MSI_OpenPackageW().

◆ MSI_CreatePackage()

MSIPACKAGE * MSI_CreatePackage ( MSIDATABASE db)

Definition at line 977 of file package.c.

978{
979 MSIPACKAGE *package;
980 WCHAR uilevel[11];
981 int len;
982 UINT r;
983
984 TRACE("%p\n", db);
985
986 package = alloc_package();
987 if (package)
988 {
989 msiobj_addref( &db->hdr );
990 package->db = db;
991
992 package->LastAction = NULL;
993 package->LastActionTemplate = NULL;
995 package->WordCount = 0;
996 package->PackagePath = wcsdup( db->path );
997
999 msi_clone_properties( package->db );
1001
1002 package->ProductCode = msi_dup_property( package->db, L"ProductCode" );
1003
1004 set_installer_properties( package );
1005
1006 package->ui_level = gUILevel;
1007 len = swprintf( uilevel, ARRAY_SIZE(uilevel), L"%u", gUILevel & INSTALLUILEVEL_MASK );
1008 msi_set_property( package->db, L"UILevel", uilevel, len );
1009
1010 r = msi_load_suminfo_properties( package );
1011 if (r != ERROR_SUCCESS)
1012 {
1013 msiobj_release( &package->hdr );
1014 return NULL;
1015 }
1016
1018 load_admin_properties( package );
1019
1020 package->log_file = INVALID_HANDLE_VALUE;
1021 package->script = SCRIPT_NONE;
1022 }
1023 return package;
1024}
void msiobj_addref(MSIOBJECTHDR *info)
Definition: handle.c:217
static VOID set_installer_properties(MSIPACKAGE *package)
Definition: package.c:631
static UINT create_temp_property_table(MSIPACKAGE *package)
Definition: package.c:365
static UINT load_admin_properties(MSIPACKAGE *package)
Definition: package.c:949
INSTALLUILEVEL gUILevel
Definition: msi_main.c:41
@ msidbSumInfoSourceTypeAdminImage
Definition: msidefs.h:223
UINT msi_clone_properties(MSIDATABASE *)
Definition: package.c:381
@ SCRIPT_NONE
Definition: msipriv.h:384
UINT msi_load_suminfo_properties(MSIPACKAGE *package)
Definition: suminfo.c:1267
UINT msi_set_property(MSIDATABASE *, const WCHAR *, const WCHAR *, int)
Definition: package.c:2100
WCHAR * msi_dup_property(MSIDATABASE *db, const WCHAR *prop)
void msi_adjust_privilege_properties(MSIPACKAGE *)
Definition: package.c:964
#define MSI_NULL_INTEGER
Definition: msiquery.h:32
MSIOBJECTHDR hdr
Definition: msipriv.h:108
LPWSTR path
Definition: msipriv.h:112
UINT WordCount
Definition: msipriv.h:458
MSIOBJECTHDR hdr
Definition: msipriv.h:393
HANDLE log_file
Definition: msipriv.h:414
enum script script
Definition: msipriv.h:432
UINT LastActionResult
Definition: msipriv.h:412

◆ msi_download_file()

UINT msi_download_file ( LPCWSTR  szUrl,
LPWSTR  filename 
)

Definition at line 1026 of file package.c.

1027{
1029 DWORD size = 0;
1030 HRESULT hr;
1031
1032 /* call will always fail, because size is 0,
1033 * but will return ERROR_FILE_NOT_FOUND first
1034 * if the file doesn't exist
1035 */
1036 GetUrlCacheEntryInfoW( szUrl, NULL, &size );
1038 {
1039 cache_entry = malloc( size );
1040 if ( !GetUrlCacheEntryInfoW( szUrl, cache_entry, &size ) )
1041 {
1043 free( cache_entry );
1044 return error;
1045 }
1046
1047 lstrcpyW( filename, cache_entry->lpszLocalFileName );
1048 free( cache_entry );
1049 return ERROR_SUCCESS;
1050 }
1051
1053 if ( FAILED(hr) )
1054 {
1055 WARN("failed to download %s to cache file\n", debugstr_w(szUrl));
1056 return ERROR_FUNCTION_FAILED;
1057 }
1058
1059 return ERROR_SUCCESS;
1060}
BOOL WINAPI GetUrlCacheEntryInfoW(LPCWSTR lpszUrl, LPINTERNET_CACHE_ENTRY_INFOW lpCacheEntryInfo, LPDWORD lpdwCacheEntryInfoBufferSize)
Definition: urlcache.c:2012
#define FAILED(hr)
Definition: intsafe.h:51
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
HRESULT hr
Definition: shlfolder.c:183
Definition: wininet.h:2127
Definition: svc_auth_des.c:77
HRESULT WINAPI URLDownloadToCacheFileW(LPUNKNOWN lpUnkCaller, LPCWSTR szURL, LPWSTR szFileName, DWORD dwBufLength, DWORD dwReserved, LPBINDSTATUSCALLBACK pBSC)
Definition: umon.c:853

Referenced by MSI_OpenPackageW(), and ready_media().

◆ msi_dup_property()

LPWSTR msi_dup_property ( MSIDATABASE db,
LPCWSTR  prop 
)

Definition at line 2283 of file package.c.

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

Referenced by set_installer_properties().

◆ msi_free_action_script()

void msi_free_action_script ( MSIPACKAGE package,
UINT  script 
)

Definition at line 137 of file package.c.

138{
139 UINT i;
140 for (i = 0; i < package->script_actions_count[script]; i++)
141 free( package->script_actions[script][i] );
142
143 free( package->script_actions[script] );
144 package->script_actions[script] = NULL;
145 package->script_actions_count[script] = 0;
146}
script
Definition: msipriv.h:383
LPWSTR * script_actions[SCRIPT_MAX]
Definition: msipriv.h:433
int script_actions_count[SCRIPT_MAX]
Definition: msipriv.h:434

Referenced by execute_script(), and free_package_structures().

◆ MSI_FreePackage()

static void MSI_FreePackage ( MSIOBJECTHDR arg)
static

Definition at line 339 of file package.c.

340{
341 MSIPACKAGE *package = (MSIPACKAGE *)arg;
342
344
345 if( package->dialog )
346 msi_dialog_destroy( package->dialog );
347
348 msiobj_release( &package->db->hdr );
350 CloseHandle( package->log_file );
351 if (package->rpc_server_started)
352 RpcServerUnregisterIf(s_IWineMsiRemote_v0_0_s_ifspec, NULL, FALSE);
353 if (rpc_handle)
354 RpcBindingFree(&rpc_handle);
355 if (package->custom_server_32_process)
356 custom_stop_server(package->custom_server_32_process, package->custom_server_32_pipe);
357 if (package->custom_server_64_process)
358 custom_stop_server(package->custom_server_64_process, package->custom_server_64_pipe);
359
360 if (package->delete_on_close) DeleteFileW( package->localfile );
361 free( package->localfile );
363}
void custom_stop_server(HANDLE process, HANDLE pipe)
Definition: custom.c:682
void msi_dialog_destroy(msi_dialog *dialog)
Definition: dialog.c:4055
static void free_package_structures(MSIPACKAGE *package)
Definition: package.c:148
void msi_destroy_assembly_caches(MSIPACKAGE *package)
Definition: assembly.c:89
INT MSI_ProcessMessage(MSIPACKAGE *, INSTALLMESSAGE, MSIRECORD *)
Definition: package.c:1909
RPC_STATUS WINAPI RpcBindingFree(RPC_BINDING_HANDLE *Binding)
Definition: rpc_binding.c:787
RPC_STATUS WINAPI RpcServerUnregisterIf(RPC_IF_HANDLE IfSpec, UUID *MgrTypeUuid, UINT WaitForCallsToComplete)
Definition: rpc_server.c:1202

◆ msi_get_error_message()

LPWSTR msi_get_error_message ( MSIDATABASE db,
int  error 
)

Definition at line 1818 of file package.c.

1819{
1821 LPWSTR ret = NULL;
1822
1823 if ((record = MSI_QueryGetRecord(db, L"SELECT `Message` FROM `Error` WHERE `Error` = %d", error)))
1824 {
1826 msiobj_release(&record->hdr);
1827 }
1828 else if (error < 2000)
1829 {
1831 if (len)
1832 {
1833 ret = malloc((len + 1) * sizeof(WCHAR));
1835 }
1836 else
1837 ret = NULL;
1838 }
1839
1840 return ret;
1841}
HINSTANCE msi_hInstance
Definition: msi_main.c:51
#define IDS_ERROR_BASE
Definition: resource.h:33
MSIRECORD *WINAPIV MSI_QueryGetRecord(MSIDATABASE *db, LPCWSTR query,...)
Definition: msiquery.c:201
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)

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

◆ msi_get_package_code()

WCHAR * msi_get_package_code ( MSIDATABASE db)

Definition at line 1277 of file package.c.

1278{
1279 WCHAR *ret;
1280 MSISUMMARYINFO *si;
1281 UINT r;
1282
1283 r = msi_get_suminfo( db->storage, 0, &si );
1284 if (r != ERROR_SUCCESS)
1285 {
1286 r = msi_get_db_suminfo( db, 0, &si );
1287 if (r != ERROR_SUCCESS)
1288 {
1289 WARN("failed to load summary info %u\n", r);
1290 return NULL;
1291 }
1292 }
1294 msiobj_release( &si->hdr );
1295 return ret;
1296}
#define PID_REVNUMBER
Definition: suminfo.c:51
UINT msi_get_db_suminfo(MSIDATABASE *db, UINT uiUpdateCount, MSISUMMARYINFO **si)
Definition: suminfo.c:492
WCHAR * msi_suminfo_dup_string(MSISUMMARYINFO *si, UINT property)
Definition: suminfo.c:701
UINT msi_get_suminfo(IStorage *stg, UINT uiUpdateCount, MSISUMMARYINFO **si)
Definition: suminfo.c:462
MSIOBJECTHDR hdr
Definition: msipriv.h:486

Referenced by ACTION_PublishProduct(), and publish_product_properties().

◆ msi_get_property()

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

Definition at line 2250 of file package.c.

2252{
2253 MSIRECORD *row;
2255
2256 TRACE("%p %s %p %p\n", db, debugstr_w(szName), szValueBuf, pchValueBuf);
2257
2258 row = get_property_row( db, szName );
2259
2260 if (*pchValueBuf > 0)
2261 szValueBuf[0] = 0;
2262
2263 if (row)
2264 {
2265 rc = MSI_RecordGetStringW(row, 1, szValueBuf, pchValueBuf);
2266 msiobj_release(&row->hdr);
2267 }
2268
2269 if (rc == ERROR_SUCCESS)
2270 TRACE("returning %s for property %s\n", debugstr_wn(szValueBuf, *pchValueBuf),
2272 else if (rc == ERROR_MORE_DATA)
2273 TRACE( "need %lu sized buffer for %s\n", *pchValueBuf, debugstr_w(szName) );
2274 else
2275 {
2276 *pchValueBuf = 0;
2277 TRACE("property %s not found\n", debugstr_w(szName));
2278 }
2279
2280 return rc;
2281}
static MSIRECORD * get_property_row(MSIDATABASE *db, const WCHAR *name)
Definition: package.c:2183
#define debugstr_wn
Definition: kernel32.h:33
UINT MSI_RecordGetStringW(MSIRECORD *, UINT, LPWSTR, LPDWORD)
static const WCHAR szName[]
Definition: powrprof.c:45

Referenced by create_temp_dir(), deformat_property(), dialog_get_checkbox_state(), msi_create_temp_file(), 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 2305 of file package.c.

2306{
2307 LPWSTR str = msi_dup_property( db, prop );
2308 int val = str ? wcstol(str, NULL, 10) : def;
2309 free(str);
2310 return val;
2311}
LPWSTR msi_dup_property(MSIDATABASE *db, LPCWSTR prop)
Definition: package.c:2283
GLuint GLfloat * val
Definition: glext.h:7180
_Check_return_ long __cdecl wcstol(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)

Referenced by ACTION_AllocateRegistrySpace(), ACTION_CostFinalize(), ACTION_FindRelatedProducts(), ACTION_InstallFiles(), ACTION_MigrateFeatureStates(), ACTION_RegisterProduct(), dialog_adjust_dialog_pos(), get_root_key(), is_obsoleted_by_patch(), msi_adjust_privilege_properties(), MSI_InstallPackage(), msi_set_context(), MSI_SetFeatureStates(), MsiEnumComponentCostsW(), MsiGetLanguage(), MsiGetMode(), publish_install_properties(), and publish_product_properties().

◆ MSI_OpenPackageW()

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

Definition at line 1384 of file package.c.

1385{
1386 MSIDATABASE *db;
1387 MSIPACKAGE *package;
1389 MSIRECORD *data_row, *info_row;
1390 UINT r;
1391 WCHAR localfile[MAX_PATH], cachefile[MAX_PATH];
1392 LPCWSTR file = szPackage;
1393 DWORD index = 0;
1394 MSISUMMARYINFO *si;
1395 BOOL delete_on_close = FALSE;
1396 WCHAR *info_template, *productname, *product_code;
1398
1399 TRACE("%s %p\n", debugstr_w(szPackage), pPackage);
1400
1402
1403 localfile[0] = 0;
1404 if( szPackage[0] == '#' )
1405 {
1406 handle = wcstol(&szPackage[1], NULL, 10);
1408 return ERROR_INVALID_HANDLE;
1409 }
1410 else
1411 {
1412 WCHAR *product_version = NULL;
1413
1414 if ( UrlIsW( szPackage, URLIS_URL ) )
1415 {
1416 r = msi_download_file( szPackage, cachefile );
1417 if (r != ERROR_SUCCESS)
1418 return r;
1419
1420 file = cachefile;
1421 }
1422#ifdef __REACTOS__
1423 AppHelpCheckPackage(file);
1424#endif
1425
1427 if (r != ERROR_SUCCESS)
1428 {
1430 return ERROR_FILE_NOT_FOUND;
1431 return r;
1432 }
1433 r = get_local_package( db, localfile );
1435 {
1436 DWORD localfile_attr;
1437
1438 r = msi_create_empty_local_file( localfile, L".msi" );
1439 if (r != ERROR_SUCCESS)
1440 {
1441 msiobj_release( &db->hdr );
1442 return r;
1443 }
1444
1445 if (!CopyFileW( file, localfile, FALSE ))
1446 {
1447 r = GetLastError();
1448 WARN("unable to copy package %s to %s (%u)\n", debugstr_w(file), debugstr_w(localfile), r);
1449 DeleteFileW( localfile );
1450 msiobj_release( &db->hdr );
1451 return r;
1452 }
1453 delete_on_close = TRUE;
1454
1455 /* Remove read-only bit, we are opening it with write access in MSI_OpenDatabaseW below. */
1456 localfile_attr = GetFileAttributesW( localfile );
1457 if (localfile_attr & FILE_ATTRIBUTE_READONLY)
1458 SetFileAttributesW( localfile, localfile_attr & ~FILE_ATTRIBUTE_READONLY);
1459 }
1461 {
1462 if (!CopyFileW( file, localfile, FALSE ))
1463 {
1464 r = GetLastError();
1465 WARN("unable to update cached package (%u)\n", r);
1466 msiobj_release( &db->hdr );
1467 return r;
1468 }
1469 }
1470 else
1471 product_version = get_product_version( db );
1472 msiobj_release( &db->hdr );
1473 TRACE("opening package %s\n", debugstr_w( localfile ));
1474 r = MSI_OpenDatabaseW( localfile, MSIDBOPEN_TRANSACT, &db );
1475 if (r != ERROR_SUCCESS)
1476 {
1477 free( product_version );
1478 return r;
1479 }
1480
1481 if (product_version)
1482 {
1483 WCHAR *cache_version = get_product_version( db );
1484 if (!product_version != !cache_version ||
1485 (product_version && wcscmp(product_version, cache_version)))
1486 {
1487 msiobj_release( &db->hdr );
1488 free( product_version );
1489 free( cache_version );
1490 return ERROR_PRODUCT_VERSION;
1491 }
1492 free( product_version );
1493 free( cache_version );
1494 }
1495 }
1496 package = MSI_CreatePackage( db );
1497 msiobj_release( &db->hdr );
1498 if (!package) return ERROR_INSTALL_PACKAGE_INVALID;
1499 package->localfile = wcsdup( localfile );
1500 package->delete_on_close = delete_on_close;
1501
1502 r = msi_get_suminfo( db->storage, 0, &si );
1503 if (r != ERROR_SUCCESS)
1504 {
1505 r = msi_get_db_suminfo( db, 0, &si );
1506 if (r != ERROR_SUCCESS)
1507 {
1508 WARN("failed to load summary info\n");
1509 msiobj_release( &package->hdr );
1511 }
1512 }
1513 r = parse_suminfo( si, package );
1514 msiobj_release( &si->hdr );
1515 if (r != ERROR_SUCCESS)
1516 {
1517 WARN("failed to parse summary info %u\n", r);
1518 msiobj_release( &package->hdr );
1519 return r;
1520 }
1521 r = validate_package( package );
1522 if (r != ERROR_SUCCESS)
1523 {
1524 msiobj_release( &package->hdr );
1525 return r;
1526 }
1527 msi_set_property( package->db, L"DATABASE", db->path, -1 );
1528 set_installed_prop( package );
1529 msi_set_context( package );
1530
1531 product_code = get_product_code( db );
1532 if (msi_locate_product( product_code, &context ) == ERROR_SUCCESS)
1533 {
1534 TRACE("product already registered\n");
1535 msi_set_property( package->db, L"ProductToBeRegistered", L"1", -1 );
1536 }
1537 free( product_code );
1538
1539 while (1)
1540 {
1541 WCHAR patch_code[GUID_SIZE];
1542 r = MsiEnumPatchesExW( package->ProductCode, NULL, package->Context,
1543 MSIPATCHSTATE_APPLIED, index, patch_code, NULL, NULL, NULL, NULL );
1544 if (r != ERROR_SUCCESS)
1545 break;
1546
1547 TRACE("found registered patch %s\n", debugstr_w(patch_code));
1548
1549 r = msi_apply_registered_patch( package, patch_code );
1550 if (r != ERROR_SUCCESS)
1551 {
1552 ERR("registered patch failed to apply %u\n", r);
1553 msiobj_release( &package->hdr );
1554 return r;
1555 }
1556 index++;
1557 }
1558 if (index) msi_adjust_privilege_properties( package );
1559
1560 r = msi_set_original_database_property( package->db, szPackage );
1561 if (r != ERROR_SUCCESS)
1562 {
1563 msiobj_release( &package->hdr );
1564 return r;
1565 }
1566 if (gszLogFile)
1569
1570 /* FIXME: when should these messages be sent? */
1571 data_row = MSI_CreateRecord(3);
1572 if (!data_row)
1573 return ERROR_OUTOFMEMORY;
1574 MSI_RecordSetStringW(data_row, 0, NULL);
1575 MSI_RecordSetInteger(data_row, 1, 0);
1576 MSI_RecordSetInteger(data_row, 2, package->num_langids ? package->langids[0] : 0);
1579
1580 info_row = MSI_CreateRecord(0);
1581 if (!info_row)
1582 {
1583 msiobj_release(&data_row->hdr);
1584 return ERROR_OUTOFMEMORY;
1585 }
1586 info_template = msi_get_error_message(package->db, MSIERR_INFO_LOGGINGSTART);
1587 MSI_RecordSetStringW(info_row, 0, info_template);
1588 free(info_template);
1590
1592
1593 productname = msi_dup_property(package->db, INSTALLPROPERTY_PRODUCTNAMEW);
1594 MSI_RecordSetInteger(data_row, 1, 1);
1595 MSI_RecordSetStringW(data_row, 2, productname);
1596 MSI_RecordSetStringW(data_row, 3, NULL);
1598
1599 free(productname);
1600 msiobj_release(&info_row->hdr);
1601 msiobj_release(&data_row->hdr);
1602
1603 *pPackage = package;
1604 return ERROR_SUCCESS;
1605}
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13
#define OPEN_EXISTING
Definition: compat.h:775
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
BOOL WINAPI CopyFileW(IN LPCWSTR lpExistingFileName, IN LPCWSTR lpNewFileName, IN BOOL bFailIfExists)
Definition: copy.c:439
BOOL WINAPI SetFileAttributesW(LPCWSTR lpFileName, DWORD dwFileAttributes)
Definition: fileinfo.c:794
UINT msi_set_context(MSIPACKAGE *package)
Definition: action.c:394
UINT MSI_OpenDatabaseW(LPCWSTR szDBPath, LPCWSTR szPersist, MSIDATABASE **pdb)
Definition: database.c:140
void * msihandle2msiinfo(MSIHANDLE handle, UINT type)
Definition: handle.c:158
static UINT validate_package(MSIPACKAGE *package)
Definition: package.c:1171
UINT msi_download_file(LPCWSTR szUrl, LPWSTR filename)
Definition: package.c:1026
INT MSI_ProcessMessage(MSIPACKAGE *package, INSTALLMESSAGE eMessageType, MSIRECORD *record)
Definition: package.c:1909
static UINT get_local_package(MSIDATABASE *db, WCHAR *localfile)
Definition: package.c:1298
static WCHAR * get_product_version(MSIDATABASE *db)
Definition: package.c:1247
static UINT parse_suminfo(MSISUMMARYINFO *si, MSIPACKAGE *package)
Definition: package.c:1102
static UINT set_installed_prop(MSIPACKAGE *package)
Definition: package.c:457
UINT msi_create_empty_local_file(LPWSTR path, LPCWSTR suffix)
Definition: package.c:1062
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:1949
#define MSIERR_INFO_LOGGINGSTART
Definition: resource.h:24
BOOL WINAPI UrlIsW(LPCWSTR pszUrl, URLIS Urlis)
Definition: url.c:1933
unsigned int BOOL
Definition: ntddk_ex.h:94
GLuint index
Definition: glext.h:6031
@ MSIPATCHSTATE_APPLIED
Definition: msi.h:54
static const WCHAR INSTALLPROPERTY_PRODUCTNAMEW[]
Definition: msi.h:277
WCHAR * gszLogFile
Definition: msi_main.c:50
#define MSIHANDLETYPE_DATABASE
Definition: msipriv.h:722
UINT msi_get_string_table_codepage(const string_table *st)
Definition: string.c:671
#define GUID_SIZE
Definition: msipriv.h:733
INT MSI_ProcessMessageVerbatim(MSIPACKAGE *, INSTALLMESSAGE, MSIRECORD *)
Definition: package.c:1843
UINT msi_apply_registered_patch(MSIPACKAGE *package, LPCWSTR patch_code)
Definition: patch.c:990
UINT msi_set_original_database_property(MSIDATABASE *, const WCHAR *)
Definition: package.c:1310
#define WINE_OPENPACKAGEFLAGS_RECACHE
Definition: msipriv.h:884
WCHAR * msi_get_error_message(MSIDATABASE *, int)
Definition: package.c:1818
#define MSIDBOPEN_TRANSACT
Definition: msiquery.h:67
#define MSIDBOPEN_READONLY
Definition: msiquery.h:66
#define FILE_SHARE_WRITE
Definition: nt_native.h:681
#define FILE_ATTRIBUTE_READONLY
Definition: nt_native.h:702
@ URLIS_URL
Definition: shlwapi.h:1217
DWORD dwOptions
Definition: solitaire.cpp:25
string_table * strings
Definition: msipriv.h:110
BOOL delete_on_close
Definition: msipriv.h:450
UINT num_langids
Definition: msipriv.h:397
MSIINSTALLCONTEXT Context
Definition: msipriv.h:459
LPWSTR localfile
Definition: msipriv.h:449
unsigned long MSIHANDLE
Definition: winemsi.idl:27
#define ERROR_PRODUCT_VERSION
Definition: winerror.h:996
#define MB_ICONHAND
Definition: winuser.h:791
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185

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

2627{
2629
2631 {
2632 if (!wcscmp( info->value, value )) return ERROR_SUCCESS;
2633 }
2634
2635 info = malloc(sizeof(MSISOURCELISTINFO));
2636 if (!info)
2637 return ERROR_OUTOFMEMORY;
2638
2639 info->context = context;
2640 info->options = options;
2641 info->property = property;
2642 info->value = wcsdup(value);
2643 list_add_head(&package->sourcelist_info, &info->entry);
2644
2645 return ERROR_SUCCESS;
2646}
static void list_add_head(struct list_entry *head, struct list_entry *entry)
Definition: list.h:76
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
Definition: pdh_main.c:94

Referenced by msi_load_media_info().

◆ msi_package_add_media_disk()

UINT msi_package_add_media_disk ( MSIPACKAGE package,
DWORD  context,
DWORD  options,
DWORD  disk_id,
LPWSTR  volume_label,
LPWSTR  disk_prompt 
)

Definition at line 2648 of file package.c.

2650{
2651 MSIMEDIADISK *disk;
2652
2654 {
2655 if (disk->disk_id == disk_id) return ERROR_SUCCESS;
2656 }
2657
2658 disk = malloc(sizeof(MSIMEDIADISK));
2659 if (!disk)
2660 return ERROR_OUTOFMEMORY;
2661
2662 disk->context = context;
2663 disk->options = options;
2664 disk->disk_id = disk_id;
2666 disk->disk_prompt = wcsdup(disk_prompt);
2667 list_add_head(&package->sourcelist_media, &disk->entry);
2668
2669 return ERROR_SUCCESS;
2670}
__u8 volume_label[11]
Definition: mkdosfs.c:4
DWORD context
Definition: msipriv.h:169
DWORD options
Definition: msipriv.h:170
LPWSTR volume_label
Definition: msipriv.h:172
struct list entry
Definition: msipriv.h:168
LPWSTR disk_prompt
Definition: msipriv.h:173
DWORD disk_id
Definition: msipriv.h:171

Referenced by msi_load_media_info().

◆ MSI_ProcessMessage()

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

Definition at line 1909 of file package.c.

1910{
1911 switch (eMessageType & 0xff000000)
1912 {
1920 {
1921 /* error message */
1922
1923 LPWSTR template;
1924 LPWSTR template_rec = NULL, template_prefix = NULL;
1926
1927 if (MSI_RecordIsNull(record, 0))
1928 {
1929 if (error >= 32)
1930 {
1931 template_rec = msi_get_error_message(package->db, error);
1932
1933 if (!template_rec && error >= 2000)
1934 {
1935 /* internal error, not localized */
1936 if ((template_rec = (LPWSTR) get_internal_error_message(error)))
1937 {
1938 MSI_RecordSetStringW(record, 0, template_rec);
1940 }
1941 template_rec = msi_get_error_message(package->db, MSIERR_INSTALLERROR);
1942 MSI_RecordSetStringW(record, 0, template_rec);
1943 MSI_ProcessMessageVerbatim(package, eMessageType, record);
1944 free(template_rec);
1945 return 0;
1946 }
1947 }
1948 }
1949 else
1950 template_rec = msi_dup_record_field(record, 0);
1951
1952 template_prefix = msi_get_error_message(package->db, eMessageType >> 24);
1953 if (!template_prefix) template_prefix = wcsdup(L"");
1954
1955 if (!template_rec)
1956 {
1957 /* always returns 0 */
1958 MSI_RecordSetStringW(record, 0, template_prefix);
1959 MSI_ProcessMessageVerbatim(package, eMessageType, record);
1960 free(template_prefix);
1961 return 0;
1962 }
1963
1964 template = malloc((wcslen(template_rec) + wcslen(template_prefix) + 1) * sizeof(WCHAR));
1965 if (!template)
1966 {
1967 free(template_prefix);
1968 free(template_rec);
1969 return ERROR_OUTOFMEMORY;
1970 }
1971
1972 lstrcpyW(template, template_prefix);
1973 lstrcatW(template, template_rec);
1974 MSI_RecordSetStringW(record, 0, template);
1975
1976 free(template_prefix);
1977 free(template_rec);
1978 free(template);
1979 }
1980 break;
1982 {
1983 WCHAR *template = msi_get_error_message(package->db, MSIERR_ACTIONSTART);
1984 MSI_RecordSetStringW(record, 0, template);
1985 free(template);
1986
1987 free(package->LastAction);
1988 free(package->LastActionTemplate);
1989 package->LastAction = msi_dup_record_field(record, 1);
1990 if (!package->LastAction) package->LastAction = wcsdup(L"");
1992 break;
1993 }
1995 if (package->LastAction && package->LastActionTemplate)
1996 {
1997 size_t len = lstrlenW(package->LastAction) + lstrlenW(package->LastActionTemplate) + 7;
1998 WCHAR *template = malloc(len * sizeof(WCHAR));
1999 if (!template) return ERROR_OUTOFMEMORY;
2000 swprintf(template, len, L"{{%s: }}%s", package->LastAction, package->LastActionTemplate);
2001 MSI_RecordSetStringW(record, 0, template);
2002 free(template);
2003 }
2004 break;
2006 {
2007 WCHAR *template = msi_get_error_message(package->db, MSIERR_COMMONDATA);
2008 MSI_RecordSetStringW(record, 0, template);
2009 free(template);
2010 }
2011 break;
2012 }
2013
2014 return MSI_ProcessMessageVerbatim(package, eMessageType, record);
2015}
static LPCWSTR get_internal_error_message(int error)
Definition: package.c:1802
INT MSI_ProcessMessageVerbatim(MSIPACKAGE *package, INSTALLMESSAGE eMessageType, MSIRECORD *record)
Definition: package.c:1843
LPWSTR msi_get_error_message(MSIDATABASE *db, int error)
Definition: package.c:1818
#define MSIERR_INSTALLERROR
Definition: resource.h:21
#define MSIERR_ACTIONSTART
Definition: resource.h:22
#define MSIERR_COMMONDATA
Definition: resource.h:23
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
BOOL MSI_RecordIsNull(MSIRECORD *, UINT)
Definition: record.c:321

Referenced by ACTION_AllocateRegistrySpace(), ACTION_ExecuteAction(), ACTION_MsiPublishAssemblies(), ACTION_MsiUnpublishAssemblies(), ACTION_ProcessComponents(), ACTION_PublishFeatures(), ACTION_PublishProduct(), ACTION_RegisterClassInfo(), ACTION_RegisterExtensionInfo(), ACTION_RegisterMIMEInfo(), ACTION_RegisterProduct(), ACTION_RegisterProgIdInfo(), ACTION_RegisterUser(), ACTION_RemoveFiles(), ACTION_ResolveSource(), ACTION_ShowDialog(), ACTION_UnregisterClassInfo(), ACTION_UnregisterExtensionInfo(), ACTION_UnregisterMIMEInfo(), ACTION_UnregisterProgIdInfo(), change_media(), dialog_create(), file_update_ui(), 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_FreePackage(), MSI_OpenPackageW(), msi_ui_progress(), MsiOpenPackageExW(), MsiProcessMessage(), ui_actioninfo(), ui_actionstart(), and unpublish_feature().

◆ MSI_ProcessMessageVerbatim()

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

Definition at line 1843 of file package.c.

1844{
1845 LPWSTR message = {0};
1846 DWORD len;
1847 DWORD log_type = 1 << (eMessageType >> 24);
1848 UINT res;
1849 INT rc = 0;
1850 char *msg;
1851
1852 TRACE("%x\n", eMessageType);
1853 if (TRACE_ON(msi)) dump_record(record);
1854
1855 if (!package || !record)
1856 message = NULL;
1857 else {
1858 res = MSI_FormatRecordW(package, record, message, &len);
1859 if (res != ERROR_SUCCESS && res != ERROR_MORE_DATA)
1860 return res;
1861 len++;
1862 message = malloc(len * sizeof(WCHAR));
1863 if (!message) return ERROR_OUTOFMEMORY;
1864 MSI_FormatRecordW(package, record, message, &len);
1865 }
1866
1867 /* convert it to ANSI */
1868 len = WideCharToMultiByte( CP_ACP, 0, message, -1, NULL, 0, NULL, NULL );
1869 msg = malloc( len );
1871
1872 if (gUIHandlerRecord && (gUIFilterRecord & log_type))
1873 {
1874 MSIHANDLE rec = alloc_msihandle(&record->hdr);
1875 TRACE( "calling UI handler %p(pvContext = %p, iMessageType = %#x, hRecord = %lu)\n",
1876 gUIHandlerRecord, gUIContextRecord, eMessageType, rec );
1877 rc = gUIHandlerRecord( gUIContextRecord, eMessageType, rec );
1878 MsiCloseHandle( rec );
1879 }
1880 if (!rc && gUIHandlerW && (gUIFilter & log_type))
1881 {
1882 TRACE( "calling UI handler %p(pvContext = %p, iMessageType = %#x, szMessage = %s)\n",
1883 gUIHandlerW, gUIContext, eMessageType, debugstr_w(message) );
1884 rc = gUIHandlerW( gUIContext, eMessageType, message );
1885 }
1886 else if (!rc && gUIHandlerA && (gUIFilter & log_type))
1887 {
1888 TRACE( "calling UI handler %p(pvContext = %p, iMessageType = %#x, szMessage = %s)\n",
1889 gUIHandlerA, gUIContext, eMessageType, debugstr_a(msg) );
1890 rc = gUIHandlerA( gUIContext, eMessageType, msg );
1891 }
1892
1893 if (!rc)
1894 rc = internal_ui_handler(package, eMessageType, record, message);
1895
1896 if (!rc && package && package->log_file != INVALID_HANDLE_VALUE &&
1897 (eMessageType & 0xff000000) != INSTALLMESSAGE_PROGRESS)
1898 {
1899 DWORD written;
1900 WriteFile( package->log_file, msg, len - 1, &written, NULL );
1901 WriteFile( package->log_file, "\n", 1, &written, NULL );
1902 }
1903 free( msg );
1904 free( message );
1905
1906 return rc;
1907}
#define msg(x)
Definition: auth_time.c:54
#define CP_ACP
Definition: compat.h:109
#define TRACE_ON(x)
Definition: compat.h:75
#define WideCharToMultiByte
Definition: compat.h:111
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: rw.c:24
UINT MSI_FormatRecordW(MSIPACKAGE *package, MSIRECORD *record, LPWSTR buffer, LPDWORD size)
Definition: format.c:838
MSIHANDLE alloc_msihandle(MSIOBJECTHDR *obj)
Definition: handle.c:111
UINT WINAPI MsiCloseHandle(MSIHANDLE handle)
Definition: handle.c:269
static INT internal_ui_handler(MSIPACKAGE *package, INSTALLMESSAGE eMessageType, MSIRECORD *record, LPCWSTR message)
Definition: package.c:1700
#define debugstr_a
Definition: kernel32.h:31
INSTALLUI_HANDLERA gUIHandlerA
Definition: msi_main.c:43
DWORD gUIFilter
Definition: msi_main.c:46
LPVOID gUIContextRecord
Definition: msi_main.c:49
DWORD gUIFilterRecord
Definition: msi_main.c:47
LPVOID gUIContext
Definition: msi_main.c:48
INSTALLUI_HANDLER_RECORD gUIHandlerRecord
Definition: msi_main.c:45
INSTALLUI_HANDLERW gUIHandlerW
Definition: msi_main.c:44
void dump_record(MSIRECORD *)
Definition: record.c:1028

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

◆ msi_reset_source_folders()

void msi_reset_source_folders ( MSIPACKAGE package)

Definition at line 2089 of file package.c.

2090{
2092
2094 {
2095 free( folder->ResolvedSource );
2096 folder->ResolvedSource = NULL;
2097 }
2098}

Referenced by ACTION_CustomAction(), append_productcode(), dialog_set_property(), ITERATE_AppSearch(), 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 1310 of file package.c.

1311{
1312 UINT r;
1313
1314 if (UrlIsW( package, URLIS_URL ))
1315 r = msi_set_property( db, L"OriginalDatabase", package, -1 );
1316 else if (package[0] == '#')
1317 r = msi_set_property( db, L"OriginalDatabase", db->path, -1 );
1318 else
1319 {
1320 DWORD len;
1321 WCHAR *path;
1322
1323 if (!(len = GetFullPathNameW( package, 0, NULL, NULL ))) return GetLastError();
1324 if (!(path = malloc( len * sizeof(WCHAR) ))) return ERROR_OUTOFMEMORY;
1325 len = GetFullPathNameW( package, len, path, NULL );
1326 r = msi_set_property( db, L"OriginalDatabase", path, len );
1327 free( path );
1328 }
1329 return r;
1330}
DWORD WINAPI GetFullPathNameW(IN LPCWSTR lpFileName, IN DWORD nBufferLength, OUT LPWSTR lpBuffer, OUT LPWSTR *lpFilePart)
Definition: path.c:1106

Referenced by MSI_InstallPackage(), and MSI_OpenPackageW().

◆ msi_set_property()

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

Definition at line 2100 of file package.c.

2101{
2102 MSIQUERY *view;
2103 MSIRECORD *row = NULL;
2104 DWORD sz = 0;
2105 WCHAR query[1024];
2106 UINT rc;
2107
2108 TRACE("%p %s %s %d\n", db, debugstr_w(name), debugstr_wn(value, len), len);
2109
2110 if (!name)
2112
2113 /* this one is weird... */
2114 if (!name[0])
2116
2117 if (value && len < 0) len = lstrlenW( value );
2118
2119 rc = msi_get_property( db, name, 0, &sz );
2120 if (!value || (!*value && !len))
2121 {
2122 swprintf( query, ARRAY_SIZE(query), L"DELETE FROM `_Property` WHERE `_Property` = '%s'", name );
2123 }
2124 else if (rc == ERROR_MORE_DATA || rc == ERROR_SUCCESS)
2125 {
2126 swprintf( query, ARRAY_SIZE(query), L"UPDATE `_Property` SET `Value` = ? WHERE `_Property` = '%s'", name );
2127 row = MSI_CreateRecord(1);
2129 }
2130 else
2131 {
2132 lstrcpyW( query, L"INSERT INTO `_Property` (`_Property`,`Value`) VALUES (?,?)" );
2133 row = MSI_CreateRecord(2);
2134 msi_record_set_string( row, 1, name, -1 );
2136 }
2137
2138 rc = MSI_DatabaseOpenViewW(db, query, &view);
2139 if (rc == ERROR_SUCCESS)
2140 {
2141 rc = MSI_ViewExecute(view, row);
2143 msiobj_release(&view->hdr);
2144 }
2145 if (row) msiobj_release(&row->hdr);
2146 return rc;
2147}
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
UINT msi_record_set_string(MSIRECORD *, UINT, const WCHAR *, int)
Definition: record.c:573

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

1670{
1671 MSIPACKAGE *package;
1672 MSIHANDLE handle = 0;
1673 MSIHANDLE remote;
1674
1675 TRACE( "%lu\n", hInstall );
1676
1677 package = msihandle2msiinfo( hInstall, MSIHANDLETYPE_PACKAGE);
1678 if( package)
1679 {
1680 handle = alloc_msihandle( &package->db->hdr );
1681 msiobj_release( &package->hdr );
1682 }
1683 else if ((remote = msi_get_remote(hInstall)))
1684 {
1685 __TRY
1686 {
1687 handle = remote_GetActiveDatabase(remote);
1689 }
1691 {
1692 handle = 0;
1693 }
1694 __ENDTRY
1695 }
1696
1697 return handle;
1698}
#define __TRY
Definition: compat.h:80
#define __ENDTRY
Definition: compat.h:82
LONG WINAPI rpc_filter(EXCEPTION_POINTERS *eptr)
Definition: custom.c:85
MSIHANDLE msi_get_remote(MSIHANDLE handle)
Definition: handle.c:183
MSIHANDLE alloc_msi_remote_handle(MSIHANDLE remote)
Definition: handle.c:135
#define __EXCEPT(func)
Definition: exception.h:84

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

2314{
2315 const WCHAR *value = L"";
2316 MSIPACKAGE *package;
2317 MSIRECORD *row;
2318 WCHAR *nameW;
2319 int len = 0;
2320 UINT r;
2321
2322 if (!name)
2324
2325 if (!(nameW = strdupAtoW(name)))
2326 return ERROR_OUTOFMEMORY;
2327
2328 package = msihandle2msiinfo(hinst, MSIHANDLETYPE_PACKAGE);
2329 if (!package)
2330 {
2331 WCHAR *value = NULL, *tmp;
2332 MSIHANDLE remote;
2333 DWORD len;
2334
2335 if (!(remote = msi_get_remote(hinst)))
2336 {
2337 free(nameW);
2338 return ERROR_INVALID_HANDLE;
2339 }
2340
2341 __TRY
2342 {
2343 r = remote_GetProperty(remote, nameW, &value, &len);
2344 }
2346 {
2347 r = GetExceptionCode();
2348 }
2349 __ENDTRY
2350
2351 free(nameW);
2352
2353 if (!r)
2354 {
2355 /* String might contain embedded nulls.
2356 * Native returns the correct size but truncates the string. */
2357 tmp = calloc(1, (len + 1) * sizeof(WCHAR));
2358 if (!tmp)
2359 {
2361 return ERROR_OUTOFMEMORY;
2362 }
2363 lstrcpyW(tmp, value);
2364
2365 r = msi_strncpyWtoA(tmp, len, buf, sz, TRUE);
2366
2367 free(tmp);
2368 }
2370 return r;
2371 }
2372
2373 row = get_property_row(package->db, nameW);
2374 if (row)
2376
2377 r = msi_strncpyWtoA(value, len, buf, sz, FALSE);
2378
2379 free(nameW);
2380 if (row) msiobj_release(&row->hdr);
2381 msiobj_release(&package->hdr);
2382 return r;
2383}
static const WCHAR nameW[]
Definition: main.c:49
static WCHAR * strdupAtoW(const char *str)
Definition: main.c:65
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
static HINSTANCE hinst
Definition: edit.c:551
const WCHAR * msi_record_get_string(const MSIRECORD *, UINT, int *)
Definition: record.c:420
#define calloc
Definition: rosglue.h:14
#define midl_user_free
Definition: rpc.h:45
#define GetExceptionCode()
Definition: seh.h:27

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

2386{
2387 const WCHAR *value = L"";
2388 MSIPACKAGE *package;
2389 MSIRECORD *row;
2390 int len = 0;
2391 UINT r;
2392
2393 if (!name)
2395
2396 package = msihandle2msiinfo(hinst, MSIHANDLETYPE_PACKAGE);
2397 if (!package)
2398 {
2399 WCHAR *value = NULL, *tmp;
2400 MSIHANDLE remote;
2401 DWORD len;
2402
2403 if (!(remote = msi_get_remote(hinst)))
2404 return ERROR_INVALID_HANDLE;
2405
2406 __TRY
2407 {
2408 r = remote_GetProperty(remote, name, &value, &len);
2409 }
2411 {
2412 r = GetExceptionCode();
2413 }
2414 __ENDTRY
2415
2416 if (!r)
2417 {
2418 /* String might contain embedded nulls.
2419 * Native returns the correct size but truncates the string. */
2420 tmp = calloc(1, (len + 1) * sizeof(WCHAR));
2421 if (!tmp)
2422 {
2424 return ERROR_OUTOFMEMORY;
2425 }
2426 lstrcpyW(tmp, value);
2427
2428 r = msi_strncpyW(tmp, len, buf, sz);
2429
2430 free(tmp);
2431 }
2433 return r;
2434 }
2435
2436 row = get_property_row(package->db, name);
2437 if (row)
2439
2440 r = msi_strncpyW(value, len, buf, sz);
2441
2442 if (row) msiobj_release(&row->hdr);
2443 msiobj_release(&package->hdr);
2444 return r;
2445}
UINT msi_strncpyW(const WCHAR *str, int len, WCHAR *buf, DWORD *sz)
Definition: install.c:213

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

1646{
1647 LPWSTR szwPack = NULL;
1648 UINT ret;
1649
1650 if( szPackage )
1651 {
1652 szwPack = strdupAtoW( szPackage );
1653 if( !szwPack )
1654 return ERROR_OUTOFMEMORY;
1655 }
1656
1657 ret = MsiOpenPackageExW( szwPack, dwOptions, phPackage );
1658
1659 free( szwPack );
1660
1661 return ret;
1662}
UINT WINAPI MsiOpenPackageExW(const WCHAR *szPackage, DWORD dwOptions, MSIHANDLE *phPackage)
Definition: package.c:1607

Referenced by MsiOpenPackageA().

◆ MsiOpenPackageExW()

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

Definition at line 1607 of file package.c.

1608{
1609 MSIPACKAGE *package = NULL;
1610 UINT ret;
1611
1612 TRACE( "%s, %#lx, %p\n", debugstr_w(szPackage), dwOptions, phPackage );
1613
1614 if( !szPackage || !phPackage )
1616
1617 if ( !*szPackage )
1618 {
1619 FIXME("Should create an empty database and package\n");
1620 return ERROR_FUNCTION_FAILED;
1621 }
1622
1623 if( dwOptions )
1624 FIXME( "dwOptions %#lx not supported\n", dwOptions );
1625
1626 ret = MSI_OpenPackageW( szPackage, 0, &package );
1627 if( ret == ERROR_SUCCESS )
1628 {
1629 *phPackage = alloc_msihandle( &package->hdr );
1630 if (! *phPackage)
1632 msiobj_release( &package->hdr );
1633 }
1634 else
1636
1637 return ret;
1638}
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
UINT MSI_OpenPackageW(LPCWSTR szPackage, DWORD dwOptions, MSIPACKAGE **pPackage)
Definition: package.c:1384

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

◆ MsiOpenPackageW()

UINT WINAPI MsiOpenPackageW ( LPCWSTR  szPackage,
MSIHANDLE phPackage 
)

Definition at line 1640 of file package.c.

1641{
1642 return MsiOpenPackageExW( szPackage, 0, phPackage );
1643}

◆ MsiProcessMessage()

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

Definition at line 2017 of file package.c.

2019{
2021 MSIPACKAGE *package = NULL;
2023
2024 if ((eMessageType & 0xff000000) == INSTALLMESSAGE_INITIALIZE ||
2025 (eMessageType & 0xff000000) == INSTALLMESSAGE_TERMINATE)
2026 return -1;
2027
2028 if ((eMessageType & 0xff000000) == INSTALLMESSAGE_COMMONDATA &&
2029 MsiRecordGetInteger(hRecord, 1) != 2)
2030 return -1;
2031
2033 if (!record)
2034 return ERROR_INVALID_HANDLE;
2035
2036 package = msihandle2msiinfo( hInstall, MSIHANDLETYPE_PACKAGE );
2037 if( !package )
2038 {
2039 MSIHANDLE remote;
2040
2041 if (!(remote = msi_get_remote(hInstall)))
2042 return ERROR_INVALID_HANDLE;
2043
2044 __TRY
2045 {
2046 ret = remote_ProcessMessage(remote, eMessageType, (struct wire_record *)&record->count);
2047 }
2049 {
2051 }
2052 __ENDTRY
2053
2054 msiobj_release(&record->hdr);
2055 return ret;
2056 }
2057
2058 ret = MSI_ProcessMessage( package, eMessageType, record );
2059
2060 msiobj_release( &record->hdr );
2061 msiobj_release( &package->hdr );
2062 return ret;
2063}
int WINAPI MsiRecordGetInteger(MSIHANDLE handle, UINT iField)
Definition: record.c:237
#define MSIHANDLETYPE_RECORD
Definition: msipriv.h:725

Referenced by __WINE_PRINTF_ATTR(), s_remote_ProcessMessage(), session_invoke(), test_externalui(), test_externalui_message(), and test_processmessage().

◆ MsiSetPropertyA()

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

Definition at line 2067 of file package.c.

2068{
2069 LPWSTR szwName = NULL, szwValue = NULL;
2071
2072 szwName = strdupAtoW( szName );
2073 if( szName && !szwName )
2074 goto end;
2075
2076 szwValue = strdupAtoW( szValue );
2077 if( szValue && !szwValue )
2078 goto end;
2079
2080 r = MsiSetPropertyW( hInstall, szwName, szwValue);
2081
2082end:
2083 free( szwName );
2084 free( szwValue );
2085
2086 return r;
2087}
UINT WINAPI MsiSetPropertyW(MSIHANDLE hInstall, LPCWSTR szName, LPCWSTR szValue)
Definition: package.c:2149
GLuint GLuint end
Definition: gl.h:1545

Referenced by nested(), test_appsearch_complocator(), test_condition(), test_format_record(), test_formatrecord2(), test_formatrecord_package(), 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 2149 of file package.c.

2150{
2151 MSIPACKAGE *package;
2152 UINT ret;
2153
2154 package = msihandle2msiinfo( hInstall, MSIHANDLETYPE_PACKAGE);
2155 if( !package )
2156 {
2157 MSIHANDLE remote;
2158
2159 if (!(remote = msi_get_remote(hInstall)))
2160 return ERROR_INVALID_HANDLE;
2161
2162 __TRY
2163 {
2164 ret = remote_SetProperty(remote, szName, szValue);
2165 }
2167 {
2169 }
2170 __ENDTRY
2171
2172 return ret;
2173 }
2174
2175 ret = msi_set_property( package->db, szName, szValue, -1 );
2176 if (ret == ERROR_SUCCESS && !wcscmp( szName, L"SourceDir" ))
2177 msi_reset_source_folders( package );
2178
2179 msiobj_release( &package->hdr );
2180 return ret;
2181}
void msi_reset_source_folders(MSIPACKAGE *package)
Definition: package.c:2089

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

◆ parse_platform()

static enum platform parse_platform ( const WCHAR str)
static

Definition at line 1092 of file package.c.

1093{
1094 if (!str[0] || !wcscmp( str, L"Intel" )) return PLATFORM_INTEL;
1095 else if (!wcscmp( str, L"Intel64" )) return PLATFORM_INTEL64;
1096 else if (!wcscmp( str, L"x64" ) || !wcscmp( str, L"AMD64" )) return PLATFORM_X64;
1097 else if (!wcscmp( str, L"Arm" )) return PLATFORM_ARM;
1098 else if (!wcscmp( str, L"Arm64" )) return PLATFORM_ARM64;
1099 return PLATFORM_UNRECOGNIZED;
1100}
@ PLATFORM_X64
Definition: msipriv.h:368
@ PLATFORM_UNRECOGNIZED
Definition: msipriv.h:365
@ PLATFORM_INTEL64
Definition: msipriv.h:367
@ PLATFORM_INTEL
Definition: msipriv.h:366
@ PLATFORM_ARM
Definition: msipriv.h:369
@ PLATFORM_ARM64
Definition: msipriv.h:370

Referenced by parse_suminfo().

◆ parse_suminfo()

static UINT parse_suminfo ( MSISUMMARYINFO si,
MSIPACKAGE package 
)
static

Definition at line 1102 of file package.c.

1103{
1104 WCHAR *template, *p, *q, *platform;
1105 DWORD i, count;
1106
1108 TRACE("version: %d\n", package->version);
1109
1110 template = msi_suminfo_dup_string( si, PID_TEMPLATE );
1111 if (!template)
1112 return ERROR_SUCCESS; /* native accepts missing template property */
1113
1114 TRACE("template: %s\n", debugstr_w(template));
1115
1116 p = wcschr( template, ';' );
1117 if (!p)
1118 {
1119 WARN("invalid template string %s\n", debugstr_w(template));
1120 free( template );
1122 }
1123 *p = 0;
1124 platform = template;
1125 if ((q = wcschr( platform, ',' ))) *q = 0;
1126 package->platform = parse_platform( platform );
1127 while (package->platform == PLATFORM_UNRECOGNIZED && q)
1128 {
1129 platform = q + 1;
1130 if ((q = wcschr( platform, ',' ))) *q = 0;
1131 package->platform = parse_platform( platform );
1132 }
1133 if (package->platform == PLATFORM_UNRECOGNIZED)
1134 {
1135 WARN("unknown platform %s\n", debugstr_w(template));
1136 free( template );
1138 }
1139 p++;
1140 if (!*p)
1141 {
1142 free( template );
1143 return ERROR_SUCCESS;
1144 }
1145 count = 1;
1146 for (q = p; (q = wcschr( q, ',' )); q++) count++;
1147
1148 package->langids = malloc( count * sizeof(LANGID) );
1149 if (!package->langids)
1150 {
1151 free( template );
1152 return ERROR_OUTOFMEMORY;
1153 }
1154
1155 i = 0;
1156 while (*p)
1157 {
1158 q = wcschr( p, ',' );
1159 if (q) *q = 0;
1160 package->langids[i] = wcstol( p, NULL, 10 );
1161 if (!q) break;
1162 p = q + 1;
1163 i++;
1164 }
1165 package->num_langids = i + 1;
1166
1167 free( template );
1168 return ERROR_SUCCESS;
1169}
#define wcschr
Definition: compat.h:17
static enum platform parse_platform(const WCHAR *str)
Definition: package.c:1092
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLdouble GLdouble GLdouble GLdouble q
Definition: gl.h:2063
GLfloat GLfloat p
Definition: glext.h:8902
USHORT LANGID
Definition: mui.h:9
#define PID_TEMPLATE
Definition: suminfo.c:49
#define PID_PAGECOUNT
Definition: suminfo.c:56
INT msi_suminfo_get_int32(MSISUMMARYINFO *si, UINT uiProperty)
Definition: suminfo.c:713
platform
Definition: msipriv.h:364
enum platform platform
Definition: msipriv.h:396
#define ERROR_PATCH_PACKAGE_INVALID
Definition: winerror.h:994
#define ERROR_INSTALL_PLATFORM_UNSUPPORTED
Definition: winerror.h:991

Referenced by MSI_OpenPackageW().

◆ s_remote_DoAction()

UINT __cdecl s_remote_DoAction ( MSIHANDLE  hinst,
LPCWSTR  action 
)

Definition at line 2490 of file package.c.

2491{
2492 return MsiDoActionW(hinst, action);
2493}
const WCHAR * action
Definition: action.c:7509
UINT WINAPI MsiDoActionW(MSIHANDLE hInstall, LPCWSTR szAction)
Definition: install.c:64

◆ s_remote_EnumComponentCosts()

UINT __cdecl s_remote_EnumComponentCosts ( MSIHANDLE  hinst,
LPCWSTR  component,
DWORD  index,
INSTALLSTATE  state,
LPWSTR  drive,
INT cost,
INT temp 
)

Definition at line 2618 of file package.c.

2620{
2621 DWORD size = 3;
2622 return MsiEnumComponentCostsW(hinst, component, index, state, drive, &size, cost, temp);
2623}
static int state
Definition: maze.c:121
UINT WINAPI MsiEnumComponentCostsW(MSIHANDLE handle, const WCHAR *component, DWORD index, INSTALLSTATE state, WCHAR *drive, DWORD *buflen, int *cost, int *temp)
Definition: msi.c:1962
static calc_node_t temp
Definition: rpn_ieee.c:38

◆ s_remote_EvaluateCondition()

MSICONDITION __cdecl s_remote_EvaluateCondition ( MSIHANDLE  hinst,
LPCWSTR  condition 
)

Definition at line 2607 of file package.c.

2608{
2610}
GLenum condition
Definition: glext.h:9255
MSICONDITION WINAPI MsiEvaluateConditionW(MSIHANDLE, LPCWSTR)

◆ s_remote_FormatRecord()

UINT __cdecl s_remote_FormatRecord ( MSIHANDLE  hinst,
struct wire_record remote_rec,
LPWSTR value 
)

Definition at line 2581 of file package.c.

2582{
2583 WCHAR empty[1];
2584 DWORD size = 0;
2585 MSIHANDLE rec;
2586 UINT r;
2587
2588 if ((r = unmarshal_record(remote_rec, &rec)))
2589 return r;
2590
2591 r = MsiFormatRecordW(hinst, rec, empty, &size);
2592 if (r == ERROR_MORE_DATA)
2593 {
2594 *value = midl_user_allocate(++size * sizeof(WCHAR));
2595 if (!*value)
2596 {
2597 MsiCloseHandle(rec);
2598 return ERROR_OUTOFMEMORY;
2599 }
2600 r = MsiFormatRecordW(hinst, rec, *value, &size);
2601 }
2602
2603 MsiCloseHandle(rec);
2604 return r;
2605}
static const WCHAR empty[]
Definition: main.c:47
UINT WINAPI MsiFormatRecordW(MSIHANDLE hInstall, MSIHANDLE hRecord, WCHAR *szResult, DWORD *sz)
Definition: format.c:900
UINT unmarshal_record(const struct wire_record *in, MSIHANDLE *out)
Definition: record.c:1095
#define midl_user_allocate
Definition: rpc.h:44

◆ s_remote_GetActiveDatabase()

MSIHANDLE __cdecl s_remote_GetActiveDatabase ( MSIHANDLE  hinst)

Definition at line 2447 of file package.c.

2448{
2450}
MSIHANDLE WINAPI MsiGetActiveDatabase(MSIHANDLE hInstall)
Definition: package.c:1669

◆ s_remote_GetComponentState()

UINT __cdecl s_remote_GetComponentState ( MSIHANDLE  hinst,
LPCWSTR  component,
INSTALLSTATE installed,
INSTALLSTATE action 
)

Definition at line 2560 of file package.c.

2562{
2563 return MsiGetComponentStateW(hinst, component, installed, action);
2564}
UINT WINAPI MsiGetComponentStateW(MSIHANDLE hInstall, const WCHAR *szComponent, INSTALLSTATE *piInstalled, INSTALLSTATE *piAction)
Definition: install.c:1500

◆ s_remote_GetFeatureCost()

UINT __cdecl s_remote_GetFeatureCost ( MSIHANDLE  hinst,
LPCWSTR  feature,
MSICOSTTREE  cost_tree,
INSTALLSTATE  state,
INT cost 
)

Definition at line 2612 of file package.c.

2614{
2615 return MsiGetFeatureCostW(hinst, feature, cost_tree, state, cost);
2616}
UINT WINAPI MsiGetFeatureCostW(MSIHANDLE hInstall, const WCHAR *szFeature, MSICOSTTREE iCostTree, INSTALLSTATE iState, INT *piCost)
Definition: install.c:1206

◆ s_remote_GetFeatureState()

UINT __cdecl s_remote_GetFeatureState ( MSIHANDLE  hinst,
LPCWSTR  feature,
INSTALLSTATE installed,
INSTALLSTATE action 
)

Definition at line 2549 of file package.c.

2551{
2552 return MsiGetFeatureStateW(hinst, feature, installed, action);
2553}
UINT WINAPI MsiGetFeatureStateW(MSIHANDLE hInstall, const WCHAR *szFeature, INSTALLSTATE *piInstalled, INSTALLSTATE *piAction)
Definition: install.c:1088

◆ s_remote_GetLanguage()

LANGID __cdecl s_remote_GetLanguage ( MSIHANDLE  hinst)

Definition at line 2571 of file package.c.

2572{
2573 return MsiGetLanguage(hinst);
2574}
LANGID WINAPI MsiGetLanguage(MSIHANDLE hInstall)
Definition: install.c:1540

◆ s_remote_GetMode()

BOOL __cdecl s_remote_GetMode ( MSIHANDLE  hinst,
MSIRUNMODE  mode 
)

Definition at line 2539 of file package.c.

2540{
2541 return MsiGetMode(hinst, mode);
2542}
BOOL WINAPI MsiGetMode(MSIHANDLE hInstall, MSIRUNMODE iRunMode)
Definition: install.c:670
GLenum mode
Definition: glext.h:6217

◆ s_remote_GetProperty()

UINT __cdecl s_remote_GetProperty ( MSIHANDLE  hinst,
LPCWSTR  property,
LPWSTR value,
DWORD size 
)

Definition at line 2452 of file package.c.

2453{
2454 WCHAR empty[1];
2455 UINT r;
2456
2457 *size = 0;
2459 if (r == ERROR_MORE_DATA)
2460 {
2461 ++*size;
2462 *value = midl_user_allocate(*size * sizeof(WCHAR));
2463 if (!*value)
2464 return ERROR_OUTOFMEMORY;
2466 }
2467 return r;
2468}
UINT WINAPI MsiGetPropertyW(MSIHANDLE hinst, const WCHAR *name, WCHAR *buf, DWORD *sz)
Definition: package.c:2385

◆ s_remote_GetSourcePath()

UINT __cdecl s_remote_GetSourcePath ( MSIHANDLE  hinst,
LPCWSTR  folder,
LPWSTR value 
)

Definition at line 2522 of file package.c.

2523{
2524 WCHAR empty[1];
2525 DWORD size = 1;
2526 UINT r;
2527
2529 if (r == ERROR_MORE_DATA)
2530 {
2531 *value = midl_user_allocate(++size * sizeof(WCHAR));
2532 if (!*value)
2533 return ERROR_OUTOFMEMORY;
2535 }
2536 return r;
2537}
UINT WINAPI MsiGetSourcePathW(MSIHANDLE hinst, const WCHAR *folder, WCHAR *buf, DWORD *sz)
Definition: install.c:468

◆ s_remote_GetTargetPath()

UINT __cdecl s_remote_GetTargetPath ( MSIHANDLE  hinst,
LPCWSTR  folder,
LPWSTR value 
)

Definition at line 2500 of file package.c.

2501{
2502 WCHAR empty[1];
2503 DWORD size = 0;
2504 UINT r;
2505
2507 if (r == ERROR_MORE_DATA)
2508 {
2509 *value = midl_user_allocate(++size * sizeof(WCHAR));
2510 if (!*value)
2511 return ERROR_OUTOFMEMORY;
2513 }
2514 return r;
2515}
UINT WINAPI MsiGetTargetPathW(MSIHANDLE hinst, const WCHAR *folder, WCHAR *buf, DWORD *sz)
Definition: install.c:311

◆ s_remote_ProcessMessage()

int __cdecl s_remote_ProcessMessage ( MSIHANDLE  hinst,
INSTALLMESSAGE  message,
struct wire_record remote_rec 
)

Definition at line 2475 of file package.c.

2476{
2477 MSIHANDLE rec;
2478 int ret;
2479 UINT r;
2480
2481 if ((r = unmarshal_record(remote_rec, &rec)))
2482 return r;
2483
2485
2486 MsiCloseHandle(rec);
2487 return ret;
2488}
INT WINAPI MsiProcessMessage(MSIHANDLE hInstall, INSTALLMESSAGE eMessageType, MSIHANDLE hRecord)
Definition: package.c:2017

◆ s_remote_Sequence()

UINT __cdecl s_remote_Sequence ( MSIHANDLE  hinst,
LPCWSTR  table,
int  sequence 
)

Definition at line 2495 of file package.c.

2496{
2497 return MsiSequenceW(hinst, table, sequence);
2498}
static struct recvd_message * sequence
Definition: SystemMenu.c:63
UINT WINAPI MsiSequenceW(MSIHANDLE hInstall, LPCWSTR szTable, INT iSequenceMode)
Definition: install.c:123

◆ s_remote_SetComponentState()

UINT __cdecl s_remote_SetComponentState ( MSIHANDLE  hinst,
LPCWSTR  component,
INSTALLSTATE  state 
)

Definition at line 2566 of file package.c.

2567{
2568 return MsiSetComponentStateW(hinst, component, state);
2569}
UINT WINAPI MsiSetComponentStateW(MSIHANDLE hInstall, LPCWSTR szComponent, INSTALLSTATE iState)
Definition: install.c:1462

◆ s_remote_SetFeatureState()

UINT __cdecl s_remote_SetFeatureState ( MSIHANDLE  hinst,
LPCWSTR  feature,
INSTALLSTATE  state 
)

Definition at line 2555 of file package.c.

2556{
2558}
UINT WINAPI MsiSetFeatureStateW(MSIHANDLE hInstall, LPCWSTR szFeature, INSTALLSTATE iState)
Definition: install.c:947

◆ s_remote_SetInstallLevel()

UINT __cdecl s_remote_SetInstallLevel ( MSIHANDLE  hinst,
int  level 
)

Definition at line 2576 of file package.c.

2577{
2579}
UINT WINAPI MsiSetInstallLevel(MSIHANDLE hInstall, int iInstallLevel)
Definition: install.c:1596
GLint level
Definition: gl.h:1546

◆ s_remote_SetMode()

UINT __cdecl s_remote_SetMode ( MSIHANDLE  hinst,
MSIRUNMODE  mode,
BOOL  state 
)

Definition at line 2544 of file package.c.

2545{
2546 return MsiSetMode(hinst, mode, state);
2547}
UINT WINAPI MsiSetMode(MSIHANDLE hInstall, MSIRUNMODE iRunMode, BOOL fState)
Definition: install.c:763

◆ s_remote_SetProperty()

UINT __cdecl s_remote_SetProperty ( MSIHANDLE  hinst,
LPCWSTR  property,
LPCWSTR  value 
)

Definition at line 2470 of file package.c.

2471{
2473}

◆ s_remote_SetTargetPath()

UINT __cdecl s_remote_SetTargetPath ( MSIHANDLE  hinst,
LPCWSTR  folder,
LPCWSTR  value 
)

Definition at line 2517 of file package.c.

2518{
2520}
UINT WINAPI MsiSetTargetPathW(MSIHANDLE hInstall, LPCWSTR szFolder, LPCWSTR szFolderPath)
Definition: install.c:600

◆ set_installed_prop()

static UINT set_installed_prop ( MSIPACKAGE package)
static

Definition at line 457 of file package.c.

458{
459 HKEY hkey;
460 UINT r;
461
462 if (!package->ProductCode) return ERROR_FUNCTION_FAILED;
463
464 r = MSIREG_OpenUninstallKey( package->ProductCode, package->platform, &hkey, FALSE );
465 if (r == ERROR_SUCCESS)
466 {
467 RegCloseKey( hkey );
468 msi_set_property( package->db, L"Installed", L"1", -1 );
469 }
470 return r;
471}
UINT MSIREG_OpenUninstallKey(const WCHAR *, enum platform, HKEY *, BOOL)

Referenced by MSI_OpenPackageW().

◆ set_installer_properties()

static VOID set_installer_properties ( MSIPACKAGE package)
static

Definition at line 631 of file package.c.

632{
633 WCHAR *ptr;
634 RTL_OSVERSIONINFOEXW OSVersion;
635 MEMORYSTATUSEX msex;
636 DWORD verval, len, type;
637 WCHAR pth[MAX_PATH], verstr[11], bufstr[22];
638 HDC dc;
639 HKEY hkey;
640 LPWSTR username, companyname;
641 SYSTEM_INFO sys_info;
643
644 /*
645 * Other things that probably should be set:
646 *
647 * VirtualMemory ShellAdvSupport DefaultUIFont PackagecodeChanging
648 * CaptionHeight BorderTop BorderSide TextHeight RedirectedDllSupport
649 */
650
652 lstrcatW(pth, L"\\");
653 msi_set_property( package->db, L"CommonAppDataFolder", pth, -1 );
654
656 lstrcatW(pth, L"\\");
657 msi_set_property( package->db, L"FavoritesFolder", pth, -1 );
658
660 lstrcatW(pth, L"\\");
661 msi_set_property( package->db, L"FontsFolder", pth, -1 );
662
664 lstrcatW(pth, L"\\");
665 msi_set_property( package->db, L"SendToFolder", pth, -1 );
666
668 lstrcatW(pth, L"\\");
669 msi_set_property( package->db, L"StartMenuFolder", pth, -1 );
670
672 lstrcatW(pth, L"\\");
673 msi_set_property( package->db, L"StartupFolder", pth, -1 );
674
676 lstrcatW(pth, L"\\");
677 msi_set_property( package->db, L"TemplateFolder", pth, -1 );
678
680 lstrcatW(pth, L"\\");
681 msi_set_property( package->db, L"DesktopFolder", pth, -1 );
682
683 /* FIXME: set to AllUsers profile path if ALLUSERS is set */
685 lstrcatW(pth, L"\\");
686 msi_set_property( package->db, L"ProgramMenuFolder", pth, -1 );
687
689 lstrcatW(pth, L"\\");
690 msi_set_property( package->db, L"AdminToolsFolder", pth, -1 );
691
693 lstrcatW(pth, L"\\");
694 msi_set_property( package->db, L"AppDataFolder", pth, -1 );
695
697 lstrcatW(pth, L"\\");
698 msi_set_property( package->db, L"SystemFolder", pth, -1 );
699 msi_set_property( package->db, L"System16Folder", pth, -1 );
700
702 lstrcatW(pth, L"\\");
703 msi_set_property( package->db, L"LocalAppDataFolder", pth, -1 );
704
706 lstrcatW(pth, L"\\");
707 msi_set_property( package->db, L"MyPicturesFolder", pth, -1 );
708
710 lstrcatW(pth, L"\\");
711 msi_set_property( package->db, L"PersonalFolder", pth, -1 );
712
714 lstrcatW(pth, L"\\");
715 msi_set_property( package->db, L"WindowsFolder", pth, -1 );
716
718 lstrcatW(pth, L"\\");
719 msi_set_property( package->db, L"PrintHoodFolder", pth, -1 );
720
722 lstrcatW(pth, L"\\");
723 msi_set_property( package->db, L"NetHoodFolder", pth, -1 );
724
726 lstrcatW(pth, L"\\");
727 msi_set_property( package->db, L"RecentFolder", pth, -1 );
728
729 /* Physical Memory is specified in MB. Using total amount. */
730 msex.dwLength = sizeof(msex);
731 GlobalMemoryStatusEx( &msex );
732 len = swprintf( bufstr, ARRAY_SIZE(bufstr), L"%d", (int)(msex.ullTotalPhys / 1024 / 1024) );
733 msi_set_property( package->db, L"PhysicalMemory", bufstr, len );
734
736 ptr = wcschr(pth,'\\');
737 if (ptr) *(ptr + 1) = 0;
738 msi_set_property( package->db, L"WindowsVolume", pth, -1 );
739
740 len = GetTempPathW(MAX_PATH, pth);
741 msi_set_property( package->db, L"TempFolder", pth, len );
742
743 /* in a wine environment the user is always admin and privileged */
744 msi_set_property( package->db, L"AdminUser", L"1", -1 );
745 msi_set_property( package->db, L"Privileged", L"1", -1 );
746 msi_set_property( package->db, L"MsiRunningElevated", L"1", -1 );
747
748 /* set the os things */
749 OSVersion.dwOSVersionInfoSize = sizeof(OSVersion);
751 verval = OSVersion.dwMinorVersion + OSVersion.dwMajorVersion * 100;
752 if (verval > 603)
753 {
754 verval = 603;
755 OSVersion.dwBuildNumber = 9600;
756 }
757 len = swprintf( verstr, ARRAY_SIZE(verstr), L"%u", verval );
758 switch (OSVersion.dwPlatformId)
759 {
761 msi_set_property( package->db, L"Version9X", verstr, len );
762 break;
764 msi_set_property( package->db, L"VersionNT", verstr, len );
765 len = swprintf( bufstr, ARRAY_SIZE(bufstr), L"%u", OSVersion.wProductType );
766 msi_set_property( package->db, L"MsiNTProductType", bufstr, len );
767 break;
768 }
769 len = swprintf( bufstr, ARRAY_SIZE(bufstr), L"%u", OSVersion.dwBuildNumber );
770 msi_set_property( package->db, L"WindowsBuild", bufstr, len );
771 len = swprintf( bufstr, ARRAY_SIZE(bufstr), L"%u", OSVersion.wServicePackMajor );
772 msi_set_property( package->db, L"ServicePackLevel", bufstr, len );
773
774 len = swprintf( bufstr, ARRAY_SIZE(bufstr), L"%u.%u", MSI_MAJORVERSION, MSI_MINORVERSION );
775 msi_set_property( package->db, L"VersionMsi", bufstr, len );
776 len = swprintf( bufstr, ARRAY_SIZE(bufstr), L"%u", MSI_MAJORVERSION * 100 );
777 msi_set_property( package->db, L"VersionDatabase", bufstr, len );
778
779 RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion", 0,
781
782 GetNativeSystemInfo( &sys_info );
783 len = swprintf( bufstr, ARRAY_SIZE(bufstr), L"%d", sys_info.wProcessorLevel );
784 msi_set_property( package->db, L"Intel", bufstr, len );
786 {
788 PathAddBackslashW( pth );
789 msi_set_property( package->db, L"SystemFolder", pth, -1 );
790
791 len = sizeof(pth);
792 RegQueryValueExW(hkey, L"ProgramFilesDir", 0, &type, (BYTE *)pth, &len);
793 PathAddBackslashW( pth );
794 msi_set_property( package->db, L"ProgramFilesFolder", pth, -1 );
795
796 len = sizeof(pth);
797 RegQueryValueExW(hkey, L"CommonFilesDir", 0, &type, (BYTE *)pth, &len);
798 PathAddBackslashW( pth );
799 msi_set_property( package->db, L"CommonFilesFolder", pth, -1 );
800 }
802 {
803 msi_set_property( package->db, L"MsiAMD64", bufstr, -1 );
804 msi_set_property( package->db, L"Msix64", bufstr, -1 );
805 msi_set_property( package->db, L"VersionNT64", verstr, -1 );
806
808 PathAddBackslashW( pth );
809 msi_set_property( package->db, L"System64Folder", pth, -1 );
810
812 PathAddBackslashW( pth );
813 msi_set_property( package->db, L"SystemFolder", pth, -1 );
814
815 len = sizeof(pth);
816 RegQueryValueExW(hkey, L"ProgramFilesDir", 0, &type, (BYTE *)pth, &len);
817 PathAddBackslashW( pth );
818 msi_set_property( package->db, L"ProgramFiles64Folder", pth, -1 );
819
820 len = sizeof(pth);
821 RegQueryValueExW(hkey, L"ProgramFilesDir (x86)", 0, &type, (BYTE *)pth, &len);
822 PathAddBackslashW( pth );
823 msi_set_property( package->db, L"ProgramFilesFolder", pth, -1 );
824
825 len = sizeof(pth);
826 RegQueryValueExW(hkey, L"CommonFilesDir", 0, &type, (BYTE *)pth, &len);
827 PathAddBackslashW( pth );
828 msi_set_property( package->db, L"CommonFiles64Folder", pth, -1 );
829
830 len = sizeof(pth);
831 RegQueryValueExW(hkey, L"CommonFilesDir (x86)", 0, &type, (BYTE *)pth, &len);
832 PathAddBackslashW( pth );
833 msi_set_property( package->db, L"CommonFilesFolder", pth, -1 );
834 }
835
836 RegCloseKey(hkey);
837
838 /* Screen properties. */
839 dc = GetDC(0);
840 len = swprintf( bufstr, ARRAY_SIZE(bufstr), L"%d", GetDeviceCaps(dc, HORZRES) );
841 msi_set_property( package->db, L"ScreenX", bufstr, len );
842 len = swprintf( bufstr, ARRAY_SIZE(bufstr), L"%d", GetDeviceCaps(dc, VERTRES) );
843 msi_set_property( package->db, L"ScreenY", bufstr, len );
844 len = swprintf( bufstr, ARRAY_SIZE(bufstr), L"%d", GetDeviceCaps(dc, BITSPIXEL) );
845 msi_set_property( package->db, L"ColorBits", bufstr, len );
846 ReleaseDC(0, dc);
847
848 /* USERNAME and COMPANYNAME */
849 username = msi_dup_property( package->db, L"USERNAME" );
850 companyname = msi_dup_property( package->db, L"COMPANYNAME" );
851
852 if ((!username || !companyname) &&
853 RegOpenKeyW( HKEY_CURRENT_USER, L"SOFTWARE\\Microsoft\\MS Setup (ACME)\\User Info", &hkey ) == ERROR_SUCCESS)
854 {
855 if (!username &&
856 (username = msi_reg_get_val_str( hkey, L"DefName" )))
857 msi_set_property( package->db, L"USERNAME", username, -1 );
858 if (!companyname &&
859 (companyname = msi_reg_get_val_str( hkey, L"DefCompany" )))
860 msi_set_property( package->db, L"COMPANYNAME", companyname, -1 );
861 CloseHandle( hkey );
862 }
863 if ((!username || !companyname) &&
864 RegOpenKeyExW( HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", 0,
866 {
867 if (!username &&
868 (username = msi_reg_get_val_str( hkey, L"RegisteredOwner" )))
869 msi_set_property( package->db, L"USERNAME", username, -1 );
870 if (!companyname &&
871 (companyname = msi_reg_get_val_str( hkey, L"RegisteredOrganization" )))
872 msi_set_property( package->db, L"COMPANYNAME", companyname, -1 );
873 CloseHandle( hkey );
874 }
875 free( username );
876 free( companyname );
877
878 if ( set_user_sid_prop( package ) != ERROR_SUCCESS)
879 ERR("Failed to set the UserSID property\n");
880
881 set_msi_assembly_prop( package );
882
884 len = swprintf( bufstr, ARRAY_SIZE(bufstr), L"%d", langid );
885 msi_set_property( package->db, L"UserLanguageID", bufstr, len );
886
888 len = swprintf( bufstr, ARRAY_SIZE(bufstr), L"%d", langid );
889 msi_set_property( package->db, L"SystemLanguageID", bufstr, len );
890
891 len = swprintf( bufstr, ARRAY_SIZE(bufstr), L"%d", MsiQueryProductStateW(package->ProductCode) );
892 msi_set_property( package->db, L"ProductState", bufstr, len );
893
894 len = 0;
896 {
898 if ((username = malloc( len * sizeof(WCHAR) )))
899 {
900 if (GetUserNameW( username, &len ))
901 msi_set_property( package->db, L"LogonUser", username, len - 1 );
902 free( username );
903 }
904 }
905 len = 0;
907 {
908 WCHAR *computername;
909 if ((computername = malloc( len * sizeof(WCHAR) )))
910 {
911 if (GetComputerNameW( computername, &len ))
912 msi_set_property( package->db, L"ComputerName", computername, len );
913 free( computername );
914 }
915 }
916}
BOOL WINAPI GetComputerNameW(LPWSTR lpBuffer, LPDWORD lpnSize)
Definition: compname.c:446
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10
NTSTATUS NTAPI RtlGetVersion(IN OUT PRTL_OSVERSIONINFOW lpVersionInformation)
Definition: version.c:158
LONG WINAPI RegOpenKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3268
BOOL WINAPI GetUserNameW(LPWSTR lpszName, LPDWORD lpSize)
Definition: misc.c:291
DWORD WINAPI GetTempPathW(IN DWORD count, OUT LPWSTR path)
Definition: path.c:2080
UINT WINAPI GetSystemWow64DirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2421
UINT WINAPI GetSystemDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2313
VOID WINAPI GetNativeSystemInfo(IN LPSYSTEM_INFO lpSystemInfo)
Definition: sysinfo.c:207
LANGID WINAPI GetSystemDefaultLangID(void)
Definition: locale.c:1194
LANGID WINAPI GetUserDefaultLangID(void)
Definition: locale.c:1177
INSTALLSTATE WINAPI MsiQueryProductStateW(LPCWSTR szProduct)
Definition: msi.c:2223
static UINT set_user_sid_prop(MSIPACKAGE *package)
Definition: package.c:473
static void set_msi_assembly_prop(MSIPACKAGE *package)
Definition: package.c:588
HRESULT WINAPI SHGetFolderPathW(HWND hwndOwner, int nFolder, HANDLE hToken, DWORD dwFlags, LPWSTR pszPath)
Definition: shellpath.c:2589
BOOL NTAPI GlobalMemoryStatusEx(LPMEMORYSTATUSEX lpBuffer)
Definition: heapmem.c:1272
static const WCHAR dc[]
static PVOID ptr
Definition: dispmode.c:27
static HDC
Definition: imagelist.c:88
static WCHAR username[]
Definition: url.c:32
LANGID langid
Definition: msctf.idl:644
#define MSI_MINORVERSION
Definition: msipriv.h:730
#define MSI_MAJORVERSION
Definition: msipriv.h:729
#define PROCESSOR_ARCHITECTURE_AMD64
Definition: ketypes.h:114
#define PROCESSOR_ARCHITECTURE_INTEL
Definition: ketypes.h:105
#define VER_PLATFORM_WIN32_NT
Definition: rtltypes.h:238
#define VER_PLATFORM_WIN32_WINDOWS
Definition: rtltypes.h:237
#define PathAddBackslashW
Definition: pathcch.h:301
#define CSIDL_TEMPLATES
Definition: shlobj.h:2193
#define CSIDL_SENDTO
Definition: shlobj.h:2182
#define CSIDL_RECENT
Definition: shlobj.h:2181
#define CSIDL_ADMINTOOLS
Definition: shlobj.h:2220
#define CSIDL_FONTS
Definition: shlobj.h:2192
#define CSIDL_PERSONAL
Definition: shlobj.h:2178
#define CSIDL_FAVORITES
Definition: shlobj.h:2179
#define CSIDL_COMMON_APPDATA
Definition: shlobj.h:2207
#define CSIDL_MYPICTURES
Definition: shlobj.h:2211
#define CSIDL_SYSTEM
Definition: shlobj.h:2209
#define CSIDL_LOCAL_APPDATA
Definition: shlobj.h:2200
#define CSIDL_DESKTOP
Definition: shlobj.h:2173
#define CSIDL_STARTMENU
Definition: shlobj.h:2184
#define CSIDL_PROGRAMS
Definition: shlobj.h:2175
#define CSIDL_APPDATA
Definition: shlobj.h:2198
#define CSIDL_PRINTHOOD
Definition: shlobj.h:2199
#define CSIDL_STARTUP
Definition: shlobj.h:2180
#define CSIDL_WINDOWS
Definition: shlobj.h:2208
#define CSIDL_NETHOOD
Definition: shlobj.h:2191
ULONG dwMajorVersion
Definition: rtltypes.h:270
ULONG dwMinorVersion
Definition: rtltypes.h:271
ULONG dwOSVersionInfoSize
Definition: rtltypes.h:269
ULONG dwPlatformId
Definition: rtltypes.h:273
UCHAR wProductType
Definition: rtltypes.h:278
ULONG dwBuildNumber
Definition: rtltypes.h:272
USHORT wServicePackMajor
Definition: rtltypes.h:275
WORD wProcessorLevel
Definition: winbase.h:1204
WORD wProcessorArchitecture
Definition: winbase.h:1193
#define ERROR_BUFFER_OVERFLOW
Definition: winerror.h:185
#define HORZRES
Definition: wingdi.h:716
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
#define VERTRES
Definition: wingdi.h:717
#define BITSPIXEL
Definition: wingdi.h:720
#define HKEY_CURRENT_USER
Definition: winreg.h:11
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
HDC WINAPI GetDC(_In_opt_ HWND)
#define KEY_WOW64_64KEY
Definition: cmtypes.h:46

Referenced by MSI_CreatePackage().

◆ set_msi_assembly_prop()

static void set_msi_assembly_prop ( MSIPACKAGE package)
static

Definition at line 588 of file package.c.

589{
590 UINT val_len;
594 LPWSTR fusion, verstr;
595 struct lang_codepage *translate;
596
597 fusion = get_fusion_filename(package);
598 if (!fusion)
599 return;
600
602 if (!size)
603 goto done;
604
606 if (!version)
607 goto done;
608
609 if (!GetFileVersionInfoW(fusion, handle, size, version))
610 goto done;
611
612 if (!VerQueryValueW(version, L"\\VarFileInfo\\Translation", (LPVOID *)&translate, &val_len))
613 goto done;
614
615 swprintf(buf, ARRAY_SIZE(buf), L"\\StringFileInfo\\%04x%04x\\ProductVersion", translate[0].wLanguage,
617
618 if (!VerQueryValueW(version, buf, (LPVOID *)&verstr, &val_len))
619 goto done;
620
621 if (!val_len || !verstr)
622 goto done;
623
624 msi_set_property( package->db, L"MsiNetAssemblySupport", verstr, -1 );
625
626done:
627 free(fusion);
628 free(version);
629}
static const WCHAR version[]
Definition: asmname.c:66
static LPWSTR get_fusion_filename(MSIPACKAGE *package)
Definition: package.c:521
BOOL WINAPI GetFileVersionInfoW(LPCWSTR filename, DWORD handle, DWORD datasize, LPVOID data)
Definition: version.c:845
BOOL WINAPI VerQueryValueW(LPCVOID pBlock, LPCWSTR lpSubBlock, LPVOID *lplpBuffer, PUINT puLen)
Definition: version.c:1057
DWORD WINAPI GetFileVersionInfoSizeW(LPCWSTR filename, LPDWORD handle)
Definition: version.c:611
static void translate(POINT *pt, UINT count, const XFORM *xform)
Definition: metafile.c:2586
WORD wLanguage
Definition: package.c:584
WORD wCodePage
Definition: package.c:585

Referenced by set_installer_properties().

◆ set_user_sid_prop()

static UINT set_user_sid_prop ( MSIPACKAGE package)
static

Definition at line 473 of file package.c.

474{
475 SID_NAME_USE use;
477 LPWSTR sid_str = NULL, dom = NULL;
478 DWORD size, dom_size;
479 PSID psid = NULL;
481
482 size = 0;
484
485 user_name = malloc( (size + 1) * sizeof(WCHAR) );
486 if (!user_name)
487 return ERROR_OUTOFMEMORY;
488
489 if (!GetUserNameW( user_name, &size ))
490 goto done;
491
492 size = 0;
493 dom_size = 0;
494 LookupAccountNameW( NULL, user_name, NULL, &size, NULL, &dom_size, &use );
495
496 psid = malloc( size );
497 dom = malloc( dom_size * sizeof (WCHAR) );
498 if (!psid || !dom)
499 {
501 goto done;
502 }
503
504 if (!LookupAccountNameW( NULL, user_name, psid, &size, dom, &dom_size, &use ))
505 goto done;
506
507 if (!ConvertSidToStringSidW( psid, &sid_str ))
508 goto done;
509
510 r = msi_set_property( package->db, L"UserSID", sid_str, -1 );
511
512done:
513 LocalFree( sid_str );
514 free( dom );
515 free( psid );
516 free( user_name );
517
518 return r;
519}
BOOL WINAPI LookupAccountNameW(LPCWSTR lpSystemName, LPCWSTR lpAccountName, PSID Sid, LPDWORD cbSid, LPWSTR ReferencedDomainName, LPDWORD cchReferencedDomainName, PSID_NAME_USE peUse)
Definition: misc.c:626
BOOL WINAPI ConvertSidToStringSidW(PSID Sid, LPWSTR *StringSid)
Definition: security.c:3583
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1594
enum _SID_NAME_USE SID_NAME_USE
static WCHAR user_name[UNLEN+1]
Definition: access.c:32

Referenced by set_installer_properties().

◆ validate_package()

static UINT validate_package ( MSIPACKAGE package)
static

Definition at line 1171 of file package.c.

1172{
1173 UINT i;
1174
1175 if (package->platform == PLATFORM_INTEL64)
1177#ifndef __arm__
1178 if (package->platform == PLATFORM_ARM)
1180#endif
1181#ifndef __aarch64__
1182 if (package->platform == PLATFORM_ARM64)
1184#endif
1185 if (package->platform == PLATFORM_X64)
1186 {
1187 if (!is_64bit && !is_wow64)
1189 if (package->version < 200)
1191 }
1192 if (!package->num_langids)
1193 {
1194 return ERROR_SUCCESS;
1195 }
1196 for (i = 0; i < package->num_langids; i++)
1197 {
1198 LANGID langid = package->langids[i];
1199
1201 {
1203 }
1205 {
1207 }
1209 return ERROR_SUCCESS;
1210 }
1212}
BOOL WINAPI IsValidLocale(LCID lcid, DWORD flags)
Definition: locale.c:2923
BOOL is_wow64
Definition: msi.c:52
static const BOOL is_64bit
Definition: msipriv.h:44
#define LANG_NEUTRAL
Definition: nls.h:22
#define MAKELANGID(p, s)
Definition: nls.h:15
#define SUBLANGID(l)
Definition: nls.h:17
#define SUBLANG_NEUTRAL
Definition: nls.h:167
#define PRIMARYLANGID(l)
Definition: nls.h:16
#define ERROR_INSTALL_LANGUAGE_UNSUPPORTED
Definition: winerror.h:981
#define LCID_INSTALLED
Definition: winnls.h:201

Referenced by MSI_OpenPackageW().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( msi  )

Variable Documentation

◆ id

Definition at line 1793 of file package.c.

◆ 

const struct { ... } internal_errors[]
Initial value:
=
{
{2726, L"DEBUG: Error [1]: Action not found: [2]"},
{0}
}

Referenced by get_internal_error_message().

◆ text

const WCHAR* text

Definition at line 1794 of file package.c.

Referenced by _create_option_elem(), _get_text_iface(), _set_text_data(), _test_comment_text(), _test_create_text(), _test_elem_innertext(), _test_elem_set_innertext(), _test_option_put_text(), _test_option_text(), _test_range_put_text(), _test_range_text(), _test_select_name(), _test_select_set_name(), _test_style_csstext(), _test_style_set_csstext(), _test_text_data(), _test_text_length(), _text_append_data(), aa_colorref(), aa_comp(), AboutProtocol_Start(), add_field(), add_field_from_token(), add_local_oid_text_to_control(), add_text_with_paraformat_to_control(), add_unformatted_text_to_control(), CNotifyToolbar::AddButton(), addItem(), AddMenuItem(), AddTextButton(), append_file(), append_file_test(), backSpaceEdit(), bind_callback_OnProgress(), bind_script_to_text(), BookmarkCompletionFunction(), BUTTON_CalcLabelRect(), BUTTON_DrawLabel(), cache_get_text(), cache_put_text(), CB_ThemedPaint(), cctrl_create_new(), cert_mgr_show_cert_usages(), check_auto_fields(), check_file_matches(), check_mask(), class_object_GetObjectText(), combobox_add_item(), CommandCompletionFunction(), CompletionFunction(), compute_text_mesh(), SEALED_::ControlWindowProc(), CreateEditLabelT(), CreateStatusWindowA(), CreateStatusWindowW(), ctrl_resize(), customWordBreakProc(), D3DXCreateTextA(), D3DXCreateTextW(), DataObjectImpl_CreateFromHGlobal(), DataObjectImpl_CreateText(), debuglvcolumn_t(), debuglvitem_t(), debugscrollinfo(), debugstr_t(), debugtext_t(), debugtext_tn(), DECLARE_INTERFACE_(), DefFrameProcA(), dialog_add_control(), DIALOG_COPY_MOVE_DlgProc(), dialog_create_radiobutton(), dialog_create_window(), dialog_dirlist_handler(), dialog_edit_control(), dialog_get_uitext(), DIALOG_GoTo_DialogProc(), dialog_handle_event(), dialog_hyperlink(), dialog_scrolltext_control(), dialog_text_control(), dialog_vcl_add_columns(), dialog_volsel_handler(), dispevent_Invoke(), display_app_usages(), display_cert_usages(), RdpClientUI::Display_DrawText(), doc_write(), DocHostContainer_set_status_text(), DoWaitForWindow(), draw_driver_string(), draw_text(), Graphics::DrawDriverString(), DrawStatusTextA(), DrawStatusTextW(), dump_CallBackFlags(), dump_D3dBufferCallbacks(), dump_D3dCallbacks(), dump_D3dDriverData(), dump_D3dTextureFormats(), dump_halinfo(), EDIT_BuildLineDefs_ML(), EDIT_WM_SetText(), EditStreamCallback(), error(), exec_tests(), expect_indexA_imp(), find_window(), GB_ThemedPaint(), GDI32_GdipDrawDriverString(), GdipDrawDriverString(), GdipMeasureDriverString(), get_binary_name(), get_ip(), getdlgitem_test_dialog_proc(), GinaLoadFailedWindowProc(), glPrint(), handle_context_menu(), HLPFILE_BrowseParagraph(), HTMLBodyElement_get_text(), HTMLBodyElement_put_text(), HTMLDocument3_createTextNode(), HTMLDOMTextNode_splitText(), HTMLElement2_getAdjacentText(), HTMLElement_insertAdjacentText(), HTMLOptionElementFactory_create(), HTMLStyle_get_cssText(), tinyxml2::XMLDocument::Identify(), IFileDialogCustomize_fnGetEditBoxText(), Imm32CompAttrAnsiToWide(), Imm32CompAttrWideToAnsi(), Imm32CompClauseAnsiToWide(), Imm32CompClauseWideToAnsi(), InfpSubstituteString(), insert_item(), is_text(), ITERATE_PublishComponent(), ITextRange_fnFindText(), ITextRange_fnFindTextEnd(), ITextRange_fnFindTextStart(), ITextSelection_fnFindText(), ITextSelection_fnFindTextEnd(), ITextSelection_fnFindTextStart(), ITextSelection_fnTypeText(), listbox_add_item(), listview_add_item(), RegistrySettings::Load(), load_icon(), locale_update_registry(), main(), MAIN_MessageBoxIDS(), MAIN_MessageBoxIDS_s(), main_window_procA(), main_window_procW(), MainWndProc(), maskedit_set_text(), ME_FindText(), ME_InsertRowStart(), ME_IsCandidateAnURL(), ME_MakeFirstParagraph(), ME_SetText(), ME_StreamOutRTFText(), ME_WmCreate(), MimeMessage_GetTextBody(), mpg123_copy_string(), msgbox_hook_proc(), MyTextOut(), tinyxml2::XMLDocument::NewText(), notify_forward_header(), notify_generic_text_handler(), nsPromptService_Alert(), CMenuToolbarBase::OnCustomDraw(), CAutoComplete::OnListSelChange(), OstreamIteratorTest::ostmit0(), PAGER_ConvertText(), PAGER_RestoreText(), PAGER_SendConvertedNotify(), parent_wnd_proc(), parse_elem_text(), parse_event_elem(), parse_extern_script(), parse_index_obj_node_param(), parse_inline_script(), parse_obj_node_param(), parse_text(), PARSER_string_substA(), PARSER_string_substW(), PB_ThemedPaint(), PdhGetCounterInfoA(), PdhGetCounterInfoW(), pp_add_define(), PrefOptCompletionFunction(), print_disconnect_reason(), prompt_save_changes(), propsys_FormatForDisplayAlloc(), tinyxml2::XMLPrinter::PushText(), read_file_test(), readconfigtext(), RemoteCompletionFunction(), RemoteDirCompletionFunction(), RemoteFileCompletionFunction(), run_script(), SaveColumnSettings(), script_parse_event(), scrolltext_add_text(), SearchCHM_File(), set_cert_info(), set_cert_name_string(), set_cert_validity_period(), set_policy_text(), setItem(), CListView::SetItemText(), setItemUnicodeNotify(), SetMacro(), SetMatrixMessage(), tinyxml2::XMLText::ShallowClone(), tinyxml2::XMLUnknown::ShallowClone(), tinyxml2::XMLText::ShallowEqual(), show_export_details(), show_import_details(), show_tooltip(), SoftModalMessageBox(), SOFTWARE_GdipDrawDriverString(), split_ip(), START_TEST(), STATIC_PaintTextfn(), status_code_GetErrorCodeText(), status_code_GetFacilityCodeText(), STATUSBAR_SetTextT(), STATUSBAR_SetTipTextA(), STATUSBAR_SetTipTextW(), STATUSBAR_WMSetText(), WebChildWindow::StatusTextChange(), RegistrySettings::Store(), SubclassButtonProc(), taskdialog_add_button(), taskdialog_create_label(), taskdialog_draw_expando_control(), taskdialog_get_label_size(), taskdialog_gettext(), taskdialog_set_element_text(), taskdialog_toggle_expando_control(), test__wcsnset_s(), test_async_xhr(), test_aw_conversion_dlgprocA(), test_aw_conversion_dlgprocW(), test_aw_conversion_wndproc(), test_bitmap_font_glyph_index(), Test_bug3481(), test_buttons(), test_CBN_SELCHANGE(), test_checkboxes(), test_combo_CBN_SELCHANGE(), test_create(), test_CreateMessage(), test_createtext(), test_data_handles(), test_DrawState(), test_DrawTextCalcRect(), test_EM_AUTOURLDETECT(), test_EM_EXLIMITTEXT(), test_EM_GETLINE(), test_EM_LINELENGTH(), test_EM_POSFROMCHAR(), test_EM_SCROLLCARET(), test_EM_SETFONTSIZE(), test_EM_SETOPTIONS(), test_encoding_detection(), test_eventMask(), test_ExtTextOut(), test_fgetwc_locale(), test_handles_process_open(), test_header(), test_hittest(), test_item_auto_format(), test_items(), test_LVM_GETCOUNTPERPAGE(), test_LVN_ENDLABELEDIT(), test_navigate_page(), test_newline_normalization(), test_openbackup(), test_popup(), test_preserve_charref(), test_put_data(), test_put_nodeValue(), test_ScriptIsComplex(), test_scrollbar_visibility(), test_selection(), test_splitText(), test_state_image(), test_sync_xhr(), test_UDS_SETBUDDYINT(), test_undo(), test_updown_base(), test_updown_create(), test_WM_GETTEXT(), test_word_wrap(), textdupTtoW(), textlenT(), textstream_Read(), textstream_read(), textstream_ReadAll(), textstream_ReadLine(), textstream_Write(), textstream_WriteLine(), textstream_writestr(), TimerProc(), WebChildWindow::TitleChange(), tokenize(), ToolTipProc(), TOOLTIPS_SetToolText(), trace_extended_error(), ui_draw_text(), unimpl(), update_counter(), update_ie_statustext(), CMainWindow::UpdateApplicationsList(), UpdateColumnDataHints(), UpdateStatusBar(), user_notice_dlg_proc(), tinyxml2::XMLPrinter::Visit(), warning(), WINHELP_MessageBoxIDS_s(), winproc_convA(), winproc_convW(), WorkerThread(), WshShell3_Popup(), xmlparser_ExpandEntity(), xmlparser_ParseEntity(), xmlwriter_WriteProcessingInstruction(), xsltAttrListTemplateProcess(), xsltAttrTemplateProcess(), xsltParseTemplateContent(), and xsltText().