{
    "version": "106.0.4998.70",
    "description": "Fast, secure, easy-to-use browser.",
    "homepage": "https://www.opera.com/",
    "license": {
        "identifier": "Freeware",
        "url": "https://www.opera.com/eula/computers"
    },
    "architecture": {
        "64bit": {
            "url": "https://get.geo.opera.com/pub/opera/desktop/106.0.4998.70/win/Opera_106.0.4998.70_Setup_x64.exe#/dl.7z",
            "hash": "ee4a8a9cbe842ebd1edf6d7f7bf2b2c57fb5afff3d7f89a7923d925bd247a1f2"
        },
        "32bit": {
            "url": "https://get.geo.opera.com/pub/opera/desktop/106.0.4998.70/win/Opera_106.0.4998.70_Setup.exe#/dl.7z",
            "hash": "94911493fe7182edad1c67698536c9b1d2de8592a1454f1e122722cb1ef7955c"
        }
    },
    "installer": {
        "script": [
            "Remove-Item -Path \"$dir\\*_list\" -Force",
            "Move-Item -Path \"$dir\\*\" -Destination \"$dir\\$version\" -Exclude 'Assets', 'launcher*', 'Resources.pri' -ErrorAction Ignore",
            "if (!(Test-Path \"$dir\\$version\\localization\")) {",
            "   New-Item -Path \"$dir\\$version\\localization\" -ItemType Directory | Out-Null",
            "   Move-Item -Path \"$dir\\$version\\*.pak\" -Destination \"$dir\\$version\\localization\" -Exclude 'opera*' -ErrorAction Ignore",
            "}",
            "Set-Content -Path \"$dir\\installer_prefs.json\" -Value (@{ 'autoupdate'= $false; 'enable_stats' = $false; 'single_profile' = $true } | ConvertTo-Json) -Encoding ASCII"
        ]
    },
    "shortcuts": [
        [
            "launcher.exe",
            "Opera"
        ]
    ],
    "persist": "profile",
    "checkver": {
        "script": [
            "$releases = 'https://get.geo.opera.com/pub/opera/desktop/'",
            "$download_page = Invoke-WebRequest -Uri $releases -UseBasicParsing",
            "$versionSort   = { [version]$_.href.TrimEnd('/') }",
            "$last_ver = $download_page.links | Where-Object href -match '^[\\d]+[\\d\\.]+/$' | Sort-Object $versionSort -Descending | Select-Object -first 1 -expand href",
            "$version = $last_ver -replace '/', ''",
            "Write-Output $version"
        ],
        "regex": "(\\S+)"
    },
    "autoupdate": {
        "architecture": {
            "64bit": {
                "url": "https://get.geo.opera.com/pub/opera/desktop/$version/win/Opera_$version_Setup_x64.exe#/dl.7z"
            },
            "32bit": {
                "url": "https://get.geo.opera.com/pub/opera/desktop/$version/win/Opera_$version_Setup.exe#/dl.7z"
            }
        },
        "hash": {
            "url": "$url.sha256sum"
        }
    }
}
