Skip to content

Commit

Permalink
Remove Tor Desktop Shortcut
Browse files Browse the repository at this point in the history
  • Loading branch information
emtuls committed Apr 3, 2024
1 parent f75d0df commit a4e3157
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 a4e3157

Please sign in to comment.