{
    "##": "Renaming .msi to .msi_ to avoid auto extraction",
    "version": "2.6.8-I001",
    "description": "A flexible virtual private network (VPN) solution to secure data communications.",
    "homepage": "https://openvpn.net",
    "license": "GPL-2.0-only",
    "suggest": {
        "openssl": "openssl"
    },
    "architecture": {
        "64bit": {
            "url": "https://swupdate.openvpn.org/community/releases/OpenVPN-2.6.8-I001-amd64.msi#/setup.msi_",
            "hash": "f6e9c5f83593ba4be289f1710b1f5ad1b867910ae74402eccfc2ed68e892c930"
        },
        "32bit": {
            "url": "https://swupdate.openvpn.org/community/releases/OpenVPN-2.6.8-I001-x86.msi#/setup.msi_",
            "hash": "ae7e0028a7b2e3790a49683aacb0d6bb52d2d86385381ed35706679d065c3cda"
        },
        "arm64": {
            "url": "https://swupdate.openvpn.org/community/releases/OpenVPN-2.6.8-I001-arm64.msi#/setup.msi_",
            "hash": "084900f96f28adff35fd8d957c5c4f2ebd82267d790b6d395224c459c9fe4c7e"
        }
    },
    "pre_install": [
        "if ([Environment]::OSVersion.Version.Major -lt 10) { error 'Windows 10 is required since version 2.4.8. Use \"versions/openvpn-w7\" instead'; break }",
        "if (-not (is_admin)) { error 'Administrator privileges are needed for installation'; break }",
        "Invoke-ExternalCommand msiexec -ArgumentList @('/i', \"`\"$dir\\setup.msi_`\"\", \"PRODUCTDIR=`\"$dir`\"\", 'ADDLOCAL=OpenVPN.GUI,OpenVPN.Service,OpenVPN.Documentation,OpenVPN.SampleCfg,OpenSSL,EasyRSA,OpenVPN,OpenVPN.GUI.OnLogon,Drivers.TAPWindows6,Drivers,Drivers.Wintun', '/passive') -RunAs | Out-Null",
        "if (Test-Path \"$persist_dir\\config\") { Copy-Item \"$persist_dir\\config\" \"$dir\\\" -Force -Recurse }",
        "else { Copy-Item \"$dir\\sample-config\\*\" \"$dir\\config\\\" }",
        "Remove-Item \"$Env:Public\\Desktop\\OpenVPN*.lnk\""
    ],
    "pre_uninstall": [
        "# Persist manually because the uninstaller deletes the 'config' folder",
        "if (Test-Path \"$dir\\config\") {",
        "    ensure \"$persist_dir\" | Out-Null",
        "    Copy-Item \"$dir\\config\" \"$persist_dir\\\" -Force -Recurse",
        "}",
        "Stop-Process -Name 'openvpn*' -Force -ErrorAction SilentlyContinue"
    ],
    "uninstaller": {
        "script": [
            "if (-not (is_admin)) { error 'Admin privileges are needed.'; break }",
            "Invoke-ExternalCommand msiexec -ArgumentList ('/x', \"`\"$dir\\setup.msi_`\"\", '/passive') -RunAs | Out-Null"
        ]
    },
    "bin": "bin\\openvpn.exe",
    "checkver": {
        "url": "https://openvpn.net/index.php/open-source/downloads.html",
        "regex": "OpenVPN-([\\d.]+-I[\\d]+)-amd64\\.msi"
    },
    "autoupdate": {
        "architecture": {
            "64bit": {
                "url": "https://swupdate.openvpn.org/community/releases/OpenVPN-$version-amd64.msi#/setup.msi_"
            },
            "32bit": {
                "url": "https://swupdate.openvpn.org/community/releases/OpenVPN-$version-x86.msi#/setup.msi_"
            },
            "arm64": {
                "url": "https://swupdate.openvpn.org/community/releases/OpenVPN-$version-arm64.msi#/setup.msi_"
            }
        }
    }
}
