From 45de6578de2e5f9933a70ee3231883b22ae150c1 Mon Sep 17 00:00:00 2001 From: sreadingMSFT <74242768+sreadingMSFT@users.noreply.github.com> Date: Wed, 22 Sep 2021 12:23:32 -0700 Subject: [PATCH 1/2] Switch to file copy instead of rename. --- .../Workflows/ShellExecuteInstallerHandler.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/AppInstallerCLICore/Workflows/ShellExecuteInstallerHandler.cpp b/src/AppInstallerCLICore/Workflows/ShellExecuteInstallerHandler.cpp index 47d26d5ac4..3fd967582a 100644 --- a/src/AppInstallerCLICore/Workflows/ShellExecuteInstallerHandler.cpp +++ b/src/AppInstallerCLICore/Workflows/ShellExecuteInstallerHandler.cpp @@ -256,8 +256,9 @@ namespace AppInstaller::CLI::Workflow if (retry) { std::this_thread::sleep_for(250ms); - // If it fails again, let that one throw - std::filesystem::rename(installerPath, renamedDownloadedInstaller); + // If retry fails, try copying with hardlink. The file at installerPath will not be cleaned up after installation, + // but it is in a temp folder. + std::filesystem::copy(installerPath, renamedDownloadedInstaller, std::filesystem::copy_options::create_hard_links); } installerPath.assign(renamedDownloadedInstaller); From d97b3ffdcf0f374f32566dbb563a39f58143fedb Mon Sep 17 00:00:00 2001 From: sreadingMSFT <74242768+sreadingMSFT@users.noreply.github.com> Date: Wed, 22 Sep 2021 12:26:16 -0700 Subject: [PATCH 2/2] fix spelling --- .github/actions/spelling/allow.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/actions/spelling/allow.txt b/.github/actions/spelling/allow.txt index 9f66017546..4233c86abe 100644 --- a/.github/actions/spelling/allow.txt +++ b/.github/actions/spelling/allow.txt @@ -163,6 +163,7 @@ gdi getline github githubusercontent +hardlink hfile HGLOBAL HIDECANCEL