Skip to content

Commit

Permalink
Merge pull request #968 from mandiant/tor-shortcut-fix
Browse files Browse the repository at this point in the history
Remove Tor Desktop Shortcut
  • Loading branch information
Ana06 authored Apr 9, 2024
2 parents 3162c8a + a4e3157 commit 67b87f2
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/common.vm/common.vm.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
<metadata>
<id>common.vm</id>
<version>0.0.0.20240402</version>
<version>0.0.0.20240404</version>
<description>Common libraries for VM-packages</description>
<authors>Mandiant</authors>
</metadata>
Expand Down
16 changes: 16 additions & 0 deletions packages/common.vm/tools/vm.common/vm.common.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 1 addition & 5 deletions packages/tor-browser.vm/tools/chocolateyinstall.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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 $_
}
2 changes: 1 addition & 1 deletion packages/tor-browser.vm/tor-browser.vm.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
<metadata>
<id>tor-browser.vm</id>
<version>13.0.13</version>
<version>13.0.10.20240403</version>
<authors>Tor Project</authors>
<description>The Tor software protects you by bouncing your communications around a distributed network of relays run by volunteers all around the world.</description>
<dependencies>
Expand Down

0 comments on commit 67b87f2

Please sign in to comment.