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].Component = get_loaded_component(package, buffer);
258 package->classes[index].ProgIDText = load_dynamic_stringW(row,4);
259 package->classes[index].ProgIDIndex =
260 load_given_progid(package, package->classes[index].ProgIDText);
262 package->classes[index].Description = load_dynamic_stringW(row,5);
264 buffer = MSI_RecordGetString(row,6);
266 package->classes[index].AppIDIndex =
267 load_given_appid(package, buffer);
269 package->classes[index].AppIDIndex = -1;
271 package->classes[index].FileTypeMask = load_dynamic_stringW(row,7);
273 if (!MSI_RecordIsNull(row,9))
276 INT icon_index = MSI_RecordGetInteger(row,9);
277 LPWSTR FileName = load_dynamic_stringW(row,8);
279 static const WCHAR fmt[] = {'%','s',',','%','i',0};
281 build_icon_path(package,FileName,&FilePath);
283 package->classes[index].IconPath =
284 HeapAlloc(GetProcessHeap(),0,(strlenW(FilePath)+5)*
287 sprintfW(package->classes[index].IconPath,fmt,FilePath,icon_index);
289 HeapFree(GetProcessHeap(),0,FilePath);
290 HeapFree(GetProcessHeap(),0,FileName);
294 buffer = MSI_RecordGetString(row,8);
296 build_icon_path(package,buffer,&(package->classes[index].IconPath));
299 if (!MSI_RecordIsNull(row,10))
301 i = MSI_RecordGetInteger(row,10);
302 if (i != MSI_NULL_INTEGER && i > 0 && i < 4)
304 static const WCHAR ole2[] = {'o','l','e','2','.','d','l','l',0};
305 static const WCHAR ole32[] = {'o','l','e','3','2','.','d','l','l',0};
310 package->classes[index].DefInprocHandler = strdupW(ole2);
313 package->classes[index].DefInprocHandler32 = strdupW(ole32);
316 package->classes[index].DefInprocHandler = strdupW(ole2);
317 package->classes[index].DefInprocHandler32 = strdupW(ole32);
323 package->classes[index].DefInprocHandler32 = load_dynamic_stringW(
325 reduce_to_longfilename(package->classes[index].DefInprocHandler32);
328 buffer = MSI_RecordGetString(row,11);
329 deformat_string(package,buffer,&package->classes[index].Argument);
331 buffer = MSI_RecordGetString(row,12);
332 package->classes[index].FeatureIndex = get_loaded_feature(package,buffer);
334 package->classes[index].Attributes = MSI_RecordGetInteger(row,13);
340 * the Class table has 3 primary keys. Generally it is only
341 * referenced through the first CLSID key. However when loading
342 * all of the classes we need to make sure we do not ignore rows
343 * with other Context and ComponentIndexs
345 static INT load_given_class(MSIPACKAGE *package, LPCWSTR classid)
350 static const WCHAR ExecSeqQuery[] =
351 {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
352 '`','C','l','a','s','s','`',' ','W','H','E','R','E',' ',
353 '`','C','L','S','I','D','`',' ','=',' ','\'','%','s','\'',0};
359 /* check for classes already loaded */
360 for (i = 0; i < package->loaded_classes; i++)
361 if (strcmpiW(package->classes[i].CLSID,classid)==0)
363 TRACE("found class %s at index %i\n",debugstr_w(classid), i);
367 row = MSI_QueryGetRecord(package->db, ExecSeqQuery, classid);
371 rc = load_class(package, row);
372 msiobj_release(&row->hdr);
377 static INT load_given_extension(MSIPACKAGE *package, LPCWSTR extension);
379 static INT load_mime(MSIPACKAGE* package, MSIRECORD *row)
381 DWORD index = package->loaded_mimes;
385 /* fill in the data */
387 package->loaded_mimes++;
388 if (package->loaded_mimes== 1)
389 package->mimes= HeapAlloc(GetProcessHeap(),0,sizeof(MSIMIME));
391 package->mimes= HeapReAlloc(GetProcessHeap(),0,
392 package->mimes, package->loaded_mimes*
395 memset(&package->mimes[index],0,sizeof(MSIMIME));
397 package->mimes[index].ContentType = load_dynamic_stringW(row,1);
398 TRACE("loading mime %s\n",debugstr_w(package->mimes[index].ContentType));
400 buffer = MSI_RecordGetString(row,2);
401 package->mimes[index].ExtensionIndex = load_given_extension(package,
404 sz = IDENTIFIER_SIZE;
405 MSI_RecordGetStringW(row,3,package->mimes[index].CLSID,&sz);
406 package->mimes[index].ClassIndex= load_given_class(package,
407 package->mimes[index].CLSID);
412 static INT load_given_mime(MSIPACKAGE *package, LPCWSTR mime)
417 static const WCHAR ExecSeqQuery[] =
418 {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
419 '`','M','I','M','E','`',' ','W','H','E','R','E',' ',
420 '`','C','o','n','t','e','n','t','T','y','p','e','`',' ','=',' ',
421 '\'','%','s','\'',0};
426 /* check for mime already loaded */
427 for (i = 0; i < package->loaded_mimes; i++)
428 if (strcmpiW(package->mimes[i].ContentType,mime)==0)
430 TRACE("found mime %s at index %i\n",debugstr_w(mime), i);
434 row = MSI_QueryGetRecord(package->db, ExecSeqQuery, mime);
438 rc = load_mime(package, row);
439 msiobj_release(&row->hdr);
444 static INT load_extension(MSIPACKAGE* package, MSIRECORD *row)
446 DWORD index = package->loaded_extensions;
450 /* fill in the data */
452 package->loaded_extensions++;
453 if (package->loaded_extensions == 1)
454 package->extensions = HeapAlloc(GetProcessHeap(),0,sizeof(MSIEXTENSION));
456 package->extensions = HeapReAlloc(GetProcessHeap(),0,
457 package->extensions, package->loaded_extensions*
458 sizeof(MSIEXTENSION));
460 memset(&package->extensions[index],0,sizeof(MSIEXTENSION));
463 MSI_RecordGetStringW(row,1,package->extensions[index].Extension,&sz);
464 TRACE("loading extension %s\n",
465 debugstr_w(package->extensions[index].Extension));
467 buffer = MSI_RecordGetString(row,2);
468 package->extensions[index].Component = get_loaded_component(package,buffer);
470 package->extensions[index].ProgIDText = load_dynamic_stringW(row,3);
471 package->extensions[index].ProgIDIndex = load_given_progid(package,
472 package->extensions[index].ProgIDText);
474 buffer = MSI_RecordGetString(row,4);
475 package->extensions[index].MIMEIndex = load_given_mime(package,buffer);
477 buffer = MSI_RecordGetString(row,5);
478 package->extensions[index].FeatureIndex =
479 get_loaded_feature(package,buffer);
485 * While the extension table has 2 primary keys, this function is only looking
486 * at the Extension key which is what is referenced as a forign key
488 static INT load_given_extension(MSIPACKAGE *package, LPCWSTR extension)
493 static const WCHAR ExecSeqQuery[] =
494 {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
495 '`','E','x','t','e','n','s','i','o','n','`',' ',
496 'W','H','E','R','E',' ',
497 '`','E','x','t','e','n','s','i','o','n','`',' ','=',' ',
498 '\'','%','s','\'',0};
503 /* check for extensions already loaded */
504 for (i = 0; i < package->loaded_extensions; i++)
505 if (strcmpiW(package->extensions[i].Extension,extension)==0)
507 TRACE("extension %s already loaded at %i\n",debugstr_w(extension),
512 row = MSI_QueryGetRecord(package->db, ExecSeqQuery, extension);
516 rc = load_extension(package, row);
517 msiobj_release(&row->hdr);
522 static UINT iterate_load_verb(MSIRECORD *row, LPVOID param)
524 MSIPACKAGE* package = (MSIPACKAGE*)param;
525 DWORD index = package->loaded_verbs;
528 /* fill in the data */
530 package->loaded_verbs++;
531 if (package->loaded_verbs == 1)
532 package->verbs = HeapAlloc(GetProcessHeap(),0,sizeof(MSIVERB));
534 package->verbs = HeapReAlloc(GetProcessHeap(),0,
535 package->verbs , package->loaded_verbs * sizeof(MSIVERB));
537 memset(&package->verbs[index],0,sizeof(MSIVERB));
539 buffer = MSI_RecordGetString(row,1);
540 package->verbs[index].ExtensionIndex = load_given_extension(package,buffer);
541 if (package->verbs[index].ExtensionIndex < 0 && buffer)
542 ERR("Verb unable to find loaded extension %s\n", debugstr_w(buffer));
544 package->verbs[index].Verb = load_dynamic_stringW(row,2);
545 TRACE("loading verb %s\n",debugstr_w(package->verbs[index].Verb));
546 package->verbs[index].Sequence = MSI_RecordGetInteger(row,3);
548 buffer = MSI_RecordGetString(row,4);
549 deformat_string(package,buffer,&package->verbs[index].Command);
551 buffer = MSI_RecordGetString(row,5);
552 deformat_string(package,buffer,&package->verbs[index].Argument);
554 /* assosiate the verb with the correct extension */
555 if (package->verbs[index].ExtensionIndex >= 0)
557 MSIEXTENSION* extension = &package->extensions[package->verbs[index].
559 int count = extension->VerbCount;
562 FIXME("Exceeding max verb count! Increase that limit!!!\n");
565 extension->VerbCount++;
566 extension->Verbs[count] = index;
570 return ERROR_SUCCESS;
573 static UINT iterate_all_classes(MSIRECORD *rec, LPVOID param)
579 MSIPACKAGE* package =(MSIPACKAGE*)param;
583 clsid = MSI_RecordGetString(rec,1);
584 context = MSI_RecordGetString(rec,2);
585 buffer = MSI_RecordGetString(rec,3);
586 comp = get_loaded_component(package,buffer);
588 for (i = 0; i < package->loaded_classes; i++)
590 if (strcmpiW(clsid,package->classes[i].CLSID))
592 if (strcmpW(context,package->classes[i].Context))
594 if (comp == package->classes[i].Component)
602 load_class(package, rec);
604 return ERROR_SUCCESS;
607 static VOID load_all_classes(MSIPACKAGE *package)
609 UINT rc = ERROR_SUCCESS;
612 static const WCHAR ExecSeqQuery[] =
613 {'S','E','L','E','C','T',' ','*',' ', 'F','R','O','M',' ',
614 '`','C','l','a','s','s','`',0};
616 rc = MSI_DatabaseOpenViewW(package->db, ExecSeqQuery, &view);
617 if (rc != ERROR_SUCCESS)
620 rc = MSI_IterateRecords(view, NULL, iterate_all_classes, package);
621 msiobj_release(&view->hdr);
624 static UINT iterate_all_extensions(MSIRECORD *rec, LPVOID param)
629 MSIPACKAGE* package =(MSIPACKAGE*)param;
633 extension = MSI_RecordGetString(rec,1);
634 buffer = MSI_RecordGetString(rec,2);
635 comp = get_loaded_component(package,buffer);
637 for (i = 0; i < package->loaded_extensions; i++)
639 if (strcmpiW(extension,package->extensions[i].Extension))
641 if (comp == package->extensions[i].Component)
649 load_extension(package, rec);
651 return ERROR_SUCCESS;
654 static VOID load_all_extensions(MSIPACKAGE *package)
656 UINT rc = ERROR_SUCCESS;
659 static const WCHAR ExecSeqQuery[] =
660 {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
661 '`','E','x','t','e','n','s','i','o','n','`',0};
663 rc = MSI_DatabaseOpenViewW(package->db, ExecSeqQuery, &view);
664 if (rc != ERROR_SUCCESS)
667 rc = MSI_IterateRecords(view, NULL, iterate_all_extensions, package);
668 msiobj_release(&view->hdr);
671 static UINT iterate_all_progids(MSIRECORD *rec, LPVOID param)
674 MSIPACKAGE* package =(MSIPACKAGE*)param;
676 buffer = MSI_RecordGetString(rec,1);
677 load_given_progid(package,buffer);
678 return ERROR_SUCCESS;
681 static VOID load_all_progids(MSIPACKAGE *package)
683 UINT rc = ERROR_SUCCESS;
686 static const WCHAR ExecSeqQuery[] =
687 {'S','E','L','E','C','T',' ','`','P','r','o','g','I','d','`',' ',
688 'F','R','O','M',' ', '`','P','r','o','g','I','d','`',0};
690 rc = MSI_DatabaseOpenViewW(package->db, ExecSeqQuery, &view);
691 if (rc != ERROR_SUCCESS)
694 rc = MSI_IterateRecords(view, NULL, iterate_all_progids, package);
695 msiobj_release(&view->hdr);
698 static VOID load_all_verbs(MSIPACKAGE *package)
700 UINT rc = ERROR_SUCCESS;
703 static const WCHAR ExecSeqQuery[] =
704 {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
705 '`','V','e','r','b','`',0};
707 rc = MSI_DatabaseOpenViewW(package->db, ExecSeqQuery, &view);
708 if (rc != ERROR_SUCCESS)
711 rc = MSI_IterateRecords(view, NULL, iterate_load_verb, package);
712 msiobj_release(&view->hdr);
715 static UINT iterate_all_mimes(MSIRECORD *rec, LPVOID param)
718 MSIPACKAGE* package =(MSIPACKAGE*)param;
720 buffer = MSI_RecordGetString(rec,1);
721 load_given_mime(package,buffer);
722 return ERROR_SUCCESS;
725 static VOID load_all_mimes(MSIPACKAGE *package)
727 UINT rc = ERROR_SUCCESS;
730 static const WCHAR ExecSeqQuery[] =
731 {'S','E','L','E','C','T',' ',
732 '`','C','o','n','t','e','n','t','T','y','p','e','`',
733 ' ','F','R','O','M',' ',
734 '`','M','I','M','E','`',0};
736 rc = MSI_DatabaseOpenViewW(package->db, ExecSeqQuery, &view);
737 if (rc != ERROR_SUCCESS)
740 rc = MSI_IterateRecords(view, NULL, iterate_all_mimes, package);
741 msiobj_release(&view->hdr);
744 static void load_classes_and_such(MSIPACKAGE *package)
746 TRACE("Loading all the class info and related tables\n");
748 /* check if already loaded */
749 if (package->classes || package->extensions || package->progids ||
750 package->verbs || package->mimes)
753 load_all_classes(package);
754 load_all_extensions(package);
755 load_all_progids(package);
756 /* these loads must come after the other loads */
757 load_all_verbs(package);
758 load_all_mimes(package);
761 static void mark_progid_for_install(MSIPACKAGE* package, INT index)
766 if (index < 0 || index >= package->loaded_progids)
769 progid = &package->progids[index];
771 if (progid->InstallMe == TRUE)
774 progid->InstallMe = TRUE;
776 /* all children if this is a parent also install */
777 for (i = 0; i < package->loaded_progids; i++)
778 if (package->progids[i].ParentIndex == index)
779 mark_progid_for_install(package,i);
782 static void mark_mime_for_install(MSIPACKAGE* package, INT index)
786 if (index < 0 || index >= package->loaded_mimes)
789 mime = &package->mimes[index];
791 if (mime->InstallMe == TRUE)
794 mime->InstallMe = TRUE;
797 static UINT register_appid(MSIPACKAGE *package, int appidIndex, LPCWSTR app )
799 static const WCHAR szAppID[] = { 'A','p','p','I','D',0 };
803 return ERROR_INVALID_HANDLE;
805 RegCreateKeyW(HKEY_CLASSES_ROOT,szAppID,&hkey2);
806 RegCreateKeyW(hkey2,package->appids[appidIndex].AppID,&hkey3);
807 RegSetValueExW(hkey3,NULL,0,REG_SZ,(LPVOID)app,
808 (strlenW(app)+1)*sizeof(WCHAR));
810 if (package->appids[appidIndex].RemoteServerName)
813 static const WCHAR szRemoteServerName[] =
814 {'R','e','m','o','t','e','S','e','r','v','e','r','N','a','m','e',
817 size = (strlenW(package->appids[appidIndex].RemoteServerName)+1) *
820 RegSetValueExW(hkey3,szRemoteServerName,0,REG_SZ,
821 (LPVOID)package->appids[appidIndex].RemoteServerName,
825 if (package->appids[appidIndex].LocalServer)
827 static const WCHAR szLocalService[] =
828 {'L','o','c','a','l','S','e','r','v','i','c','e',0};
830 size = (strlenW(package->appids[appidIndex].LocalServer)+1) *
833 RegSetValueExW(hkey3,szLocalService,0,REG_SZ,
834 (LPVOID)package->appids[appidIndex].LocalServer,size);
837 if (package->appids[appidIndex].ServiceParameters)
839 static const WCHAR szService[] =
840 {'S','e','r','v','i','c','e',
841 'P','a','r','a','m','e','t','e','r','s',0};
843 size = (strlenW(package->appids[appidIndex].ServiceParameters)+1) *
845 RegSetValueExW(hkey3,szService,0,REG_SZ,
846 (LPVOID)package->appids[appidIndex].ServiceParameters,
850 if (package->appids[appidIndex].DllSurrogate)
852 static const WCHAR szDLL[] =
853 {'D','l','l','S','u','r','r','o','g','a','t','e',0};
855 size = (strlenW(package->appids[appidIndex].DllSurrogate)+1) *
857 RegSetValueExW(hkey3,szDLL,0,REG_SZ,
858 (LPVOID)package->appids[appidIndex].DllSurrogate,size);
861 if (package->appids[appidIndex].ActivateAtStorage)
863 static const WCHAR szActivate[] =
864 {'A','c','t','i','v','a','t','e','A','s',
865 'S','t','o','r','a','g','e',0};
866 static const WCHAR szY[] = {'Y',0};
868 RegSetValueExW(hkey3,szActivate,0,REG_SZ,(LPVOID)szY,4);
871 if (package->appids[appidIndex].RunAsInteractiveUser)
873 static const WCHAR szRunAs[] = {'R','u','n','A','s',0};
874 static const WCHAR szUser[] =
875 {'I','n','t','e','r','a','c','t','i','v','e',' ',
878 RegSetValueExW(hkey3,szRunAs,0,REG_SZ,(LPVOID)szUser,sizeof(szUser));
883 return ERROR_SUCCESS;
886 UINT ACTION_RegisterClassInfo(MSIPACKAGE *package)
889 * Again I am assuming the words, "Whose key file represents" when referring
890 * to a Component as to meaning that Components KeyPath file
895 static const WCHAR szCLSID[] = { 'C','L','S','I','D',0 };
896 static const WCHAR szProgID[] = { 'P','r','o','g','I','D',0 };
897 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 };
898 static const WCHAR szAppID[] = { 'A','p','p','I','D',0 };
899 static const WCHAR szSpace[] = {' ',0};
900 static const WCHAR szInprocServer32[] = {'I','n','p','r','o','c','S','e','r','v','e','r','3','2',0};
901 static const WCHAR szFileType_fmt[] = {'F','i','l','e','T','y','p','e','\\','%','s','\\','%','i',0};
902 HKEY hkey,hkey2,hkey3;
903 BOOL install_on_demand = FALSE;
907 return ERROR_INVALID_HANDLE;
909 load_classes_and_such(package);
910 rc = RegCreateKeyW(HKEY_CLASSES_ROOT,szCLSID,&hkey);
911 if (rc != ERROR_SUCCESS)
912 return ERROR_FUNCTION_FAILED;
914 /* install_on_demand should be set if OLE supports install on demand OLE
915 * servers. For now i am defaulting to FALSE because i do not know how to
916 * check, and i am told our builtin OLE does not support it
919 for (i = 0; i < package->loaded_classes; i++)
926 comp = package->classes[i].Component;
930 f_index = package->classes[i].FeatureIndex;
933 * yes. MSDN says that these are based on _Feature_ not on
934 * Component. So verify the feature is to be installed
936 if ((!ACTION_VerifyFeatureForAction(package, f_index,
937 INSTALLSTATE_LOCAL)) &&
938 !(install_on_demand && ACTION_VerifyFeatureForAction(package,
939 f_index, INSTALLSTATE_ADVERTISED)))
941 TRACE("Skipping class %s reg due to disabled feature %s\n",
942 debugstr_w(package->classes[i].CLSID),
943 debugstr_w(package->features[f_index].Feature));
948 TRACE("Registering index %i class %s\n",i,
949 debugstr_w(package->classes[i].CLSID));
951 package->classes[i].Installed = TRUE;
952 if (package->classes[i].ProgIDIndex >= 0)
953 mark_progid_for_install(package, package->classes[i].ProgIDIndex);
955 RegCreateKeyW(hkey,package->classes[i].CLSID,&hkey2);
957 if (package->classes[i].Description)
958 RegSetValueExW(hkey2,NULL,0,REG_SZ,(LPVOID)package->classes[i].
959 Description, (strlenW(package->classes[i].
960 Description)+1)*sizeof(WCHAR));
962 RegCreateKeyW(hkey2,package->classes[i].Context,&hkey3);
963 index = get_loaded_file( package, comp->KeyPath );
966 /* the context server is a short path name
967 * except for if it is InprocServer32...
969 if (strcmpiW(package->classes[i].Context,szInprocServer32)!=0)
972 sz = GetShortPathNameW(package->files[index].TargetPath, NULL, 0);
975 ERR("Unable to find short path for CLSID COM Server\n");
980 size = sz * sizeof(WCHAR);
982 if (package->classes[i].Argument)
984 size += strlenW(package->classes[i].Argument) *
986 size += sizeof(WCHAR);
989 argument = HeapAlloc(GetProcessHeap(), 0, size + sizeof(WCHAR));
990 GetShortPathNameW(package->files[index].TargetPath, argument,
993 if (package->classes[i].Argument)
995 strcatW(argument,szSpace);
996 strcatW(argument,package->classes[i].Argument);
1002 size = lstrlenW(package->files[index].TargetPath) * sizeof(WCHAR);
1004 if (package->classes[i].Argument)
1006 size += strlenW(package->classes[i].Argument) * sizeof(WCHAR);
1007 size += sizeof(WCHAR);
1010 argument = HeapAlloc(GetProcessHeap(), 0, size + sizeof(WCHAR));
1011 strcpyW(argument, package->files[index].TargetPath);
1013 if (package->classes[i].Argument)
1015 strcatW(argument,szSpace);
1016 strcatW(argument,package->classes[i].Argument);
1022 RegSetValueExW(hkey3,NULL,0,REG_SZ, (LPVOID)argument, size);
1023 HeapFree(GetProcessHeap(),0,argument);
1028 if (package->classes[i].ProgIDIndex >= 0 ||
1029 package->classes[i].ProgIDText)
1033 if (package->classes[i].ProgIDIndex >= 0)
1034 progid = package->progids[
1035 package->classes[i].ProgIDIndex].ProgID;
1037 progid = package->classes[i].ProgIDText;
1039 RegCreateKeyW(hkey2,szProgID,&hkey3);
1040 RegSetValueExW(hkey3,NULL,0,REG_SZ,(LPVOID)progid,
1041 (strlenW(progid)+1) *sizeof(WCHAR));
1044 if (package->classes[i].ProgIDIndex >= 0 &&
1045 package->progids[package->classes[i].ProgIDIndex].
1046 VersionIndIndex >= 0)
1048 LPWSTR viprogid = strdupW(package->progids[package->progids[
1049 package->classes[i].ProgIDIndex].VersionIndIndex].
1051 RegCreateKeyW(hkey2,szVIProgID,&hkey3);
1052 RegSetValueExW(hkey3,NULL,0,REG_SZ,(LPVOID)viprogid,
1053 (strlenW(viprogid)+1) *sizeof(WCHAR));
1055 HeapFree(GetProcessHeap(), 0, viprogid);
1059 if (package->classes[i].AppIDIndex >= 0)
1061 RegSetValueExW(hkey2,szAppID,0,REG_SZ,
1062 (LPVOID)package->appids[package->classes[i].AppIDIndex].AppID,
1063 (strlenW(package->appids[package->classes[i].AppIDIndex].AppID)+1)
1066 register_appid(package,package->classes[i].AppIDIndex,
1067 package->classes[i].Description);
1070 if (package->classes[i].IconPath)
1072 static const WCHAR szDefaultIcon[] =
1073 {'D','e','f','a','u','l','t','I','c','o','n',0};
1075 RegCreateKeyW(hkey2,szDefaultIcon,&hkey3);
1077 RegSetValueExW(hkey3,NULL,0,REG_SZ,
1078 (LPVOID)package->classes[i].IconPath,
1079 (strlenW(package->classes[i].IconPath)+1) *
1085 if (package->classes[i].DefInprocHandler)
1087 static const WCHAR szInproc[] =
1088 {'I','n','p','r','o','c','H','a','n','d','l','e','r',0};
1090 size = (strlenW(package->classes[i].DefInprocHandler) + 1) *
1092 RegCreateKeyW(hkey2,szInproc,&hkey3);
1093 RegSetValueExW(hkey3,NULL,0,REG_SZ,
1094 (LPVOID)package->classes[i].DefInprocHandler, size);
1098 if (package->classes[i].DefInprocHandler32)
1100 static const WCHAR szInproc32[] =
1101 {'I','n','p','r','o','c','H','a','n','d','l','e','r','3','2',
1103 size = (strlenW(package->classes[i].DefInprocHandler32) + 1) *
1106 RegCreateKeyW(hkey2,szInproc32,&hkey3);
1107 RegSetValueExW(hkey3,NULL,0,REG_SZ,
1108 (LPVOID)package->classes[i].DefInprocHandler32,size);
1114 /* if there is a FileTypeMask, register the FileType */
1115 if (package->classes[i].FileTypeMask)
1120 ptr = package->classes[i].FileTypeMask;
1123 ptr2 = strchrW(ptr,';');
1126 keyname = HeapAlloc(GetProcessHeap(),0,(strlenW(szFileType_fmt)+
1127 strlenW(package->classes[i].CLSID) + 4)
1129 sprintfW(keyname,szFileType_fmt, package->classes[i].CLSID,
1132 RegCreateKeyW(HKEY_CLASSES_ROOT,keyname,&hkey2);
1133 RegSetValueExW(hkey2,NULL,0,REG_SZ, (LPVOID)ptr,
1134 strlenW(ptr)*sizeof(WCHAR));
1136 HeapFree(GetProcessHeap(), 0, keyname);
1147 uirow = MSI_CreateRecord(1);
1149 MSI_RecordSetStringW(uirow,1,package->classes[i].CLSID);
1150 ui_actiondata(package,szRegisterClassInfo,uirow);
1151 msiobj_release(&uirow->hdr);
1158 static UINT register_progid_base(MSIPACKAGE* package, MSIPROGID* progid,
1161 static const WCHAR szCLSID[] = { 'C','L','S','I','D',0 };
1162 static const WCHAR szDefaultIcon[] =
1163 {'D','e','f','a','u','l','t','I','c','o','n',0};
1166 RegCreateKeyW(HKEY_CLASSES_ROOT,progid->ProgID,&hkey);
1168 if (progid->Description)
1170 RegSetValueExW(hkey,NULL,0,REG_SZ,
1171 (LPVOID)progid->Description,
1172 (strlenW(progid->Description)+1) *
1176 if (progid->ClassIndex >= 0)
1178 RegCreateKeyW(hkey,szCLSID,&hkey2);
1179 RegSetValueExW(hkey2,NULL,0,REG_SZ,
1180 (LPVOID)package->classes[progid->ClassIndex].CLSID,
1181 (strlenW(package->classes[progid->ClassIndex].CLSID)+1)
1185 strcpyW(clsid,package->classes[progid->ClassIndex].CLSID);
1191 FIXME("UNHANDLED case, Parent progid but classid is NULL\n");
1194 if (progid->IconPath)
1196 RegCreateKeyW(hkey,szDefaultIcon,&hkey2);
1198 RegSetValueExW(hkey2,NULL,0,REG_SZ,(LPVOID)progid->IconPath,
1199 (strlenW(progid->IconPath)+1) * sizeof(WCHAR));
1202 return ERROR_SUCCESS;
1205 static UINT register_progid(MSIPACKAGE *package, MSIPROGID* progid,
1208 UINT rc = ERROR_SUCCESS;
1210 if (progid->ParentIndex < 0)
1211 rc = register_progid_base(package, progid, clsid);
1216 static const WCHAR szCLSID[] = { 'C','L','S','I','D',0 };
1217 static const WCHAR szDefaultIcon[] =
1218 {'D','e','f','a','u','l','t','I','c','o','n',0};
1219 static const WCHAR szCurVer[] =
1220 {'C','u','r','V','e','r',0};
1222 /* check if already registered */
1223 RegCreateKeyExW(HKEY_CLASSES_ROOT, progid->ProgID, 0, NULL, 0,
1224 KEY_ALL_ACCESS, NULL, &hkey, &disp );
1225 if (disp == REG_OPENED_EXISTING_KEY)
1227 TRACE("Key already registered\n");
1232 TRACE("Registering Parent %s index %i\n",
1233 debugstr_w(package->progids[progid->ParentIndex].ProgID),
1234 progid->ParentIndex);
1235 rc = register_progid(package,&package->progids[progid->ParentIndex],
1238 /* clsid is same as parent */
1239 RegCreateKeyW(hkey,szCLSID,&hkey2);
1240 RegSetValueExW(hkey2,NULL,0,REG_SZ,(LPVOID)clsid, (strlenW(clsid)+1) *
1246 if (progid->Description)
1248 RegSetValueExW(hkey,NULL,0,REG_SZ,(LPVOID)progid->Description,
1249 (strlenW(progid->Description)+1) * sizeof(WCHAR));
1252 if (progid->IconPath)
1254 RegCreateKeyW(hkey,szDefaultIcon,&hkey2);
1255 RegSetValueExW(hkey2,NULL,0,REG_SZ,(LPVOID)progid->IconPath,
1256 (strlenW(progid->IconPath)+1) * sizeof(WCHAR));
1260 /* write out the current version */
1261 if (progid->CurVerIndex >= 0)
1263 RegCreateKeyW(hkey,szCurVer,&hkey2);
1264 RegSetValueExW(hkey2,NULL,0,REG_SZ,
1265 (LPVOID)package->progids[progid->CurVerIndex].ProgID,
1266 (strlenW(package->progids[progid->CurVerIndex].ProgID)+1) *
1276 UINT ACTION_RegisterProgIdInfo(MSIPACKAGE *package)
1282 return ERROR_INVALID_HANDLE;
1284 load_classes_and_such(package);
1286 for (i = 0; i < package->loaded_progids; i++)
1288 WCHAR clsid[0x1000];
1290 /* check if this progid is to be installed */
1291 package->progids[i].InstallMe = ((package->progids[i].InstallMe) ||
1292 (package->progids[i].ClassIndex >= 0 &&
1293 package->classes[package->progids[i].ClassIndex].Installed));
1295 if (!package->progids[i].InstallMe)
1297 TRACE("progid %s not scheduled to be installed\n",
1298 debugstr_w(package->progids[i].ProgID));
1302 TRACE("Registering progid %s index %i\n",
1303 debugstr_w(package->progids[i].ProgID), i);
1305 register_progid(package,&package->progids[i],clsid);
1307 uirow = MSI_CreateRecord(1);
1308 MSI_RecordSetStringW(uirow,1,package->progids[i].ProgID);
1309 ui_actiondata(package,szRegisterProgIdInfo,uirow);
1310 msiobj_release(&uirow->hdr);
1313 return ERROR_SUCCESS;
1316 static UINT register_verb(MSIPACKAGE *package, LPCWSTR progid,
1317 MSICOMPONENT* component, MSIEXTENSION* extension,
1318 MSIVERB* verb, INT* Sequence )
1322 static const WCHAR szShell[] = {'s','h','e','l','l',0};
1323 static const WCHAR szCommand[] = {'c','o','m','m','a','n','d',0};
1324 static const WCHAR fmt[] = {'\"','%','s','\"',' ','%','s',0};
1325 static const WCHAR fmt2[] = {'\"','%','s','\"',0};
1330 keyname = build_directory_name(4, progid, szShell, verb->Verb, szCommand);
1332 TRACE("Making Key %s\n",debugstr_w(keyname));
1333 RegCreateKeyW(HKEY_CLASSES_ROOT, keyname, &key);
1334 size = strlenW(component->FullKeypath);
1336 size += strlenW(verb->Argument);
1339 command = HeapAlloc(GetProcessHeap(),0, size * sizeof (WCHAR));
1341 sprintfW(command, fmt, component->FullKeypath, verb->Argument);
1343 sprintfW(command, fmt2, component->FullKeypath);
1345 RegSetValueExW(key,NULL,0,REG_SZ, (LPVOID)command, (strlenW(command)+1)*
1347 HeapFree(GetProcessHeap(),0,command);
1349 advertise = create_component_advertise_string(package, component,
1350 package->features[extension->FeatureIndex].Feature);
1352 size = strlenW(advertise);
1355 size += strlenW(verb->Argument);
1358 command = HeapAlloc(GetProcessHeap(),0, size * sizeof (WCHAR));
1359 memset(command,0,size*sizeof(WCHAR));
1361 strcpyW(command,advertise);
1364 static const WCHAR szSpace[] = {' ',0};
1365 strcatW(command,szSpace);
1366 strcatW(command,verb->Argument);
1369 RegSetValueExW(key, szCommand, 0, REG_MULTI_SZ, (LPBYTE)command,
1370 (strlenW(command)+2)*sizeof(WCHAR));
1373 HeapFree(GetProcessHeap(),0,keyname);
1374 HeapFree(GetProcessHeap(),0,advertise);
1375 HeapFree(GetProcessHeap(),0,command);
1379 keyname = build_directory_name(3, progid, szShell, verb->Verb);
1380 RegCreateKeyW(HKEY_CLASSES_ROOT, keyname, &key);
1381 RegSetValueExW(key,NULL,0,REG_SZ, (LPVOID)verb->Command,
1382 (strlenW(verb->Command)+1) *sizeof(WCHAR));
1384 HeapFree(GetProcessHeap(),0,keyname);
1387 if (verb->Sequence != MSI_NULL_INTEGER)
1389 if (*Sequence == MSI_NULL_INTEGER || verb->Sequence < *Sequence)
1391 *Sequence = verb->Sequence;
1392 keyname = build_directory_name(2, progid, szShell);
1393 RegCreateKeyW(HKEY_CLASSES_ROOT, keyname, &key);
1394 RegSetValueExW(key,NULL,0,REG_SZ, (LPVOID)verb->Verb,
1395 (strlenW(verb->Verb)+1) *sizeof(WCHAR));
1397 HeapFree(GetProcessHeap(),0,keyname);
1400 return ERROR_SUCCESS;
1403 UINT ACTION_RegisterExtensionInfo(MSIPACKAGE *package)
1405 static const WCHAR szContentType[] =
1406 {'C','o','n','t','e','n','t',' ','T','y','p','e',0 };
1410 BOOL install_on_demand = TRUE;
1413 return ERROR_INVALID_HANDLE;
1415 load_classes_and_such(package);
1417 /* We need to set install_on_demand based on if the shell handles advertised
1418 * shortcuts and the like. Because Mike McCormack is working on this i am
1419 * going to default to TRUE
1422 for (i = 0; i < package->loaded_extensions; i++)
1424 WCHAR extension[257];
1427 if (!package->extensions[i].Component)
1430 f_index = package->extensions[i].FeatureIndex;
1433 * yes. MSDN says that these are based on _Feature_ not on
1434 * Component. So verify the feature is to be installed
1436 if ((!ACTION_VerifyFeatureForAction(package, f_index,
1437 INSTALLSTATE_LOCAL)) &&
1438 !(install_on_demand && ACTION_VerifyFeatureForAction(package,
1439 f_index, INSTALLSTATE_ADVERTISED)))
1441 TRACE("Skipping extension %s reg due to disabled feature %s\n",
1442 debugstr_w(package->extensions[i].Extension),
1443 debugstr_w(package->features[f_index].Feature));
1448 TRACE("Registering extension %s index %i\n",
1449 debugstr_w(package->extensions[i].Extension), i);
1451 package->extensions[i].Installed = TRUE;
1453 /* this is only registered if the extension has at least 1 verb
1456 if (package->extensions[i].ProgIDIndex >= 0 &&
1457 package->extensions[i].VerbCount > 0)
1458 mark_progid_for_install(package, package->extensions[i].ProgIDIndex);
1460 if (package->extensions[i].MIMEIndex >= 0)
1461 mark_mime_for_install(package, package->extensions[i].MIMEIndex);
1465 strcatW(extension,package->extensions[i].Extension);
1467 RegCreateKeyW(HKEY_CLASSES_ROOT,extension,&hkey);
1469 if (package->extensions[i].MIMEIndex >= 0)
1471 RegSetValueExW(hkey,szContentType,0,REG_SZ,
1472 (LPVOID)package->mimes[package->extensions[i].
1473 MIMEIndex].ContentType,
1474 (strlenW(package->mimes[package->extensions[i].
1475 MIMEIndex].ContentType)+1)*sizeof(WCHAR));
1478 if (package->extensions[i].ProgIDIndex >= 0 ||
1479 package->extensions[i].ProgIDText)
1481 static const WCHAR szSN[] =
1482 {'\\','S','h','e','l','l','N','e','w',0};
1487 INT Sequence = MSI_NULL_INTEGER;
1489 if (package->extensions[i].ProgIDIndex >= 0)
1490 progid = package->progids[package->extensions[i].
1491 ProgIDIndex].ProgID;
1493 progid = package->extensions[i].ProgIDText;
1495 RegSetValueExW(hkey,NULL,0,REG_SZ,(LPVOID)progid,
1496 (strlenW(progid)+1)*sizeof(WCHAR));
1498 newkey = HeapAlloc(GetProcessHeap(),0,
1499 (strlenW(progid)+strlenW(szSN)+1) * sizeof(WCHAR));
1501 strcpyW(newkey,progid);
1502 strcatW(newkey,szSN);
1503 RegCreateKeyW(hkey,newkey,&hkey2);
1506 HeapFree(GetProcessHeap(),0,newkey);
1508 /* do all the verbs */
1509 for (v = 0; v < package->extensions[i].VerbCount; v++)
1510 register_verb(package, progid,
1511 package->extensions[i].Component,
1512 &package->extensions[i],
1513 &package->verbs[package->extensions[i].Verbs[v]],
1519 uirow = MSI_CreateRecord(1);
1520 MSI_RecordSetStringW(uirow,1,package->extensions[i].Extension);
1521 ui_actiondata(package,szRegisterExtensionInfo,uirow);
1522 msiobj_release(&uirow->hdr);
1525 return ERROR_SUCCESS;
1528 UINT ACTION_RegisterMIMEInfo(MSIPACKAGE *package)
1530 static const WCHAR szExten[] =
1531 {'E','x','t','e','n','s','i','o','n',0 };
1537 return ERROR_INVALID_HANDLE;
1539 load_classes_and_such(package);
1541 for (i = 0; i < package->loaded_mimes; i++)
1543 WCHAR extension[257];
1546 static const WCHAR fmt[] =
1547 {'M','I','M','E','\\','D','a','t','a','b','a','s','e','\\',
1548 'C','o','n','t','e','n','t',' ','T','y','p','e','\\', '%','s',0};
1552 * check if the MIME is to be installed. Either as requesed by an
1553 * extension or Class
1555 package->mimes[i].InstallMe = ((package->mimes[i].InstallMe) ||
1556 (package->mimes[i].ClassIndex >= 0 &&
1557 package->classes[package->mimes[i].ClassIndex].Installed) ||
1558 (package->mimes[i].ExtensionIndex >=0 &&
1559 package->extensions[package->mimes[i].ExtensionIndex].Installed));
1561 if (!package->mimes[i].InstallMe)
1563 TRACE("MIME %s not scheduled to be installed\n",
1564 debugstr_w(package->mimes[i].ContentType));
1568 mime = package->mimes[i].ContentType;
1569 exten = package->extensions[package->mimes[i].ExtensionIndex].Extension;
1572 strcatW(extension,exten);
1574 key = HeapAlloc(GetProcessHeap(),0,(strlenW(mime)+strlenW(fmt)+1) *
1576 sprintfW(key,fmt,mime);
1577 RegCreateKeyW(HKEY_CLASSES_ROOT,key,&hkey);
1578 RegSetValueExW(hkey,szExten,0,REG_SZ,(LPVOID)extension,
1579 (strlenW(extension)+1)*sizeof(WCHAR));
1581 HeapFree(GetProcessHeap(),0,key);
1583 if (package->mimes[i].CLSID[0])
1585 FIXME("Handle non null for field 3\n");
1590 uirow = MSI_CreateRecord(2);
1591 MSI_RecordSetStringW(uirow,1,package->mimes[i].ContentType);
1592 MSI_RecordSetStringW(uirow,2,exten);
1593 ui_actiondata(package,szRegisterMIMEInfo,uirow);
1594 msiobj_release(&uirow->hdr);
1597 return ERROR_SUCCESS;