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 Sep 30, 2024
1 parent 6b95e46 commit a80c3c5
Show file tree
Hide file tree
Showing 3 changed files with 44 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>
26 changes: 26 additions & 0 deletions packages/7zip.plugin.asar.vm/tools/chocolateyinstall.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
$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

$zipUrl = "https://www.tc4shell.com/binary/Asar.zip"
$zipSha256 = "ea17751b2d7d607dfc11612e71d0c9d36561e643cdfb2bfb16922a9a0ec6d250"

$packageArgs = @{
packageName = ${Env:ChocolateyPackageName}
unzipLocation = $pluginsDir
url = $zipUrl
checksum = $zipSha256
checksumType = 'sha256'
}
Install-ChocolateyZipPackage @packageArgs
VM-Assert-Path (Join-Path $pluginsDir "$toolName.64.dll")

Remove-Item (Join-Path $pluginsDir "$toolName.32.dll") -Force -ea 0
Remove-Item (Join-Path $pluginsDir "ReadMe.txt") -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

0 comments on commit a80c3c5

Please sign in to comment.