{
    "version": "26.01",
    "description": "A multi-format file archiver with high compression ratios.",
    "homepage": "https://www.7-zip.org",
    "license": {
        "identifier": "BSD-2-Clause, BSD-3-Clause, LGPL-2.1-or-later",
        "url": "https://www.7-zip.org/license.txt"
    },
    "notes": [
        "To register the context menu entry, please execute the following command:",
        "reg import \"$dir\\install-context.reg\"",
        "",
        "If an error occurs while attempting to delete files during uninstallation, run the following command and then retry:",
        "Stop-Process -Name 'explorer'"
    ],
    "architecture": {
        "64bit": {
            "url": "https://github.com/ip7z/7zip/releases/download/26.01/7z2601-x64.msi",
            "hash": "a47ea8dcf8bc08e6de474cae77c828e031fa22cb528f6095defffebf11cd02f2",
            "extract_dir": "Files\\7-Zip"
        },
        "32bit": {
            "url": "https://github.com/ip7z/7zip/releases/download/26.01/7z2601.msi",
            "hash": "9643110e10bd0f2f31afa30d904da77f91161b95cc9b744d2f58c9167e23c1a7",
            "extract_dir": "Files\\7-Zip"
        },
        "arm64": {
            "url": "https://github.com/ip7z/7zip/releases/download/26.01/7z2601-arm64.exe",
            "hash": "1fecf4e3407950939c8ffcc3e42e3039821997dea155301c75369474e5f15175",
            "pre_install": [
                "$7zr = Join-Path $env:TMP '7zr.exe'",
                "Invoke-WebRequest -Uri \"https://github.com/ip7z/7zip/releases/download/$version/7zr.exe\" -OutFile $7zr",
                "Invoke-ExternalCommand $7zr @('x', \"$dir\\$fname\", \"-o$dir\", '-y') | Out-Null",
                "Remove-Item \"$dir\\Uninstall.exe\", \"$dir\\*-arm64.exe\", $7zr"
            ]
        }
    },
    "post_install": [
        "$7zip_dir = $dir -replace '\\\\', '\\\\'",
        "Get-ChildItem -Path \"$bucketsdir\\$bucket\\scripts\\7-zip\" -Filter '*.reg' -File | ForEach-Object {",
        "    $content = Get-Content -Path $_.FullName -Encoding utf8",
        "    if ($global) { $content = $content -replace 'HKEY_CURRENT_USER(?=.+Classes)', 'HKEY_LOCAL_MACHINE' }",
        "    $content -replace '{{7zip_dir}}', $7zip_dir | Set-Content -Path \"$dir\\$($_.Name)\" -Encoding unicode",
        "}"
    ],
    "bin": [
        "7z.exe",
        "7zG.exe",
        "7zFM.exe"
    ],
    "shortcuts": [
        [
            "7zFM.exe",
            "7-Zip\\7-Zip File Manager"
        ],
        [
            "7-zip.chm",
            "7-Zip\\7-Zip Help"
        ]
    ],
    "persist": [
        "Codecs",
        "Formats"
    ],
    "uninstaller": {
        "script": "if ($cmd -eq 'uninstall') { reg import \"$dir\\uninstall-context.reg\" *> $null }"
    },
    "checkver": {
        "github": "https://github.com/ip7z/7zip"
    },
    "autoupdate": {
        "architecture": {
            "64bit": {
                "url": "https://github.com/ip7z/7zip/releases/download/$version/7z$cleanVersion-x64.msi"
            },
            "32bit": {
                "url": "https://github.com/ip7z/7zip/releases/download/$version/7z$cleanVersion.msi"
            },
            "arm64": {
                "url": "https://github.com/ip7z/7zip/releases/download/$version/7z$cleanVersion-arm64.exe"
            }
        }
    }
}
