From 64eee762990f222beda3a676561dd5ff11725d81 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Wed, 1 Apr 2020 22:45:56 +0200 Subject: [PATCH] Improve tmp dir --- windows-installer/auto-update.ps1 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/windows-installer/auto-update.ps1 b/windows-installer/auto-update.ps1 index a8537a8ff..419152242 100644 --- a/windows-installer/auto-update.ps1 +++ b/windows-installer/auto-update.ps1 @@ -94,7 +94,10 @@ Aborting auto-upgrade process. Write-Message "Starting Certbot auto-upgrade from $currentVersion to $latestVersion ..." - $installerPath = "$env:TMP/certbot-installer-win32.exe" + $tmpPath = Join-Path ([System.IO.Path]::GetTempPath()) ([System.Guid]::NewGuid()) + New-Item -ItemType Directory -Path $tmpPath + + $installerPath = Join-Path $tmpPath "certbot-installer-win32.exe" try { # Download the installer Write-Message "Downloading the installer ..." @@ -132,7 +135,7 @@ $_ Aborting auto-upgrade process. "@ } finally { - Remove-Item $installerPath -ErrorAction 'Ignore' + Remove-Item $tmpPath -Recurse -ErrorAction 'Ignore' } }