diff --git a/packages/7zip.plugin.asar.vm/7zip.plugin.asar.vm.nuspec b/packages/7zip.plugin.asar.vm/7zip.plugin.asar.vm.nuspec new file mode 100644 index 000000000..e59c1c071 --- /dev/null +++ b/packages/7zip.plugin.asar.vm/7zip.plugin.asar.vm.nuspec @@ -0,0 +1,13 @@ + + + + 7zip.plugin.asar.vm + 1.5.0.20240930 + Asar7z is a small plugin for the popular 7-Zip archiver. You can use Asar7z with 7-Zip to open, modify, or create .asar archives, which are used for packaging applications based on the Electron framework. + tc4shell + + + + + + diff --git a/packages/7zip.plugin.asar.vm/tools/chocolateyinstall.ps1 b/packages/7zip.plugin.asar.vm/tools/chocolateyinstall.ps1 new file mode 100644 index 000000000..7f1cb2553 --- /dev/null +++ b/packages/7zip.plugin.asar.vm/tools/chocolateyinstall.ps1 @@ -0,0 +1,29 @@ +$ErrorActionPreference = 'Stop' +Import-Module vm.common -Force -DisableNameChecking + +try { + $toolName = "Asar" + $pluginsDir = Join-Path ${Env:ProgramFiles} "7-Zip\Formats" + New-Item -ItemType Directory -Force -Path $pluginsDir | Out-Null + + $pluginUrl = "https://www.tc4shell.com/binary/Asar.zip" + $pluginSha256 = "ea17751b2d7d607dfc11612e71d0c9d36561e643cdfb2bfb16922a9a0ec6d250" + + $tempDownloadDir = Join-Path ${Env:chocolateyPackageFolder} "temp_$([guid]::NewGuid())" + $packageArgs = @{ + packageName = ${Env:ChocolateyPackageName} + unzipLocation = $tempDownloadDir + url = $pluginUrl + checksum = $pluginSha256 + checksumType = 'sha256' + } + Install-ChocolateyZipPackage @packageArgs | Out-Null + VM-Assert-Path $tempDownloadDir + + Copy-Item "$tempDownloadDir\$toolName.64.dll" $pluginsDir + VM-Assert-Path (Join-Path $pluginsDir "$toolName.64.dll") + + Remove-Item $tempDownloadDir -Recurse -Force -ea 0 +} catch { + VM-Write-Log-Exception $_ +} diff --git a/packages/7zip.plugin.asar.vm/tools/chocolateyuninstall.ps1 b/packages/7zip.plugin.asar.vm/tools/chocolateyuninstall.ps1 new file mode 100644 index 000000000..bc38c58f5 --- /dev/null +++ b/packages/7zip.plugin.asar.vm/tools/chocolateyuninstall.ps1 @@ -0,0 +1,5 @@ +$ErrorActionPreference = 'Continue' + +$toolName = "Asar" +$pluginsDir = Join-Path ${Env:ProgramFiles} "7-Zip\Formats" +Remove-Item (Join-Path $pluginsDir "$toolName.64.dll") -Force -ea 0 diff --git a/scripts/test/lint.py b/scripts/test/lint.py index 16d8452b1..8689cc000 100644 --- a/scripts/test/lint.py +++ b/scripts/test/lint.py @@ -335,6 +335,7 @@ class UsesInvalidCategory(Lint): "python3.vm", "x64dbgpy.vm", "vscode.extension.", + "7zip.plugin.", ] root_path = os.path.abspath(os.path.join(__file__, "../../.."))