Skip to content

Commit

Permalink
Package proposal: magika
Browse files Browse the repository at this point in the history
  • Loading branch information
emtuls committed Mar 6, 2024
1 parent 11f59e9 commit 078dfe8
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
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.0</version>
<authors>Google</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" />
</dependencies>
</metadata>
</package>
19 changes: 19 additions & 0 deletions packages/magika.vm/tools/chocolateyinstall.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
$ErrorActionPreference = 'Continue'
Import-Module vm.common -Force -DisableNameChecking

try {
$toolName = 'magika'
$category = 'File Information'
$executablePath = $toolName
$arguments = " -h"
$iconLocation = Join-Path ${Env:WinDir} "system32\cmd.exe" -Resolve

# 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 $toolName 2>&1 >> $outputFile"

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

0 comments on commit 078dfe8

Please sign in to comment.