Skip to content

Commit

Permalink
Merge pull request #781 from naacbin/dcode
Browse files Browse the repository at this point in the history
Add dcode
  • Loading branch information
Ana06 authored Dec 22, 2023
2 parents 9cc8c7f + f807531 commit 8842a36
Show file tree
Hide file tree
Showing 3 changed files with 95 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/dcode.vm/dcode.vm.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
<metadata>
<id>dcode.vm</id>
<version>5.5.21194.20231212</version>
<authors>Digital Detective Group</authors>
<description>Utility for converting data found on desktop and mobile devices into human-readable timestamps.</description>
<dependencies>
<dependency id="common.vm" />
</dependencies>
</metadata>
</package>
76 changes: 76 additions & 0 deletions packages/dcode.vm/tools/chocolateyinstall.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
$ErrorActionPreference = 'Stop'
Import-Module vm.common -Force -DisableNameChecking

$toolName = 'DCode'
$category = 'Utilities'

$url = 'https://www.digital-detective.net/download/download.php?downcode=ae2znu5994j1lforlh03'
$sha256 = 'dbb23d6ea4f572fbaec017fb8acc2a8b62b74fafa81ea4a388966ec14087a9e4'

$toolDir = Join-Path ${Env:ProgramFiles(x86)} "Digital Detective"
$toolDir = Join-Path $toolDir "$toolName v5"
$executablePath = Join-Path $toolDir "$toolName.exe"

$fileType = "EXE"
$silentArgs = '/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP- /MERGETASKS="!desktopicon"'
$validExitCodes= @(0, 3010, 1605, 1614, 1641)
$consoleApp=$false
$arguments = ""
#VM-Install-With-Installer -toolName $toolName -category $category -fileType "EXE" -silentArgs '/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP- /MERGETASKS="!desktopicon"' -executablePath $executablePath -url $exeUrl -sha256 $exeSha256

try {
$toolDir = Join-Path ${Env:RAW_TOOLS_DIR} $toolName

# Get the file extension from the URL
$installerName = Split-Path -Path $url -Leaf
$ext = "zip"

# Download and install
$packageArgs = @{
packageName = ${Env:ChocolateyPackageName}
url = $url
checksum = $sha256
checksumType = "sha256"
}
if ($ext -in @("zip", "7z")) {
VM-Remove-PreviousZipPackage ${Env:chocolateyPackageFolder}
$unzippedDir= Join-Path $toolDir "$($toolName)_installer"
$packageArgs['unzipLocation'] = $unzippedDir
Install-ChocolateyZipPackage @packageArgs
VM-Assert-Path $unzippedDir

$exePaths = Get-ChildItem $unzippedDir | Where-Object { $_.Name.ToLower() -match '^.*\.(exe|msi)$' }
if ($exePaths.Count -eq 1) {
$installerPath = $exePaths[0].FullName
} else {
$exePaths = Get-ChildItem $unzippedDir | Where-Object { $_.Name.ToLower() -match '^.*(setup|install).*\.(exe|msi)$' }
if ($exePaths.Count -eq 1) {
$installerPath = $exePaths[0].FullName
} else {
throw "Unable to determine installer file within: $unzippedDir"
}
}
} else {
$installerPath = Join-Path $toolDir $installerName
$packageArgs['fileFullPath'] = $installerPath
Get-ChocolateyWebFile @packageArgs
VM-Assert-Path $installerPath
}

# Install tool via native installer
$packageArgs = @{
packageName = ${Env:ChocolateyPackageName}
fileType = $fileType
file = $installerPath
silentArgs = $silentArgs
validExitCodes= $validExitCodes
softwareName = $toolName
}
Install-ChocolateyInstallPackage @packageArgs
VM-Assert-Path $executablePath

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

$toolName = 'DCode'
$category = 'Utilities'

VM-Uninstall $toolName $category

0 comments on commit 8842a36

Please sign in to comment.