2 * Implementation of the Microsoft Installer (msi.dll)
4 * Copyright 2005 Aric Stewart for CodeWeavers
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
22 * Here are helper functions formally in action.c that are used by a variaty of
23 * actions and functions.
31 #include "wine/debug.h"
34 #include "wine/unicode.h"
37 WINE_DEFAULT_DEBUG_CHANNEL(msi);
39 static const WCHAR cszTargetDir[] = {'T','A','R','G','E','T','D','I','R',0};
40 static const WCHAR cszDatabase[]={'D','A','T','A','B','A','S','E',0};
42 const WCHAR cszSourceDir[] = {'S','o','u','r','c','e','D','i','r',0};
43 const WCHAR cszSOURCEDIR[] = {'S','O','U','R','C','E','D','I','R',0};
44 const WCHAR cszRootDrive[] = {'R','O','O','T','D','R','I','V','E',0};
45 const WCHAR cszbs[]={'\\',0};
47 LPWSTR build_icon_path(MSIPACKAGE *package, LPCWSTR icon_name )
49 LPWSTR SystemFolder, dest, FilePath;
51 static const WCHAR szInstaller[] =
52 {'M','i','c','r','o','s','o','f','t','\\',
53 'I','n','s','t','a','l','l','e','r','\\',0};
54 static const WCHAR szFolder[] =
55 {'A','p','p','D','a','t','a','F','o','l','d','e','r',0};
57 SystemFolder = msi_dup_property( package, szFolder );
59 dest = build_directory_name(3, SystemFolder, szInstaller, package->ProductCode);
61 create_full_pathW(dest);
63 FilePath = build_directory_name(2, dest, icon_name);
65 msi_free(SystemFolder);
70 LPWSTR msi_dup_record_field( MSIRECORD *row, INT index )
72 return strdupW( MSI_RecordGetString(row,index) );
75 MSICOMPONENT* get_loaded_component( MSIPACKAGE* package, LPCWSTR Component )
79 LIST_FOR_EACH_ENTRY( comp, &package->components, MSICOMPONENT, entry )
81 if (lstrcmpW(Component,comp->Component)==0)
87 MSIFEATURE* get_loaded_feature(MSIPACKAGE* package, LPCWSTR Feature )
91 LIST_FOR_EACH_ENTRY( feature, &package->features, MSIFEATURE, entry )
93 if (lstrcmpW( Feature, feature->Feature )==0)
99 MSIFILE* get_loaded_file( MSIPACKAGE* package, LPCWSTR key )
103 LIST_FOR_EACH_ENTRY( file, &package->files, MSIFILE, entry )
105 if (lstrcmpW( key, file->File )==0)
111 int track_tempfile( MSIPACKAGE *package, LPCWSTR name, LPCWSTR path )
115 LIST_FOR_EACH_ENTRY( temp, &package->tempfiles, MSITEMPFILE, entry )
117 if (lstrcmpW( name, temp->File )==0)
119 TRACE("tempfile %s already exists with path %s\n",
120 debugstr_w(temp->File), debugstr_w(temp->Path));
125 temp = msi_alloc_zero( sizeof (MSITEMPFILE) );
129 list_add_head( &package->tempfiles, &temp->entry );
131 temp->File = strdupW( name );
132 temp->Path = strdupW( path );
134 TRACE("adding tempfile %s with path %s\n",
135 debugstr_w(temp->File), debugstr_w(temp->Path));
140 MSIFOLDER *get_loaded_folder( MSIPACKAGE *package, LPCWSTR dir )
144 LIST_FOR_EACH_ENTRY( folder, &package->folders, MSIFOLDER, entry )
146 if (lstrcmpW( dir, folder->Directory )==0)
152 static LPWSTR get_source_root( MSIPACKAGE *package )
156 path = msi_dup_property( package, cszSourceDir );
160 path = msi_dup_property( package, cszDatabase );
163 p = strrchrW(path,'\\');
171 * clean_spaces_from_path()
173 * removes spaces from the beginning and end of path segments
174 * removes multiple \\ characters
176 static void clean_spaces_from_path( LPWSTR p )
183 /* copy until the end of the string or a space */
184 while (*p != ' ' && (*q = *p))
187 /* reduce many backslashes to one */
188 if (*p != '\\' || *q != '\\')
192 /* quit at the end of the string */
196 /* count the number of spaces */
201 /* if it's leading or trailing space, skip it */
202 if ( len == 0 || p[-1] == '\\' || p[n] == '\\' )
204 else /* copy n spaces */
205 while (n && (*q++ = *p++)) n--;
209 LPWSTR resolve_folder(MSIPACKAGE *package, LPCWSTR name, BOOL source,
210 BOOL set_prop, MSIFOLDER **folder)
213 LPWSTR p, path = NULL;
215 TRACE("Working to resolve %s\n",debugstr_w(name));
220 f = get_loaded_folder( package, name );
224 /* special resolving for Target and Source root dir */
225 if (strcmpW(name,cszTargetDir)==0 || strcmpW(name,cszSourceDir)==0)
227 if (!f->ResolvedTarget && !f->Property)
230 check_path = msi_dup_property( package, cszTargetDir );
233 check_path = msi_dup_property( package, cszRootDrive );
235 MSI_SetPropertyW(package,cszTargetDir,check_path);
238 /* correct misbuilt target dir */
239 path = build_directory_name(2, check_path, NULL);
240 clean_spaces_from_path( path );
241 if (strcmpiW(path,check_path)!=0)
242 MSI_SetPropertyW(package,cszTargetDir,path);
243 msi_free(check_path);
245 f->ResolvedTarget = path;
248 if (!f->ResolvedSource)
249 f->ResolvedSource = get_source_root( package );
255 if (!source && f->ResolvedTarget)
257 path = strdupW( f->ResolvedTarget );
258 TRACE(" already resolved to %s\n",debugstr_w(path));
261 else if (source && f->ResolvedSource)
263 path = strdupW( f->ResolvedSource );
264 TRACE(" (source)already resolved to %s\n",debugstr_w(path));
267 else if (!source && f->Property)
269 path = build_directory_name( 2, f->Property, NULL );
271 TRACE(" internally set to %s\n",debugstr_w(path));
273 MSI_SetPropertyW( package, name, path );
279 LPWSTR parent = f->Parent->Directory;
281 TRACE(" ! Parent is %s\n", debugstr_w(parent));
283 p = resolve_folder(package, parent, source, set_prop, NULL);
286 TRACE(" TargetDefault = %s\n", debugstr_w(f->TargetDefault));
288 path = build_directory_name( 3, p, f->TargetDefault, NULL );
289 clean_spaces_from_path( path );
290 f->ResolvedTarget = strdupW( path );
291 TRACE("target -> %s\n", debugstr_w(path));
293 MSI_SetPropertyW(package,name,path);
297 /* source may be in a few different places ... check each of them */
300 /* try the long path directory */
301 if (f->SourceLongPath)
303 path = build_directory_name( 3, p, f->SourceLongPath, NULL );
304 if (INVALID_FILE_ATTRIBUTES == GetFileAttributesW( path ))
311 /* try the short path directory */
312 if (!path && f->SourceShortPath)
314 path = build_directory_name( 3, p, f->SourceShortPath, NULL );
315 if (INVALID_FILE_ATTRIBUTES == GetFileAttributesW( path ))
322 /* try the root of the install */
324 path = get_source_root( package );
326 TRACE("source -> %s\n", debugstr_w(path));
327 f->ResolvedSource = strdupW( path );
334 /* wrapper to resist a need for a full rewrite right now */
335 DWORD deformat_string(MSIPACKAGE *package, LPCWSTR ptr, WCHAR** data )
339 MSIRECORD *rec = MSI_CreateRecord(1);
342 MSI_RecordSetStringW(rec,0,ptr);
343 MSI_FormatRecordW(package,rec,NULL,&size);
347 *data = msi_alloc(size*sizeof(WCHAR));
349 MSI_FormatRecordW(package,rec,*data,&size);
352 msiobj_release( &rec->hdr );
353 return sizeof(WCHAR)*size;
355 msiobj_release( &rec->hdr );
362 UINT schedule_action(MSIPACKAGE *package, UINT script, LPCWSTR action)
365 LPWSTR *newbuf = NULL;
366 if (script >= TOTAL_SCRIPTS)
368 FIXME("Unknown script requested %i\n",script);
369 return ERROR_FUNCTION_FAILED;
371 TRACE("Scheduling Action %s in script %i\n",debugstr_w(action), script);
373 count = package->script->ActionCount[script];
374 package->script->ActionCount[script]++;
376 newbuf = msi_realloc( package->script->Actions[script],
377 package->script->ActionCount[script]* sizeof(LPWSTR));
379 newbuf = msi_alloc( sizeof(LPWSTR));
381 newbuf[count] = strdupW(action);
382 package->script->Actions[script] = newbuf;
384 return ERROR_SUCCESS;
387 void msi_free_action_script(MSIPACKAGE *package, UINT script)
390 for (i = 0; i < package->script->ActionCount[script]; i++)
391 msi_free(package->script->Actions[script][i]);
393 msi_free(package->script->Actions[script]);
394 package->script->Actions[script] = NULL;
395 package->script->ActionCount[script] = 0;
398 static void remove_tracked_tempfiles(MSIPACKAGE* package)
400 struct list *item, *cursor;
402 LIST_FOR_EACH_SAFE( item, cursor, &package->tempfiles )
404 MSITEMPFILE *temp = LIST_ENTRY( item, MSITEMPFILE, entry );
406 list_remove( &temp->entry );
407 TRACE("deleting temp file %s\n", debugstr_w( temp->Path ));
408 DeleteFileW( temp->Path );
409 msi_free( temp->File );
410 msi_free( temp->Path );
415 static void free_feature( MSIFEATURE *feature )
417 struct list *item, *cursor;
419 LIST_FOR_EACH_SAFE( item, cursor, &feature->Children )
421 FeatureList *fl = LIST_ENTRY( item, FeatureList, entry );
422 list_remove( &fl->entry );
426 LIST_FOR_EACH_SAFE( item, cursor, &feature->Components )
428 ComponentList *cl = LIST_ENTRY( item, ComponentList, entry );
429 list_remove( &cl->entry );
432 msi_free( feature->Feature );
433 msi_free( feature->Feature_Parent );
434 msi_free( feature->Directory );
435 msi_free( feature->Description );
436 msi_free( feature->Title );
440 static void free_extension( MSIEXTENSION *ext )
442 struct list *item, *cursor;
444 LIST_FOR_EACH_SAFE( item, cursor, &ext->verbs )
446 MSIVERB *verb = LIST_ENTRY( item, MSIVERB, entry );
448 list_remove( &verb->entry );
449 msi_free( verb->Verb );
450 msi_free( verb->Command );
451 msi_free( verb->Argument );
455 msi_free( ext->Extension );
456 msi_free( ext->ProgIDText );
460 /* Called when the package is being closed */
461 void ACTION_free_package_structures( MSIPACKAGE* package)
464 struct list *item, *cursor;
466 TRACE("Freeing package action data\n");
468 remove_tracked_tempfiles(package);
470 LIST_FOR_EACH_SAFE( item, cursor, &package->features )
472 MSIFEATURE *feature = LIST_ENTRY( item, MSIFEATURE, entry );
473 list_remove( &feature->entry );
474 free_feature( feature );
477 LIST_FOR_EACH_SAFE( item, cursor, &package->folders )
479 MSIFOLDER *folder = LIST_ENTRY( item, MSIFOLDER, entry );
481 list_remove( &folder->entry );
482 msi_free( folder->Directory );
483 msi_free( folder->TargetDefault );
484 msi_free( folder->SourceLongPath );
485 msi_free( folder->SourceShortPath );
486 msi_free( folder->ResolvedTarget );
487 msi_free( folder->ResolvedSource );
488 msi_free( folder->Property );
492 LIST_FOR_EACH_SAFE( item, cursor, &package->components )
494 MSICOMPONENT *comp = LIST_ENTRY( item, MSICOMPONENT, entry );
496 list_remove( &comp->entry );
497 msi_free( comp->Component );
498 msi_free( comp->ComponentId );
499 msi_free( comp->Directory );
500 msi_free( comp->Condition );
501 msi_free( comp->KeyPath );
502 msi_free( comp->FullKeypath );
506 LIST_FOR_EACH_SAFE( item, cursor, &package->files )
508 MSIFILE *file = LIST_ENTRY( item, MSIFILE, entry );
510 list_remove( &file->entry );
511 msi_free( file->File );
512 msi_free( file->FileName );
513 msi_free( file->ShortName );
514 msi_free( file->LongName );
515 msi_free( file->Version );
516 msi_free( file->Language );
517 msi_free( file->SourcePath );
518 msi_free( file->TargetPath );
522 /* clean up extension, progid, class and verb structures */
523 LIST_FOR_EACH_SAFE( item, cursor, &package->classes )
525 MSICLASS *cls = LIST_ENTRY( item, MSICLASS, entry );
527 list_remove( &cls->entry );
528 msi_free( cls->clsid );
529 msi_free( cls->Context );
530 msi_free( cls->Description );
531 msi_free( cls->FileTypeMask );
532 msi_free( cls->IconPath );
533 msi_free( cls->DefInprocHandler );
534 msi_free( cls->DefInprocHandler32 );
535 msi_free( cls->Argument );
536 msi_free( cls->ProgIDText );
540 LIST_FOR_EACH_SAFE( item, cursor, &package->extensions )
542 MSIEXTENSION *ext = LIST_ENTRY( item, MSIEXTENSION, entry );
544 list_remove( &ext->entry );
545 free_extension( ext );
548 LIST_FOR_EACH_SAFE( item, cursor, &package->progids )
550 MSIPROGID *progid = LIST_ENTRY( item, MSIPROGID, entry );
552 list_remove( &progid->entry );
553 msi_free( progid->ProgID );
554 msi_free( progid->Description );
555 msi_free( progid->IconPath );
559 LIST_FOR_EACH_SAFE( item, cursor, &package->mimes )
561 MSIMIME *mt = LIST_ENTRY( item, MSIMIME, entry );
563 list_remove( &mt->entry );
564 msi_free( mt->clsid );
565 msi_free( mt->ContentType );
569 LIST_FOR_EACH_SAFE( item, cursor, &package->appids )
571 MSIAPPID *appid = LIST_ENTRY( item, MSIAPPID, entry );
573 list_remove( &appid->entry );
574 msi_free( appid->AppID );
575 msi_free( appid->RemoteServerName );
576 msi_free( appid->LocalServer );
577 msi_free( appid->ServiceParameters );
578 msi_free( appid->DllSurrogate );
584 for (i = 0; i < TOTAL_SCRIPTS; i++)
585 msi_free_action_script(package, i);
587 for (i = 0; i < package->script->UniqueActionsCount; i++)
588 msi_free(package->script->UniqueActions[i]);
590 msi_free(package->script->UniqueActions);
591 msi_free(package->script);
594 msi_free(package->BaseURL);
595 msi_free(package->PackagePath);
596 msi_free(package->ProductCode);
597 msi_free(package->ActionFormat);
598 msi_free(package->LastAction);
600 /* cleanup control event subscriptions */
601 ControlEvent_CleanupSubscriptions(package);
605 * build_directory_name()
607 * This function is to save messing round with directory names
608 * It handles adding backslashes between path segments,
609 * and can add \ at the end of the directory name if told to.
611 * It takes a variable number of arguments.
612 * It always allocates a new string for the result, so make sure
613 * to free the return value when finished with it.
615 * The first arg is the number of path segments that follow.
616 * The arguments following count are a list of path segments.
617 * A path segment may be NULL.
619 * Path segments will be added with a \ separating them.
620 * A \ will not be added after the last segment, however if the
621 * last segment is NULL, then the last character will be a \
624 LPWSTR build_directory_name(DWORD count, ...)
631 for(i=0; i<count; i++)
633 LPCWSTR str = va_arg(va,LPCWSTR);
635 sz += strlenW(str) + 1;
639 dir = msi_alloc(sz*sizeof(WCHAR));
643 for(i=0; i<count; i++)
645 LPCWSTR str = va_arg(va,LPCWSTR);
649 if( ((i+1)!=count) && dir[strlenW(dir)-1]!='\\')
655 /***********************************************************************
658 * Recursively create all directories in the path.
660 * shamelessly stolen from setupapi/queue.c
662 BOOL create_full_pathW(const WCHAR *path)
668 new_path = msi_alloc( (strlenW(path) + 1) * sizeof(WCHAR));
670 strcpyW(new_path, path);
672 while((len = strlenW(new_path)) && new_path[len - 1] == '\\')
673 new_path[len - 1] = 0;
675 while(!CreateDirectoryW(new_path, NULL))
678 DWORD last_error = GetLastError();
679 if(last_error == ERROR_ALREADY_EXISTS)
682 if(last_error != ERROR_PATH_NOT_FOUND)
688 if(!(slash = strrchrW(new_path, '\\')))
694 len = slash - new_path;
696 if(!create_full_pathW(new_path))
701 new_path[len] = '\\';
708 void ui_progress(MSIPACKAGE *package, int a, int b, int c, int d )
712 row = MSI_CreateRecord(4);
713 MSI_RecordSetInteger(row,1,a);
714 MSI_RecordSetInteger(row,2,b);
715 MSI_RecordSetInteger(row,3,c);
716 MSI_RecordSetInteger(row,4,d);
717 MSI_ProcessMessage(package, INSTALLMESSAGE_PROGRESS, row);
718 msiobj_release(&row->hdr);
720 msi_dialog_check_messages(NULL);
723 void ui_actiondata(MSIPACKAGE *package, LPCWSTR action, MSIRECORD * record)
725 static const WCHAR Query_t[] =
726 {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
727 '`','A','c','t','i','o', 'n','T','e','x','t','`',' ',
728 'W','H','E','R','E',' ', '`','A','c','t','i','o','n','`',' ','=',
729 ' ','\'','%','s','\'',0};
734 if (!package->LastAction || strcmpW(package->LastAction,action))
736 row = MSI_QueryGetRecord(package->db, Query_t, action);
740 if (MSI_RecordIsNull(row,3))
742 msiobj_release(&row->hdr);
746 /* update the cached actionformat */
747 msi_free(package->ActionFormat);
748 package->ActionFormat = msi_dup_record_field(row,3);
750 msi_free(package->LastAction);
751 package->LastAction = strdupW(action);
753 msiobj_release(&row->hdr);
756 MSI_RecordSetStringW(record,0,package->ActionFormat);
758 MSI_FormatRecordW(package,record,message,&size);
760 row = MSI_CreateRecord(1);
761 MSI_RecordSetStringW(row,1,message);
763 MSI_ProcessMessage(package, INSTALLMESSAGE_ACTIONDATA, row);
765 msiobj_release(&row->hdr);
768 BOOL ACTION_VerifyComponentForAction( MSICOMPONENT* comp, INSTALLSTATE check )
773 if (comp->Installed == check)
776 if (comp->ActionRequest == check)
782 BOOL ACTION_VerifyFeatureForAction( MSIFEATURE* feature, INSTALLSTATE check )
787 if (feature->Installed == check)
790 if (feature->ActionRequest == check)
796 void reduce_to_longfilename(WCHAR* filename)
798 LPWSTR p = strchrW(filename,'|');
800 memmove(filename, p+1, (strlenW(p+1)+1)*sizeof(WCHAR));
803 void reduce_to_shortfilename(WCHAR* filename)
805 LPWSTR p = strchrW(filename,'|');
810 LPWSTR create_component_advertise_string(MSIPACKAGE* package,
811 MSICOMPONENT* component, LPCWSTR feature)
813 static const WCHAR fmt[] = {'%','s','%','s','%','c','%','s',0};
814 WCHAR productid_85[21], component_85[21];
815 LPWSTR output = NULL;
819 /* > is used if there is a component GUID and < if not. */
824 CLSIDFromString(package->ProductCode, &clsid);
825 encode_base85_guid(&clsid, productid_85);
829 CLSIDFromString(component->ComponentId, &clsid);
830 encode_base85_guid(&clsid, component_85);
833 TRACE("prod=%s feat=%s comp=%s\n", debugstr_w(productid_85),
834 debugstr_w(feature), debugstr_w(component_85));
836 sz = 20 + lstrlenW(feature) + 20 + 3;
838 output = msi_alloc_zero(sz*sizeof(WCHAR));
840 sprintfW(output, fmt, productid_85, feature,
841 component?'>':'<', component_85);
846 /* update compoennt state based on a feature change */
847 void ACTION_UpdateComponentStates(MSIPACKAGE *package, LPCWSTR szFeature)
849 INSTALLSTATE newstate;
853 feature = get_loaded_feature(package,szFeature);
857 newstate = feature->ActionRequest;
859 if (newstate == INSTALLSTATE_ABSENT)
860 newstate = INSTALLSTATE_UNKNOWN;
862 LIST_FOR_EACH_ENTRY( cl, &feature->Components, ComponentList, entry )
864 MSICOMPONENT* component = cl->component;
866 TRACE("MODIFYING(%i): Component %s (Installed %i, Action %i, Request %i)\n",
867 newstate, debugstr_w(component->Component), component->Installed,
868 component->Action, component->ActionRequest);
870 if (!component->Enabled)
873 if (newstate == INSTALLSTATE_LOCAL)
874 msi_component_set_state( component, INSTALLSTATE_LOCAL );
877 ComponentList *clist;
880 msi_component_set_state( component, newstate );
882 /*if any other feature wants is local we need to set it local*/
883 LIST_FOR_EACH_ENTRY( f, &package->features, MSIFEATURE, entry )
885 if ( f->ActionRequest != INSTALLSTATE_LOCAL &&
886 f->ActionRequest != INSTALLSTATE_SOURCE )
891 LIST_FOR_EACH_ENTRY( clist, &f->Components, ComponentList, entry )
893 if ( clist->component == component &&
894 (f->ActionRequest == INSTALLSTATE_LOCAL ||
895 f->ActionRequest == INSTALLSTATE_SOURCE) )
897 TRACE("Saved by %s\n", debugstr_w(f->Feature));
899 if (component->Attributes & msidbComponentAttributesOptional)
901 if (f->Attributes & msidbFeatureAttributesFavorSource)
902 msi_component_set_state( component, INSTALLSTATE_SOURCE );
904 msi_component_set_state( component, INSTALLSTATE_LOCAL );
906 else if (component->Attributes & msidbComponentAttributesSourceOnly)
907 msi_component_set_state( component, INSTALLSTATE_SOURCE );
909 msi_component_set_state( component, INSTALLSTATE_LOCAL );
914 TRACE("Result (%i): Component %s (Installed %i, Action %i, Request %i)\n",
915 newstate, debugstr_w(component->Component), component->Installed,
916 component->Action, component->ActionRequest);
920 UINT register_unique_action(MSIPACKAGE *package, LPCWSTR action)
923 LPWSTR *newbuf = NULL;
925 if (!package->script)
928 TRACE("Registering Action %s as having fun\n",debugstr_w(action));
930 count = package->script->UniqueActionsCount;
931 package->script->UniqueActionsCount++;
933 newbuf = msi_realloc( package->script->UniqueActions,
934 package->script->UniqueActionsCount* sizeof(LPWSTR));
936 newbuf = msi_alloc( sizeof(LPWSTR));
938 newbuf[count] = strdupW(action);
939 package->script->UniqueActions = newbuf;
941 return ERROR_SUCCESS;
944 BOOL check_unique_action(MSIPACKAGE *package, LPCWSTR action)
948 if (!package->script)
951 for (i = 0; i < package->script->UniqueActionsCount; i++)
952 if (!strcmpW(package->script->UniqueActions[i],action))
958 WCHAR* generate_error_string(MSIPACKAGE *package, UINT error, DWORD count, ... )
960 static const WCHAR query[] = {'S','E','L','E','C','T',' ','`','M','e','s','s','a','g','e','`',' ','F','R','O','M',' ','`','E','r','r','o','r','`',' ','W','H','E','R','E',' ','`','E','r','r','o','r','`',' ','=',' ','%','i',0};
970 row = MSI_QueryGetRecord(package->db, query, error);
974 rec = MSI_CreateRecord(count+2);
976 str = MSI_RecordGetString(row,1);
977 MSI_RecordSetStringW(rec,0,str);
978 msiobj_release( &row->hdr );
979 MSI_RecordSetInteger(rec,1,error);
982 for (i = 0; i < count; i++)
984 str = va_arg(va,LPCWSTR);
985 MSI_RecordSetStringW(rec,(i+2),str);
989 MSI_FormatRecordW(package,rec,NULL,&size);
993 data = msi_alloc(size*sizeof(WCHAR));
995 MSI_FormatRecordW(package,rec,data,&size);
998 msiobj_release( &rec->hdr );
1002 msiobj_release( &rec->hdr );
1007 void msi_ui_error( DWORD msg_id, DWORD type )
1011 static const WCHAR title[] = {
1012 'W','i','n','d','o','w','s',' ','I','n','s','t','a','l','l','e','r',0
1015 if (!MsiLoadStringW( -1, msg_id, text, sizeof(text) / sizeof(text[0]),
1016 MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL) ))
1019 MessageBoxW( NULL, text, title, type );