Skip to content

Commit

Permalink
Delay deleting the tool directory at VM-Uninstall-With-Uninstaller
Browse files Browse the repository at this point in the history
  • Loading branch information
d35ha committed Jun 12, 2024
1 parent 1f70a3e commit dbdeba4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/common.vm/tools/vm.common/vm.common.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -791,10 +791,6 @@ function VM-Uninstall-With-Uninstaller {
# Remove tool shortcut
VM-Remove-Tool-Shortcut $toolName $category

# Remove tool files
$toolDir = Join-Path ${Env:RAW_TOOLS_DIR} $toolName
Remove-Item $toolDir -Recurse -Force -ea 0 | Out-Null

# Attempt to find and execute the uninstaller, may need to use wildcards
# See: https://docs.chocolatey.org/en-us/create/functions/get-uninstallregistrykey
[array]$key = Get-UninstallRegistryKey -SoftwareName $toolName
Expand All @@ -821,6 +817,10 @@ function VM-Uninstall-With-Uninstaller {
$key | ForEach-Object {VM-Write-Log "WARN" " - $($_.DisplayName)"}
VM-Write-Log "WARN" "Now allowing Chocolatey's auto uninstaller a chance to run."
}

# Remove tool files
$toolDir = Join-Path ${Env:RAW_TOOLS_DIR} $toolName
Remove-Item $toolDir -Recurse -Force -ea 0 | Out-Null
}

function VM-Write-Log-Exception {
Expand Down

0 comments on commit dbdeba4

Please sign in to comment.