Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package proposal: magika #935

Merged
merged 1 commit into from
Apr 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/common.vm/common.vm.nuspec
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
<metadata>
<id>common.vm</id>
<version>0.0.0.20240404</version>
<version>0.0.0.20240409</version>
<description>Common libraries for VM-packages</description>
<authors>Mandiant</authors>
</metadata>
10 changes: 10 additions & 0 deletions packages/common.vm/tools/vm.common/vm.common.psm1
Original file line number Diff line number Diff line change
@@ -1550,3 +1550,13 @@ function VM-Get-MSIInstallerPathByProductName {
VM-Write-Log-Exception $_ "An error occurred: $_"
}
}

function VM-Pip-Install {
param (
[string]$package
)
# Create output file to log python module installation details
$outputFile = VM-New-Install-Log ${Env:VM_COMMON_DIR}

Invoke-Expression "py -3.10 -m pip install $package --disable-pip-version-check 2>&1 >> $outputFile"
}
13 changes: 13 additions & 0 deletions packages/magika.vm/magika.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>magika.vm</id>
<version>0.5.1</version>
<authors>Yanick Fratantonio, Luca Invernizzi, Marina Zhang, Giancarlo Metitieri, Thomas Kurt, Francois Galilee, Alexandre Petit-Bianco, Loua Farah, Ange Albertini, Elie Bursztein</authors>
<description>Magika is an AI powered file type detection tool that uses deep learning to provide accurate detection.</description>
<dependencies>
<dependency id="common.vm" />
<dependency id="python3.vm" />
emtuls marked this conversation as resolved.
Show resolved Hide resolved
</dependencies>
</metadata>
</package>
16 changes: 16 additions & 0 deletions packages/magika.vm/tools/chocolateyinstall.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
$ErrorActionPreference = 'Stop'
Import-Module vm.common -Force -DisableNameChecking

try {
$toolName = 'magika'
$category = 'File Information'

VM-Pip-Install $toolName

$executablePath = "$(where.exe $toolName)"
$arguments = "--help"

VM-Install-Shortcut $toolName $category $executablePath -consoleApp $true -arguments $arguments -iconLocation $iconLocation
} catch {
VM-Write-Log-Exception $_
}
9 changes: 9 additions & 0 deletions packages/magika.vm/tools/chocolateyuninstall.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
$ErrorActionPreference = 'Continue'
Import-Module vm.common -Force -DisableNameChecking

$toolName = 'magika'
$category = 'File Information'

Invoke-Expression "py -3.10 -m pip uninstall $toolName -y"

VM-Uninstall $toolName $category
Loading