Commit fd4a2003 authored by Mike McCormack's avatar Mike McCormack Committed by Alexandre Julliard

Implement the RemoveFiles action.

parent 19855726
......@@ -4285,7 +4285,7 @@ static struct _actions StandardActions[] = {
{ szRemoveDuplicateFiles, NULL},
{ szRemoveEnvironmentStrings, ACTION_RemoveEnvironmentStrings },
{ szRemoveExistingProducts, NULL},
{ szRemoveFiles, NULL},
{ szRemoveFiles, ACTION_RemoveFiles},
{ szRemoveFolders, NULL},
{ szRemoveIniValues, ACTION_RemoveIniValues },
{ szRemoveODBC, NULL},
......
......@@ -243,6 +243,7 @@ extern UINT ACTION_CustomAction(MSIPACKAGE *package,const WCHAR *action, BOOL ex
extern UINT ACTION_AppSearch(MSIPACKAGE *package);
extern UINT ACTION_FindRelatedProducts(MSIPACKAGE *package);
extern UINT ACTION_InstallFiles(MSIPACKAGE *package);
extern UINT ACTION_RemoveFiles(MSIPACKAGE *package);
extern UINT ACTION_DuplicateFiles(MSIPACKAGE *package);
extern UINT ACTION_RegisterClassInfo(MSIPACKAGE *package);
extern UINT ACTION_RegisterProgIdInfo(MSIPACKAGE *package);
......
......@@ -868,3 +868,29 @@ UINT ACTION_DuplicateFiles(MSIPACKAGE *package)
return rc;
}
UINT ACTION_RemoveFiles( MSIPACKAGE *package )
{
MSIFILE *file;
LIST_FOR_EACH_ENTRY( file, &package->files, MSIFILE, entry )
{
if ( !file->Component )
continue;
if ( file->Component->Installed == INSTALLSTATE_LOCAL )
continue;
if ( file->state == msifs_installed )
ERR("removing installed file %s\n", debugstr_w(file->TargetPath));
if ( file->state != msifs_present )
continue;
TRACE("removing %s\n", debugstr_w(file->File) );
if ( !DeleteFileW( file->TargetPath ) )
ERR("failed to delete %s\n", debugstr_w(file->TargetPath) );
file->state = msifs_missing;
}
return ERROR_SUCCESS;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment