Skip to content

Commit

Permalink
Allow the uninstallation to proceed if we cannot delete every file ex…
Browse files Browse the repository at this point in the history
…actly.
  • Loading branch information
jwhite66 committed Jun 10, 2010
1 parent 8ab059c commit f3b6661
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
7 changes: 7 additions & 0 deletions docs.txt
Expand Up @@ -330,6 +330,13 @@ Here are the elements, and the attributes they can possess.
will be replaced with the installation destination.


delete_error_is_fatal (default true, mustBeTrue)

If we cannot exactly delete every file during uninstallation, we will
terminate at the very first failure if this is true. Otherwise, we
will delete every file we can.


updateurl (no default, mustBeUrl)

This is written to the manifest files for the aid of external tools, but
Expand Down
3 changes: 2 additions & 1 deletion scripts/mojosetup_init.lua
Expand Up @@ -318,7 +318,8 @@ function Setup.Package(tab)
{ "support_uninstall", true, mustBeBool },
{ "preuninstall", nil, mustBeFunction },
{ "postuninstall", nil, mustBeFunction },
{ "postexec", nil, mustBeString}
{ "postexec", nil, mustBeString},
{ "delete_error_is_fatal", true, mustBeBool}
})

if MojoSetup.installs == nil then
Expand Down
4 changes: 3 additions & 1 deletion scripts/mojosetup_mainline.lua
Expand Up @@ -155,6 +155,8 @@ local function do_delete(fname)
retval = true
elseif not MojoSetup.platform.exists(fname) then
retval = true
else
MojoSetup.logerror("Deleting '" .. fname .. "'" .. " failed!")
end
end
return retval
Expand Down Expand Up @@ -2059,7 +2061,7 @@ local function uninstaller()
end

local filelist = flatten_manifest(package.manifest, prepend_dest_dir)
delete_files(filelist, callback, true)
delete_files(filelist, callback, package.delete_error_is_fatal)
run_config_defined_hook(package.postuninstall, package)
MojoSetup.gui.final(_("Uninstall complete"))
stop_gui()
Expand Down

0 comments on commit f3b6661

Please sign in to comment.