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
23 * Actions dealing with files These are
29 * RemoveDuplicateFiles(TODO)
38 #include "wine/debug.h"
42 #include "msvcrt/fcntl.h"
45 #include "wine/unicode.h"
48 WINE_DEFAULT_DEBUG_CHANNEL(msi
);
50 extern const WCHAR szInstallFiles
[];
51 extern const WCHAR szDuplicateFiles
[];
52 extern const WCHAR szMoveFiles
[];
53 extern const WCHAR szPatchFiles
[];
54 extern const WCHAR szRemoveDuplicateFiles
[];
55 extern const WCHAR szRemoveFiles
[];
57 static const WCHAR cszTempFolder
[]= {'T','e','m','p','F','o','l','d','e','r',0};
61 * This is a helper function for handling embedded cabinet media
63 static UINT
writeout_cabinet_stream(MSIPACKAGE
*package
, LPCWSTR stream_name
,
73 rc
= read_raw_stream_data(package
->db
,stream_name
,&data
,&size
);
74 if (rc
!= ERROR_SUCCESS
)
78 if (MSI_GetPropertyW(package
, cszTempFolder
, tmp
, &write
))
79 GetTempPathW(MAX_PATH
,tmp
);
81 GetTempFileNameW(tmp
,stream_name
,0,source
);
83 track_tempfile(package
,strrchrW(source
,'\\'), source
);
84 the_file
= CreateFileW(source
, GENERIC_WRITE
, 0, NULL
, CREATE_ALWAYS
,
85 FILE_ATTRIBUTE_NORMAL
, NULL
);
87 if (the_file
== INVALID_HANDLE_VALUE
)
89 ERR("Unable to create file %s\n",debugstr_w(source
));
90 rc
= ERROR_FUNCTION_FAILED
;
94 WriteFile(the_file
,data
,size
,&write
,NULL
);
95 CloseHandle(the_file
);
96 TRACE("wrote %li bytes to %s\n",write
,debugstr_w(source
));
103 /* Support functions for FDI functions */
110 static void * cabinet_alloc(ULONG cb
)
112 return msi_alloc(cb
);
115 static void cabinet_free(void *pv
)
120 static INT_PTR
cabinet_open(char *pszFile
, int oflag
, int pmode
)
123 DWORD dwShareMode
= 0;
124 DWORD dwCreateDisposition
= OPEN_EXISTING
;
125 switch (oflag
& _O_ACCMODE
)
128 dwAccess
= GENERIC_READ
;
129 dwShareMode
= FILE_SHARE_READ
| FILE_SHARE_DELETE
;
132 dwAccess
= GENERIC_WRITE
;
133 dwShareMode
= FILE_SHARE_READ
| FILE_SHARE_WRITE
| FILE_SHARE_DELETE
;
136 dwAccess
= GENERIC_READ
| GENERIC_WRITE
;
137 dwShareMode
= FILE_SHARE_READ
| FILE_SHARE_WRITE
| FILE_SHARE_DELETE
;
140 if ((oflag
& (_O_CREAT
| _O_EXCL
)) == (_O_CREAT
| _O_EXCL
))
141 dwCreateDisposition
= CREATE_NEW
;
142 else if (oflag
& _O_CREAT
)
143 dwCreateDisposition
= CREATE_ALWAYS
;
144 return (INT_PTR
)CreateFileA(pszFile
, dwAccess
, dwShareMode
, NULL
,
145 dwCreateDisposition
, 0, NULL
);
148 static UINT
cabinet_read(INT_PTR hf
, void *pv
, UINT cb
)
151 if (ReadFile((HANDLE
)hf
, pv
, cb
, &dwRead
, NULL
))
156 static UINT
cabinet_write(INT_PTR hf
, void *pv
, UINT cb
)
159 if (WriteFile((HANDLE
)hf
, pv
, cb
, &dwWritten
, NULL
))
164 static int cabinet_close(INT_PTR hf
)
166 return CloseHandle((HANDLE
)hf
) ? 0 : -1;
169 static long cabinet_seek(INT_PTR hf
, long dist
, int seektype
)
171 /* flags are compatible and so are passed straight through */
172 return SetFilePointer((HANDLE
)hf
, dist
, NULL
, seektype
);
175 static INT_PTR
cabinet_notify(FDINOTIFICATIONTYPE fdint
, PFDINOTIFICATION pfdin
)
181 CabData
*data
= (CabData
*) pfdin
->pv
;
182 ULONG len
= strlen(data
->cab_path
) + strlen(pfdin
->psz1
);
188 static const WCHAR tmpprefix
[] = {'C','A','B','T','M','P','_',0};
195 given_file
= strdupAtoW(pfdin
->psz1
);
196 f
= get_loaded_file(data
->package
, given_file
);
197 msi_free(given_file
);
201 ERR("Unknown File in Cabinet (%s)\n",debugstr_a(pfdin
->psz1
));
205 if (!((f
->State
== 1 || f
->State
== 2)))
207 TRACE("Skipping extraction of %s\n",debugstr_a(pfdin
->psz1
));
211 file
= cabinet_alloc((len
+1)*sizeof(char));
212 strcpy(file
, data
->cab_path
);
213 strcat(file
, pfdin
->psz1
);
215 TRACE("file: %s\n", debugstr_a(file
));
217 /* track this file so it can be deleted if not installed */
218 trackpath
=strdupAtoW(file
);
219 tracknametmp
=strdupAtoW(strrchr(file
,'\\')+1);
220 trackname
= msi_alloc((strlenW(tracknametmp
) +
221 strlenW(tmpprefix
)+1) * sizeof(WCHAR
));
223 strcpyW(trackname
,tmpprefix
);
224 strcatW(trackname
,tracknametmp
);
226 track_tempfile(data
->package
, trackname
, trackpath
);
230 msi_free(tracknametmp
);
233 uirow
=MSI_CreateRecord(9);
234 MSI_RecordSetStringW( uirow
, 1, f
->FileName
);
235 uipath
= strdupW( f
->TargetPath
);
236 *(strrchrW(uipath
,'\\')+1)=0;
237 MSI_RecordSetStringW(uirow
,9,uipath
);
238 MSI_RecordSetInteger( uirow
, 6, f
->FileSize
);
239 ui_actiondata(data
->package
,szInstallFiles
,uirow
);
240 msiobj_release( &uirow
->hdr
);
243 ui_progress( data
->package
, 2, f
->FileSize
, 0, 0);
245 return cabinet_open(file
, _O_WRONLY
| _O_CREAT
, 0);
247 case fdintCLOSE_FILE_INFO
:
251 if (!DosDateTimeToFileTime(pfdin
->date
, pfdin
->time
, &ft
))
253 if (!LocalFileTimeToFileTime(&ft
, &ftLocal
))
255 if (!SetFileTime((HANDLE
)pfdin
->hf
, &ftLocal
, 0, &ftLocal
))
258 cabinet_close(pfdin
->hf
);
266 /***********************************************************************
267 * extract_cabinet_file
269 * Extract files from a cab file.
271 static BOOL
extract_cabinet_file(MSIPACKAGE
* package
, LPCWSTR source
,
281 TRACE("Extracting %s to %s\n",debugstr_w(source
), debugstr_w(path
));
283 hfdi
= FDICreate(cabinet_alloc
,
294 ERR("FDICreate failed\n");
298 if (!(cabinet
= strdupWtoA( source
)))
303 if (!(cab_path
= strdupWtoA( path
)))
310 data
.package
= package
;
311 data
.cab_path
= cab_path
;
313 ret
= FDICopy(hfdi
, cabinet
, "", 0, cabinet_notify
, NULL
, &data
);
316 ERR("FDICopy failed\n");
326 static VOID
set_file_source(MSIPACKAGE
* package
, MSIFILE
* file
, MSICOMPONENT
*
329 if (file
->Attributes
& msidbFileAttributesNoncompressed
)
332 p
= resolve_folder(package
, comp
->Directory
, TRUE
, FALSE
, NULL
);
333 file
->SourcePath
= build_directory_name(2, p
, file
->ShortName
);
337 file
->SourcePath
= build_directory_name(2, path
, file
->File
);
340 static BOOL
check_volume(LPCWSTR path
, LPCWSTR want_volume
, LPWSTR volume
,
344 WCHAR name
[MAX_PATH
];
347 if (!(path
[0] && path
[1] == ':'))
354 TRACE("Checking volume %s .. (%s)\n",debugstr_w(drive
), debugstr_w(want_volume
));
355 type
= GetDriveTypeW(drive
);
356 TRACE("drive is of type %x\n",type
);
358 if (type
== DRIVE_UNKNOWN
|| type
== DRIVE_NO_ROOT_DIR
||
359 type
== DRIVE_FIXED
|| type
== DRIVE_RAMDISK
)
362 GetVolumeInformationW(drive
, name
, MAX_PATH
, NULL
, NULL
, NULL
, NULL
, 0);
363 TRACE("Drive contains %s\n", debugstr_w(name
));
364 volume
= strdupW(name
);
367 return (strcmpiW(want_volume
,name
)==0);
370 static BOOL
check_for_sourcefile(LPCWSTR source
)
372 DWORD attrib
= GetFileAttributesW(source
);
373 return (!(attrib
== INVALID_FILE_ATTRIBUTES
));
376 static UINT
ready_volume(MSIPACKAGE
* package
, LPCWSTR path
, LPWSTR last_volume
,
377 MSIRECORD
*row
,UINT
*type
)
379 LPWSTR volume
= NULL
;
380 LPCWSTR want_volume
= MSI_RecordGetString(row
, 5);
381 BOOL ok
= check_volume(path
, want_volume
, volume
, type
);
383 TRACE("Readying Volume for %s (%s, %s)\n",debugstr_w(path
), debugstr_w(want_volume
), debugstr_w(last_volume
));
385 if (check_for_sourcefile(path
) && !ok
)
387 FIXME("Found the Sourcefile but not on the correct volume.(%s,%s,%s)\n",
388 debugstr_w(path
),debugstr_w(want_volume
), debugstr_w(volume
));
389 return ERROR_SUCCESS
;
398 prompt
= MSI_RecordGetString(row
,3);
399 msg
= generate_error_string(package
, 1302, 1, prompt
);
400 rc
= MessageBoxW(NULL
,msg
,NULL
,MB_OKCANCEL
);
404 ok
= check_for_sourcefile(path
);
406 return ERROR_INSTALL_USEREXIT
;
409 msi_free(last_volume
);
410 last_volume
= strdupW(volume
);
411 return ERROR_SUCCESS
;
419 WCHAR source
[MAX_PATH
];
422 static struct media_info
*create_media_info( void )
424 struct media_info
*mi
;
426 mi
= msi_alloc( sizeof *mi
);
429 mi
->last_sequence
= 0;
430 mi
->last_volume
= NULL
;
431 mi
->last_path
= NULL
;
439 static void free_media_info( struct media_info
*mi
)
441 msi_free( mi
->last_path
);
445 static UINT
ready_media_for_file( MSIPACKAGE
*package
, struct media_info
*mi
,
448 UINT rc
= ERROR_SUCCESS
;
450 static const WCHAR ExecSeqQuery
[] =
451 {'S','E','L','E','C','T',' ','*',' ', 'F','R','O','M',' ',
452 '`','M','e','d','i','a','`',' ','W','H','E','R','E',' ',
453 '`','L','a','s','t','S','e','q','u','e','n','c','e','`',' ','>','=',
454 ' ','%', 'i',' ','O','R','D','E','R',' ','B','Y',' ',
455 '`','L','a','s','t','S','e','q','u','e','n','c','e','`',0};
461 MSICOMPONENT
*comp
= file
->Component
;
463 if (file
->Sequence
<= mi
->last_sequence
)
465 set_file_source(package
,file
,comp
,mi
->last_path
);
466 TRACE("Media already ready (%u, %u)\n",file
->Sequence
,mi
->last_sequence
);
467 return ERROR_SUCCESS
;
471 row
= MSI_QueryGetRecord(package
->db
, ExecSeqQuery
, file
->Sequence
);
474 TRACE("Unable to query row\n");
475 return ERROR_FUNCTION_FAILED
;
478 seq
= MSI_RecordGetInteger(row
,2);
479 mi
->last_sequence
= seq
;
481 volume
= MSI_RecordGetString(row
, 5);
482 prompt
= MSI_RecordGetString(row
, 3);
484 msi_free(mi
->last_path
);
485 mi
->last_path
= NULL
;
487 if (file
->Attributes
& msidbFileAttributesNoncompressed
)
489 mi
->last_path
= resolve_folder(package
, comp
->Directory
, TRUE
, FALSE
, NULL
);
490 set_file_source(package
,file
,comp
,mi
->last_path
);
491 rc
= ready_volume(package
, file
->SourcePath
, mi
->last_volume
, row
,&type
);
493 MsiSourceListAddMediaDiskW(package
->ProductCode
, NULL
,
494 MSIINSTALLCONTEXT_USERMANAGED
, MSICODE_PRODUCT
, mi
->count
, volume
,
497 if (type
== DRIVE_REMOVABLE
|| type
== DRIVE_CDROM
||
498 type
== DRIVE_RAMDISK
)
499 MsiSourceListSetInfoW(package
->ProductCode
, NULL
,
500 MSIINSTALLCONTEXT_USERMANAGED
,
501 MSICODE_PRODUCT
|MSISOURCETYPE_MEDIA
,
502 INSTALLPROPERTY_LASTUSEDSOURCEW
, mi
->last_path
);
504 MsiSourceListSetInfoW(package
->ProductCode
, NULL
,
505 MSIINSTALLCONTEXT_USERMANAGED
,
506 MSICODE_PRODUCT
|MSISOURCETYPE_NETWORK
,
507 INSTALLPROPERTY_LASTUSEDSOURCEW
, mi
->last_path
);
508 msiobj_release(&row
->hdr
);
512 cab
= MSI_RecordGetString(row
,4);
515 TRACE("Source is CAB %s\n",debugstr_w(cab
));
516 /* the stream does not contain the # character */
521 writeout_cabinet_stream(package
,&cab
[1],mi
->source
);
522 mi
->last_path
= strdupW(mi
->source
);
523 *(strrchrW(mi
->last_path
,'\\')+1)=0;
525 path
= msi_dup_property( package
, cszSourceDir
);
527 MsiSourceListAddMediaDiskW(package
->ProductCode
, NULL
,
528 MSIINSTALLCONTEXT_USERMANAGED
, MSICODE_PRODUCT
, mi
->count
,
531 MsiSourceListSetInfoW(package
->ProductCode
, NULL
,
532 MSIINSTALLCONTEXT_USERMANAGED
,
533 MSICODE_PRODUCT
|MSISOURCETYPE_NETWORK
,
534 INSTALLPROPERTY_LASTUSEDSOURCEW
, path
);
541 mi
->last_path
= msi_alloc(MAX_PATH
*sizeof(WCHAR
));
542 if (MSI_GetPropertyW(package
, cszSourceDir
, mi
->source
, &sz
))
544 ERR("No Source dir defined \n");
545 rc
= ERROR_FUNCTION_FAILED
;
549 strcpyW(mi
->last_path
,mi
->source
);
550 strcatW(mi
->source
,cab
);
552 rc
= ready_volume(package
, mi
->source
, mi
->last_volume
, row
, &type
);
553 if (type
== DRIVE_REMOVABLE
|| type
== DRIVE_CDROM
||
554 type
== DRIVE_RAMDISK
)
555 MsiSourceListSetInfoW(package
->ProductCode
, NULL
,
556 MSIINSTALLCONTEXT_USERMANAGED
,
557 MSICODE_PRODUCT
|MSISOURCETYPE_MEDIA
,
558 INSTALLPROPERTY_LASTUSEDSOURCEW
, mi
->last_path
);
560 MsiSourceListSetInfoW(package
->ProductCode
, NULL
,
561 MSIINSTALLCONTEXT_USERMANAGED
,
562 MSICODE_PRODUCT
|MSISOURCETYPE_NETWORK
,
563 INSTALLPROPERTY_LASTUSEDSOURCEW
, mi
->last_path
);
565 /* extract the cab file into a folder in the temp folder */
567 if (MSI_GetPropertyW(package
, cszTempFolder
,mi
->last_path
, &sz
)
569 GetTempPathW(MAX_PATH
,mi
->last_path
);
572 rc
= !extract_cabinet_file(package
, mi
->source
, mi
->last_path
);
577 mi
->last_path
= msi_alloc(MAX_PATH
*sizeof(WCHAR
));
578 MSI_GetPropertyW(package
,cszSourceDir
,mi
->source
,&sz
);
579 strcpyW(mi
->last_path
,mi
->source
);
580 rc
= ready_volume(package
, mi
->last_path
, mi
->last_volume
, row
, &type
);
582 if (type
== DRIVE_REMOVABLE
|| type
== DRIVE_CDROM
||
583 type
== DRIVE_RAMDISK
)
584 MsiSourceListSetInfoW(package
->ProductCode
, NULL
,
585 MSIINSTALLCONTEXT_USERMANAGED
,
586 MSICODE_PRODUCT
|MSISOURCETYPE_MEDIA
,
587 INSTALLPROPERTY_LASTUSEDSOURCEW
, mi
->last_path
);
589 MsiSourceListSetInfoW(package
->ProductCode
, NULL
,
590 MSIINSTALLCONTEXT_USERMANAGED
,
591 MSICODE_PRODUCT
|MSISOURCETYPE_NETWORK
,
592 INSTALLPROPERTY_LASTUSEDSOURCEW
, mi
->last_path
);
594 set_file_source(package
, file
, comp
, mi
->last_path
);
596 MsiSourceListAddMediaDiskW(package
->ProductCode
, NULL
,
597 MSIINSTALLCONTEXT_USERMANAGED
, MSICODE_PRODUCT
, mi
->count
, volume
,
600 msiobj_release(&row
->hdr
);
605 static UINT
get_file_target(MSIPACKAGE
*package
, LPCWSTR file_key
,
611 return ERROR_INVALID_HANDLE
;
613 LIST_FOR_EACH_ENTRY( file
, &package
->files
, MSIFILE
, entry
)
615 if (lstrcmpW( file_key
, file
->File
)==0)
617 if (file
->State
>= 2)
619 *file_source
= strdupW( file
->TargetPath
);
620 return ERROR_SUCCESS
;
623 return ERROR_FILE_NOT_FOUND
;
627 return ERROR_FUNCTION_FAILED
;
631 * In order to make this work more effeciencly I am going to do this in 2
633 * Pass 1) Correct all the TargetPaths and determin what files are to be
635 * Pass 2) Extract Cabinents and copy files.
637 UINT
ACTION_InstallFiles(MSIPACKAGE
*package
)
639 struct media_info
*mi
;
640 UINT rc
= ERROR_SUCCESS
;
645 return ERROR_INVALID_HANDLE
;
647 /* increment progress bar each time action data is sent */
648 ui_progress(package
,1,1,0,0);
650 /* handle the keys for the SouceList */
651 ptr
= strrchrW(package
->PackagePath
,'\\');
655 MsiSourceListSetInfoW(package
->ProductCode
, NULL
,
656 MSIINSTALLCONTEXT_USERMANAGED
,
658 INSTALLPROPERTY_PACKAGENAMEW
, ptr
);
660 FIXME("Write DiskPrompt\n");
663 LIST_FOR_EACH_ENTRY( file
, &package
->files
, MSIFILE
, entry
)
665 if (!ACTION_VerifyComponentForAction(package
, file
->Component
,
668 ui_progress(package
,2,file
->FileSize
,0,0);
669 TRACE("File %s is not scheduled for install\n",
670 debugstr_w(file
->File
));
676 mi
= create_media_info();
679 LIST_FOR_EACH_ENTRY( file
, &package
->files
, MSIFILE
, entry
)
681 if ((file
->State
== 1) || (file
->State
== 2))
683 TRACE("Pass 2: %s\n",debugstr_w(file
->File
));
685 rc
= ready_media_for_file( package
, mi
, file
);
686 if (rc
!= ERROR_SUCCESS
)
688 ERR("Unable to ready media\n");
689 rc
= ERROR_FUNCTION_FAILED
;
693 TRACE("file paths %s to %s\n",debugstr_w(file
->SourcePath
),
694 debugstr_w(file
->TargetPath
));
696 if (file
->Attributes
& msidbFileAttributesNoncompressed
)
697 rc
= CopyFileW(file
->SourcePath
,file
->TargetPath
,FALSE
);
699 rc
= MoveFileW(file
->SourcePath
, file
->TargetPath
);
704 ERR("Unable to move/copy file (%s -> %s) (error %d)\n",
705 debugstr_w(file
->SourcePath
), debugstr_w(file
->TargetPath
),
707 if (rc
== ERROR_ALREADY_EXISTS
&& file
->State
== 2)
709 if (!CopyFileW(file
->SourcePath
,file
->TargetPath
,FALSE
))
710 ERR("Unable to copy file (%s -> %s) (error %ld)\n",
711 debugstr_w(file
->SourcePath
),
712 debugstr_w(file
->TargetPath
), GetLastError());
713 if (!(file
->Attributes
& msidbFileAttributesNoncompressed
))
714 DeleteFileW(file
->SourcePath
);
717 else if (rc
== ERROR_FILE_NOT_FOUND
)
719 ERR("Source File Not Found! Continuing\n");
722 else if (file
->Attributes
& msidbFileAttributesVital
)
724 ERR("Ignoring Error and continuing (nonvital file)...\n");
737 free_media_info( mi
);
741 static UINT
ITERATE_DuplicateFiles(MSIRECORD
*row
, LPVOID param
)
743 MSIPACKAGE
*package
= (MSIPACKAGE
*)param
;
744 WCHAR
*file_source
= NULL
;
745 WCHAR dest_name
[0x100];
746 LPWSTR dest_path
, dest
;
747 LPCWSTR file_key
, component
;
752 component
= MSI_RecordGetString(row
,2);
753 comp
= get_loaded_component(package
,component
);
755 if (!ACTION_VerifyComponentForAction(package
, comp
, INSTALLSTATE_LOCAL
))
757 TRACE("Skipping copy due to disabled component %s\n",
758 debugstr_w(component
));
760 /* the action taken was the same as the current install state */
761 comp
->Action
= comp
->Installed
;
763 return ERROR_SUCCESS
;
766 comp
->Action
= INSTALLSTATE_LOCAL
;
768 file_key
= MSI_RecordGetString(row
,3);
771 ERR("Unable to get file key\n");
772 return ERROR_FUNCTION_FAILED
;
775 rc
= get_file_target(package
,file_key
,&file_source
);
777 if (rc
!= ERROR_SUCCESS
)
779 ERR("Original file unknown %s\n",debugstr_w(file_key
));
780 msi_free(file_source
);
781 return ERROR_SUCCESS
;
784 if (MSI_RecordIsNull(row
,4))
785 strcpyW(dest_name
,strrchrW(file_source
,'\\')+1);
789 MSI_RecordGetStringW(row
,4,dest_name
,&sz
);
790 reduce_to_longfilename(dest_name
);
793 if (MSI_RecordIsNull(row
,5))
796 dest_path
= strdupW(file_source
);
797 p
= strrchrW(dest_path
,'\\');
804 destkey
= MSI_RecordGetString(row
,5);
805 dest_path
= resolve_folder(package
, destkey
, FALSE
,FALSE
,NULL
);
809 dest_path
= msi_dup_property( package
, destkey
);
812 FIXME("Unable to get destination folder, try AppSearch properties\n");
813 msi_free(file_source
);
814 return ERROR_SUCCESS
;
819 dest
= build_directory_name(2, dest_path
, dest_name
);
821 TRACE("Duplicating file %s to %s\n",debugstr_w(file_source
),
824 if (strcmpW(file_source
,dest
))
825 rc
= !CopyFileW(file_source
,dest
,TRUE
);
829 if (rc
!= ERROR_SUCCESS
)
830 ERR("Failed to copy file %s -> %s, last error %ld\n", debugstr_w(file_source
), debugstr_w(dest_path
), GetLastError());
832 FIXME("We should track these duplicate files as well\n");
836 msi_free(file_source
);
838 return ERROR_SUCCESS
;
841 UINT
ACTION_DuplicateFiles(MSIPACKAGE
*package
)
845 static const WCHAR ExecSeqQuery
[] =
846 {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
847 '`','D','u','p','l','i','c','a','t','e','F','i','l','e','`',0};
850 return ERROR_INVALID_HANDLE
;
852 rc
= MSI_DatabaseOpenViewW(package
->db
, ExecSeqQuery
, &view
);
853 if (rc
!= ERROR_SUCCESS
)
854 return ERROR_SUCCESS
;
856 rc
= MSI_IterateRecords(view
, NULL
, ITERATE_DuplicateFiles
, package
);
857 msiobj_release(&view
->hdr
);