diff --git a/packages/7zip-15-05.vm/7zip-15-05.vm.nuspec b/packages/7zip-15-05.vm/7zip-15-05.vm.nuspec
deleted file mode 100644
index 551764b13..000000000
--- a/packages/7zip-15-05.vm/7zip-15-05.vm.nuspec
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
- 7zip-15-05.vm
- 15.05.0.20240614
- Igor Pavlov
- 7-Zip file archiver. This version is able to extract NSIS scripts.
-
-
-
-
-
diff --git a/packages/7zip-15-05.vm/tools/chocolateyuninstall.ps1 b/packages/7zip-15-05.vm/tools/chocolateyuninstall.ps1
deleted file mode 100644
index cc36a76a8..000000000
--- a/packages/7zip-15-05.vm/tools/chocolateyuninstall.ps1
+++ /dev/null
@@ -1,16 +0,0 @@
-$ErrorActionPreference = 'Continue'
-Import-Module vm.common -Force -DisableNameChecking
-
-$toolName = '7z'
-$category = 'Productivity Tools'
-
-VM-Uninstall $toolName $category
-
-# Manually silently uninstall
-VM-Uninstall-With-Uninstaller "7-Zip 15.05*" $category "EXE" "/S"
-
-$extensions = @(".7z", ".bzip2", ".gzip", ".tar", ".wim", ".xz", ".txz", ".zip", ".rar")
-foreach ($extension in $extensions) {
- VM-Remove-From-Right-Click-Menu $toolName -extension $extension
- VM-Remove-Open-With-Association "${toolName}FM" -extension $extension
-}
diff --git a/packages/7zip-nsis.vm/7zip-nsis.vm.nuspec b/packages/7zip-nsis.vm/7zip-nsis.vm.nuspec
deleted file mode 100644
index 3d2cd0c0f..000000000
--- a/packages/7zip-nsis.vm/7zip-nsis.vm.nuspec
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
- 7zip-nsis.vm
- 23.01.0.20240507
- myfreeer
- 7-zip build with nsis script decompiling
-
-
-
-
-
diff --git a/packages/7zip-nsis.vm/tools/chocolateyinstall.ps1 b/packages/7zip-nsis.vm/tools/chocolateyinstall.ps1
deleted file mode 100644
index af7fe198e..000000000
--- a/packages/7zip-nsis.vm/tools/chocolateyinstall.ps1
+++ /dev/null
@@ -1,42 +0,0 @@
-$ErrorActionPreference = 'Stop'
-Import-Module vm.common -Force -DisableNameChecking
-
-try {
- $toolName = '7z'
- $category = 'Productivity Tools'
-
- $url = 'https://github.com/myfreeer/7z-build-nsis/releases/download/23.01/7z2301-x86.exe'
- $checksum = '7b1d50073e6d3631267f2bbb986fb1faffddc5fc72d6bc23e10b5920a6f365b4'
- $url64 = 'https://github.com/myfreeer/7z-build-nsis/releases/download/23.01/7z2301-x64.exe'
- $checksum64 = 'b7f1d8360d988808447f9af3989db7665dfec72bac83c8b6467cc35f8fe718ff'
-
- $packageArgs = @{
- packageName = ${Env:ChocolateyPackageName}
- fileType = 'EXE'
- url = $url
- url64bit = $url64
- checksumType = 'sha256'
- checksum = $checksum
- checksum64 = $checksum64
- silentArgs = '/S'
- }
- Install-ChocolateyPackage @packageArgs
-
- $toolDir = Join-Path ${Env:ProgramFiles} '7-Zip' -Resolve
- $7zExecutablePath = Join-Path $toolDir "$toolName.exe" -Resolve
- Install-BinFile -Name $toolName -Path $7zExecutablePath
-
- # Make shortcut point to 7z File Manager so that it's more useful of a shortcut.
- $executablePath = Join-Path $toolDir "${toolName}FM.exe" -Resolve
- VM-Install-Shortcut $toolName $category $executablePath
-
- # Add 7z unzip with password "infected" to the right menu for the most common extensions.
- # 7z can unzip other file extensions like .docx but these don't likely use the infected password.
- $extensions = @(".7z", ".bzip2", ".gzip", ".tar", ".wim", ".xz", ".txz", ".zip", ".rar")
- foreach ($extension in $extensions) {
- VM-Add-To-Right-Click-Menu $toolName 'unzip "infected"' "`"$7zExecutablePath`" x -pinfected `"%1`"" "$executablePath" -extension $extension
- VM-Set-Open-With-Association $executablePath $extension
- }
-} catch {
- VM-Write-Log-Exception $_
-}
diff --git a/packages/7zip.vm/7zip.vm.nuspec b/packages/7zip.vm/7zip.vm.nuspec
index f58c7a9e7..ae2cc15fa 100644
--- a/packages/7zip.vm/7zip.vm.nuspec
+++ b/packages/7zip.vm/7zip.vm.nuspec
@@ -2,12 +2,11 @@
7zip.vm
- 0.0.0.20240425
- Metapackage for 7zip to ensure all packages use the same 7zip version.
- Mandiant
+ 23.01.0.20250206
+ myfreeer
+ 7-zip build with nsis script decompiling
-
-
+
diff --git a/packages/7zip-15-05.vm/tools/chocolateyinstall.ps1 b/packages/7zip.vm/tools/chocolateyinstall.ps1
similarity index 60%
rename from packages/7zip-15-05.vm/tools/chocolateyinstall.ps1
rename to packages/7zip.vm/tools/chocolateyinstall.ps1
index 4ab830fea..d7363d8d1 100644
--- a/packages/7zip-15-05.vm/tools/chocolateyinstall.ps1
+++ b/packages/7zip.vm/tools/chocolateyinstall.ps1
@@ -5,10 +5,10 @@ try {
$toolName = '7z'
$category = 'Productivity Tools'
- $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'
- $checksum64 = '6abaf04e44c87bd109df7485eb67a2d69a2e3e6e6deb9df59e5e707176c69449'
+ $url = 'https://github.com/myfreeer/7z-build-nsis/releases/download/23.01/7z2301-x86.exe'
+ $checksum = '7b1d50073e6d3631267f2bbb986fb1faffddc5fc72d6bc23e10b5920a6f365b4'
+ $url64 = 'https://github.com/myfreeer/7z-build-nsis/releases/download/23.01/7z2301-x64.exe'
+ $checksum64 = 'b7f1d8360d988808447f9af3989db7665dfec72bac83c8b6467cc35f8fe718ff'
$packageArgs = @{
packageName = ${Env:ChocolateyPackageName}
@@ -30,11 +30,20 @@ try {
$executablePath = Join-Path $toolDir "${toolName}FM.exe" -Resolve
VM-Install-Shortcut $toolName $category $executablePath
+ # Test integrity of the archive (which also check that the password is correct) before extraction.
+ $7zCommand = @'
+ cmd /c (7z t -pinfected "%1" || (
+ cmd /c start mshta vbscript:Execute^(
+ "msgbox ""The password is not 'infected' or the archive is corrupted!!"", vbOKOnly, ""7z Error"":close"
+ ^) && call
+ )) && 7z x -pinfected "%1"
+'@ -replace "`t", "" -replace "`n", ""
+
# Add 7z unzip with password "infected" to the right menu for the most common extensions.
# 7z can unzip other file extensions like .docx but these don't likely use the infected password.
$extensions = @(".7z", ".bzip2", ".gzip", ".tar", ".wim", ".xz", ".txz", ".zip", ".rar")
foreach ($extension in $extensions) {
- VM-Add-To-Right-Click-Menu $toolName 'unzip "infected"' "`"$7zExecutablePath`" x -pinfected `"%1`"" "$executablePath" -extension $extension
+ VM-Add-To-Right-Click-Menu $toolName 'unzip "infected"' $7zCommand $executablePath -extension $extension
VM-Set-Open-With-Association $executablePath $extension
}
} catch {
diff --git a/packages/7zip-nsis.vm/tools/chocolateyuninstall.ps1 b/packages/7zip.vm/tools/chocolateyuninstall.ps1
similarity index 100%
rename from packages/7zip-nsis.vm/tools/chocolateyuninstall.ps1
rename to packages/7zip.vm/tools/chocolateyuninstall.ps1