Skip to content

Commit

Permalink
[cyberchef] Improve CyberChef shortcut
Browse files Browse the repository at this point in the history
Improve the CyberChef shortcut to avoid duplication of CyberChef and
Chrome in the taskbar.
  • Loading branch information
Ana06 committed Oct 2, 2024
1 parent 622c271 commit 2428b28
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
2 changes: 1 addition & 1 deletion packages/cyberchef.vm/cyberchef.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>cyberchef.vm</id>
<version>10.19.0.20240913</version>
<version>10.19.0.20241002</version>
<authors>GCHQ</authors>
<description>The Cyber Swiss Army Knife - a web app for encryption, encoding, compression, data analysis, and more.</description>
<dependencies>
Expand Down
16 changes: 4 additions & 12 deletions packages/cyberchef.vm/tools/chocolateyinstall.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ try {

$category = 'Utilities'
$toolName = 'CyberChef'
$shortcutDir = Join-Path ${Env:TOOL_LIST_DIR} $category
$toolDir = Join-Path ${Env:RAW_TOOLS_DIR} $toolName

$packageArgs = @{
Expand All @@ -19,17 +18,10 @@ try {
Install-ChocolateyZipPackage @packageArgs
VM-Assert-Path $toolDir

$shortcutDir = Join-Path ${Env:TOOL_LIST_DIR} $category
$shortcut = Join-Path $shortcutDir "$toolName.lnk"
$executableCmd = Join-Path ${Env:WinDir} "system32\cmd.exe" -Resolve
$htmlPath = Join-Path $toolDir "CyberChef_v10.19.0.html" -Resolve
$arguments = "start chrome $htmlPath && exit"
$executableArgs = "/C $arguments"
$iconLocation = VM-Create-Ico (Join-Path $toolDir "images\cyberchef-128x128.png") # Create .ico for cyberchef icon

Install-ChocolateyShortcut -ShortcutFilePath $shortcut -TargetPath $executableCmd -Arguments $executableArgs -WorkingDirectory $toolDir -WindowStyle 7 -IconLocation $iconLocation

VM-Assert-Path $shortcut
$chromePath = "${env:ProgramFiles}\Google\Chrome\Application\chrome.exe"
$cyberchefPath = Get-Item "$toolDir\CyberChef*.html"
$iconLocation = VM-Create-Ico (Join-Path $toolDir "images\cyberchef-128x128.png")
VM-Install-Shortcut -toolName $toolName -category $category -executablePath $chromePath -arguments "-home $cyberchefPath" -iconLocation $iconLocation
} catch {
VM-Write-Log-Exception $_
}

0 comments on commit 2428b28

Please sign in to comment.