-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #781 from naacbin/dcode
Add dcode
- Loading branch information
Showing
3 changed files
with
95 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 $_ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |