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 cszRootDrive[] = {'R','O','O','T','D','R','I','V','E',0};
44 const WCHAR cszbs[]={'\\',0};
46 LPWSTR build_icon_path(MSIPACKAGE *package, LPCWSTR icon_name )
48 LPWSTR SystemFolder, dest, FilePath;
50 static const WCHAR szInstaller[] =
51 {'M','i','c','r','o','s','o','f','t','\\',
52 'I','n','s','t','a','l','l','e','r','\\',0};
53 static const WCHAR szFolder[] =
54 {'A','p','p','D','a','t','a','F','o','l','d','e','r',0};
56 SystemFolder = msi_dup_property( package, szFolder );
58 dest = build_directory_name(3, SystemFolder, szInstaller, package->ProductCode);
60 create_full_pathW(dest);
62 FilePath = build_directory_name(2, dest, icon_name);
64 msi_free(SystemFolder);
69 LPWSTR msi_dup_record_field( MSIRECORD *row, INT index )
71 return strdupW( MSI_RecordGetString(row,index) );
74 MSICOMPONENT* get_loaded_component( MSIPACKAGE* package, LPCWSTR Component )
78 LIST_FOR_EACH_ENTRY( comp, &package->components, MSICOMPONENT, entry )
80 if (lstrcmpW(Component,comp->Component)==0)
86 MSIFEATURE* get_loaded_feature(MSIPACKAGE* package, LPCWSTR Feature )
90 LIST_FOR_EACH_ENTRY( feature, &package->features, MSIFEATURE, entry )
92 if (lstrcmpW( Feature, feature->Feature )==0)
98 MSIFILE* get_loaded_file( MSIPACKAGE* package, LPCWSTR key )
102 LIST_FOR_EACH_ENTRY( file, &package->files, MSIFILE, entry )
104 if (lstrcmpW( key, file->File )==0)
110 int track_tempfile( MSIPACKAGE *package, LPCWSTR name, LPCWSTR path )
114 LIST_FOR_EACH_ENTRY( temp, &package->tempfiles, MSITEMPFILE, entry )
116 if (lstrcmpW( name, temp->File )==0)
118 TRACE("tempfile %s already exists with path %s\n",
119 debugstr_w(temp->File), debugstr_w(temp->Path));
124 temp = msi_alloc_zero( sizeof (MSITEMPFILE) );
128 list_add_head( &package->tempfiles, &temp->entry );
130 temp->File = strdupW( name );
131 temp->Path = strdupW( path );
133 TRACE("adding tempfile %s with path %s\n",
134 debugstr_w(temp->File), debugstr_w(temp->Path));
139 MSIFOLDER *get_loaded_folder( MSIPACKAGE *package, LPCWSTR dir )
143 LIST_FOR_EACH_ENTRY( folder, &package->folders, MSIFOLDER, entry )
145 if (lstrcmpW( dir, folder->Directory )==0)
151 static LPWSTR get_source_root( MSIPACKAGE *package )
155 path = msi_dup_property( package, cszSourceDir );
159 path = msi_dup_property( package, cszDatabase );
162 p = strrchrW(path,'\\');
170 * clean_spaces_from_path()
172 * removes spaces from the beginning and end of path segments
173 * removes multiple \\ characters
175 static void clean_spaces_from_path( LPWSTR p )
182 /* copy until the end of the string or a space */
183 while (*p != ' ' && (*q = *p))
186 /* reduce many backslashes to one */
187 if (*p != '\\' || *q != '\\')
191 /* quit at the end of the string */
195 /* count the number of spaces */
200 /* if it's leading or trailing space, skip it */
201 if ( len == 0 || p[-1] == '\\' || p[n] == '\\' )
203 else /* copy n spaces */
204 while (n && (*q++ = *p++)) n--;
208 LPWSTR resolve_folder(MSIPACKAGE *package, LPCWSTR name, BOOL source,
209 BOOL set_prop, MSIFOLDER **folder)
212 LPWSTR p, path = NULL;
214 TRACE("Working to resolve %s\n",debugstr_w(name));
219 f = get_loaded_folder( package, name );
223 /* special resolving for Target and Source root dir */
224 if (strcmpW(name,cszTargetDir)==0 || strcmpW(name,cszSourceDir)==0)
226 if (!f->ResolvedTarget && !f->Property)
229 check_path = msi_dup_property( package, cszTargetDir );
232 check_path = msi_dup_property( package, cszRootDrive );
234 MSI_SetPropertyW(package,cszTargetDir,check_path);
237 /* correct misbuilt target dir */
238 path = build_directory_name(2, check_path, NULL);
239 clean_spaces_from_path( path );
240 if (strcmpiW(path,check_path)!=0)
241 MSI_SetPropertyW(package,cszTargetDir,path);
242 msi_free(check_path);
244 f->ResolvedTarget = path;
247 if (!f->ResolvedSource)
248 f->ResolvedSource = get_source_root( package );
254 if (!source && f->ResolvedTarget)
256 path = strdupW( f->ResolvedTarget );
257 TRACE(" already resolved to %s\n",debugstr_w(path));
260 else if (source && f->ResolvedSource)
262 path = strdupW( f->ResolvedSource );
263 TRACE(" (source)already resolved to %s\n",debugstr_w(path));
266 else if (!source && f->Property)
268 path = build_directory_name( 2, f->Property, NULL );
270 TRACE(" internally set to %s\n",debugstr_w(path));
272 MSI_SetPropertyW( package, name, path );
278 LPWSTR parent = f->Parent->Directory;
280 TRACE(" ! Parent is %s\n", debugstr_w(parent));
282 p = resolve_folder(package, parent, source, set_prop, NULL);
285 TRACE(" TargetDefault = %s\n", debugstr_w(f->TargetDefault));
287 path = build_directory_name( 3, p, f->TargetDefault, NULL );
288 clean_spaces_from_path( path );
289 f->ResolvedTarget = strdupW( path );
290 TRACE("target -> %s\n", debugstr_w(path));
292 MSI_SetPropertyW(package,name,path);
296 /* source may be in a few different places ... check each of them */
299 /* try the long path directory */
300 if (f->SourceLongPath)
302 path = build_directory_name( 3, p, f->SourceLongPath, NULL );
303 if (INVALID_FILE_ATTRIBUTES == GetFileAttributesW( path ))
310 /* try the short path directory */
311 if (!path && f->SourceShortPath)
313 path = build_directory_name( 3, p, f->SourceShortPath, NULL );
314 if (INVALID_FILE_ATTRIBUTES == GetFileAttributesW( path ))
321 /* try the root of the install */
323 path = get_source_root( package );
325 TRACE("source -> %s\n", debugstr_w(path));
326 f->ResolvedSource = strdupW( path );
333 /* wrapper to resist a need for a full rewrite right now */
334 DWORD deformat_string(MSIPACKAGE *package, LPCWSTR ptr, WCHAR** data )
338 MSIRECORD *rec = MSI_CreateRecord(1);
341 MSI_RecordSetStringW(rec,0,ptr);
342 MSI_FormatRecordW(package,rec,NULL,&size);
346 *data = msi_alloc(size*sizeof(WCHAR));
348 MSI_FormatRecordW(package,rec,*data,&size);
351 msiobj_release( &rec->hdr );
352 return sizeof(WCHAR)*size;
354 msiobj_release( &rec->hdr );
361 UINT schedule_action(MSIPACKAGE *package, UINT script, LPCWSTR action)
364 LPWSTR *newbuf = NULL;
365 if (script >= TOTAL_SCRIPTS)
367 FIXME("Unknown script requested %i\n",script);
368 return ERROR_FUNCTION_FAILED;
370 TRACE("Scheduling Action %s in script %i\n",debugstr_w(action), script);
372 count = package->script->ActionCount[script];
373 package->script->ActionCount[script]++;
375 newbuf = msi_realloc( package->script->Actions[script],
376 package->script->ActionCount[script]* sizeof(LPWSTR));
378 newbuf = msi_alloc( sizeof(LPWSTR));
380 newbuf[count] = strdupW(action);
381 package->script->Actions[script] = newbuf;
383 return ERROR_SUCCESS;
386 static void remove_tracked_tempfiles(MSIPACKAGE* package)
388 struct list *item, *cursor;
390 LIST_FOR_EACH_SAFE( item, cursor, &package->tempfiles )
392 MSITEMPFILE *temp = LIST_ENTRY( item, MSITEMPFILE, entry );
394 list_remove( &temp->entry );
395 TRACE("deleting temp file %s\n", debugstr_w( temp->Path ));
396 DeleteFileW( temp->Path );
397 msi_free( temp->File );
398 msi_free( temp->Path );
403 static void free_feature( MSIFEATURE *feature )
405 struct list *item, *cursor;
407 LIST_FOR_EACH_SAFE( item, cursor, &feature->Children )
409 FeatureList *fl = LIST_ENTRY( item, FeatureList, entry );
410 list_remove( &fl->entry );
414 LIST_FOR_EACH_SAFE( item, cursor, &feature->Components )
416 ComponentList *cl = LIST_ENTRY( item, ComponentList, entry );
417 list_remove( &cl->entry );
420 msi_free( feature->Feature );
421 msi_free( feature->Feature_Parent );
422 msi_free( feature->Directory );
423 msi_free( feature->Description );
424 msi_free( feature->Title );
428 static void free_extension( MSIEXTENSION *ext )
430 struct list *item, *cursor;
432 LIST_FOR_EACH_SAFE( item, cursor, &ext->verbs )
434 MSIVERB *verb = LIST_ENTRY( item, MSIVERB, entry );
436 list_remove( &verb->entry );
437 msi_free( verb->Verb );
438 msi_free( verb->Command );
439 msi_free( verb->Argument );
443 msi_free( ext->Extension );
444 msi_free( ext->ProgIDText );
448 /* Called when the package is being closed */
449 void ACTION_free_package_structures( MSIPACKAGE* package)
452 struct list *item, *cursor;
454 TRACE("Freeing package action data\n");
456 remove_tracked_tempfiles(package);
458 LIST_FOR_EACH_SAFE( item, cursor, &package->features )
460 MSIFEATURE *feature = LIST_ENTRY( item, MSIFEATURE, entry );
461 list_remove( &feature->entry );
462 free_feature( feature );
465 LIST_FOR_EACH_SAFE( item, cursor, &package->folders )
467 MSIFOLDER *folder = LIST_ENTRY( item, MSIFOLDER, entry );
469 list_remove( &folder->entry );
470 msi_free( folder->Directory );
471 msi_free( folder->TargetDefault );
472 msi_free( folder->SourceLongPath );
473 msi_free( folder->SourceShortPath );
474 msi_free( folder->ResolvedTarget );
475 msi_free( folder->ResolvedSource );
476 msi_free( folder->Property );
480 LIST_FOR_EACH_SAFE( item, cursor, &package->components )
482 MSICOMPONENT *comp = LIST_ENTRY( item, MSICOMPONENT, entry );
484 list_remove( &comp->entry );
485 msi_free( comp->Component );
486 msi_free( comp->ComponentId );
487 msi_free( comp->Directory );
488 msi_free( comp->Condition );
489 msi_free( comp->KeyPath );
490 msi_free( comp->FullKeypath );
494 LIST_FOR_EACH_SAFE( item, cursor, &package->files )
496 MSIFILE *file = LIST_ENTRY( item, MSIFILE, entry );
498 list_remove( &file->entry );
499 msi_free( file->File );
500 msi_free( file->FileName );
501 msi_free( file->ShortName );
502 msi_free( file->LongName );
503 msi_free( file->Version );
504 msi_free( file->Language );
505 msi_free( file->SourcePath );
506 msi_free( file->TargetPath );
510 /* clean up extension, progid, class and verb structures */
511 LIST_FOR_EACH_SAFE( item, cursor, &package->classes )
513 MSICLASS *cls = LIST_ENTRY( item, MSICLASS, entry );
515 list_remove( &cls->entry );
516 msi_free( cls->clsid );
517 msi_free( cls->Context );
518 msi_free( cls->Description );
519 msi_free( cls->FileTypeMask );
520 msi_free( cls->IconPath );
521 msi_free( cls->DefInprocHandler );
522 msi_free( cls->DefInprocHandler32 );
523 msi_free( cls->Argument );
524 msi_free( cls->ProgIDText );
528 LIST_FOR_EACH_SAFE( item, cursor, &package->extensions )
530 MSIEXTENSION *ext = LIST_ENTRY( item, MSIEXTENSION, entry );
532 list_remove( &ext->entry );
533 free_extension( ext );
536 LIST_FOR_EACH_SAFE( item, cursor, &package->progids )
538 MSIPROGID *progid = LIST_ENTRY( item, MSIPROGID, entry );
540 list_remove( &progid->entry );
541 msi_free( progid->ProgID );
542 msi_free( progid->Description );
543 msi_free( progid->IconPath );
547 LIST_FOR_EACH_SAFE( item, cursor, &package->mimes )
549 MSIMIME *mt = LIST_ENTRY( item, MSIMIME, entry );
551 list_remove( &mt->entry );
552 msi_free( mt->clsid );
553 msi_free( mt->ContentType );
557 LIST_FOR_EACH_SAFE( item, cursor, &package->appids )
559 MSIAPPID *appid = LIST_ENTRY( item, MSIAPPID, entry );
561 list_remove( &appid->entry );
562 msi_free( appid->AppID );
563 msi_free( appid->RemoteServerName );
564 msi_free( appid->LocalServer );
565 msi_free( appid->ServiceParameters );
566 msi_free( appid->DllSurrogate );
572 for (i = 0; i < TOTAL_SCRIPTS; i++)
575 for (j = 0; j < package->script->ActionCount[i]; j++)
576 msi_free(package->script->Actions[i][j]);
578 msi_free(package->script->Actions[i]);
581 for (i = 0; i < package->script->UniqueActionsCount; i++)
582 msi_free(package->script->UniqueActions[i]);
584 msi_free(package->script->UniqueActions);
585 msi_free(package->script);
588 msi_free(package->PackagePath);
589 msi_free(package->ProductCode);
590 msi_free(package->ActionFormat);
591 msi_free(package->LastAction);
593 /* cleanup control event subscriptions */
594 ControlEvent_CleanupSubscriptions(package);
598 * build_directory_name()
600 * This function is to save messing round with directory names
601 * It handles adding backslashes between path segments,
602 * and can add \ at the end of the directory name if told to.
604 * It takes a variable number of arguments.
605 * It always allocates a new string for the result, so make sure
606 * to free the return value when finished with it.
608 * The first arg is the number of path segments that follow.
609 * The arguments following count are a list of path segments.
610 * A path segment may be NULL.
612 * Path segments will be added with a \ separating them.
613 * A \ will not be added after the last segment, however if the
614 * last segment is NULL, then the last character will be a \
617 LPWSTR build_directory_name(DWORD count, ...)
624 for(i=0; i<count; i++)
626 LPCWSTR str = va_arg(va,LPCWSTR);
628 sz += strlenW(str) + 1;
632 dir = msi_alloc(sz*sizeof(WCHAR));
636 for(i=0; i<count; i++)
638 LPCWSTR str = va_arg(va,LPCWSTR);
642 if( ((i+1)!=count) && dir[strlenW(dir)-1]!='\\')
648 /***********************************************************************
651 * Recursively create all directories in the path.
653 * shamelessly stolen from setupapi/queue.c
655 BOOL create_full_pathW(const WCHAR *path)
661 new_path = msi_alloc( (strlenW(path) + 1) * sizeof(WCHAR));
663 strcpyW(new_path, path);
665 while((len = strlenW(new_path)) && new_path[len - 1] == '\\')
666 new_path[len - 1] = 0;
668 while(!CreateDirectoryW(new_path, NULL))
671 DWORD last_error = GetLastError();
672 if(last_error == ERROR_ALREADY_EXISTS)
675 if(last_error != ERROR_PATH_NOT_FOUND)
681 if(!(slash = strrchrW(new_path, '\\')))
687 len = slash - new_path;
689 if(!create_full_pathW(new_path))
694 new_path[len] = '\\';
701 void ui_progress(MSIPACKAGE *package, int a, int b, int c, int d )
705 row = MSI_CreateRecord(4);
706 MSI_RecordSetInteger(row,1,a);
707 MSI_RecordSetInteger(row,2,b);
708 MSI_RecordSetInteger(row,3,c);
709 MSI_RecordSetInteger(row,4,d);
710 MSI_ProcessMessage(package, INSTALLMESSAGE_PROGRESS, row);
711 msiobj_release(&row->hdr);
713 msi_dialog_check_messages(NULL);
716 void ui_actiondata(MSIPACKAGE *package, LPCWSTR action, MSIRECORD * record)
718 static const WCHAR Query_t[] =
719 {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
720 '`','A','c','t','i','o', 'n','T','e','x','t','`',' ',
721 'W','H','E','R','E',' ', '`','A','c','t','i','o','n','`',' ','=',
722 ' ','\'','%','s','\'',0};
727 if (!package->LastAction || strcmpW(package->LastAction,action))
729 row = MSI_QueryGetRecord(package->db, Query_t, action);
733 if (MSI_RecordIsNull(row,3))
735 msiobj_release(&row->hdr);
739 /* update the cached actionformat */
740 msi_free(package->ActionFormat);
741 package->ActionFormat = msi_dup_record_field(row,3);
743 msi_free(package->LastAction);
744 package->LastAction = strdupW(action);
746 msiobj_release(&row->hdr);
749 MSI_RecordSetStringW(record,0,package->ActionFormat);
751 MSI_FormatRecordW(package,record,message,&size);
753 row = MSI_CreateRecord(1);
754 MSI_RecordSetStringW(row,1,message);
756 MSI_ProcessMessage(package, INSTALLMESSAGE_ACTIONDATA, row);
758 msiobj_release(&row->hdr);
761 BOOL ACTION_VerifyComponentForAction( MSICOMPONENT* comp, INSTALLSTATE check )
766 if (comp->Installed == check)
769 if (comp->ActionRequest == check)
775 BOOL ACTION_VerifyFeatureForAction( MSIFEATURE* feature, INSTALLSTATE check )
780 if (feature->Installed == check)
783 if (feature->ActionRequest == check)
789 void reduce_to_longfilename(WCHAR* filename)
791 LPWSTR p = strchrW(filename,'|');
793 memmove(filename, p+1, (strlenW(p+1)+1)*sizeof(WCHAR));
796 void reduce_to_shortfilename(WCHAR* filename)
798 LPWSTR p = strchrW(filename,'|');
803 LPWSTR create_component_advertise_string(MSIPACKAGE* package,
804 MSICOMPONENT* component, LPCWSTR feature)
806 static const WCHAR fmt[] = {'%','s','%','s','%','c','%','s',0};
807 WCHAR productid_85[21], component_85[21];
808 LPWSTR output = NULL;
812 /* > is used if there is a component GUID and < if not. */
817 CLSIDFromString(package->ProductCode, &clsid);
818 encode_base85_guid(&clsid, productid_85);
822 CLSIDFromString(component->ComponentId, &clsid);
823 encode_base85_guid(&clsid, component_85);
826 TRACE("prod=%s feat=%s comp=%s\n", debugstr_w(productid_85),
827 debugstr_w(feature), debugstr_w(component_85));
829 sz = 20 + lstrlenW(feature) + 20 + 3;
831 output = msi_alloc_zero(sz*sizeof(WCHAR));
833 sprintfW(output, fmt, productid_85, feature,
834 component?'>':'<', component_85);
839 /* update compoennt state based on a feature change */
840 void ACTION_UpdateComponentStates(MSIPACKAGE *package, LPCWSTR szFeature)
842 INSTALLSTATE newstate;
846 feature = get_loaded_feature(package,szFeature);
850 newstate = feature->ActionRequest;
852 if (newstate == INSTALLSTATE_ABSENT)
853 newstate = INSTALLSTATE_UNKNOWN;
855 LIST_FOR_EACH_ENTRY( cl, &feature->Components, ComponentList, entry )
857 MSICOMPONENT* component = cl->component;
859 TRACE("MODIFYING(%i): Component %s (Installed %i, Action %i, Request %i)\n",
860 newstate, debugstr_w(component->Component), component->Installed,
861 component->Action, component->ActionRequest);
863 if (!component->Enabled)
866 if (newstate == INSTALLSTATE_LOCAL)
868 component->ActionRequest = INSTALLSTATE_LOCAL;
869 component->Action = INSTALLSTATE_LOCAL;
873 ComponentList *clist;
876 component->ActionRequest = newstate;
877 component->Action = newstate;
879 /*if any other feature wants is local we need to set it local*/
880 LIST_FOR_EACH_ENTRY( f, &package->features, MSIFEATURE, entry )
882 if ( f->ActionRequest != INSTALLSTATE_LOCAL &&
883 f->ActionRequest != INSTALLSTATE_SOURCE )
888 LIST_FOR_EACH_ENTRY( clist, &f->Components, ComponentList, entry )
890 if ( clist->component == component &&
891 (f->ActionRequest == INSTALLSTATE_LOCAL ||
892 f->ActionRequest == INSTALLSTATE_SOURCE) )
894 TRACE("Saved by %s\n", debugstr_w(f->Feature));
896 if (component->Attributes & msidbComponentAttributesOptional)
898 if (f->Attributes & msidbFeatureAttributesFavorSource)
900 component->Action = INSTALLSTATE_SOURCE;
901 component->ActionRequest = INSTALLSTATE_SOURCE;
905 component->Action = INSTALLSTATE_LOCAL;
906 component->ActionRequest = INSTALLSTATE_LOCAL;
909 else if (component->Attributes & msidbComponentAttributesSourceOnly)
911 component->Action = INSTALLSTATE_SOURCE;
912 component->ActionRequest = INSTALLSTATE_SOURCE;
916 component->Action = INSTALLSTATE_LOCAL;
917 component->ActionRequest = INSTALLSTATE_LOCAL;
923 TRACE("Result (%i): Component %s (Installed %i, Action %i, Request %i)\n",
924 newstate, debugstr_w(component->Component), component->Installed,
925 component->Action, component->ActionRequest);
929 UINT register_unique_action(MSIPACKAGE *package, LPCWSTR action)
932 LPWSTR *newbuf = NULL;
934 if (!package->script)
937 TRACE("Registering Action %s as having fun\n",debugstr_w(action));
939 count = package->script->UniqueActionsCount;
940 package->script->UniqueActionsCount++;
942 newbuf = msi_realloc( package->script->UniqueActions,
943 package->script->UniqueActionsCount* sizeof(LPWSTR));
945 newbuf = msi_alloc( sizeof(LPWSTR));
947 newbuf[count] = strdupW(action);
948 package->script->UniqueActions = newbuf;
950 return ERROR_SUCCESS;
953 BOOL check_unique_action(MSIPACKAGE *package, LPCWSTR action)
957 if (!package->script)
960 for (i = 0; i < package->script->UniqueActionsCount; i++)
961 if (!strcmpW(package->script->UniqueActions[i],action))
967 WCHAR* generate_error_string(MSIPACKAGE *package, UINT error, DWORD count, ... )
969 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};
979 row = MSI_QueryGetRecord(package->db, query, error);
983 rec = MSI_CreateRecord(count+2);
985 str = MSI_RecordGetString(row,1);
986 MSI_RecordSetStringW(rec,0,str);
987 msiobj_release( &row->hdr );
988 MSI_RecordSetInteger(rec,1,error);
991 for (i = 0; i < count; i++)
993 str = va_arg(va,LPCWSTR);
994 MSI_RecordSetStringW(rec,(i+2),str);
998 MSI_FormatRecordW(package,rec,NULL,&size);
1002 data = msi_alloc(size*sizeof(WCHAR));
1004 MSI_FormatRecordW(package,rec,data,&size);
1007 msiobj_release( &rec->hdr );
1011 msiobj_release( &rec->hdr );
1016 void msi_ui_error( DWORD msg_id, DWORD type )
1020 static const WCHAR title[] = {
1021 'W','i','n','d','o','w','s',' ','I','n','s','t','a','l','l','e','r',0
1024 if (!MsiLoadStringW( -1, msg_id, text, sizeof(text) / sizeof(text[0]),
1025 MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL) ))
1028 MessageBoxW( NULL, text, title, type );