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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 /* actions handled in this module
24 * RegisterExtensionInfo
26 * UnRegisterClassInfo (TODO)
27 * UnRegisterProgIdInfo (TODO)
28 * UnRegisterExtensionInfo (TODO)
29 * UnRegisterMIMEInfo (TODO)
38 #include "wine/debug.h"
41 #include "wine/unicode.h"
44 WINE_DEFAULT_DEBUG_CHANNEL(msi);
47 extern const WCHAR szRegisterClassInfo[];
48 extern const WCHAR szRegisterProgIdInfo[];
49 extern const WCHAR szRegisterExtensionInfo[];
50 extern const WCHAR szRegisterMIMEInfo[];
52 extern const WCHAR szUnregisterClassInfo[];
53 extern const WCHAR szUnregisterExtensionInfo[];
54 extern const WCHAR szUnregisterMIMEInfo[];
55 extern const WCHAR szUnregisterProgIdInfo[];
57 static INT load_appid(MSIPACKAGE* package, MSIRECORD *row)
59 DWORD index = package->loaded_appids;
63 /* fill in the data */
65 package->loaded_appids++;
66 if (package->loaded_appids == 1)
67 package->appids = HeapAlloc(GetProcessHeap(),0,sizeof(MSIAPPID));
69 package->appids = HeapReAlloc(GetProcessHeap(),0,
70 package->appids, package->loaded_appids * sizeof(MSIAPPID));
72 memset(&package->appids[index],0,sizeof(MSIAPPID));
75 MSI_RecordGetStringW(row, 1, package->appids[index].AppID, &sz);
76 TRACE("loading appid %s\n",debugstr_w(package->appids[index].AppID));
78 buffer = MSI_RecordGetString(row,2);
79 deformat_string(package,buffer,&package->appids[index].RemoteServerName);
81 package->appids[index].LocalServer = load_dynamic_stringW(row,3);
82 package->appids[index].ServiceParameters = load_dynamic_stringW(row,4);
83 package->appids[index].DllSurrogate = load_dynamic_stringW(row,5);
85 package->appids[index].ActivateAtStorage = !MSI_RecordIsNull(row,6);
86 package->appids[index].RunAsInteractiveUser = !MSI_RecordIsNull(row,7);
91 static INT load_given_appid(MSIPACKAGE *package, LPCWSTR appid)
96 static const WCHAR ExecSeqQuery[] =
97 {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
98 '`','A','p','p','I','d','`',' ','W','H','E','R','E',' ',
99 '`','A','p','p','I','d','`',' ','=',' ','\'','%','s','\'',0};
104 /* check for appids already loaded */
105 for (i = 0; i < package->loaded_appids; i++)
106 if (strcmpiW(package->appids[i].AppID,appid)==0)
108 TRACE("found appid %s at index %i\n",debugstr_w(appid),i);
112 row = MSI_QueryGetRecord(package->db, ExecSeqQuery, appid);
116 rc = load_appid(package, row);
117 msiobj_release(&row->hdr);
122 static INT load_given_progid(MSIPACKAGE *package, LPCWSTR progid);
123 static INT load_given_class(MSIPACKAGE *package, LPCWSTR classid);
125 static INT load_progid(MSIPACKAGE* package, MSIRECORD *row)
127 DWORD index = package->loaded_progids;
130 /* fill in the data */
132 package->loaded_progids++;
133 if (package->loaded_progids == 1)
134 package->progids = HeapAlloc(GetProcessHeap(),0,sizeof(MSIPROGID));
136 package->progids = HeapReAlloc(GetProcessHeap(),0,
137 package->progids , package->loaded_progids * sizeof(MSIPROGID));
139 memset(&package->progids[index],0,sizeof(MSIPROGID));
141 package->progids[index].ProgID = load_dynamic_stringW(row,1);
142 TRACE("loading progid %s\n",debugstr_w(package->progids[index].ProgID));
144 buffer = MSI_RecordGetString(row,2);
145 package->progids[index].ParentIndex = load_given_progid(package,buffer);
146 if (package->progids[index].ParentIndex < 0 && buffer)
147 FIXME("Unknown parent ProgID %s\n",debugstr_w(buffer));
149 buffer = MSI_RecordGetString(row,3);
150 package->progids[index].ClassIndex = load_given_class(package,buffer);
151 if (package->progids[index].ClassIndex< 0 && buffer)
152 FIXME("Unknown class %s\n",debugstr_w(buffer));
154 package->progids[index].Description = load_dynamic_stringW(row,4);
156 if (!MSI_RecordIsNull(row,6))
158 INT icon_index = MSI_RecordGetInteger(row,6);
159 LPWSTR FileName = load_dynamic_stringW(row,5);
161 static const WCHAR fmt[] = {'%','s',',','%','i',0};
163 build_icon_path(package,FileName,&FilePath);
165 package->progids[index].IconPath =
166 HeapAlloc(GetProcessHeap(),0,(strlenW(FilePath)+10)*
169 sprintfW(package->progids[index].IconPath,fmt,FilePath,icon_index);
171 HeapFree(GetProcessHeap(),0,FilePath);
172 HeapFree(GetProcessHeap(),0,FileName);
176 buffer = MSI_RecordGetString(row,5);
178 build_icon_path(package,buffer,&(package->progids[index].IconPath));
181 package->progids[index].CurVerIndex = -1;
182 package->progids[index].VersionIndIndex = -1;
184 /* if we have a parent then we may be that parents CurVer */
185 if (package->progids[index].ParentIndex >= 0 &&
186 package->progids[index].ParentIndex != index)
188 int pindex = package->progids[index].ParentIndex;
189 while (package->progids[pindex].ParentIndex>= 0 &&
190 package->progids[pindex].ParentIndex != pindex)
191 pindex = package->progids[pindex].ParentIndex;
193 FIXME("BAD BAD need to determing if we are really the CurVer\n");
195 package->progids[index].CurVerIndex = pindex;
196 package->progids[pindex].VersionIndIndex = index;
202 static INT load_given_progid(MSIPACKAGE *package, LPCWSTR progid)
207 static const WCHAR ExecSeqQuery[] =
208 {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
209 '`','P','r','o','g','I','d','`',' ','W','H','E','R','E',' ',
210 '`','P','r','o','g','I','d','`',' ','=',' ','\'','%','s','\'',0};
215 /* check for progids already loaded */
216 for (i = 0; i < package->loaded_progids; i++)
217 if (strcmpiW(package->progids[i].ProgID,progid)==0)
219 TRACE("found progid %s at index %i\n",debugstr_w(progid), i);
223 row = MSI_QueryGetRecord(package->db, ExecSeqQuery, progid);
227 rc = load_progid(package, row);
228 msiobj_release(&row->hdr);
233 static INT load_class(MSIPACKAGE* package, MSIRECORD *row)
235 DWORD index = package->loaded_classes;
239 /* fill in the data */
241 package->loaded_classes++;
242 if (package->loaded_classes== 1)
243 package->classes = HeapAlloc(GetProcessHeap(),0,sizeof(MSICLASS));
245 package->classes = HeapReAlloc(GetProcessHeap(),0,
246 package->classes, package->loaded_classes * sizeof(MSICLASS));
248 memset(&package->classes[index],0,sizeof(MSICLASS));
250 sz = IDENTIFIER_SIZE;
251 MSI_RecordGetStringW(row, 1, package->classes[index].CLSID, &sz);
252 TRACE("loading class %s\n",debugstr_w(package->classes[index].CLSID));
253 sz = IDENTIFIER_SIZE;
254 MSI_RecordGetStringW(row, 2, package->classes[index].Context, &sz);
255 buffer = MSI_RecordGetString(row,3);
256 package->classes[index].ComponentIndex = get_loaded_component(package,
259 package->classes[index].ProgIDText = load_dynamic_stringW(row,4);
260 package->classes[index].ProgIDIndex =
261 load_given_progid(package, package->classes[index].ProgIDText);
263 package->classes[index].Description = load_dynamic_stringW(row,5);
265 buffer = MSI_RecordGetString(row,6);
267 package->classes[index].AppIDIndex =
268 load_given_appid(package, buffer);
270 package->classes[index].AppIDIndex = -1;
272 package->classes[index].FileTypeMask = load_dynamic_stringW(row,7);
274 if (!MSI_RecordIsNull(row,9))
277 INT icon_index = MSI_RecordGetInteger(row,9);
278 LPWSTR FileName = load_dynamic_stringW(row,8);
280 static const WCHAR fmt[] = {'%','s',',','%','i',0};
282 build_icon_path(package,FileName,&FilePath);
284 package->classes[index].IconPath =
285 HeapAlloc(GetProcessHeap(),0,(strlenW(FilePath)+5)*
288 sprintfW(package->classes[index].IconPath,fmt,FilePath,icon_index);
290 HeapFree(GetProcessHeap(),0,FilePath);
291 HeapFree(GetProcessHeap(),0,FileName);
295 buffer = MSI_RecordGetString(row,8);
297 build_icon_path(package,buffer,&(package->classes[index].IconPath));
300 if (!MSI_RecordIsNull(row,10))
302 i = MSI_RecordGetInteger(row,10);
303 if (i != MSI_NULL_INTEGER && i > 0 && i < 4)
305 static const WCHAR ole2[] = {'o','l','e','2','.','d','l','l',0};
306 static const WCHAR ole32[] = {'o','l','e','3','2','.','d','l','l',0};
311 package->classes[index].DefInprocHandler = strdupW(ole2);
314 package->classes[index].DefInprocHandler32 = strdupW(ole32);
317 package->classes[index].DefInprocHandler = strdupW(ole2);
318 package->classes[index].DefInprocHandler32 = strdupW(ole32);
324 package->classes[index].DefInprocHandler32 = load_dynamic_stringW(
326 reduce_to_longfilename(package->classes[index].DefInprocHandler32);
329 buffer = MSI_RecordGetString(row,11);
330 deformat_string(package,buffer,&package->classes[index].Argument);
332 buffer = MSI_RecordGetString(row,12);
333 package->classes[index].FeatureIndex = get_loaded_feature(package,buffer);
335 package->classes[index].Attributes = MSI_RecordGetInteger(row,13);
341 * the Class table has 3 primary keys. Generally it is only
342 * referenced through the first CLSID key. However when loading
343 * all of the classes we need to make sure we do not ignore rows
344 * with other Context and ComponentIndexs
346 static INT load_given_class(MSIPACKAGE *package, LPCWSTR classid)
351 static const WCHAR ExecSeqQuery[] =
352 {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
353 '`','C','l','a','s','s','`',' ','W','H','E','R','E',' ',
354 '`','C','L','S','I','D','`',' ','=',' ','\'','%','s','\'',0};
360 /* check for classes already loaded */
361 for (i = 0; i < package->loaded_classes; i++)
362 if (strcmpiW(package->classes[i].CLSID,classid)==0)
364 TRACE("found class %s at index %i\n",debugstr_w(classid), i);
368 row = MSI_QueryGetRecord(package->db, ExecSeqQuery, classid);
372 rc = load_class(package, row);
373 msiobj_release(&row->hdr);
378 static INT load_given_extension(MSIPACKAGE *package, LPCWSTR extension);
380 static INT load_mime(MSIPACKAGE* package, MSIRECORD *row)
382 DWORD index = package->loaded_mimes;
386 /* fill in the data */
388 package->loaded_mimes++;
389 if (package->loaded_mimes== 1)
390 package->mimes= HeapAlloc(GetProcessHeap(),0,sizeof(MSIMIME));
392 package->mimes= HeapReAlloc(GetProcessHeap(),0,
393 package->mimes, package->loaded_mimes*
396 memset(&package->mimes[index],0,sizeof(MSIMIME));
398 package->mimes[index].ContentType = load_dynamic_stringW(row,1);
399 TRACE("loading mime %s\n",debugstr_w(package->mimes[index].ContentType));
401 buffer = MSI_RecordGetString(row,2);
402 package->mimes[index].ExtensionIndex = load_given_extension(package,
405 sz = IDENTIFIER_SIZE;
406 MSI_RecordGetStringW(row,3,package->mimes[index].CLSID,&sz);
407 package->mimes[index].ClassIndex= load_given_class(package,
408 package->mimes[index].CLSID);
413 static INT load_given_mime(MSIPACKAGE *package, LPCWSTR mime)
418 static const WCHAR ExecSeqQuery[] =
419 {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
420 '`','M','I','M','E','`',' ','W','H','E','R','E',' ',
421 '`','C','o','n','t','e','n','t','T','y','p','e','`',' ','=',' ',
422 '\'','%','s','\'',0};
427 /* check for mime already loaded */
428 for (i = 0; i < package->loaded_mimes; i++)
429 if (strcmpiW(package->mimes[i].ContentType,mime)==0)
431 TRACE("found mime %s at index %i\n",debugstr_w(mime), i);
435 row = MSI_QueryGetRecord(package->db, ExecSeqQuery, mime);
439 rc = load_mime(package, row);
440 msiobj_release(&row->hdr);
445 static INT load_extension(MSIPACKAGE* package, MSIRECORD *row)
447 DWORD index = package->loaded_extensions;
451 /* fill in the data */
453 package->loaded_extensions++;
454 if (package->loaded_extensions == 1)
455 package->extensions = HeapAlloc(GetProcessHeap(),0,sizeof(MSIEXTENSION));
457 package->extensions = HeapReAlloc(GetProcessHeap(),0,
458 package->extensions, package->loaded_extensions*
459 sizeof(MSIEXTENSION));
461 memset(&package->extensions[index],0,sizeof(MSIEXTENSION));
464 MSI_RecordGetStringW(row,1,package->extensions[index].Extension,&sz);
465 TRACE("loading extension %s\n",
466 debugstr_w(package->extensions[index].Extension));
468 buffer = MSI_RecordGetString(row,2);
469 package->extensions[index].ComponentIndex =
470 get_loaded_component(package,buffer);
472 package->extensions[index].ProgIDText = load_dynamic_stringW(row,3);
473 package->extensions[index].ProgIDIndex = load_given_progid(package,
474 package->extensions[index].ProgIDText);
476 buffer = MSI_RecordGetString(row,4);
477 package->extensions[index].MIMEIndex = load_given_mime(package,buffer);
479 buffer = MSI_RecordGetString(row,5);
480 package->extensions[index].FeatureIndex =
481 get_loaded_feature(package,buffer);
487 * While the extension table has 2 primary keys, this function is only looking
488 * at the Extension key which is what is referenced as a forign key
490 static INT load_given_extension(MSIPACKAGE *package, LPCWSTR extension)
495 static const WCHAR ExecSeqQuery[] =
496 {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
497 '`','E','x','t','e','n','s','i','o','n','`',' ',
498 'W','H','E','R','E',' ',
499 '`','E','x','t','e','n','s','i','o','n','`',' ','=',' ',
500 '\'','%','s','\'',0};
505 /* check for extensions already loaded */
506 for (i = 0; i < package->loaded_extensions; i++)
507 if (strcmpiW(package->extensions[i].Extension,extension)==0)
509 TRACE("extension %s already loaded at %i\n",debugstr_w(extension),
514 row = MSI_QueryGetRecord(package->db, ExecSeqQuery, extension);
518 rc = load_extension(package, row);
519 msiobj_release(&row->hdr);
524 static UINT iterate_load_verb(MSIRECORD *row, LPVOID param)
526 MSIPACKAGE* package = (MSIPACKAGE*)param;
527 DWORD index = package->loaded_verbs;
530 /* fill in the data */
532 package->loaded_verbs++;
533 if (package->loaded_verbs == 1)
534 package->verbs = HeapAlloc(GetProcessHeap(),0,sizeof(MSIVERB));
536 package->verbs = HeapReAlloc(GetProcessHeap(),0,
537 package->verbs , package->loaded_verbs * sizeof(MSIVERB));
539 memset(&package->verbs[index],0,sizeof(MSIVERB));
541 buffer = MSI_RecordGetString(row,1);
542 package->verbs[index].ExtensionIndex = load_given_extension(package,buffer);
543 if (package->verbs[index].ExtensionIndex < 0 && buffer)
544 ERR("Verb unable to find loaded extension %s\n", debugstr_w(buffer));
546 package->verbs[index].Verb = load_dynamic_stringW(row,2);
547 TRACE("loading verb %s\n",debugstr_w(package->verbs[index].Verb));
548 package->verbs[index].Sequence = MSI_RecordGetInteger(row,3);
550 buffer = MSI_RecordGetString(row,4);
551 deformat_string(package,buffer,&package->verbs[index].Command);
553 buffer = MSI_RecordGetString(row,5);
554 deformat_string(package,buffer,&package->verbs[index].Argument);
556 /* assosiate the verb with the correct extension */
557 if (package->verbs[index].ExtensionIndex >= 0)
559 MSIEXTENSION* extension = &package->extensions[package->verbs[index].
561 int count = extension->VerbCount;
564 FIXME("Exceeding max verb count! Increase that limit!!!\n");
567 extension->VerbCount++;
568 extension->Verbs[count] = index;
572 return ERROR_SUCCESS;
575 static UINT iterate_all_classes(MSIRECORD *rec, LPVOID param)
581 MSIPACKAGE* package =(MSIPACKAGE*)param;
585 clsid = MSI_RecordGetString(rec,1);
586 context = MSI_RecordGetString(rec,2);
587 buffer = MSI_RecordGetString(rec,3);
588 component_index = get_loaded_component(package,buffer);
590 for (i = 0; i < package->loaded_classes; i++)
592 if (strcmpiW(clsid,package->classes[i].CLSID))
594 if (strcmpW(context,package->classes[i].Context))
596 if (component_index == package->classes[i].ComponentIndex)
604 load_class(package, rec);
606 return ERROR_SUCCESS;
609 static VOID load_all_classes(MSIPACKAGE *package)
611 UINT rc = ERROR_SUCCESS;
614 static const WCHAR ExecSeqQuery[] =
615 {'S','E','L','E','C','T',' ','*',' ', 'F','R','O','M',' ',
616 '`','C','l','a','s','s','`',0};
618 rc = MSI_DatabaseOpenViewW(package->db, ExecSeqQuery, &view);
619 if (rc != ERROR_SUCCESS)
622 rc = MSI_IterateRecords(view, NULL, iterate_all_classes, package);
623 msiobj_release(&view->hdr);
626 static UINT iterate_all_extensions(MSIRECORD *rec, LPVOID param)
631 MSIPACKAGE* package =(MSIPACKAGE*)param;
635 extension = MSI_RecordGetString(rec,1);
636 buffer = MSI_RecordGetString(rec,2);
637 component_index = get_loaded_component(package,buffer);
639 for (i = 0; i < package->loaded_extensions; i++)
641 if (strcmpiW(extension,package->extensions[i].Extension))
643 if (component_index == package->extensions[i].ComponentIndex)
651 load_extension(package, rec);
653 return ERROR_SUCCESS;
656 static VOID load_all_extensions(MSIPACKAGE *package)
658 UINT rc = ERROR_SUCCESS;
661 static const WCHAR ExecSeqQuery[] =
662 {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
663 '`','E','x','t','e','n','s','i','o','n','`',0};
665 rc = MSI_DatabaseOpenViewW(package->db, ExecSeqQuery, &view);
666 if (rc != ERROR_SUCCESS)
669 rc = MSI_IterateRecords(view, NULL, iterate_all_extensions, package);
670 msiobj_release(&view->hdr);
673 static UINT iterate_all_progids(MSIRECORD *rec, LPVOID param)
676 MSIPACKAGE* package =(MSIPACKAGE*)param;
678 buffer = MSI_RecordGetString(rec,1);
679 load_given_progid(package,buffer);
680 return ERROR_SUCCESS;
683 static VOID load_all_progids(MSIPACKAGE *package)
685 UINT rc = ERROR_SUCCESS;
688 static const WCHAR ExecSeqQuery[] =
689 {'S','E','L','E','C','T',' ','`','P','r','o','g','I','d','`',' ',
690 'F','R','O','M',' ', '`','P','r','o','g','I','d','`',0};
692 rc = MSI_DatabaseOpenViewW(package->db, ExecSeqQuery, &view);
693 if (rc != ERROR_SUCCESS)
696 rc = MSI_IterateRecords(view, NULL, iterate_all_progids, package);
697 msiobj_release(&view->hdr);
700 static VOID load_all_verbs(MSIPACKAGE *package)
702 UINT rc = ERROR_SUCCESS;
705 static const WCHAR ExecSeqQuery[] =
706 {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
707 '`','V','e','r','b','`',0};
709 rc = MSI_DatabaseOpenViewW(package->db, ExecSeqQuery, &view);
710 if (rc != ERROR_SUCCESS)
713 rc = MSI_IterateRecords(view, NULL, iterate_load_verb, package);
714 msiobj_release(&view->hdr);
717 static UINT iterate_all_mimes(MSIRECORD *rec, LPVOID param)
720 MSIPACKAGE* package =(MSIPACKAGE*)param;
722 buffer = MSI_RecordGetString(rec,1);
723 load_given_mime(package,buffer);
724 return ERROR_SUCCESS;
727 static VOID load_all_mimes(MSIPACKAGE *package)
729 UINT rc = ERROR_SUCCESS;
732 static const WCHAR ExecSeqQuery[] =
733 {'S','E','L','E','C','T',' ',
734 '`','C','o','n','t','e','n','t','T','y','p','e','`',
735 ' ','F','R','O','M',' ',
736 '`','M','I','M','E','`',0};
738 rc = MSI_DatabaseOpenViewW(package->db, ExecSeqQuery, &view);
739 if (rc != ERROR_SUCCESS)
742 rc = MSI_IterateRecords(view, NULL, iterate_all_mimes, package);
743 msiobj_release(&view->hdr);
746 static void load_classes_and_such(MSIPACKAGE *package)
748 TRACE("Loading all the class info and related tables\n");
750 /* check if already loaded */
751 if (package->classes || package->extensions || package->progids ||
752 package->verbs || package->mimes)
755 load_all_classes(package);
756 load_all_extensions(package);
757 load_all_progids(package);
758 /* these loads must come after the other loads */
759 load_all_verbs(package);
760 load_all_mimes(package);
763 static void mark_progid_for_install(MSIPACKAGE* package, INT index)
768 if (index < 0 || index >= package->loaded_progids)
771 progid = &package->progids[index];
773 if (progid->InstallMe == TRUE)
776 progid->InstallMe = TRUE;
778 /* all children if this is a parent also install */
779 for (i = 0; i < package->loaded_progids; i++)
780 if (package->progids[i].ParentIndex == index)
781 mark_progid_for_install(package,i);
784 static void mark_mime_for_install(MSIPACKAGE* package, INT index)
788 if (index < 0 || index >= package->loaded_mimes)
791 mime = &package->mimes[index];
793 if (mime->InstallMe == TRUE)
796 mime->InstallMe = TRUE;
799 static UINT register_appid(MSIPACKAGE *package, int appidIndex, LPCWSTR app )
801 static const WCHAR szAppID[] = { 'A','p','p','I','D',0 };
805 return ERROR_INVALID_HANDLE;
807 RegCreateKeyW(HKEY_CLASSES_ROOT,szAppID,&hkey2);
808 RegCreateKeyW(hkey2,package->appids[appidIndex].AppID,&hkey3);
809 RegSetValueExW(hkey3,NULL,0,REG_SZ,(LPVOID)app,
810 (strlenW(app)+1)*sizeof(WCHAR));
812 if (package->appids[appidIndex].RemoteServerName)
815 static const WCHAR szRemoteServerName[] =
816 {'R','e','m','o','t','e','S','e','r','v','e','r','N','a','m','e',
819 size = (strlenW(package->appids[appidIndex].RemoteServerName)+1) *
822 RegSetValueExW(hkey3,szRemoteServerName,0,REG_SZ,
823 (LPVOID)package->appids[appidIndex].RemoteServerName,
827 if (package->appids[appidIndex].LocalServer)
829 static const WCHAR szLocalService[] =
830 {'L','o','c','a','l','S','e','r','v','i','c','e',0};
832 size = (strlenW(package->appids[appidIndex].LocalServer)+1) *
835 RegSetValueExW(hkey3,szLocalService,0,REG_SZ,
836 (LPVOID)package->appids[appidIndex].LocalServer,size);
839 if (package->appids[appidIndex].ServiceParameters)
841 static const WCHAR szService[] =
842 {'S','e','r','v','i','c','e',
843 'P','a','r','a','m','e','t','e','r','s',0};
845 size = (strlenW(package->appids[appidIndex].ServiceParameters)+1) *
847 RegSetValueExW(hkey3,szService,0,REG_SZ,
848 (LPVOID)package->appids[appidIndex].ServiceParameters,
852 if (package->appids[appidIndex].DllSurrogate)
854 static const WCHAR szDLL[] =
855 {'D','l','l','S','u','r','r','o','g','a','t','e',0};
857 size = (strlenW(package->appids[appidIndex].DllSurrogate)+1) *
859 RegSetValueExW(hkey3,szDLL,0,REG_SZ,
860 (LPVOID)package->appids[appidIndex].DllSurrogate,size);
863 if (package->appids[appidIndex].ActivateAtStorage)
865 static const WCHAR szActivate[] =
866 {'A','c','t','i','v','a','t','e','A','s',
867 'S','t','o','r','a','g','e',0};
868 static const WCHAR szY[] = {'Y',0};
870 RegSetValueExW(hkey3,szActivate,0,REG_SZ,(LPVOID)szY,4);
873 if (package->appids[appidIndex].RunAsInteractiveUser)
875 static const WCHAR szRunAs[] = {'R','u','n','A','s',0};
876 static const WCHAR szUser[] =
877 {'I','n','t','e','r','a','c','t','i','v','e',' ',
880 RegSetValueExW(hkey3,szRunAs,0,REG_SZ,(LPVOID)szUser,sizeof(szUser));
885 return ERROR_SUCCESS;
888 UINT ACTION_RegisterClassInfo(MSIPACKAGE *package)
891 * Again I am assuming the words, "Whose key file represents" when referring
892 * to a Component as to meaning that Components KeyPath file
897 static const WCHAR szCLSID[] = { 'C','L','S','I','D',0 };
898 static const WCHAR szProgID[] = { 'P','r','o','g','I','D',0 };
899 static const WCHAR szVIProgID[] = { 'V','e','r','s','i','o','n','I','n','d','e','p','e','n','d','e','n','t','P','r','o','g','I','D',0 };
900 static const WCHAR szAppID[] = { 'A','p','p','I','D',0 };
901 static const WCHAR szSpace[] = {' ',0};
902 static const WCHAR szInprocServer32[] = {'I','n','p','r','o','c','S','e','r','v','e','r','3','2',0};
903 static const WCHAR szFileType_fmt[] = {'F','i','l','e','T','y','p','e','\\','%','s','\\','%','i',0};
904 HKEY hkey,hkey2,hkey3;
905 BOOL install_on_demand = FALSE;
909 return ERROR_INVALID_HANDLE;
911 load_classes_and_such(package);
912 rc = RegCreateKeyW(HKEY_CLASSES_ROOT,szCLSID,&hkey);
913 if (rc != ERROR_SUCCESS)
914 return ERROR_FUNCTION_FAILED;
916 /* install_on_demand should be set if OLE supports install on demand OLE
917 * servers. For now i am defaulting to FALSE because i do not know how to
918 * check, and i am told our builtin OLE does not support it
921 for (i = 0; i < package->loaded_classes; i++)
927 if (package->classes[i].ComponentIndex < 0)
932 index = package->classes[i].ComponentIndex;
933 f_index = package->classes[i].FeatureIndex;
936 * yes. MSDN says that these are based on _Feature_ not on
937 * Component. So verify the feature is to be installed
939 if ((!ACTION_VerifyFeatureForAction(package, f_index,
940 INSTALLSTATE_LOCAL)) &&
941 !(install_on_demand && ACTION_VerifyFeatureForAction(package,
942 f_index, INSTALLSTATE_ADVERTISED)))
944 TRACE("Skipping class %s reg due to disabled feature %s\n",
945 debugstr_w(package->classes[i].CLSID),
946 debugstr_w(package->features[f_index].Feature));
951 TRACE("Registering index %i class %s\n",i,
952 debugstr_w(package->classes[i].CLSID));
954 package->classes[i].Installed = TRUE;
955 if (package->classes[i].ProgIDIndex >= 0)
956 mark_progid_for_install(package, package->classes[i].ProgIDIndex);
958 RegCreateKeyW(hkey,package->classes[i].CLSID,&hkey2);
960 if (package->classes[i].Description)
961 RegSetValueExW(hkey2,NULL,0,REG_SZ,(LPVOID)package->classes[i].
962 Description, (strlenW(package->classes[i].
963 Description)+1)*sizeof(WCHAR));
965 RegCreateKeyW(hkey2,package->classes[i].Context,&hkey3);
966 index = get_loaded_file(package,package->components[index].KeyPath);
969 /* the context server is a short path name
970 * except for if it is InprocServer32...
972 if (strcmpiW(package->classes[i].Context,szInprocServer32)!=0)
975 sz = GetShortPathNameW(package->files[index].TargetPath, NULL, 0);
978 ERR("Unable to find short path for CLSID COM Server\n");
983 size = sz * sizeof(WCHAR);
985 if (package->classes[i].Argument)
987 size += strlenW(package->classes[i].Argument) *
989 size += sizeof(WCHAR);
992 argument = HeapAlloc(GetProcessHeap(), 0, size + sizeof(WCHAR));
993 GetShortPathNameW(package->files[index].TargetPath, argument,
996 if (package->classes[i].Argument)
998 strcatW(argument,szSpace);
999 strcatW(argument,package->classes[i].Argument);
1005 size = lstrlenW(package->files[index].TargetPath) * sizeof(WCHAR);
1007 if (package->classes[i].Argument)
1009 size += strlenW(package->classes[i].Argument) * sizeof(WCHAR);
1010 size += sizeof(WCHAR);
1013 argument = HeapAlloc(GetProcessHeap(), 0, size + sizeof(WCHAR));
1014 strcpyW(argument, package->files[index].TargetPath);
1016 if (package->classes[i].Argument)
1018 strcatW(argument,szSpace);
1019 strcatW(argument,package->classes[i].Argument);
1025 RegSetValueExW(hkey3,NULL,0,REG_SZ, (LPVOID)argument, size);
1026 HeapFree(GetProcessHeap(),0,argument);
1031 if (package->classes[i].ProgIDIndex >= 0 ||
1032 package->classes[i].ProgIDText)
1036 if (package->classes[i].ProgIDIndex >= 0)
1037 progid = package->progids[
1038 package->classes[i].ProgIDIndex].ProgID;
1040 progid = package->classes[i].ProgIDText;
1042 RegCreateKeyW(hkey2,szProgID,&hkey3);
1043 RegSetValueExW(hkey3,NULL,0,REG_SZ,(LPVOID)progid,
1044 (strlenW(progid)+1) *sizeof(WCHAR));
1047 if (package->classes[i].ProgIDIndex >= 0 &&
1048 package->progids[package->classes[i].ProgIDIndex].
1049 VersionIndIndex >= 0)
1051 LPWSTR viprogid = strdupW(package->progids[package->progids[
1052 package->classes[i].ProgIDIndex].VersionIndIndex].
1054 RegCreateKeyW(hkey2,szVIProgID,&hkey3);
1055 RegSetValueExW(hkey3,NULL,0,REG_SZ,(LPVOID)viprogid,
1056 (strlenW(viprogid)+1) *sizeof(WCHAR));
1058 HeapFree(GetProcessHeap(), 0, viprogid);
1062 if (package->classes[i].AppIDIndex >= 0)
1064 RegSetValueExW(hkey2,szAppID,0,REG_SZ,
1065 (LPVOID)package->appids[package->classes[i].AppIDIndex].AppID,
1066 (strlenW(package->appids[package->classes[i].AppIDIndex].AppID)+1)
1069 register_appid(package,package->classes[i].AppIDIndex,
1070 package->classes[i].Description);
1073 if (package->classes[i].IconPath)
1075 static const WCHAR szDefaultIcon[] =
1076 {'D','e','f','a','u','l','t','I','c','o','n',0};
1078 RegCreateKeyW(hkey2,szDefaultIcon,&hkey3);
1080 RegSetValueExW(hkey3,NULL,0,REG_SZ,
1081 (LPVOID)package->classes[i].IconPath,
1082 (strlenW(package->classes[i].IconPath)+1) *
1088 if (package->classes[i].DefInprocHandler)
1090 static const WCHAR szInproc[] =
1091 {'I','n','p','r','o','c','H','a','n','d','l','e','r',0};
1093 size = (strlenW(package->classes[i].DefInprocHandler) + 1) *
1095 RegCreateKeyW(hkey2,szInproc,&hkey3);
1096 RegSetValueExW(hkey3,NULL,0,REG_SZ,
1097 (LPVOID)package->classes[i].DefInprocHandler, size);
1101 if (package->classes[i].DefInprocHandler32)
1103 static const WCHAR szInproc32[] =
1104 {'I','n','p','r','o','c','H','a','n','d','l','e','r','3','2',
1106 size = (strlenW(package->classes[i].DefInprocHandler32) + 1) *
1109 RegCreateKeyW(hkey2,szInproc32,&hkey3);
1110 RegSetValueExW(hkey3,NULL,0,REG_SZ,
1111 (LPVOID)package->classes[i].DefInprocHandler32,size);
1117 /* if there is a FileTypeMask, register the FileType */
1118 if (package->classes[i].FileTypeMask)
1123 ptr = package->classes[i].FileTypeMask;
1126 ptr2 = strchrW(ptr,';');
1129 keyname = HeapAlloc(GetProcessHeap(),0,(strlenW(szFileType_fmt)+
1130 strlenW(package->classes[i].CLSID) + 4)
1132 sprintfW(keyname,szFileType_fmt, package->classes[i].CLSID,
1135 RegCreateKeyW(HKEY_CLASSES_ROOT,keyname,&hkey2);
1136 RegSetValueExW(hkey2,NULL,0,REG_SZ, (LPVOID)ptr,
1137 strlenW(ptr)*sizeof(WCHAR));
1139 HeapFree(GetProcessHeap(), 0, keyname);
1150 uirow = MSI_CreateRecord(1);
1152 MSI_RecordSetStringW(uirow,1,package->classes[i].CLSID);
1153 ui_actiondata(package,szRegisterClassInfo,uirow);
1154 msiobj_release(&uirow->hdr);
1161 static UINT register_progid_base(MSIPACKAGE* package, MSIPROGID* progid,
1164 static const WCHAR szCLSID[] = { 'C','L','S','I','D',0 };
1165 static const WCHAR szDefaultIcon[] =
1166 {'D','e','f','a','u','l','t','I','c','o','n',0};
1169 RegCreateKeyW(HKEY_CLASSES_ROOT,progid->ProgID,&hkey);
1171 if (progid->Description)
1173 RegSetValueExW(hkey,NULL,0,REG_SZ,
1174 (LPVOID)progid->Description,
1175 (strlenW(progid->Description)+1) *
1179 if (progid->ClassIndex >= 0)
1181 RegCreateKeyW(hkey,szCLSID,&hkey2);
1182 RegSetValueExW(hkey2,NULL,0,REG_SZ,
1183 (LPVOID)package->classes[progid->ClassIndex].CLSID,
1184 (strlenW(package->classes[progid->ClassIndex].CLSID)+1)
1188 strcpyW(clsid,package->classes[progid->ClassIndex].CLSID);
1194 FIXME("UNHANDLED case, Parent progid but classid is NULL\n");
1197 if (progid->IconPath)
1199 RegCreateKeyW(hkey,szDefaultIcon,&hkey2);
1201 RegSetValueExW(hkey2,NULL,0,REG_SZ,(LPVOID)progid->IconPath,
1202 (strlenW(progid->IconPath)+1) * sizeof(WCHAR));
1205 return ERROR_SUCCESS;
1208 static UINT register_progid(MSIPACKAGE *package, MSIPROGID* progid,
1211 UINT rc = ERROR_SUCCESS;
1213 if (progid->ParentIndex < 0)
1214 rc = register_progid_base(package, progid, clsid);
1219 static const WCHAR szCLSID[] = { 'C','L','S','I','D',0 };
1220 static const WCHAR szDefaultIcon[] =
1221 {'D','e','f','a','u','l','t','I','c','o','n',0};
1222 static const WCHAR szCurVer[] =
1223 {'C','u','r','V','e','r',0};
1225 /* check if already registered */
1226 RegCreateKeyExW(HKEY_CLASSES_ROOT, progid->ProgID, 0, NULL, 0,
1227 KEY_ALL_ACCESS, NULL, &hkey, &disp );
1228 if (disp == REG_OPENED_EXISTING_KEY)
1230 TRACE("Key already registered\n");
1235 TRACE("Registering Parent %s index %i\n",
1236 debugstr_w(package->progids[progid->ParentIndex].ProgID),
1237 progid->ParentIndex);
1238 rc = register_progid(package,&package->progids[progid->ParentIndex],
1241 /* clsid is same as parent */
1242 RegCreateKeyW(hkey,szCLSID,&hkey2);
1243 RegSetValueExW(hkey2,NULL,0,REG_SZ,(LPVOID)clsid, (strlenW(clsid)+1) *
1249 if (progid->Description)
1251 RegSetValueExW(hkey,NULL,0,REG_SZ,(LPVOID)progid->Description,
1252 (strlenW(progid->Description)+1) * sizeof(WCHAR));
1255 if (progid->IconPath)
1257 RegCreateKeyW(hkey,szDefaultIcon,&hkey2);
1258 RegSetValueExW(hkey2,NULL,0,REG_SZ,(LPVOID)progid->IconPath,
1259 (strlenW(progid->IconPath)+1) * sizeof(WCHAR));
1263 /* write out the current version */
1264 if (progid->CurVerIndex >= 0)
1266 RegCreateKeyW(hkey,szCurVer,&hkey2);
1267 RegSetValueExW(hkey2,NULL,0,REG_SZ,
1268 (LPVOID)package->progids[progid->CurVerIndex].ProgID,
1269 (strlenW(package->progids[progid->CurVerIndex].ProgID)+1) *
1279 UINT ACTION_RegisterProgIdInfo(MSIPACKAGE *package)
1285 return ERROR_INVALID_HANDLE;
1287 load_classes_and_such(package);
1289 for (i = 0; i < package->loaded_progids; i++)
1291 WCHAR clsid[0x1000];
1293 /* check if this progid is to be installed */
1294 package->progids[i].InstallMe = ((package->progids[i].InstallMe) ||
1295 (package->progids[i].ClassIndex >= 0 &&
1296 package->classes[package->progids[i].ClassIndex].Installed));
1298 if (!package->progids[i].InstallMe)
1300 TRACE("progid %s not scheduled to be installed\n",
1301 debugstr_w(package->progids[i].ProgID));
1305 TRACE("Registering progid %s index %i\n",
1306 debugstr_w(package->progids[i].ProgID), i);
1308 register_progid(package,&package->progids[i],clsid);
1310 uirow = MSI_CreateRecord(1);
1311 MSI_RecordSetStringW(uirow,1,package->progids[i].ProgID);
1312 ui_actiondata(package,szRegisterProgIdInfo,uirow);
1313 msiobj_release(&uirow->hdr);
1316 return ERROR_SUCCESS;
1319 static UINT register_verb(MSIPACKAGE *package, LPCWSTR progid,
1320 MSICOMPONENT* component, MSIEXTENSION* extension,
1321 MSIVERB* verb, INT* Sequence )
1325 static const WCHAR szShell[] = {'s','h','e','l','l',0};
1326 static const WCHAR szCommand[] = {'c','o','m','m','a','n','d',0};
1327 static const WCHAR fmt[] = {'\"','%','s','\"',' ','%','s',0};
1328 static const WCHAR fmt2[] = {'\"','%','s','\"',0};
1333 keyname = build_directory_name(4, progid, szShell, verb->Verb, szCommand);
1335 TRACE("Making Key %s\n",debugstr_w(keyname));
1336 RegCreateKeyW(HKEY_CLASSES_ROOT, keyname, &key);
1337 size = strlenW(component->FullKeypath);
1339 size += strlenW(verb->Argument);
1342 command = HeapAlloc(GetProcessHeap(),0, size * sizeof (WCHAR));
1344 sprintfW(command, fmt, component->FullKeypath, verb->Argument);
1346 sprintfW(command, fmt2, component->FullKeypath);
1348 RegSetValueExW(key,NULL,0,REG_SZ, (LPVOID)command, (strlenW(command)+1)*
1350 HeapFree(GetProcessHeap(),0,command);
1352 advertise = create_component_advertise_string(package, component,
1353 package->features[extension->FeatureIndex].Feature);
1355 size = strlenW(advertise);
1358 size += strlenW(verb->Argument);
1361 command = HeapAlloc(GetProcessHeap(),0, size * sizeof (WCHAR));
1362 memset(command,0,size*sizeof(WCHAR));
1364 strcpyW(command,advertise);
1367 static const WCHAR szSpace[] = {' ',0};
1368 strcatW(command,szSpace);
1369 strcatW(command,verb->Argument);
1372 RegSetValueExW(key, szCommand, 0, REG_MULTI_SZ, (LPBYTE)command,
1373 (strlenW(command)+2)*sizeof(WCHAR));
1376 HeapFree(GetProcessHeap(),0,keyname);
1377 HeapFree(GetProcessHeap(),0,advertise);
1378 HeapFree(GetProcessHeap(),0,command);
1382 keyname = build_directory_name(3, progid, szShell, verb->Verb);
1383 RegCreateKeyW(HKEY_CLASSES_ROOT, keyname, &key);
1384 RegSetValueExW(key,NULL,0,REG_SZ, (LPVOID)verb->Command,
1385 (strlenW(verb->Command)+1) *sizeof(WCHAR));
1387 HeapFree(GetProcessHeap(),0,keyname);
1390 if (verb->Sequence != MSI_NULL_INTEGER)
1392 if (*Sequence == MSI_NULL_INTEGER || verb->Sequence < *Sequence)
1394 *Sequence = verb->Sequence;
1395 keyname = build_directory_name(2, progid, szShell);
1396 RegCreateKeyW(HKEY_CLASSES_ROOT, keyname, &key);
1397 RegSetValueExW(key,NULL,0,REG_SZ, (LPVOID)verb->Verb,
1398 (strlenW(verb->Verb)+1) *sizeof(WCHAR));
1400 HeapFree(GetProcessHeap(),0,keyname);
1403 return ERROR_SUCCESS;
1406 UINT ACTION_RegisterExtensionInfo(MSIPACKAGE *package)
1408 static const WCHAR szContentType[] =
1409 {'C','o','n','t','e','n','t',' ','T','y','p','e',0 };
1413 BOOL install_on_demand = TRUE;
1416 return ERROR_INVALID_HANDLE;
1418 load_classes_and_such(package);
1420 /* We need to set install_on_demand based on if the shell handles advertised
1421 * shortcuts and the like. Because Mike McCormack is working on this i am
1422 * going to default to TRUE
1425 for (i = 0; i < package->loaded_extensions; i++)
1427 WCHAR extension[257];
1430 index = package->extensions[i].ComponentIndex;
1431 f_index = package->extensions[i].FeatureIndex;
1437 * yes. MSDN says that these are based on _Feature_ not on
1438 * Component. So verify the feature is to be installed
1440 if ((!ACTION_VerifyFeatureForAction(package, f_index,
1441 INSTALLSTATE_LOCAL)) &&
1442 !(install_on_demand && ACTION_VerifyFeatureForAction(package,
1443 f_index, INSTALLSTATE_ADVERTISED)))
1445 TRACE("Skipping extension %s reg due to disabled feature %s\n",
1446 debugstr_w(package->extensions[i].Extension),
1447 debugstr_w(package->features[f_index].Feature));
1452 TRACE("Registering extension %s index %i\n",
1453 debugstr_w(package->extensions[i].Extension), i);
1455 package->extensions[i].Installed = TRUE;
1457 /* this is only registered if the extension has at least 1 verb
1460 if (package->extensions[i].ProgIDIndex >= 0 &&
1461 package->extensions[i].VerbCount > 0)
1462 mark_progid_for_install(package, package->extensions[i].ProgIDIndex);
1464 if (package->extensions[i].MIMEIndex >= 0)
1465 mark_mime_for_install(package, package->extensions[i].MIMEIndex);
1469 strcatW(extension,package->extensions[i].Extension);
1471 RegCreateKeyW(HKEY_CLASSES_ROOT,extension,&hkey);
1473 if (package->extensions[i].MIMEIndex >= 0)
1475 RegSetValueExW(hkey,szContentType,0,REG_SZ,
1476 (LPVOID)package->mimes[package->extensions[i].
1477 MIMEIndex].ContentType,
1478 (strlenW(package->mimes[package->extensions[i].
1479 MIMEIndex].ContentType)+1)*sizeof(WCHAR));
1482 if (package->extensions[i].ProgIDIndex >= 0 ||
1483 package->extensions[i].ProgIDText)
1485 static const WCHAR szSN[] =
1486 {'\\','S','h','e','l','l','N','e','w',0};
1491 INT Sequence = MSI_NULL_INTEGER;
1493 if (package->extensions[i].ProgIDIndex >= 0)
1494 progid = package->progids[package->extensions[i].
1495 ProgIDIndex].ProgID;
1497 progid = package->extensions[i].ProgIDText;
1499 RegSetValueExW(hkey,NULL,0,REG_SZ,(LPVOID)progid,
1500 (strlenW(progid)+1)*sizeof(WCHAR));
1502 newkey = HeapAlloc(GetProcessHeap(),0,
1503 (strlenW(progid)+strlenW(szSN)+1) * sizeof(WCHAR));
1505 strcpyW(newkey,progid);
1506 strcatW(newkey,szSN);
1507 RegCreateKeyW(hkey,newkey,&hkey2);
1510 HeapFree(GetProcessHeap(),0,newkey);
1512 /* do all the verbs */
1513 for (v = 0; v < package->extensions[i].VerbCount; v++)
1514 register_verb(package, progid,
1515 &package->components[index],
1516 &package->extensions[i],
1517 &package->verbs[package->extensions[i].Verbs[v]],
1523 uirow = MSI_CreateRecord(1);
1524 MSI_RecordSetStringW(uirow,1,package->extensions[i].Extension);
1525 ui_actiondata(package,szRegisterExtensionInfo,uirow);
1526 msiobj_release(&uirow->hdr);
1529 return ERROR_SUCCESS;
1532 UINT ACTION_RegisterMIMEInfo(MSIPACKAGE *package)
1534 static const WCHAR szExten[] =
1535 {'E','x','t','e','n','s','i','o','n',0 };
1541 return ERROR_INVALID_HANDLE;
1543 load_classes_and_such(package);
1545 for (i = 0; i < package->loaded_mimes; i++)
1547 WCHAR extension[257];
1550 static const WCHAR fmt[] =
1551 {'M','I','M','E','\\','D','a','t','a','b','a','s','e','\\',
1552 'C','o','n','t','e','n','t',' ','T','y','p','e','\\', '%','s',0};
1556 * check if the MIME is to be installed. Either as requesed by an
1557 * extension or Class
1559 package->mimes[i].InstallMe = ((package->mimes[i].InstallMe) ||
1560 (package->mimes[i].ClassIndex >= 0 &&
1561 package->classes[package->mimes[i].ClassIndex].Installed) ||
1562 (package->mimes[i].ExtensionIndex >=0 &&
1563 package->extensions[package->mimes[i].ExtensionIndex].Installed));
1565 if (!package->mimes[i].InstallMe)
1567 TRACE("MIME %s not scheduled to be installed\n",
1568 debugstr_w(package->mimes[i].ContentType));
1572 mime = package->mimes[i].ContentType;
1573 exten = package->extensions[package->mimes[i].ExtensionIndex].Extension;
1576 strcatW(extension,exten);
1578 key = HeapAlloc(GetProcessHeap(),0,(strlenW(mime)+strlenW(fmt)+1) *
1580 sprintfW(key,fmt,mime);
1581 RegCreateKeyW(HKEY_CLASSES_ROOT,key,&hkey);
1582 RegSetValueExW(hkey,szExten,0,REG_SZ,(LPVOID)extension,
1583 (strlenW(extension)+1)*sizeof(WCHAR));
1585 HeapFree(GetProcessHeap(),0,key);
1587 if (package->mimes[i].CLSID[0])
1589 FIXME("Handle non null for field 3\n");
1594 uirow = MSI_CreateRecord(2);
1595 MSI_RecordSetStringW(uirow,1,package->mimes[i].ContentType);
1596 MSI_RecordSetStringW(uirow,2,exten);
1597 ui_actiondata(package,szRegisterMIMEInfo,uirow);
1598 msiobj_release(&uirow->hdr);
1601 return ERROR_SUCCESS;