ReactOS 0.4.17-dev-966-gf06eace
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.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 MSIPACKAGE * alloc_package (void)
 
static UINT load_admin_properties (MSIPACKAGE *package)
 
void msi_adjust_privilege_properties (MSIPACKAGE *package)
 
MSIPACKAGE * MSI_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 BOOL validate_package_platform (enum platform platform)
 
static UINT validate_package (MSIPACKAGE *package)
 
static WCHAR * get_property (MSIDATABASE *db, const WCHAR *prop)
 
static WCHAR * get_product_code (MSIDATABASE *db)
 
static WCHAR * get_product_version (MSIDATABASE *db)
 
static UINT get_registered_local_package (const WCHAR *product, WCHAR *localfile)
 
WCHAR * msi_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 MSIRECORD * get_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 920 of file package.c.

921{
922 MSIPACKAGE *package;
923
924 package = alloc_msiobject( MSIHANDLETYPE_PACKAGE, sizeof (MSIPACKAGE),
925 MSI_FreePackage );
926 if( package )
927 {
928 list_init( &package->components );
929 list_init( &package->features );
930 list_init( &package->files );
931 list_init( &package->filepatches );
932 list_init( &package->tempfiles );
933 list_init( &package->folders );
934 list_init( &package->subscriptions );
935 list_init( &package->appids );
936 list_init( &package->classes );
937 list_init( &package->mimes );
938 list_init( &package->extensions );
939 list_init( &package->progids );
940 list_init( &package->RunningActions );
941 list_init( &package->sourcelist_info );
942 list_init( &package->sourcelist_media );
943 list_init( &package->patches );
944 list_init( &package->binaries );
945 list_init( &package->cabinet_streams );
946 list_init( &package->drlocators );
947 }
948
949 return package;
950}
static void list_init(struct list_entry *head)
Definition: list.h:51
struct list progids
Definition: msipriv.h:442
struct list subscriptions
Definition: msipriv.h:475
struct list drlocators
Definition: msipriv.h:422
struct list classes
Definition: msipriv.h:440
struct list RunningActions
Definition: msipriv.h:454
struct list appids
Definition: msipriv.h:444
struct list features
Definition: msipriv.h:415
struct list files
Definition: msipriv.h:416
struct list cabinet_streams
Definition: msipriv.h:421
struct list extensions
Definition: msipriv.h:441
struct list folders
Definition: msipriv.h:419
struct list components
Definition: msipriv.h:414
struct list mimes
Definition: msipriv.h:443
struct list sourcelist_media
Definition: msipriv.h:478
struct list filepatches
Definition: msipriv.h:417
struct list patches
Definition: msipriv.h:413
struct list binaries
Definition: msipriv.h:420
struct list tempfiles
Definition: msipriv.h:418
struct list sourcelist_info
Definition: msipriv.h:477

◆ 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
#define L(x)
Definition: resources.c:13
unsigned int UINT
Definition: sysinfo.c:13
UINT MSI_ViewExecute(MSIQUERY *, MSIRECORD *)
Definition: msiquery.c:498
UINT MSI_ViewClose(MSIQUERY *)
Definition: msiquery.c:450
UINT MSI_DatabaseOpenViewW(MSIDATABASE *, LPCWSTR, MSIQUERY **)
MSIDATABASE * db
Definition: msipriv.h:407

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:700
struct file_info manifest
Definition: actctx.c:555

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:39
static const WCHAR *const ext[]
Definition: module.c:53
const char cursor[]
Definition: icontest.c:13
uint32_t entry
Definition: isohybrid.c:63
#define LIST_FOR_EACH_SAFE(cursor, cursor2, list)
Definition: list.h:230
LPWSTR Command
Definition: msipriv.h:718
struct list entry
Definition: msipriv.h:715
LPWSTR Argument
Definition: msipriv.h:719
LPWSTR Verb
Definition: msipriv.h:716
#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:1807
struct list entry
Definition: msipriv.h:567
_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:112

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
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:2035
void msi_event_cleanup_all_subscriptions(MSIPACKAGE *package)
Definition: dialog.c:4111
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:401
void msi_free_patchinfo(MSIPATCHINFO *patch)
Definition: patch.c:865
struct list entry
Definition: wpp.c:51
Definition: fci.c:123
struct list entry
Definition: fci.c:124
struct list entry
Definition: fci.c:113
struct list entry
Definition: msipriv.h:192
IStorage * storage
Definition: msipriv.h:194
LPWSTR clsid
Definition: msipriv.h:666
LPWSTR IconPath
Definition: msipriv.h:674
LPWSTR Argument
Definition: msipriv.h:677
LPWSTR ProgIDText
Definition: msipriv.h:670
LPWSTR DefInprocHandler
Definition: msipriv.h:675
LPWSTR FileTypeMask
Definition: msipriv.h:673
struct list entry
Definition: msipriv.h:665
LPWSTR Description
Definition: msipriv.h:671
LPWSTR DefInprocHandler32
Definition: msipriv.h:676
LPWSTR Context
Definition: msipriv.h:667
LPWSTR Component
Definition: msipriv.h:538
LPWSTR ComponentId
Definition: msipriv.h:539
MSIASSEMBLY * assembly
Definition: msipriv.h:554
struct list entry
Definition: msipriv.h:537
LPWSTR KeyPath
Definition: msipriv.h:543
LPWSTR Condition
Definition: msipriv.h:542
LPWSTR Directory
Definition: msipriv.h:540
LPWSTR FullKeypath
Definition: msipriv.h:552
WCHAR * path
Definition: msipriv.h:646
struct list entry
Definition: msipriv.h:639
LPWSTR ContentType
Definition: msipriv.h:725
LPWSTR clsid
Definition: msipriv.h:728
struct list entry
Definition: msipriv.h:724
LPWSTR suffix
Definition: msipriv.h:727
int unique_actions_count
Definition: msipriv.h:450
LPWSTR LastAction
Definition: msipriv.h:424
LPWSTR * unique_actions
Definition: msipriv.h:449
LPWSTR ProductCode
Definition: msipriv.h:462
LPWSTR PackagePath
Definition: msipriv.h:461
LANGID * langids
Definition: msipriv.h:411
LPWSTR LastActionTemplate
Definition: msipriv.h:425
LPWSTR ActionFormat
Definition: msipriv.h:423
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:636
UINT WINAPI GetWindowsDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2370
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLuint res
Definition: glext.h:9613
GLsizeiptr size
Definition: glext.h:5919
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:1021
#define KEY_QUERY_VALUE
Definition: nt_native.h:1019
short WCHAR
Definition: pedump.c:58
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
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 1834 of file package.c.

1835{
1836 int i = 0;
1837
1838 while (internal_errors[i].id != 0)
1839 {
1840 if (internal_errors[i].id == error)
1841 return internal_errors[i].text;
1842 i++;
1843 }
1844
1845 FIXME("missing error message %d\n", error);
1846 return NULL;
1847}
#define FIXME(fmt,...)
Definition: precomp.h:53
static const struct @618 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 1330 of file package.c.

1331{
1332 WCHAR *product_code;
1333 UINT r;
1334
1335 if (!(product_code = get_product_code( db )))
1337 r = get_registered_local_package( product_code, localfile );
1338 free( product_code );
1339 return r;
1340}
static UINT get_registered_local_package(const WCHAR *product, WCHAR *localfile)
Definition: package.c:1284
static WCHAR * get_product_code(MSIDATABASE *db)
Definition: package.c:1274
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define ERROR_INSTALL_PACKAGE_INVALID
Definition: winerror.h:1326

Referenced by MSI_OpenPackageW().

◆ get_product_code()

static WCHAR * get_product_code ( MSIDATABASE *  db)
static

Definition at line 1274 of file package.c.

1275{
1276 return get_property( db, L"ProductCode" );
1277}
static WCHAR * get_property(MSIDATABASE *db, const WCHAR *prop)
Definition: package.c:1246

Referenced by get_local_package(), and MSI_OpenPackageW().

◆ get_product_version()

static WCHAR * get_product_version ( MSIDATABASE *  db)
static

Definition at line 1279 of file package.c.

1280{
1281 return get_property( db, L"ProductVersion" );
1282}

Referenced by MSI_OpenPackageW().

◆ get_property()

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

Definition at line 1246 of file package.c.

1247{
1249 MSIQUERY *view;
1250 MSIRECORD *rec;
1251 WCHAR *ret = NULL;
1252
1253 swprintf(query, ARRAY_SIZE(query), L"SELECT `Value` FROM `Property` WHERE `Property`='%s'", prop);
1255 {
1256 return NULL;
1257 }
1258 if (MSI_ViewExecute( view, 0 ) != ERROR_SUCCESS)
1259 {
1261 msiobj_release( &view->hdr );
1262 return NULL;
1263 }
1264 if (MSI_ViewFetch( view, &rec ) == ERROR_SUCCESS)
1265 {
1266 ret = wcsdup( MSI_RecordGetString( rec, 1 ) );
1267 msiobj_release( &rec->hdr );
1268 }
1270 msiobj_release( &view->hdr );
1271 return ret;
1272}
#define ARRAY_SIZE(A)
Definition: main.h:20
static wchar_t * wcsdup(const wchar_t *str)
Definition: string.h:94
#define swprintf
Definition: precomp.h:40
return ret
Definition: mutex.c:147
const WCHAR * MSI_RecordGetString(const MSIRECORD *, UINT)
Definition: record.c:433
UINT MSI_ViewFetch(MSIQUERY *, MSIRECORD **)
Definition: msiquery.c:373
MSIOBJECTHDR hdr
Definition: msipriv.h:151

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

2216{
2217 MSIRECORD *rec, *row = NULL;
2218 MSIQUERY *view;
2219 UINT r;
2220 WCHAR *buffer;
2221 int length;
2222
2223 if (!name || !*name)
2224 return NULL;
2225
2226 if (!wcscmp(name, L"Date"))
2227 {
2229 if (!length)
2230 return NULL;
2231 buffer = malloc(length * sizeof(WCHAR));
2233
2234 row = MSI_CreateRecord(1);
2235 if (!row)
2236 {
2237 free(buffer);
2238 return NULL;
2239 }
2241 free(buffer);
2242 return row;
2243 }
2244 else if (!wcscmp(name, L"Time"))
2245 {
2247 if (!length)
2248 return NULL;
2249 buffer = malloc(length * sizeof(WCHAR));
2251
2252 row = MSI_CreateRecord(1);
2253 if (!row)
2254 {
2255 free(buffer);
2256 return NULL;
2257 }
2259 free(buffer);
2260 return row;
2261 }
2262
2263 rec = MSI_CreateRecord(1);
2264 if (!rec)
2265 return NULL;
2266
2267 MSI_RecordSetStringW(rec, 1, name);
2268
2269 r = MSI_DatabaseOpenViewW(db, L"SELECT `Value` FROM `_Property` WHERE `_Property`=?", &view);
2270 if (r == ERROR_SUCCESS)
2271 {
2272 MSI_ViewExecute(view, rec);
2275 msiobj_release(&view->hdr);
2276 }
2277 msiobj_release(&rec->hdr);
2278 return row;
2279}
_ACRTIMP int __cdecl wcscmp(const wchar_t *, const wchar_t *)
Definition: wcs.c:1977
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:1101
INT WINAPI GetDateFormatW(LCID lcid, DWORD dwFlags, const SYSTEMTIME *lpTime, LPCWSTR lpFormat, LPWSTR lpDateStr, INT cchOut)
Definition: lcformat.c:1001
UINT MSI_RecordSetStringW(MSIRECORD *, UINT, LPCWSTR)
Definition: record.c:597
MSIRECORD * MSI_CreateRecord(UINT)
Definition: record.c:76
#define LOCALE_USER_DEFAULT
Definition: name.c:39
#define TIME_NOTIMEMARKER
Definition: winnls.h:307
#define DATE_SHORTDATE
Definition: winnls.h:216

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

1285{
1287 WCHAR *filename;
1288 HKEY props_key;
1289 UINT r;
1290
1291 r = msi_locate_product( product, &context );
1292 if (r != ERROR_SUCCESS)
1293 return r;
1294
1295 r = MSIREG_OpenInstallProps( product, context, NULL, &props_key, FALSE );
1296 if (r != ERROR_SUCCESS)
1297 return r;
1298
1300 RegCloseKey( props_key );
1301 if (!filename)
1302 return ERROR_FUNCTION_FAILED;
1303
1304 lstrcpyW( localfile, filename );
1305 free( filename );
1306 return ERROR_SUCCESS;
1307}
#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) __WINE_DEALLOC(free) __WINE_MALLOC
Definition: http.c:7252
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:1333

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

1733{
1734 if (!package || (package->ui_level & INSTALLUILEVEL_MASK) == INSTALLUILEVEL_NONE)
1735 return 0;
1736
1737 /* todo: check if message needs additional styles (topmost/foreground/modality?) */
1738
1739 switch (eMessageType & 0xff000000)
1740 {
1744 if (package->ui_level & INSTALLUILEVEL_PROGRESSONLY) return 0;
1745 if (!(eMessageType & MB_ICONMASK))
1746 eMessageType |= MB_ICONEXCLAMATION;
1747 return MessageBoxW(gUIhwnd, message, L"Windows Installer", eMessageType & 0x00ffffff);
1749 if (package->ui_level & INSTALLUILEVEL_PROGRESSONLY) return 0;
1750 if (!(eMessageType & MB_ICONMASK))
1751 eMessageType |= MB_ICONASTERISK;
1752 return MessageBoxW(gUIhwnd, message, L"Windows Installer", eMessageType & 0x00ffffff);
1754 if (package->ui_level & INSTALLUILEVEL_PROGRESSONLY) return 0;
1755 if (!(eMessageType & MB_ICONMASK))
1756 eMessageType |= MB_USERICON;
1757 return MessageBoxW(gUIhwnd, message, L"Windows Installer", eMessageType & 0x00ffffff);
1763 return 0;
1765 {
1767 INT rc = ACTION_DialogBox(package, dialog);
1768 free(dialog);
1769 return rc;
1770 }
1772 {
1773 LPWSTR deformatted;
1774 MSIRECORD *uirow = MSI_CreateRecord(1);
1775 if (!uirow) return -1;
1776 deformat_string(package, MSI_RecordGetString(record, 2), &deformatted);
1777 MSI_RecordSetStringW(uirow, 1, deformatted);
1778 msi_event_fire(package, L"ActionText", uirow);
1779
1780 free(deformatted);
1781 msiobj_release(&uirow->hdr);
1782 return 1;
1783 }
1785 {
1786 MSIRECORD *uirow = MSI_CreateRecord(1);
1787 if (!uirow) return -1;
1788 MSI_RecordSetStringW(uirow, 1, message);
1789 msi_event_fire(package, L"ActionData", uirow);
1790 msiobj_release(&uirow->hdr);
1791
1792 if (package->action_progress_increment)
1793 {
1794 uirow = MSI_CreateRecord(2);
1795 if (!uirow) return -1;
1796 MSI_RecordSetInteger(uirow, 1, 2);
1798 msi_event_fire(package, L"SetProgress", uirow);
1799 msiobj_release(&uirow->hdr);
1800 }
1801 return 1;
1802 }
1804 msi_event_fire(package, L"SetProgress", record);
1805 return 1;
1807 switch (MSI_RecordGetInteger(record, 1))
1808 {
1809 case 0:
1810 case 1:
1811 /* do nothing */
1812 return 0;
1813 default:
1814 /* fall through */
1815 ;
1816 }
1817 default:
1818 FIXME("internal UI not implemented for message 0x%08x (UI level = %x)\n", eMessageType, package->ui_level);
1819 return 0;
1820 }
1821}
void msi_event_fire(MSIPACKAGE *package, const WCHAR *event, MSIRECORD *rec)
Definition: dialog.c:4421
INT ACTION_DialogBox(MSIPACKAGE *package, const WCHAR *dialog)
Definition: dialog.c:4486
DWORD deformat_string(MSIPACKAGE *package, const WCHAR *fmt, WCHAR **data)
Definition: format.c:1015
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
WCHAR * msi_dup_record_field(MSIRECORD *row, INT index) __WINE_DEALLOC(free) __WINE_MALLOC
Definition: record.c:1002
UINT MSI_RecordSetInteger(MSIRECORD *, UINT, int)
Definition: record.c:280
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
#define MB_ICONMASK
Definition: winuser.h:830
#define MB_ICONEXCLAMATION
Definition: winuser.h:796
#define MB_USERICON
Definition: winuser.h:794
#define MB_ICONASTERISK
Definition: winuser.h:795
Definition: tftpd.h:60
INSTALLUILEVEL ui_level
Definition: msipriv.h:466
UINT action_progress_increment
Definition: msipriv.h:427
uint16_t * LPWSTR
Definition: typedefs.h:56
int32_t INT
Definition: typedefs.h:58

Referenced by MSI_ProcessMessageVerbatim().

◆ load_admin_properties()

static UINT load_admin_properties ( MSIPACKAGE *  package)
static

Definition at line 952 of file package.c.

953{
954 BYTE *data;
955 UINT r, sz;
956
957 r = read_stream_data(package->db->storage, L"AdminProperties", FALSE, &data, &sz);
958 if (r != ERROR_SUCCESS)
959 return r;
960
961 r = msi_parse_command_line(package, (WCHAR *)data, TRUE);
962
963 free(data);
964 return r;
965}
#define TRUE
Definition: types.h:120
UINT msi_parse_command_line(MSIPACKAGE *package, LPCWSTR szCommandLine, BOOL preserve_case)
Definition: action.c:206
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 967 of file package.c.

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

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

1067{
1068 DWORD time, len, i, offset;
1069 HANDLE handle;
1070
1071 time = GetTickCount();
1073 lstrcatW( path, L"\\Installer\\" );
1075
1076 len = lstrlenW(path);
1077 for (i = 0; i < 0x10000; i++)
1078 {
1079 offset = swprintf( path + len, MAX_PATH - len, L"%x", (time + i) & 0xffff );
1080 memcpy( path + len + offset, suffix, (lstrlenW( suffix ) + 1) * sizeof(WCHAR) );
1084 {
1086 break;
1087 }
1090 return ERROR_FUNCTION_FAILED;
1091 }
1092
1093 return ERROR_SUCCESS;
1094}
#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:58
ULONG WINAPI DECLSPEC_HOTPATCH GetTickCount(void)
Definition: sync.c:182
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:257
#define ERROR_FILE_EXISTS
Definition: winerror.h:287

Referenced by apply_patch_package(), and MSI_OpenPackageW().

◆ MSI_CreatePackage()

MSIPACKAGE * MSI_CreatePackage ( MSIDATABASE *  db)

Definition at line 981 of file package.c.

982{
983 MSIPACKAGE *package;
984 WCHAR uilevel[11];
985 int len;
986 UINT r;
987
988 TRACE("%p\n", db);
989
990 package = alloc_package();
991 if (package)
992 {
993 msiobj_addref( &db->hdr );
994 package->db = db;
995
996 package->LastAction = NULL;
997 package->LastActionTemplate = NULL;
999 package->WordCount = 0;
1000 package->PackagePath = wcsdup( db->path );
1001
1002 create_temp_property_table( package );
1003 msi_clone_properties( package->db );
1005
1006 package->ProductCode = msi_dup_property( package->db, L"ProductCode" );
1007
1008 set_installer_properties( package );
1009
1010 package->ui_level = gUILevel;
1011 len = swprintf( uilevel, ARRAY_SIZE(uilevel), L"%u", gUILevel & INSTALLUILEVEL_MASK );
1012 msi_set_property( package->db, L"UILevel", uilevel, len );
1013
1014 r = msi_load_suminfo_properties( package );
1015 if (r != ERROR_SUCCESS)
1016 {
1017 msiobj_release( &package->hdr );
1018 return NULL;
1019 }
1020
1022 load_admin_properties( package );
1023
1024 package->log_file = INVALID_HANDLE_VALUE;
1025 package->script = SCRIPT_NONE;
1026 }
1027 return package;
1028}
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:952
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:397
UINT msi_load_suminfo_properties(MSIPACKAGE *package)
Definition: suminfo.c:1266
UINT msi_set_property(MSIDATABASE *, const WCHAR *, const WCHAR *, int)
Definition: package.c:2132
WCHAR * msi_dup_property(MSIDATABASE *db, const WCHAR *prop) __WINE_DEALLOC(free) __WINE_MALLOC
void msi_adjust_privilege_properties(MSIPACKAGE *)
Definition: package.c:967
#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:472
MSIOBJECTHDR hdr
Definition: msipriv.h:406
HANDLE log_file
Definition: msipriv.h:428
enum script script
Definition: msipriv.h:446
UINT LastActionResult
Definition: msipriv.h:426

◆ msi_download_file()

UINT msi_download_file ( LPCWSTR  szUrl,
LPWSTR  filename 
)

Definition at line 1030 of file package.c.

1031{
1033 DWORD size = 0;
1034 HRESULT hr;
1035
1036 /* call will always fail, because size is 0,
1037 * but will return ERROR_FILE_NOT_FOUND first
1038 * if the file doesn't exist
1039 */
1040 GetUrlCacheEntryInfoW( szUrl, NULL, &size );
1042 {
1043 cache_entry = malloc( size );
1044 if ( !GetUrlCacheEntryInfoW( szUrl, cache_entry, &size ) )
1045 {
1047 free( cache_entry );
1048 return error;
1049 }
1050
1051 lstrcpyW( filename, cache_entry->lpszLocalFileName );
1052 free( cache_entry );
1053 return ERROR_SUCCESS;
1054 }
1055
1057 if ( FAILED(hr) )
1058 {
1059 WARN("failed to download %s to cache file\n", debugstr_w(szUrl));
1060 return ERROR_FUNCTION_FAILED;
1061 }
1062
1063 return ERROR_SUCCESS;
1064}
HRESULT hr
Definition: delayimp.cpp:582
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
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:868

Referenced by MSI_OpenPackageW(), and ready_media().

◆ msi_dup_property()

LPWSTR msi_dup_property ( MSIDATABASE *  db,
LPCWSTR  prop 
)

Definition at line 2315 of file package.c.

2316{
2317 DWORD sz = 0;
2318 LPWSTR str;
2319 UINT r;
2320
2321 r = msi_get_property(db, prop, NULL, &sz);
2322 if (r != ERROR_SUCCESS && r != ERROR_MORE_DATA)
2323 return NULL;
2324
2325 sz++;
2326 str = malloc(sz * sizeof(WCHAR));
2327 r = msi_get_property(db, prop, str, &sz);
2328 if (r != ERROR_SUCCESS)
2329 {
2330 free(str);
2331 str = NULL;
2332 }
2333
2334 return str;
2335}
#define ERROR_MORE_DATA
Definition: dderror.h:13
UINT msi_get_property(MSIDATABASE *db, LPCWSTR szName, LPWSTR szValueBuf, LPDWORD pchValueBuf)
Definition: package.c:2282
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:396
LPWSTR * script_actions[SCRIPT_MAX]
Definition: msipriv.h:447
int script_actions_count[SCRIPT_MAX]
Definition: msipriv.h:448

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:681
void msi_dialog_destroy(msi_dialog *dialog)
Definition: dialog.c:4059
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:1941
RPC_STATUS WINAPI RpcBindingFree(RPC_BINDING_HANDLE *Binding)
Definition: rpc_binding.c:769
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 1850 of file package.c.

1851{
1853 LPWSTR ret = NULL;
1854
1855 if ((record = MSI_QueryGetRecord(db, L"SELECT `Message` FROM `Error` WHERE `Error` = %d", error)))
1856 {
1858 msiobj_release(&record->hdr);
1859 }
1860 else if (error < 2000)
1861 {
1863 if (len)
1864 {
1865 ret = malloc((len + 1) * sizeof(WCHAR));
1867 }
1868 else
1869 ret = NULL;
1870 }
1871
1872 return ret;
1873}
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
#define LoadStringW
Definition: utils.h:64

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

1310{
1311 WCHAR *ret;
1313 UINT r;
1314
1315 r = msi_get_suminfo( db->storage, 0, &si );
1316 if (r != ERROR_SUCCESS)
1317 {
1318 r = msi_get_db_suminfo( db, 0, &si );
1319 if (r != ERROR_SUCCESS)
1320 {
1321 WARN("failed to load summary info %u\n", r);
1322 return NULL;
1323 }
1324 }
1326 msiobj_release( &si->hdr );
1327 return ret;
1328}
static SYSTEM_INFO si
Definition: virtual.c:39
#define PID_REVNUMBER
Definition: suminfo.c:51
UINT msi_get_db_suminfo(MSIDATABASE *db, UINT uiUpdateCount, MSISUMMARYINFO **si)
Definition: suminfo.c:491
UINT msi_get_suminfo(IStorage *stg, UINT uiUpdateCount, MSISUMMARYINFO **si)
Definition: suminfo.c:461
WCHAR * msi_suminfo_dup_string(MSISUMMARYINFO *si, UINT property) __WINE_DEALLOC(free) __WINE_MALLOC
Definition: suminfo.c:700

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

2284{
2285 MSIRECORD *row;
2287
2288 TRACE("%p %s %p %p\n", db, debugstr_w(szName), szValueBuf, pchValueBuf);
2289
2290 row = get_property_row( db, szName );
2291
2292 if (*pchValueBuf > 0)
2293 szValueBuf[0] = 0;
2294
2295 if (row)
2296 {
2297 rc = MSI_RecordGetStringW(row, 1, szValueBuf, pchValueBuf);
2298 msiobj_release(&row->hdr);
2299 }
2300
2301 if (rc == ERROR_SUCCESS)
2302 TRACE("returning %s for property %s\n", debugstr_wn(szValueBuf, *pchValueBuf),
2304 else if (rc == ERROR_MORE_DATA)
2305 TRACE( "need %lu sized buffer for %s\n", *pchValueBuf, debugstr_w(szName) );
2306 else
2307 {
2308 *pchValueBuf = 0;
2309 TRACE("property %s not found\n", debugstr_w(szName));
2310 }
2311
2312 return rc;
2313}
static MSIRECORD * get_property_row(MSIDATABASE *db, const WCHAR *name)
Definition: package.c:2215
#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 
)

◆ MSI_OpenPackageW()

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

Definition at line 1416 of file package.c.

1417{
1418 MSIDATABASE *db;
1419 MSIPACKAGE *package;
1421 MSIRECORD *data_row, *info_row;
1422 UINT r;
1423 WCHAR localfile[MAX_PATH], cachefile[MAX_PATH];
1424 LPCWSTR file = szPackage;
1425 DWORD index = 0;
1427 BOOL delete_on_close = FALSE;
1428 WCHAR *info_template, *productname, *product_code;
1430
1431 TRACE("%s %p\n", debugstr_w(szPackage), pPackage);
1432
1434
1435 localfile[0] = 0;
1436 if( szPackage[0] == '#' )
1437 {
1438 handle = wcstol(&szPackage[1], NULL, 10);
1440 return ERROR_INVALID_HANDLE;
1441 }
1442 else
1443 {
1444 WCHAR *product_version = NULL;
1445
1446 if ( UrlIsW( szPackage, URLIS_URL ) )
1447 {
1448 r = msi_download_file( szPackage, cachefile );
1449 if (r != ERROR_SUCCESS)
1450 return r;
1451
1452 file = cachefile;
1453 }
1454#ifdef __REACTOS__
1455 AppHelpCheckPackage(file);
1456#endif
1457
1459 if (r != ERROR_SUCCESS)
1460 {
1462 return ERROR_FILE_NOT_FOUND;
1463 return r;
1464 }
1465 r = get_local_package( db, localfile );
1467 {
1468 DWORD localfile_attr;
1469
1470 r = msi_create_empty_local_file( localfile, L".msi" );
1471 if (r != ERROR_SUCCESS)
1472 {
1473 msiobj_release( &db->hdr );
1474 return r;
1475 }
1476
1477 if (!CopyFileW( file, localfile, FALSE ))
1478 {
1479 r = GetLastError();
1480 WARN("unable to copy package %s to %s (%u)\n", debugstr_w(file), debugstr_w(localfile), r);
1481 DeleteFileW( localfile );
1482 msiobj_release( &db->hdr );
1483 return r;
1484 }
1485 delete_on_close = TRUE;
1486
1487 /* Remove read-only bit, we are opening it with write access in MSI_OpenDatabaseW below. */
1488 localfile_attr = GetFileAttributesW( localfile );
1489 if (localfile_attr & FILE_ATTRIBUTE_READONLY)
1490 SetFileAttributesW( localfile, localfile_attr & ~FILE_ATTRIBUTE_READONLY);
1491 }
1493 {
1494 if (!CopyFileW( file, localfile, FALSE ))
1495 {
1496 r = GetLastError();
1497 WARN("unable to update cached package (%u)\n", r);
1498 msiobj_release( &db->hdr );
1499 return r;
1500 }
1501 }
1502 else
1503 product_version = get_product_version( db );
1504 msiobj_release( &db->hdr );
1505 TRACE("opening package %s\n", debugstr_w( localfile ));
1506 r = MSI_OpenDatabaseW( localfile, MSIDBOPEN_TRANSACT, &db );
1507 if (r != ERROR_SUCCESS)
1508 {
1509 free( product_version );
1510 return r;
1511 }
1512
1513 if (product_version)
1514 {
1515 WCHAR *cache_version = get_product_version( db );
1516 if (!product_version != !cache_version ||
1517 (product_version && wcscmp(product_version, cache_version)))
1518 {
1519 msiobj_release( &db->hdr );
1520 free( product_version );
1521 free( cache_version );
1522 return ERROR_PRODUCT_VERSION;
1523 }
1524 free( product_version );
1525 free( cache_version );
1526 }
1527 }
1528 package = MSI_CreatePackage( db );
1529 msiobj_release( &db->hdr );
1530 if (!package) return ERROR_INSTALL_PACKAGE_INVALID;
1531 package->localfile = wcsdup( localfile );
1532 package->delete_on_close = delete_on_close;
1533
1534 r = msi_get_suminfo( db->storage, 0, &si );
1535 if (r != ERROR_SUCCESS)
1536 {
1537 r = msi_get_db_suminfo( db, 0, &si );
1538 if (r != ERROR_SUCCESS)
1539 {
1540 WARN("failed to load summary info\n");
1541 msiobj_release( &package->hdr );
1543 }
1544 }
1545 r = parse_suminfo( si, package );
1546 msiobj_release( &si->hdr );
1547 if (r != ERROR_SUCCESS)
1548 {
1549 WARN("failed to parse summary info %u\n", r);
1550 msiobj_release( &package->hdr );
1551 return r;
1552 }
1553 r = validate_package( package );
1554 if (r != ERROR_SUCCESS)
1555 {
1556 msiobj_release( &package->hdr );
1557 return r;
1558 }
1559 msi_set_property( package->db, L"DATABASE", db->path, -1 );
1560 set_installed_prop( package );
1561 msi_set_context( package );
1562
1563 product_code = get_product_code( db );
1564 if (msi_locate_product( product_code, &context ) == ERROR_SUCCESS)
1565 {
1566 TRACE("product already registered\n");
1567 msi_set_property( package->db, L"ProductToBeRegistered", L"1", -1 );
1568 }
1569 free( product_code );
1570
1571 while (1)
1572 {
1573 WCHAR patch_code[GUID_SIZE];
1574 r = MsiEnumPatchesExW( package->ProductCode, NULL, package->Context,
1575 MSIPATCHSTATE_APPLIED, index, patch_code, NULL, NULL, NULL, NULL );
1576 if (r != ERROR_SUCCESS)
1577 break;
1578
1579 TRACE("found registered patch %s\n", debugstr_w(patch_code));
1580
1581 r = msi_apply_registered_patch( package, patch_code );
1582 if (r != ERROR_SUCCESS)
1583 {
1584 ERR("registered patch failed to apply %u\n", r);
1585 msiobj_release( &package->hdr );
1586 return r;
1587 }
1588 index++;
1589 }
1590 if (index) msi_adjust_privilege_properties( package );
1591
1592 r = msi_set_original_database_property( package->db, szPackage );
1593 if (r != ERROR_SUCCESS)
1594 {
1595 msiobj_release( &package->hdr );
1596 return r;
1597 }
1598 if (gszLogFile)
1601
1602 /* FIXME: when should these messages be sent? */
1603 data_row = MSI_CreateRecord(3);
1604 if (!data_row)
1605 return ERROR_OUTOFMEMORY;
1606 MSI_RecordSetStringW(data_row, 0, NULL);
1607 MSI_RecordSetInteger(data_row, 1, 0);
1608 MSI_RecordSetInteger(data_row, 2, package->num_langids ? package->langids[0] : 0);
1611
1612 info_row = MSI_CreateRecord(0);
1613 if (!info_row)
1614 {
1615 msiobj_release(&data_row->hdr);
1616 return ERROR_OUTOFMEMORY;
1617 }
1618 info_template = msi_get_error_message(package->db, MSIERR_INFO_LOGGINGSTART);
1619 MSI_RecordSetStringW(info_row, 0, info_template);
1620 free(info_template);
1622
1624
1625 productname = msi_dup_property(package->db, INSTALLPROPERTY_PRODUCTNAMEW);
1626 MSI_RecordSetInteger(data_row, 1, 1);
1627 MSI_RecordSetStringW(data_row, 2, productname);
1628 MSI_RecordSetStringW(data_row, 3, NULL);
1630
1631 free(productname);
1632 msiobj_release(&info_row->hdr);
1633 msiobj_release(&data_row->hdr);
1634
1635 *pPackage = package;
1636 return ERROR_SUCCESS;
1637}
#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:367
BOOL WINAPI SetFileAttributesW(LPCWSTR lpFileName, DWORD dwFileAttributes)
Definition: fileinfo.c:779
BOOL WINAPI UrlIsW(const WCHAR *url, URLIS Urlis)
Definition: path.c:4788
UINT msi_set_context(MSIPACKAGE *package)
Definition: action.c:390
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:1214
UINT msi_download_file(LPCWSTR szUrl, LPWSTR filename)
Definition: package.c:1030
INT MSI_ProcessMessage(MSIPACKAGE *package, INSTALLMESSAGE eMessageType, MSIRECORD *record)
Definition: package.c:1941
static UINT get_local_package(MSIDATABASE *db, WCHAR *localfile)
Definition: package.c:1330
static WCHAR * get_product_version(MSIDATABASE *db)
Definition: package.c:1279
static UINT parse_suminfo(MSISUMMARYINFO *si, MSIPACKAGE *package)
Definition: package.c:1106
static UINT set_installed_prop(MSIPACKAGE *package)
Definition: package.c:457
UINT msi_create_empty_local_file(LPWSTR path, LPCWSTR suffix)
Definition: package.c:1066
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:1950
#define MSIERR_INFO_LOGGINGSTART
Definition: resource.h:24
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:746
UINT msi_get_string_table_codepage(const string_table *st)
Definition: string.c:671
WCHAR * msi_get_error_message(MSIDATABASE *, int) __WINE_DEALLOC(free) __WINE_MALLOC
Definition: package.c:1850
#define GUID_SIZE
Definition: msipriv.h:757
INT MSI_ProcessMessageVerbatim(MSIPACKAGE *, INSTALLMESSAGE, MSIRECORD *)
Definition: package.c:1875
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:1342
#define WINE_OPENPACKAGEFLAGS_RECACHE
Definition: msipriv.h:908
#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:597
#define MB_ICONHAND
Definition: winuser.h:799
DWORD dwOptions
Definition: solitaire.cpp:25
string_table * strings
Definition: msipriv.h:110
BOOL delete_on_close
Definition: msipriv.h:464
UINT num_langids
Definition: msipriv.h:410
MSIINSTALLCONTEXT Context
Definition: msipriv.h:473
LPWSTR localfile
Definition: msipriv.h:463
const uint16_t * LPCWSTR
Definition: typedefs.h:57
unsigned long MSIHANDLE
Definition: winemsi.idl:27
#define ERROR_PRODUCT_VERSION
Definition: winerror.h:1344

Referenced by ACTION_InstallAdminPackage(), 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 2657 of file package.c.

2659{
2661
2663 {
2664 if (!wcscmp( info->value, value )) return ERROR_SUCCESS;
2665 }
2666
2667 info = malloc(sizeof(MSISOURCELISTINFO));
2668 if (!info)
2669 return ERROR_OUTOFMEMORY;
2670
2671 info->context = context;
2672 info->options = options;
2673 info->property = property;
2674 info->value = wcsdup(value);
2675 list_add_head(&package->sourcelist_info, &info->entry);
2676
2677 return ERROR_SUCCESS;
2678}
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:236
Definition: pdh_main.c:64

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

2682{
2683 MSIMEDIADISK *disk;
2684
2686 {
2687 if (disk->disk_id == disk_id) return ERROR_SUCCESS;
2688 }
2689
2690 disk = malloc(sizeof(MSIMEDIADISK));
2691 if (!disk)
2692 return ERROR_OUTOFMEMORY;
2693
2694 disk->context = context;
2695 disk->options = options;
2696 disk->disk_id = disk_id;
2698 disk->disk_prompt = wcsdup(disk_prompt);
2699 list_add_head(&package->sourcelist_media, &disk->entry);
2700
2701 return ERROR_SUCCESS;
2702}
__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 1941 of file package.c.

1942{
1943 switch (eMessageType & 0xff000000)
1944 {
1952 {
1953 /* error message */
1954
1955 LPWSTR template;
1956 LPWSTR template_rec = NULL, template_prefix = NULL;
1958
1959 if (MSI_RecordIsNull(record, 0))
1960 {
1961 if (error >= 32)
1962 {
1963 template_rec = msi_get_error_message(package->db, error);
1964
1965 if (!template_rec && error >= 2000)
1966 {
1967 /* internal error, not localized */
1968 if ((template_rec = (LPWSTR) get_internal_error_message(error)))
1969 {
1970 MSI_RecordSetStringW(record, 0, template_rec);
1972 }
1973 template_rec = msi_get_error_message(package->db, MSIERR_INSTALLERROR);
1974 MSI_RecordSetStringW(record, 0, template_rec);
1975 MSI_ProcessMessageVerbatim(package, eMessageType, record);
1976 free(template_rec);
1977 return 0;
1978 }
1979 }
1980 }
1981 else
1982 template_rec = msi_dup_record_field(record, 0);
1983
1984 template_prefix = msi_get_error_message(package->db, eMessageType >> 24);
1985 if (!template_prefix) template_prefix = wcsdup(L"");
1986
1987 if (!template_rec)
1988 {
1989 /* always returns 0 */
1990 MSI_RecordSetStringW(record, 0, template_prefix);
1991 MSI_ProcessMessageVerbatim(package, eMessageType, record);
1992 free(template_prefix);
1993 return 0;
1994 }
1995
1996 template = malloc((wcslen(template_rec) + wcslen(template_prefix) + 1) * sizeof(WCHAR));
1997 if (!template)
1998 {
1999 free(template_prefix);
2000 free(template_rec);
2001 return ERROR_OUTOFMEMORY;
2002 }
2003
2004 lstrcpyW(template, template_prefix);
2005 lstrcatW(template, template_rec);
2006 MSI_RecordSetStringW(record, 0, template);
2007
2008 free(template_prefix);
2009 free(template_rec);
2010 free(template);
2011 }
2012 break;
2014 {
2015 WCHAR *template = msi_get_error_message(package->db, MSIERR_ACTIONSTART);
2016 MSI_RecordSetStringW(record, 0, template);
2017 free(template);
2018
2019 free(package->LastAction);
2020 free(package->LastActionTemplate);
2021 package->LastAction = msi_dup_record_field(record, 1);
2022 if (!package->LastAction) package->LastAction = wcsdup(L"");
2024 break;
2025 }
2027 if (package->LastAction && package->LastActionTemplate)
2028 {
2029 size_t len = lstrlenW(package->LastAction) + lstrlenW(package->LastActionTemplate) + 7;
2030 WCHAR *template = malloc(len * sizeof(WCHAR));
2031 if (!template) return ERROR_OUTOFMEMORY;
2032 swprintf(template, len, L"{{%s: }}%s", package->LastAction, package->LastActionTemplate);
2033 MSI_RecordSetStringW(record, 0, template);
2034 free(template);
2035 }
2036 break;
2038 {
2039 WCHAR *template = msi_get_error_message(package->db, MSIERR_COMMONDATA);
2040 MSI_RecordSetStringW(record, 0, template);
2041 free(template);
2042 }
2043 break;
2044 }
2045
2046 return MSI_ProcessMessageVerbatim(package, eMessageType, record);
2047}
static LPCWSTR get_internal_error_message(int error)
Definition: package.c:1834
INT MSI_ProcessMessageVerbatim(MSIPACKAGE *package, INSTALLMESSAGE eMessageType, MSIRECORD *record)
Definition: package.c:1875
LPWSTR msi_get_error_message(MSIDATABASE *db, int error)
Definition: package.c:1850
#define MSIERR_INSTALLERROR
Definition: resource.h:21
#define MSIERR_ACTIONSTART
Definition: resource.h:22
#define MSIERR_COMMONDATA
Definition: resource.h:23
_ACRTIMP size_t __cdecl wcslen(const wchar_t *)
Definition: wcs.c:2988
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 1875 of file package.c.

1876{
1877 LPWSTR message = {0};
1878 DWORD len;
1879 DWORD log_type = 1 << (eMessageType >> 24);
1880 UINT res;
1881 INT rc = 0;
1882 char *msg;
1883
1884 TRACE("%x\n", eMessageType);
1885 if (TRACE_ON(msi)) dump_record(record);
1886
1887 if (!package || !record)
1888 message = NULL;
1889 else {
1890 res = MSI_FormatRecordW(package, record, message, &len);
1891 if (res != ERROR_SUCCESS && res != ERROR_MORE_DATA)
1892 return res;
1893 len++;
1894 message = malloc(len * sizeof(WCHAR));
1895 if (!message) return ERROR_OUTOFMEMORY;
1896 MSI_FormatRecordW(package, record, message, &len);
1897 }
1898
1899 /* convert it to ANSI */
1900 len = WideCharToMultiByte( CP_ACP, 0, message, -1, NULL, 0, NULL, NULL );
1901 msg = malloc( len );
1903
1904 if (gUIHandlerRecord && (gUIFilterRecord & log_type))
1905 {
1906 MSIHANDLE rec = alloc_msihandle(&record->hdr);
1907 TRACE( "calling UI handler %p(pvContext = %p, iMessageType = %#x, hRecord = %lu)\n",
1908 gUIHandlerRecord, gUIContextRecord, eMessageType, rec );
1909 rc = gUIHandlerRecord( gUIContextRecord, eMessageType, rec );
1910 MsiCloseHandle( rec );
1911 }
1912 if (!rc && gUIHandlerW && (gUIFilter & log_type))
1913 {
1914 TRACE( "calling UI handler %p(pvContext = %p, iMessageType = %#x, szMessage = %s)\n",
1915 gUIHandlerW, gUIContext, eMessageType, debugstr_w(message) );
1916 rc = gUIHandlerW( gUIContext, eMessageType, message );
1917 }
1918 else if (!rc && gUIHandlerA && (gUIFilter & log_type))
1919 {
1920 TRACE( "calling UI handler %p(pvContext = %p, iMessageType = %#x, szMessage = %s)\n",
1921 gUIHandlerA, gUIContext, eMessageType, debugstr_a(msg) );
1922 rc = gUIHandlerA( gUIContext, eMessageType, msg );
1923 }
1924
1925 if (!rc)
1926 rc = internal_ui_handler(package, eMessageType, record, message);
1927
1928 if (!rc && package && package->log_file != INVALID_HANDLE_VALUE &&
1929 (eMessageType & 0xff000000) != INSTALLMESSAGE_PROGRESS)
1930 {
1931 DWORD written;
1932 WriteFile( package->log_file, msg, len - 1, &written, NULL );
1933 WriteFile( package->log_file, "\n", 1, &written, NULL );
1934 }
1935 free( msg );
1936 free( message );
1937
1938 return rc;
1939}
#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_reads_bytes_opt_(nNumberOfBytesToWrite) LPCVOID lpBuffer, _In_ DWORD nNumberOfBytesToWrite, _Out_opt_ LPDWORD lpNumberOfBytesWritten, _Inout_opt_ LPOVERLAPPED lpOverlapped)
Definition: rw.c:25
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:1732
#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 2121 of file package.c.

2122{
2124
2126 {
2127 free( folder->ResolvedSource );
2128 folder->ResolvedSource = NULL;
2129 }
2130}

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

1343{
1344 UINT r;
1345
1346 if (UrlIsW( package, URLIS_URL ))
1347 r = msi_set_property( db, L"OriginalDatabase", package, -1 );
1348 else if (package[0] == '#')
1349 r = msi_set_property( db, L"OriginalDatabase", db->path, -1 );
1350 else
1351 {
1352 DWORD len;
1353 WCHAR *path;
1354
1355 if (!(len = GetFullPathNameW( package, 0, NULL, NULL ))) return GetLastError();
1356 if (!(path = malloc( len * sizeof(WCHAR) ))) return ERROR_OUTOFMEMORY;
1357 len = GetFullPathNameW( package, len, path, NULL );
1358 r = msi_set_property( db, L"OriginalDatabase", path, len );
1359 free( path );
1360 }
1361 return r;
1362}
DWORD WINAPI GetFullPathNameW(IN LPCWSTR lpFileName, IN DWORD nBufferLength, OUT LPWSTR lpBuffer, OUT LPWSTR *lpFilePart)
Definition: path.c:1164

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

2133{
2134 MSIQUERY *view;
2135 MSIRECORD *row = NULL;
2136 DWORD sz = 0;
2137 WCHAR query[1024];
2138 UINT rc;
2139
2140 TRACE("%p %s %s %d\n", db, debugstr_w(name), debugstr_wn(value, len), len);
2141
2142 if (!name)
2144
2145 /* this one is weird... */
2146 if (!name[0])
2148
2149 if (value && len < 0) len = lstrlenW( value );
2150
2151 rc = msi_get_property( db, name, 0, &sz );
2152 if (!value || (!*value && !len))
2153 {
2154 swprintf( query, ARRAY_SIZE(query), L"DELETE FROM `_Property` WHERE `_Property` = '%s'", name );
2155 }
2156 else if (rc == ERROR_MORE_DATA || rc == ERROR_SUCCESS)
2157 {
2158 swprintf( query, ARRAY_SIZE(query), L"UPDATE `_Property` SET `Value` = ? WHERE `_Property` = '%s'", name );
2159 row = MSI_CreateRecord(1);
2161 }
2162 else
2163 {
2164 lstrcpyW( query, L"INSERT INTO `_Property` (`_Property`,`Value`) VALUES (?,?)" );
2165 row = MSI_CreateRecord(2);
2166 msi_record_set_string( row, 1, name, -1 );
2168 }
2169
2170 rc = MSI_DatabaseOpenViewW(db, query, &view);
2171 if (rc == ERROR_SUCCESS)
2172 {
2173 rc = MSI_ViewExecute(view, row);
2175 msiobj_release(&view->hdr);
2176 }
2177 if (row) msiobj_release(&row->hdr);
2178 return rc;
2179}
#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_ADMIN(), 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 1701 of file package.c.

1702{
1703 MSIPACKAGE *package;
1704 MSIHANDLE handle = 0;
1705 MSIHANDLE remote;
1706
1707 TRACE( "%lu\n", hInstall );
1708
1709 package = msihandle2msiinfo( hInstall, MSIHANDLETYPE_PACKAGE);
1710 if( package)
1711 {
1712 handle = alloc_msihandle( &package->db->hdr );
1713 msiobj_release( &package->hdr );
1714 }
1715 else if ((remote = msi_get_remote(hInstall)))
1716 {
1717 __TRY
1718 {
1719 handle = remote_GetActiveDatabase(remote);
1721 }
1723 {
1724 handle = 0;
1725 }
1726 __ENDTRY
1727 }
1728
1729 return handle;
1730}
static LONG WINAPI rpc_filter(EXCEPTION_POINTERS *eptr)
Definition: rpc.c:184
#define __TRY
Definition: compat.h:80
#define __ENDTRY
Definition: compat.h:82
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:62

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

2346{
2347 const WCHAR *value = L"";
2348 MSIPACKAGE *package;
2349 MSIRECORD *row;
2350 WCHAR *nameW;
2351 int len = 0;
2352 UINT r;
2353
2354 if (!name)
2356
2357 if (!(nameW = strdupAtoW(name)))
2358 return ERROR_OUTOFMEMORY;
2359
2360 package = msihandle2msiinfo(hinst, MSIHANDLETYPE_PACKAGE);
2361 if (!package)
2362 {
2363 WCHAR *value = NULL, *tmp;
2364 MSIHANDLE remote;
2365 DWORD len;
2366
2367 if (!(remote = msi_get_remote(hinst)))
2368 {
2369 free(nameW);
2370 return ERROR_INVALID_HANDLE;
2371 }
2372
2373 __TRY
2374 {
2375 r = remote_GetProperty(remote, nameW, &value, &len);
2376 }
2378 {
2379 r = GetExceptionCode();
2380 }
2381 __ENDTRY
2382
2383 free(nameW);
2384
2385 if (!r)
2386 {
2387 /* String might contain embedded nulls.
2388 * Native returns the correct size but truncates the string. */
2389 tmp = calloc(1, (len + 1) * sizeof(WCHAR));
2390 if (!tmp)
2391 {
2393 return ERROR_OUTOFMEMORY;
2394 }
2395 lstrcpyW(tmp, value);
2396
2397 r = msi_strncpyWtoA(tmp, len, buf, sz, TRUE);
2398
2399 free(tmp);
2400 }
2402 return r;
2403 }
2404
2405 row = get_property_row(package->db, nameW);
2406 if (row)
2408
2409 r = msi_strncpyWtoA(value, len, buf, sz, FALSE);
2410
2411 free(nameW);
2412 if (row) msiobj_release(&row->hdr);
2413 msiobj_release(&package->hdr);
2414 return r;
2415}
static const WCHAR nameW[]
Definition: main.c:49
static WCHAR * strdupAtoW(const char *str)
Definition: main.c:61
UINT msi_strncpyWtoA(const WCHAR *str, int lenW, char *buf, DWORD *sz, BOOL remote)
Definition: install.c:190
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define GetExceptionCode
Definition: excpt.h:83
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:41

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

2418{
2419 const WCHAR *value = L"";
2420 MSIPACKAGE *package;
2421 MSIRECORD *row;
2422 int len = 0;
2423 UINT r;
2424
2425 if (!name)
2427
2428 package = msihandle2msiinfo(hinst, MSIHANDLETYPE_PACKAGE);
2429 if (!package)
2430 {
2431 WCHAR *value = NULL, *tmp;
2432 MSIHANDLE remote;
2433 DWORD len;
2434
2435 if (!(remote = msi_get_remote(hinst)))
2436 return ERROR_INVALID_HANDLE;
2437
2438 __TRY
2439 {
2440 r = remote_GetProperty(remote, name, &value, &len);
2441 }
2443 {
2444 r = GetExceptionCode();
2445 }
2446 __ENDTRY
2447
2448 if (!r)
2449 {
2450 /* String might contain embedded nulls.
2451 * Native returns the correct size but truncates the string. */
2452 tmp = calloc(1, (len + 1) * sizeof(WCHAR));
2453 if (!tmp)
2454 {
2456 return ERROR_OUTOFMEMORY;
2457 }
2458 lstrcpyW(tmp, value);
2459
2460 r = msi_strncpyW(tmp, len, buf, sz);
2461
2462 free(tmp);
2463 }
2465 return r;
2466 }
2467
2468 row = get_property_row(package->db, name);
2469 if (row)
2471
2472 r = msi_strncpyW(value, len, buf, sz);
2473
2474 if (row) msiobj_release(&row->hdr);
2475 msiobj_release(&package->hdr);
2476 return r;
2477}
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 1677 of file package.c.

1678{
1679 LPWSTR szwPack = NULL;
1680 UINT ret;
1681
1682 if( szPackage )
1683 {
1684 szwPack = strdupAtoW( szPackage );
1685 if( !szwPack )
1686 return ERROR_OUTOFMEMORY;
1687 }
1688
1689 ret = MsiOpenPackageExW( szwPack, dwOptions, phPackage );
1690
1691 free( szwPack );
1692
1693 return ret;
1694}
UINT WINAPI MsiOpenPackageExW(const WCHAR *szPackage, DWORD dwOptions, MSIHANDLE *phPackage)
Definition: package.c:1639

Referenced by MsiOpenPackageA().

◆ MsiOpenPackageExW()

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

Definition at line 1639 of file package.c.

1640{
1641 MSIPACKAGE *package = NULL;
1642 UINT ret;
1643
1644 TRACE( "%s, %#lx, %p\n", debugstr_w(szPackage), dwOptions, phPackage );
1645
1646 if( !szPackage || !phPackage )
1648
1649 if ( !*szPackage )
1650 {
1651 FIXME("Should create an empty database and package\n");
1652 return ERROR_FUNCTION_FAILED;
1653 }
1654
1655 if( dwOptions )
1656 FIXME( "dwOptions %#lx not supported\n", dwOptions );
1657
1658 ret = MSI_OpenPackageW( szPackage, 0, &package );
1659 if( ret == ERROR_SUCCESS )
1660 {
1661 *phPackage = alloc_msihandle( &package->hdr );
1662 if (! *phPackage)
1664 msiobj_release( &package->hdr );
1665 }
1666 else
1668
1669 return ret;
1670}
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
UINT MSI_OpenPackageW(LPCWSTR szPackage, DWORD dwOptions, MSIPACKAGE **pPackage)
Definition: package.c:1416

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

◆ MsiOpenPackageW()

UINT WINAPI MsiOpenPackageW ( LPCWSTR  szPackage,
MSIHANDLE *  phPackage 
)

Definition at line 1672 of file package.c.

1673{
1674 return MsiOpenPackageExW( szPackage, 0, phPackage );
1675}

◆ MsiProcessMessage()

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

Definition at line 2049 of file package.c.

2051{
2053 MSIPACKAGE *package = NULL;
2055
2056 if ((eMessageType & 0xff000000) == INSTALLMESSAGE_INITIALIZE ||
2057 (eMessageType & 0xff000000) == INSTALLMESSAGE_TERMINATE)
2058 return -1;
2059
2060 if ((eMessageType & 0xff000000) == INSTALLMESSAGE_COMMONDATA &&
2061 MsiRecordGetInteger(hRecord, 1) != 2)
2062 return -1;
2063
2065 if (!record)
2066 return ERROR_INVALID_HANDLE;
2067
2068 package = msihandle2msiinfo( hInstall, MSIHANDLETYPE_PACKAGE );
2069 if( !package )
2070 {
2071 MSIHANDLE remote;
2072
2073 if (!(remote = msi_get_remote(hInstall)))
2074 return ERROR_INVALID_HANDLE;
2075
2076 __TRY
2077 {
2078 ret = remote_ProcessMessage(remote, eMessageType, (struct wire_record *)&record->count);
2079 }
2081 {
2083 }
2084 __ENDTRY
2085
2086 msiobj_release(&record->hdr);
2087 return ret;
2088 }
2089
2090 ret = MSI_ProcessMessage( package, eMessageType, record );
2091
2092 msiobj_release( &record->hdr );
2093 msiobj_release( &package->hdr );
2094 return ret;
2095}
int WINAPI MsiRecordGetInteger(MSIHANDLE handle, UINT iField)
Definition: record.c:237
#define MSIHANDLETYPE_RECORD
Definition: msipriv.h:749

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

2100{
2101 LPWSTR szwName = NULL, szwValue = NULL;
2103
2104 szwName = strdupAtoW( szName );
2105 if( szName && !szwName )
2106 goto end;
2107
2108 szwValue = strdupAtoW( szValue );
2109 if( szValue && !szwValue )
2110 goto end;
2111
2112 r = MsiSetPropertyW( hInstall, szwName, szwValue);
2113
2114end:
2115 free( szwName );
2116 free( szwValue );
2117
2118 return r;
2119}
UINT WINAPI MsiSetPropertyW(MSIHANDLE hInstall, LPCWSTR szName, LPCWSTR szValue)
Definition: package.c:2181
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 2181 of file package.c.

2182{
2183 MSIPACKAGE *package;
2184 UINT ret;
2185
2186 package = msihandle2msiinfo( hInstall, MSIHANDLETYPE_PACKAGE);
2187 if( !package )
2188 {
2189 MSIHANDLE remote;
2190
2191 if (!(remote = msi_get_remote(hInstall)))
2192 return ERROR_INVALID_HANDLE;
2193
2194 __TRY
2195 {
2196 ret = remote_SetProperty(remote, szName, szValue);
2197 }
2199 {
2201 }
2202 __ENDTRY
2203
2204 return ret;
2205 }
2206
2207 ret = msi_set_property( package->db, szName, szValue, -1 );
2208 if (ret == ERROR_SUCCESS && !wcscmp( szName, L"SourceDir" ))
2209 msi_reset_source_folders( package );
2210
2211 msiobj_release( &package->hdr );
2212 return ret;
2213}
void msi_reset_source_folders(MSIPACKAGE *package)
Definition: package.c:2121

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

◆ parse_platform()

static enum platform parse_platform ( const WCHAR *  str)
static

Definition at line 1096 of file package.c.

1097{
1098 if (!str[0] || !wcscmp( str, L"Intel" )) return PLATFORM_INTEL;
1099 else if (!wcscmp( str, L"Intel64" )) return PLATFORM_INTEL64;
1100 else if (!wcscmp( str, L"x64" ) || !wcscmp( str, L"AMD64" )) return PLATFORM_X64;
1101 else if (!wcscmp( str, L"Arm" )) return PLATFORM_ARM;
1102 else if (!wcscmp( str, L"Arm64" )) return PLATFORM_ARM64;
1103 return PLATFORM_UNRECOGNIZED;
1104}
@ 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 1106 of file package.c.

1107{
1108 WCHAR *template, *p, *q, *platform;
1109 DWORD i, count;
1110
1112 TRACE("version: %d\n", package->version);
1113
1114 package->platform = PLATFORM_INTEL;
1115
1116 template = msi_suminfo_dup_string( si, PID_TEMPLATE );
1117 if (!template)
1118 return ERROR_SUCCESS; /* native accepts missing template property */
1119
1120 TRACE("template: %s\n", debugstr_w(template));
1121
1122 p = wcschr( template, ';' );
1123 if (p) *p++ = 0;
1124
1125 platform = template;
1126 if ((q = wcschr( platform, ',' ))) *q = 0;
1127 package->platform = parse_platform( platform );
1128 while (package->platform == PLATFORM_UNRECOGNIZED && q)
1129 {
1130 platform = q + 1;
1131 if ((q = wcschr( platform, ',' ))) *q = 0;
1132 package->platform = parse_platform( platform );
1133 }
1134 if (package->platform == PLATFORM_UNRECOGNIZED)
1135 {
1136 WARN("unknown platform %s\n", debugstr_w(template));
1137 free( template );
1139 }
1140
1141 if (!p || !*p)
1142 {
1143 free( template );
1144 return ERROR_SUCCESS;
1145 }
1146 count = 1;
1147 for (q = p; (q = wcschr( q, ',' )); q++) count++;
1148
1149 package->langids = malloc( count * sizeof(LANGID) );
1150 if (!package->langids)
1151 {
1152 free( template );
1153 return ERROR_OUTOFMEMORY;
1154 }
1155
1156 i = 0;
1157 while (*p)
1158 {
1159 q = wcschr( p, ',' );
1160 if (q) *q = 0;
1161 package->langids[i] = wcstol( p, NULL, 10 );
1162 if (!q) break;
1163 p = q + 1;
1164 i++;
1165 }
1166 package->num_langids = i + 1;
1167
1168 free( template );
1169 return ERROR_SUCCESS;
1170}
#define wcschr
Definition: compat.h:17
static enum platform parse_platform(const WCHAR *str)
Definition: package.c:1096
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:712
platform
Definition: msipriv.h:364
enum platform platform
Definition: msipriv.h:409
#define ERROR_INSTALL_PLATFORM_UNSUPPORTED
Definition: winerror.h:1339

Referenced by MSI_OpenPackageW().

◆ s_remote_DoAction()

UINT __cdecl s_remote_DoAction ( MSIHANDLE  hinst,
LPCWSTR  action 
)

Definition at line 2522 of file package.c.

2523{
2524 return MsiDoActionW(hinst, action);
2525}
UINT WINAPI MsiDoActionW(MSIHANDLE hInstall, LPCWSTR szAction)
Definition: install.c:64
action
Definition: namespace.c:707

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

2652{
2653 DWORD size = 3;
2655}
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 2639 of file package.c.

2640{
2642}
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 2613 of file package.c.

2614{
2615 WCHAR empty[1];
2616 DWORD size = 0;
2617 MSIHANDLE rec;
2618 UINT r;
2619
2620 if ((r = unmarshal_record(remote_rec, &rec)))
2621 return r;
2622
2623 r = MsiFormatRecordW(hinst, rec, empty, &size);
2624 if (r == ERROR_MORE_DATA)
2625 {
2626 *value = midl_user_allocate(++size * sizeof(WCHAR));
2627 if (!*value)
2628 {
2629 MsiCloseHandle(rec);
2630 return ERROR_OUTOFMEMORY;
2631 }
2632 r = MsiFormatRecordW(hinst, rec, *value, &size);
2633 }
2634
2635 MsiCloseHandle(rec);
2636 return r;
2637}
static const WCHAR empty[1]
Definition: string.c:47
UINT WINAPI MsiFormatRecordW(MSIHANDLE hInstall, MSIHANDLE hRecord, WCHAR *szResult, DWORD *sz)
Definition: format.c:899
UINT unmarshal_record(const struct wire_record *in, MSIHANDLE *out)
Definition: record.c:1095
#define midl_user_allocate
Definition: rpc.h:40

◆ s_remote_GetActiveDatabase()

MSIHANDLE __cdecl s_remote_GetActiveDatabase ( MSIHANDLE  hinst)

Definition at line 2479 of file package.c.

2480{
2482}
MSIHANDLE WINAPI MsiGetActiveDatabase(MSIHANDLE hInstall)
Definition: package.c:1701

◆ s_remote_GetComponentState()

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

Definition at line 2592 of file package.c.

2594{
2595 return MsiGetComponentStateW(hinst, component, installed, action);
2596}
UINT WINAPI MsiGetComponentStateW(MSIHANDLE hInstall, const WCHAR *szComponent, INSTALLSTATE *piInstalled, INSTALLSTATE *piAction)
Definition: install.c:1503

◆ s_remote_GetFeatureCost()

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

Definition at line 2644 of file package.c.

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

◆ s_remote_GetFeatureState()

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

Definition at line 2581 of file package.c.

2583{
2584 return MsiGetFeatureStateW(hinst, feature, installed, action);
2585}
UINT WINAPI MsiGetFeatureStateW(MSIHANDLE hInstall, const WCHAR *szFeature, INSTALLSTATE *piInstalled, INSTALLSTATE *piAction)
Definition: install.c:1091

◆ s_remote_GetLanguage()

LANGID __cdecl s_remote_GetLanguage ( MSIHANDLE  hinst)

Definition at line 2603 of file package.c.

2604{
2605 return MsiGetLanguage(hinst);
2606}
LANGID WINAPI MsiGetLanguage(MSIHANDLE hInstall)
Definition: install.c:1543

◆ s_remote_GetMode()

BOOL __cdecl s_remote_GetMode ( MSIHANDLE  hinst,
MSIRUNMODE  mode 
)

Definition at line 2571 of file package.c.

2572{
2573 return MsiGetMode(hinst, mode);
2574}
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 2484 of file package.c.

2485{
2486 WCHAR empty[1];
2487 UINT r;
2488
2489 *size = 0;
2491 if (r == ERROR_MORE_DATA)
2492 {
2493 ++*size;
2494 *value = midl_user_allocate(*size * sizeof(WCHAR));
2495 if (!*value)
2496 return ERROR_OUTOFMEMORY;
2498 }
2499 return r;
2500}
UINT WINAPI MsiGetPropertyW(MSIHANDLE hinst, const WCHAR *name, WCHAR *buf, DWORD *sz)
Definition: package.c:2417

◆ s_remote_GetSourcePath()

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

Definition at line 2554 of file package.c.

2555{
2556 WCHAR empty[1];
2557 DWORD size = 1;
2558 UINT r;
2559
2561 if (r == ERROR_MORE_DATA)
2562 {
2563 *value = midl_user_allocate(++size * sizeof(WCHAR));
2564 if (!*value)
2565 return ERROR_OUTOFMEMORY;
2567 }
2568 return r;
2569}
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 2532 of file package.c.

2533{
2534 WCHAR empty[1];
2535 DWORD size = 0;
2536 UINT r;
2537
2539 if (r == ERROR_MORE_DATA)
2540 {
2541 *value = midl_user_allocate(++size * sizeof(WCHAR));
2542 if (!*value)
2543 return ERROR_OUTOFMEMORY;
2545 }
2546 return r;
2547}
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 2507 of file package.c.

2508{
2509 MSIHANDLE rec;
2510 int ret;
2511 UINT r;
2512
2513 if ((r = unmarshal_record(remote_rec, &rec)))
2514 return r;
2515
2517
2518 MsiCloseHandle(rec);
2519 return ret;
2520}
INT WINAPI MsiProcessMessage(MSIHANDLE hInstall, INSTALLMESSAGE eMessageType, MSIHANDLE hRecord)
Definition: package.c:2049

◆ s_remote_Sequence()

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

Definition at line 2527 of file package.c.

2528{
2529 return MsiSequenceW(hinst, table, sequence);
2530}
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 2598 of file package.c.

2599{
2601}
UINT WINAPI MsiSetComponentStateW(MSIHANDLE hInstall, LPCWSTR szComponent, INSTALLSTATE iState)
Definition: install.c:1465

◆ s_remote_SetFeatureState()

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

Definition at line 2587 of file package.c.

2588{
2590}
UINT WINAPI MsiSetFeatureStateW(MSIHANDLE hInstall, LPCWSTR szFeature, INSTALLSTATE iState)
Definition: install.c:950

◆ s_remote_SetInstallLevel()

UINT __cdecl s_remote_SetInstallLevel ( MSIHANDLE  hinst,
int  level 
)

Definition at line 2608 of file package.c.

2609{
2611}
UINT WINAPI MsiSetInstallLevel(MSIHANDLE hInstall, int iInstallLevel)
Definition: install.c:1599
GLint level
Definition: gl.h:1546

◆ s_remote_SetMode()

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

Definition at line 2576 of file package.c.

2577{
2578 return MsiSetMode(hinst, mode, state);
2579}
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 2502 of file package.c.

2503{
2505}

◆ s_remote_SetTargetPath()

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

Definition at line 2549 of file package.c.

2550{
2552}
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 msi_set_property( package->db, L"MsiTrueAdminUser", L"1", -1 );
748
749 /* set the os things */
750 OSVersion.dwOSVersionInfoSize = sizeof(OSVersion);
751 RtlGetVersion(&OSVersion);
752 verval = OSVersion.dwMinorVersion + OSVersion.dwMajorVersion * 100;
753 if (verval > 603)
754 {
755 verval = 603;
756 OSVersion.dwBuildNumber = 9600;
757 }
758 len = swprintf( verstr, ARRAY_SIZE(verstr), L"%u", verval );
759 switch (OSVersion.dwPlatformId)
760 {
762 msi_set_property( package->db, L"Version9X", verstr, len );
763 break;
765 msi_set_property( package->db, L"VersionNT", verstr, len );
766 len = swprintf( bufstr, ARRAY_SIZE(bufstr), L"%u", OSVersion.wProductType );
767 msi_set_property( package->db, L"MsiNTProductType", bufstr, len );
768 break;
769 }
770 len = swprintf( bufstr, ARRAY_SIZE(bufstr), L"%u", OSVersion.dwBuildNumber );
771 msi_set_property( package->db, L"WindowsBuild", bufstr, len );
772 len = swprintf( bufstr, ARRAY_SIZE(bufstr), L"%u", OSVersion.wServicePackMajor );
773 msi_set_property( package->db, L"ServicePackLevel", bufstr, len );
774
775 len = swprintf( bufstr, ARRAY_SIZE(bufstr), L"%u.%u", MSI_MAJORVERSION, MSI_MINORVERSION );
776 msi_set_property( package->db, L"VersionMsi", bufstr, len );
777 len = swprintf( bufstr, ARRAY_SIZE(bufstr), L"%u", MSI_MAJORVERSION * 100 );
778 msi_set_property( package->db, L"VersionDatabase", bufstr, len );
779
780 RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion", 0,
782
783 GetNativeSystemInfo( &sys_info );
784 len = swprintf( bufstr, ARRAY_SIZE(bufstr), L"%d", sys_info.wProcessorLevel );
785 msi_set_property( package->db, L"Intel", bufstr, len );
787 {
789 PathAddBackslashW( pth );
790 msi_set_property( package->db, L"SystemFolder", pth, -1 );
791
792 len = sizeof(pth);
793 RegQueryValueExW(hkey, L"ProgramFilesDir", 0, &type, (BYTE *)pth, &len);
794 PathAddBackslashW( pth );
795 msi_set_property( package->db, L"ProgramFilesFolder", pth, -1 );
796
797 len = sizeof(pth);
798 RegQueryValueExW(hkey, L"CommonFilesDir", 0, &type, (BYTE *)pth, &len);
799 PathAddBackslashW( pth );
800 msi_set_property( package->db, L"CommonFilesFolder", pth, -1 );
801 }
804 {
805 msi_set_property( package->db, L"MsiAMD64", bufstr, -1 );
806 msi_set_property( package->db, L"Msix64", bufstr, -1 );
807 msi_set_property( package->db, L"VersionNT64", verstr, -1 );
808
810 PathAddBackslashW( pth );
811 msi_set_property( package->db, L"System64Folder", pth, -1 );
812
814 PathAddBackslashW( pth );
815 msi_set_property( package->db, L"SystemFolder", pth, -1 );
816
817 len = sizeof(pth);
818 RegQueryValueExW(hkey, L"ProgramFilesDir", 0, &type, (BYTE *)pth, &len);
819 PathAddBackslashW( pth );
820 msi_set_property( package->db, L"ProgramFiles64Folder", pth, -1 );
821
822 len = sizeof(pth);
823 RegQueryValueExW(hkey, L"ProgramFilesDir (x86)", 0, &type, (BYTE *)pth, &len);
824 PathAddBackslashW( pth );
825 msi_set_property( package->db, L"ProgramFilesFolder", pth, -1 );
826
827 len = sizeof(pth);
828 RegQueryValueExW(hkey, L"CommonFilesDir", 0, &type, (BYTE *)pth, &len);
829 PathAddBackslashW( pth );
830 msi_set_property( package->db, L"CommonFiles64Folder", pth, -1 );
831
832 len = sizeof(pth);
833 RegQueryValueExW(hkey, L"CommonFilesDir (x86)", 0, &type, (BYTE *)pth, &len);
834 PathAddBackslashW( pth );
835 msi_set_property( package->db, L"CommonFilesFolder", pth, -1 );
836 }
837
838 RegCloseKey(hkey);
839
840 /* Screen properties. */
841 dc = GetDC(0);
842 len = swprintf( bufstr, ARRAY_SIZE(bufstr), L"%d", GetDeviceCaps(dc, HORZRES) );
843 msi_set_property( package->db, L"ScreenX", bufstr, len );
844 len = swprintf( bufstr, ARRAY_SIZE(bufstr), L"%d", GetDeviceCaps(dc, VERTRES) );
845 msi_set_property( package->db, L"ScreenY", bufstr, len );
846 len = swprintf( bufstr, ARRAY_SIZE(bufstr), L"%d", GetDeviceCaps(dc, BITSPIXEL) );
847 msi_set_property( package->db, L"ColorBits", bufstr, len );
848 ReleaseDC(0, dc);
849
850 /* USERNAME and COMPANYNAME */
851 username = msi_dup_property( package->db, L"USERNAME" );
852 companyname = msi_dup_property( package->db, L"COMPANYNAME" );
853
854 if ((!username || !companyname) &&
855 RegOpenKeyW( HKEY_CURRENT_USER, L"SOFTWARE\\Microsoft\\MS Setup (ACME)\\User Info", &hkey ) == ERROR_SUCCESS)
856 {
857 if (!username &&
858 (username = msi_reg_get_val_str( hkey, L"DefName" )))
859 msi_set_property( package->db, L"USERNAME", username, -1 );
860 if (!companyname &&
861 (companyname = msi_reg_get_val_str( hkey, L"DefCompany" )))
862 msi_set_property( package->db, L"COMPANYNAME", companyname, -1 );
863 CloseHandle( hkey );
864 }
865 if ((!username || !companyname) &&
866 RegOpenKeyExW( HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", 0,
868 {
869 if (!username &&
870 (username = msi_reg_get_val_str( hkey, L"RegisteredOwner" )))
871 msi_set_property( package->db, L"USERNAME", username, -1 );
872 if (!companyname &&
873 (companyname = msi_reg_get_val_str( hkey, L"RegisteredOrganization" )))
874 msi_set_property( package->db, L"COMPANYNAME", companyname, -1 );
875 CloseHandle( hkey );
876 }
877 free( username );
878 free( companyname );
879
880 if ( set_user_sid_prop( package ) != ERROR_SUCCESS)
881 ERR("Failed to set the UserSID property\n");
882
883 set_msi_assembly_prop( package );
884
886 len = swprintf( bufstr, ARRAY_SIZE(bufstr), L"%d", langid );
887 msi_set_property( package->db, L"UserLanguageID", bufstr, len );
888
890 len = swprintf( bufstr, ARRAY_SIZE(bufstr), L"%d", langid );
891 msi_set_property( package->db, L"SystemLanguageID", bufstr, len );
892
893 len = swprintf( bufstr, ARRAY_SIZE(bufstr), L"%d", MsiQueryProductStateW(package->ProductCode) );
894 msi_set_property( package->db, L"ProductState", bufstr, len );
895
896 len = 0;
898 {
900 if ((username = malloc( len * sizeof(WCHAR) )))
901 {
902 if (GetUserNameW( username, &len ))
903 msi_set_property( package->db, L"LogonUser", username, len - 1 );
904 free( username );
905 }
906 }
907 len = 0;
909 {
910 WCHAR *computername;
911 if ((computername = malloc( len * sizeof(WCHAR) )))
912 {
913 if (GetComputerNameW( computername, &len ))
914 msi_set_property( package->db, L"ComputerName", computername, len );
915 free( computername );
916 }
917 }
918}
BOOL WINAPI GetComputerNameW(LPWSTR lpBuffer, LPDWORD lpnSize)
Definition: compname.c:446
HDC dc
Definition: cylfrac.c:34
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10
NTSTATUS NTAPI RtlGetVersion(IN OUT PRTL_OSVERSIONINFOW lpVersionInformation)
Definition: version.c:182
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:2098
UINT WINAPI GetSystemWow64DirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2439
UINT WINAPI GetSystemDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2331
VOID WINAPI GetNativeSystemInfo(IN LPSYSTEM_INFO lpSystemInfo)
Definition: sysinfo.c:207
LANGID WINAPI GetSystemDefaultLangID(void)
Definition: locale.c:1199
LANGID WINAPI GetUserDefaultLangID(void)
Definition: locale.c:1182
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:2717
BOOL NTAPI GlobalMemoryStatusEx(LPMEMORYSTATUSEX lpBuffer)
Definition: heapmem.c:1272
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:626
#define MSI_MINORVERSION
Definition: msipriv.h:754
#define MSI_MAJORVERSION
Definition: msipriv.h:753
#define PROCESSOR_ARCHITECTURE_AMD64
Definition: ketypes.h:114
#define PROCESSOR_ARCHITECTURE_INTEL
Definition: ketypes.h:105
#define VER_PLATFORM_WIN32_NT
Definition: rtltypes.h:246
#define VER_PLATFORM_WIN32_WINDOWS
Definition: rtltypes.h:245
#define PathAddBackslashW
Definition: pathcch.h:302
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
HDC WINAPI GetDC(_In_opt_ HWND)
#define CSIDL_TEMPLATES
Definition: shlobj.h:2211
#define CSIDL_SENDTO
Definition: shlobj.h:2200
#define CSIDL_RECENT
Definition: shlobj.h:2199
#define CSIDL_ADMINTOOLS
Definition: shlobj.h:2238
#define CSIDL_FONTS
Definition: shlobj.h:2210
#define CSIDL_PERSONAL
Definition: shlobj.h:2196
#define CSIDL_FAVORITES
Definition: shlobj.h:2197
#define CSIDL_COMMON_APPDATA
Definition: shlobj.h:2225
#define CSIDL_MYPICTURES
Definition: shlobj.h:2229
#define CSIDL_SYSTEM
Definition: shlobj.h:2227
#define CSIDL_LOCAL_APPDATA
Definition: shlobj.h:2218
#define CSIDL_DESKTOP
Definition: shlobj.h:2191
#define CSIDL_STARTMENU
Definition: shlobj.h:2202
#define CSIDL_PROGRAMS
Definition: shlobj.h:2193
#define CSIDL_APPDATA
Definition: shlobj.h:2216
#define CSIDL_PRINTHOOD
Definition: shlobj.h:2217
#define CSIDL_STARTUP
Definition: shlobj.h:2198
#define CSIDL_WINDOWS
Definition: shlobj.h:2226
#define CSIDL_NETHOOD
Definition: shlobj.h:2209
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:903
WORD wProcessorArchitecture
Definition: winbase.h:892
#define ERROR_BUFFER_OVERFLOW
Definition: winerror.h:307
#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 PROCESSOR_ARCHITECTURE_ARM64
Definition: winnt_old.h:503
#define HKEY_CURRENT_USER
Definition: winreg.h:11
#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
BOOL WINAPI GetFileVersionInfoW(LPCWSTR filename, DWORD handle, DWORD datasize, LPVOID data)
Definition: version.c:967
BOOL WINAPI VerQueryValueW(LPCVOID pBlock, LPCWSTR lpSubBlock, LPVOID *lplpBuffer, PUINT puLen)
Definition: version.c:1171
DWORD WINAPI GetFileVersionInfoSizeW(LPCWSTR filename, LPDWORD handle)
Definition: version.c:738
static LPWSTR get_fusion_filename(MSIPACKAGE *package)
Definition: package.c:521
static void translate(POINT *pt, UINT count, const XFORM *xform)
Definition: metafile.c:8268
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 1214 of file package.c.

1215{
1216 UINT i;
1217
1218 if (!validate_package_platform( package->platform ))
1220
1221 if (package->platform == PLATFORM_X64 && package->version < 200)
1223
1224 if (!package->num_langids)
1225 {
1226 return ERROR_SUCCESS;
1227 }
1228 for (i = 0; i < package->num_langids; i++)
1229 {
1230 LANGID langid = package->langids[i];
1231
1233 {
1235 }
1237 {
1239 }
1241 return ERROR_SUCCESS;
1242 }
1244}
BOOL WINAPI IsValidLocale(LCID lcid, DWORD flags)
Definition: locale.c:2925
static BOOL validate_package_platform(enum platform platform)
Definition: package.c:1172
#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:1329
#define LCID_INSTALLED
Definition: winnls.h:224

Referenced by MSI_OpenPackageW().

◆ validate_package_platform()

static BOOL validate_package_platform ( enum platform  platform)
static

Definition at line 1172 of file package.c.

1173{
1174#ifdef __REACTOS__
1175 // IsWow64Process2 is Windows 10 1709+, so use wine's implementation from commit c3f77b0f9a187109385d1dad17796241004057f4.
1176 // The usage of the function was introduced in wine commit 2e32067f1f80b169169fa662576a75b1c2382204
1177 #ifndef __arm__
1178 if (platform == PLATFORM_ARM)
1179 return FALSE;
1180 #endif
1181 #ifndef __aarch64__
1182 if (platform == PLATFORM_ARM64)
1183 return FALSE;
1184 #endif
1185 if (platform == PLATFORM_X64)
1186 {
1187 if (!is_64bit && !is_wow64)
1188 return FALSE;
1189 }
1190 return TRUE;
1191#else
1192 USHORT proc_machine, native_machine;
1193 IsWow64Process2( GetCurrentProcess(), &proc_machine, &native_machine );
1194 switch (platform)
1195 {
1196 case PLATFORM_INTEL:
1200 case PLATFORM_X64:
1203 case PLATFORM_ARM:
1205 case PLATFORM_ARM64:
1207 case PLATFORM_INTEL64:
1208 default:
1209 return FALSE;
1210 }
1211#endif
1212}
#define GetCurrentProcess()
Definition: compat.h:759
#define IMAGE_FILE_MACHINE_ARM64
Definition: compat.h:129
BOOL WINAPI DECLSPEC_HOTPATCH IsWow64Process2(HANDLE process, USHORT *machine, USHORT *native_machine)
Definition: process.c:1032
BOOL is_wow64
Definition: main.c:38
static USHORT native_machine
Definition: wow64.c:92
static const BOOL is_64bit
Definition: msipriv.h:44
#define IMAGE_FILE_MACHINE_ARM
Definition: ntimage.h:18
#define IMAGE_FILE_MACHINE_AMD64
Definition: ntimage.h:17
#define IMAGE_FILE_MACHINE_I386
Definition: pedump.c:174
unsigned short USHORT
Definition: pedump.c:61

Referenced by validate_package().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( msi  )

Variable Documentation

◆ id

Definition at line 1825 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 1826 of file package.c.

Referenced by __acrt_MessageBoxA(), __acrt_MessageBoxW(), __acrt_OutputDebugStringA(), __acrt_show_narrow_message_box(), __acrt_show_wide_message_box(), _amsg_exit(), _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(), _wassert(), 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(), blend_pixel(), blend_subpixel(), BookmarkCompletionFunction(), BUTTON_CalcLabelRect(), BUTTON_DrawLabel(), cache_get_text(), cache_put_text(), CB_ThemedPaint(), cert_mgr_show_cert_usages(), check_auto_fields(), check_file_matches(), check_mask(), class_object_GetObjectText(), combobox_add_item(), CommandCompletionFunction(), common_show_message_box(), CompletionFunction(), compute_text_mesh(), SEALED_::ControlWindowProc(), create_cdata(), create_text(), CreateEditLabelT(), CreateStatusWindowA(), CreateStatusWindowW(), 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(), domdoc_createTextNode(), domdoc_put_text(), DoMessageBoxW(), DoWaitForWindow(), draw_driver_string(), draw_text(), Graphics::DrawDriverString(), DrawStatusTextA(), DrawStatusTextW(), CFontExt::Drop(), dump_CallBackFlags(), dump_D3dBufferCallbacks(), dump_D3dCallbacks(), dump_D3dDriverData(), dump_D3dTextureFormats(), dump_halinfo(), dwritefontface3_AreCharactersLocal(), dwritetextanalyzer1_GetJustificationOpportunities(), dwritetextanalyzer1_GetTextComplexity(), dwritetextanalyzer_GetGdiCompatibleGlyphPlacements(), dwritetextanalyzer_GetGlyphPlacements(), dwritetextanalyzer_GetGlyphs(), dwritetextlayout_source_GetTextAtPosition(), dwritetextlayout_source_GetTextBeforePosition(), EDIT_BuildLineDefs_ML(), EDIT_WM_SetText(), editor_handle_message(), error(), exec_tests(), expect_indexA_imp(), find_counter_value(), find_window(), fnTextSrv_TxGetText(), fnTextSrv_TxSetText(), GB_ThemedPaint(), GDI32_GdipDrawDriverString(), GdipDrawDriverString(), GdipMeasureDriverString(), GdipPlayMetafileRecord(), get_binary_name(), get_ip(), getdlgitem_test_dialog_proc(), GinaLoadFailedWindowProc(), 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(), Imm32CompAttrAnsiToWide(), Imm32CompAttrWideToAnsi(), Imm32CompClauseAnsiToWide(), Imm32CompClauseWideToAnsi(), InfpSubstituteString(), insert_item(), CFontBackgroundMenu::InvokeCommand(), 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(), METAFILE_DrawDriverString(), MimeMessage_GetTextBody(), mpg123_copy_string(), msgbox_hook_proc(), MyTextOut(), tinyxml2::XMLDocument::NewText(), node_get_text(), node_put_text(), notify_forward_header(), notify_generic_text_handler(), nsPromptService_Alert(), CMenuToolbarBase::OnCustomDraw(), CAutoComplete::OnListSelChange(), opentype_get_nominal_glyphs(), 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(), pipestream_Read(), pipestream_ReadAll(), pipestream_ReadLine(), pipestream_Write(), pipestream_WriteLine(), pp_add_define(), PrefOptCompletionFunction(), print_disconnect_reason(), prompt_save_changes(), propsys_FormatForDisplayAlloc(), tinyxml2::XMLPrinter::PushText(), read_file_test(), readconfigtext(), RemoteCompletionFunction(), RemoteDirCompletionFunction(), RemoteFileCompletionFunction(), RichEditWndProc_common(), 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(), SetMultiline(), tinyxml2::XMLText::ShallowClone(), tinyxml2::XMLUnknown::ShallowClone(), tinyxml2::XMLText::ShallowEqual(), show_export_details(), show_import_details(), show_tooltip(), simple_write_console(), SoftModalMessageBox(), SOFTWARE_GdipDrawDriverString(), spirv_compiler_generate_spirv(), split_ip(), START_TEST(), STATIC_PaintTextfn(), status_code_GetErrorCodeText(), status_code_GetFacilityCodeText(), STATUSBAR_SetTextT(), STATUSBAR_SetTipTextA(), STATUSBAR_SetTipTextW(), STATUSBAR_WMSetText(), 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_counter_values(), 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_help_values(), 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_video_window_caption(), test_WM_GETTEXT(), test_word_wrap(), text_source_get_u32_char(), textdupTtoW(), textlenT(), textstream_Read(), textstream_ReadAll(), textstream_ReadLine(), textstream_Write(), textstream_write(), textstream_WriteLine(), TimerProc(), tokenize(), ToolTipProc(), TOOLTIPS_SetToolText(), trace_extended_error(), trust_status_to_str(), ui_draw_text(), unimpl(), update_counter(), update_ie_statustext(), CMainWindow::UpdateApplicationsList(), UpdateColumnDataHints(), UpdateStatusBar(), user_notice_dlg_proc(), tinyxml2::XMLPrinter::Visit(), vkd3d_shader_trace_text_(), warning(), WINHELP_MessageBoxIDS_s(), winproc_convA(), winproc_convW(), WshShell3_Popup(), xmlparser_ExpandEntity(), xmlparser_ParseEntity(), xmlwriter_WriteProcessingInstruction(), xmlwriter_WriteWhitespace(), xsltAttrListTemplateProcess(), xsltAttrTemplateProcess(), xsltParseTemplateContent(), and xsltText().