0
0
forked from blender/blender
blender/scripts/modules
Campbell Barton a5c5015dac Fix #128175: Updating extension can remove the extension on WIN32
On Windows an entire directory may be locked when any files inside it
are opened by another process. This can cause operations that
recursively remove a directory (uninstalling & updating) to fail
with a partially removed extension.

The case of uninstalling was already handled, where failure to remove
a directory would stage the extension for later removal.
In the case of updating however, the user could be left with a broken
(partially removed) extension where some files were removed, as the
directory was locked, the update would fail to extract new files.

Address this issue by renaming the directory before recursive removal.

The following logic has been implemented:

- If any files in the directory are locked, renaming will fail.
  So even though the operation fails the extension is left intact.

- If renaming succeeds, it's possible to apply the update.

  While it's possible (albeit unlikely) recursive removal fails,
  which could be caused by file-system permissions issues corruption or
  a process could open a file between rename & removal.

  In this case the renamed directory is staged for later removal.

Other changes:

- Resolve a related problem where the user could install an
  extension previously staged for removal, now installing an extension
  ensured it's not removed later.

  This would occur if uninstalling failed, the user resolves
  directory-lock, uninstalls again, then re-installs the extension.

- When an extension fails to be removed, don't attempt to remove
  user configuration for that extension.

  Prefer to keep the extension & it's settings in their "current state"
  if it can't be removed.
2024-10-10 12:10:07 +02:00
..
_bpy_internal Fix #128175: Updating extension can remove the extension on WIN32 2024-10-10 12:10:07 +02:00
bl_app_override Cleanup: Python script formatting 2024-06-06 11:26:28 +10:00
bl_console_utils Cleanup: replace %-formatting with str.format in scripts/modules/ 2024-04-27 16:06:51 +10:00
bl_i18n_utils I18N: Update UI translations from git/weblate repository (9735e28dcce47210). 2024-07-08 20:50:07 +02:00
bl_keymap_utils GPv3: Fill tool to generate strokes in empty areas 2024-05-15 13:36:06 +02:00
bl_previews_utils Cleanup: replace %-formatting with str.format in scripts/modules/ 2024-04-27 16:06:51 +10:00
bl_rna_utils Cleanup: replace %-formatting with str.format in scripts/modules/ 2024-04-27 16:06:51 +10:00
bl_text_utils Fix bl_text_utils/external_editor.py broken __all__ 2024-06-29 22:14:37 +10:00
bl_ui_utils Use the redirect.b.o website for bug reports 2024-04-30 14:56:33 +02:00
bpy Presets: consider presets within the extensions repo to be "built-in" 2024-08-16 11:02:09 +02:00
bpy_extras Extensions: move junction_module to a private location 2024-06-28 14:30:11 +10:00
gpu_extras License Headers: Set copyright to "Blender Authors", add AUTHORS 2023-08-16 00:20:26 +10:00
addon_utils.py Fix #128175: Updating extension can remove the extension on WIN32 2024-10-10 12:10:07 +02:00
animsys_refactor.py Cleanup: replace %-formatting with str.format in scripts/modules/ 2024-04-27 16:06:51 +10:00
bl_app_template_utils.py Cleanup: replace %-formatting with str.format in scripts/modules/ 2024-04-27 16:06:51 +10:00
blend_render_info.py Cleanup: replace %-formatting with str.format in scripts/modules/ 2024-04-27 16:06:51 +10:00
bpy_restrict_state.py License Headers: Set copyright to "Blender Authors", add AUTHORS 2023-08-16 00:20:26 +10:00
bpy_types.py PyAPI: fixes for defining operator macros 2024-06-01 16:17:02 +10:00
console_python.py Cleanup: replace %-formatting with str.format in scripts/modules/ 2024-04-27 16:06:51 +10:00
console_shell.py License Headers: Set copyright to "Blender Authors", add AUTHORS 2023-08-16 00:20:26 +10:00
graphviz_export.py Cleanup: replace %-formatting with str.format in scripts/modules/ 2024-04-27 16:06:51 +10:00
keyingsets_utils.py Fix #122372: Keyingsets not keying custom properties of type EnumProperty 2024-06-13 13:17:32 +02:00
nodeitems_utils.py Cleanup: replace %-formatting with str.format in scripts/modules/ 2024-04-27 16:06:51 +10:00
rna_info.py Fix #108254: Infinite loop in rna_info.BuildRNAInfo(..) 2024-07-02 16:03:26 +10:00
rna_keymap_ui.py Cleanup: replace %-formatting with str.format in scripts/modules/ 2024-04-27 16:06:51 +10:00
rna_manual_reference.py Docs: Fix RNA to manual mapping 2024-07-16 02:20:19 -04:00
rna_prop_ui.py Cleanup: replace %-formatting with str.format in scripts/modules/ 2024-04-27 16:06:51 +10:00
rna_xml.py Core: support restricting the types an XML preset may load 2024-06-27 21:21:07 +10:00
sys_info.py Cleanup: replace %-formatting with str.format in scripts/modules/ 2024-04-27 16:06:51 +10:00