From 3a339cf37293756ef76319adf6fc9702ea8a08cd Mon Sep 17 00:00:00 2001 From: Ana Maria Martinez Gomez Date: Wed, 20 Dec 2023 12:04:35 +0100 Subject: [PATCH] Improve 7zip-15-05.vm - Add 7z instead of 7zip to path - Do not add the tool to the Utilities folder - Order linter exclusions alphabetically --- packages/7zip-15-05.vm/7zip-15-05.vm.nuspec | 2 +- packages/7zip-15-05.vm/tools/chocolateyinstall.ps1 | 14 ++------------ .../7zip-15-05.vm/tools/chocolateyuninstall.ps1 | 6 +----- scripts/test/lint.py | 3 ++- 4 files changed, 6 insertions(+), 19 deletions(-) diff --git a/packages/7zip-15-05.vm/7zip-15-05.vm.nuspec b/packages/7zip-15-05.vm/7zip-15-05.vm.nuspec index 5ea1943ca..66cb3d5b0 100644 --- a/packages/7zip-15-05.vm/7zip-15-05.vm.nuspec +++ b/packages/7zip-15-05.vm/7zip-15-05.vm.nuspec @@ -2,7 +2,7 @@ 7zip-15-05.vm - 15.05.0.20230926 + 15.05.0.20231220 Igor Pavlov 7-Zip file archiver. This version is able to extract NSIS scripts. diff --git a/packages/7zip-15-05.vm/tools/chocolateyinstall.ps1 b/packages/7zip-15-05.vm/tools/chocolateyinstall.ps1 index 50c9f4942..425deeb46 100644 --- a/packages/7zip-15-05.vm/tools/chocolateyinstall.ps1 +++ b/packages/7zip-15-05.vm/tools/chocolateyinstall.ps1 @@ -2,9 +2,7 @@ $ErrorActionPreference = 'Stop' Import-Module vm.common -Force -DisableNameChecking try { - $toolName = '7zip' - $category = 'Utilities' - + $toolName = '7z' $url = 'https://sourceforge.net/projects/sevenzip/files/7-Zip/15.05/7z1505.exe/download' $checksum = 'fa99d29283d9a6c501b70d2755cd06cf5bc3dd8e48acc73926b6e0f389885120' $url64 = 'https://sourceforge.net/projects/sevenzip/files/7-Zip/15.05/7z1505-x64.exe/download' @@ -23,15 +21,7 @@ try { Install-ChocolateyPackage @packageArgs $toolDir = Join-Path ${Env:ProgramFiles} '7-Zip' -Resolve - $shortcutDir = Join-Path ${Env:TOOL_LIST_DIR} $category - - $executablePath = Join-Path $toolDir "7zFM.exe" -Resolve - $shortcut = Join-Path $shortcutDir "$toolName.lnk" - - Install-ChocolateyShortcut -shortcutFilePath $shortcut -targetPath $executablePath - VM-Assert-Path $shortcut - - $7zExecutablePath = Join-Path $toolDir "7z.exe" -Resolve + $7zExecutablePath = Join-Path $toolDir "$toolName.exe" -Resolve Install-BinFile -Name $toolName -Path $7zExecutablePath # Add 7z unzip with password "infected" to the right menu for the most common extensions. diff --git a/packages/7zip-15-05.vm/tools/chocolateyuninstall.ps1 b/packages/7zip-15-05.vm/tools/chocolateyuninstall.ps1 index 55903ee60..f8573a31b 100644 --- a/packages/7zip-15-05.vm/tools/chocolateyuninstall.ps1 +++ b/packages/7zip-15-05.vm/tools/chocolateyuninstall.ps1 @@ -1,11 +1,7 @@ $ErrorActionPreference = 'Continue' Import-Module vm.common -Force -DisableNameChecking -$toolName = '7zip' -$category = 'Utilities' - -# Remove tool shortcut -VM-Remove-Tool-Shortcut $toolName $category +$toolName = '7z' # Remove binary from PATH Uninstall-BinFile -Name $toolName diff --git a/scripts/test/lint.py b/scripts/test/lint.py index 4bf2b9be7..f21e9c851 100644 --- a/scripts/test/lint.py +++ b/scripts/test/lint.py @@ -308,10 +308,12 @@ class UsesInvalidCategory(Lint): EXCLUSIONS = [ ".ollydumpex.vm", ".scyllahide.vm", + "7zip-15-05.vm", "common.vm", "debloat.vm", "flarevm.installer.vm", "ida.plugin.capa.vm", + "idafree.vm", "installer.vm", "libraries.python2.vm", "libraries.python3.vm", @@ -321,7 +323,6 @@ class UsesInvalidCategory(Lint): "openjdk.vm", "python3.vm", "x64dbgpy.vm", - "idafree.vm", ] root_path = os.path.abspath(os.path.join(__file__, "../../.."))