{
    "version": "8.46-5960",
    "description": "Comprehensive Hardware Analysis, Monitoring and Reporting for Windows and DOS.",
    "homepage": "https://www.hwinfo.com",
    "license": {
        "identifier": "Freeware",
        "url": "https://www.hwinfo.com/licenses/"
    },
    "url": "https://www.sac.sk/download/utildiag/hwi_846.zip",
    "hash": "af88b25070605f2d32b336381de70afabf8dac1e72adad1820dbe9ef1fb3f12d",
    "architecture": {
        "64bit": {
            "pre_install": "Get-ChildItem -Path $dir -Include '*32*', '*ARM*' -Recurse -File | Remove-Item -Force -ErrorAction SilentlyContinue",
            "bin": [
                [
                    "HWiNFO64.exe",
                    "HWiNFO"
                ]
            ],
            "shortcuts": [
                [
                    "HWiNFO64.exe",
                    "HWiNFO"
                ]
            ]
        },
        "32bit": {
            "pre_install": "Get-ChildItem -Path $dir -Include '*64*' -Recurse -File | Remove-Item -Force -ErrorAction SilentlyContinue",
            "bin": [
                [
                    "HWiNFO32.exe",
                    "HWiNFO"
                ]
            ],
            "shortcuts": [
                [
                    "HWiNFO32.exe",
                    "HWiNFO"
                ]
            ]
        },
        "arm64": {
            "pre_install": "Get-ChildItem -Path $dir -Exclude '*ARM*' -Recurse -File | Remove-Item -Force -ErrorAction SilentlyContinue",
            "bin": [
                [
                    "HWiNFO_ARM64.exe",
                    "HWiNFO"
                ]
            ],
            "shortcuts": [
                [
                    "HWiNFO_ARM64.exe",
                    "HWiNFO"
                ]
            ]
        }
    },
    "installer": {
        "script": [
            "ensure $persist_dir | Out-Null",
            "Get-ChildItem -Path $persist_dir -Include '*64_KEY.txt' -Recurse -File | Copy-Item -Destination $dir -Force",
            "$setting_name = if ($architecture -match '\\d{2}(?=bit)') { 'HWiNFO{0}.INI' -f $matches[0] } else { 'HWiNFO_ARM64.INI' }",
            "if (-not (Test-Path -Path \"$persist_dir\\$setting_name\" -PathType Leaf)) {",
            "    $cfg = @('[Settings]', 'AutoUpdate=0', 'AutoUpdateBetaDisable=1')",
            "    Set-Content -Path \"$dir\\$setting_name\" -Value $cfg -Encoding ascii",
            "}",
            "persist_data @{ persist = $setting_name } $original_dir $persist_dir",
            "persist_permission @{ persist = $setting_name } $global"
        ]
    },
    "pre_uninstall": "Get-ChildItem -Path $dir -Filter '*64_KEY.txt' -File | Copy-Item -Destination $persist_dir -Force",
    "uninstaller": {
        "script": [
            "$setting_name = if ($architecture -match '\\d{2}(?=bit)') { 'HWiNFO{0}.INI' -f $matches[0] } else { 'HWiNFO_ARM64.INI' }",
            "unlink_persist_data @{ persist = $setting_name } $dir"
        ]
    },
    "checkver": {
        "url": "https://www.hwinfo.com/ver.txt",
        "regex": "([\\d.-]+)"
    },
    "autoupdate": {
        "url": "https://www.sac.sk/download/utildiag/hwi_$majorVersion$minorVersion.zip"
    }
}
