OSDN Git Service
Merge: SDK Manager: Rework install logic.
This should get rid of the annoying behavior on Windows
that prevent the "folder swap" operation due to the folders
being locked. Cf public issue 4410.
High level summary of the issue and the fix: the old behavior
was to unzip in a temp folder, then rename the old folder to
another temp file and finally rename the new folder at the
desired location. This fails typically when there is a file
indexer (e.g. anti-virus) scanning the new folder so we can't
move that folder.
The new logic is to try to move the old folder first into a
temp folder. If the fail move, we have a lock on the old folder
and ask the user to fix it manually. They probably have a file
opened and it's a legit issue to report. Once that succeeded
we can directly unzip the archive into the final destination
without using a temp unzip location, thus avoiding the common
"indexer in progress" issue.
In case the unzip operation fails, we try to copy (not move) the
old folder back.
Change-Id: I4fd862147cf7e0813eeef77a8332c0ce4f97a836
13 files changed: