Skip to content

Commit

Permalink
Add 7zip.plugin.asar.vm
Browse files Browse the repository at this point in the history
  • Loading branch information
d35ha committed Oct 1, 2024
1 parent 6b95e46 commit e4cbcfa
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 0 deletions.
13 changes: 13 additions & 0 deletions packages/7zip.plugin.asar.vm/7zip.plugin.asar.vm.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
<metadata>
<id>7zip.plugin.asar.vm</id>
<version>1.5.0.20240930</version>
<description>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.</description>
<authors>tc4shell</authors>
<dependencies>
<dependency id="common.vm" />
<dependency id="7zip.vm" />
</dependencies>
</metadata>
</package>
29 changes: 29 additions & 0 deletions packages/7zip.plugin.asar.vm/tools/chocolateyinstall.ps1
Original file line number Diff line number Diff line change
@@ -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 $_
}
5 changes: 5 additions & 0 deletions packages/7zip.plugin.asar.vm/tools/chocolateyuninstall.ps1
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions scripts/test/lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ class UsesInvalidCategory(Lint):
"python3.vm",
"x64dbgpy.vm",
"vscode.extension.",
"7zip.plugin.",
]

root_path = os.path.abspath(os.path.join(__file__, "../../.."))
Expand Down

0 comments on commit e4cbcfa

Please sign in to comment.