diff --git a/packages/common.vm/common.vm.nuspec b/packages/common.vm/common.vm.nuspec index 295caf221..359f47aea 100755 --- a/packages/common.vm/common.vm.nuspec +++ b/packages/common.vm/common.vm.nuspec @@ -2,7 +2,7 @@ common.vm - 0.0.0.20240402 + 0.0.0.20240404 Common libraries for VM-packages Mandiant diff --git a/packages/common.vm/tools/vm.common/vm.common.psm1 b/packages/common.vm/tools/vm.common/vm.common.psm1 index 192f22df4..a65cff493 100755 --- a/packages/common.vm/tools/vm.common/vm.common.psm1 +++ b/packages/common.vm/tools/vm.common/vm.common.psm1 @@ -533,6 +533,22 @@ function VM-Remove-Tool-Shortcut { Remove-Item $shortcut -Force -ea 0 | Out-Null } +# Delete Desktop shortcuts +function VM-Remove-Desktop-Shortcut { + Param + ( + [Parameter(Mandatory=$true, Position=0)] + [string] $toolName + ) + # Some shortcuts exist in Public and/or User profiles. + ForEach ($location in @(${Env:Public}, ${Env:UserProfile})) { + $desktopShortcut = Join-Path $location "Desktop\$toolName.lnk" + if (Test-Path $desktopShortcut) { + Remove-Item $desktopShortcut -Force -ea 0 + } + } +} + function VM-Install-With-Installer { [CmdletBinding()] Param diff --git a/packages/tor-browser.vm/tools/chocolateyinstall.ps1 b/packages/tor-browser.vm/tools/chocolateyinstall.ps1 index 475dc4433..f0b14bc6b 100644 --- a/packages/tor-browser.vm/tools/chocolateyinstall.ps1 +++ b/packages/tor-browser.vm/tools/chocolateyinstall.ps1 @@ -12,11 +12,7 @@ try { Install-ChocolateyShortcut -shortcutFilePath $shortcut -targetPath $executablePath -RunAsAdmin VM-Assert-Path $shortcut - # Delete Desktop shortcut - $desktopShortcut = Join-Path ${Env:Public} "Desktop\$toolName.lnk" - if (Test-Path $desktopShortcut) { - Remove-Item $desktopShortcut -Force -ea 0 - } + VM-Remove-Desktop-Shortcut $toolName } catch { VM-Write-Log-Exception $_ } diff --git a/packages/tor-browser.vm/tor-browser.vm.nuspec b/packages/tor-browser.vm/tor-browser.vm.nuspec index a49cd6754..2e1e97b59 100644 --- a/packages/tor-browser.vm/tor-browser.vm.nuspec +++ b/packages/tor-browser.vm/tor-browser.vm.nuspec @@ -2,7 +2,7 @@ tor-browser.vm - 13.0.13 + 13.0.10.20240403 Tor Project The Tor software protects you by bouncing your communications around a distributed network of relays run by volunteers all around the world.