{
    "version": "3.4.3.3337",
    "description": "A flexible virtual private network (VPN) solution to secure data communications.",
    "homepage": "https://openvpn.net",
    "license": "GPL-2.0-only",
    "architecture": {
        "64bit": {
            "url": "https://swupdate.openvpn.net/downloads/connect/openvpn-connect-3.4.3.3337_signed.msi",
            "hash": "7bf942de0db9d02bcce88420db1dea26d0f0be62bf68b463b8edfbf0d9b7d1ad"
        },
        "32bit": {
            "url": "https://swupdate.openvpn.net/downloads/connect/openvpn-connect-3.4.3.3337_signed_x86.msi",
            "hash": "d03beff03bdb9313872be4b357829a9e4956889aa80949bab6ee22cde58ad581"
        }
    },
    "extract_dir": "OpenVPN Connect",
    "pre_install": [
        "# OpenVPN Connect cannot work under junctions ('current'), therefore we need to manually create the shortcut",
        "$scoop_startmenu_folder = Join-Path $([Environment]::GetFolderPath($(if ($global) {'commonstartmenu'} else {'startmenu'}))) 'Programs\\Scoop Apps'",
        "$exe_dir = versiondir 'openvpn-connect' $version",
        "$wsShell = New-Object -ComObject WScript.Shell",
        "$wsShell = $wsShell.CreateShortcut(\"$scoop_startmenu_folder\\OpenVPN Connect.lnk\")",
        "$wsShell.TargetPath = \"$exe_dir\\OpenVPNConnect.exe\"",
        "$wsShell.WorkingDirectory = \"$exe_dir\"",
        "$wsShell.Save()"
    ],
    "uninstaller": {
        "script": [
            "$scoop_startmenu_folder = Join-Path $([Environment]::GetFolderPath($(if ($global) {'commonstartmenu'} else {'startmenu'}))) 'Programs\\Scoop Apps'",
            "Remove-Item \"$scoop_startmenu_folder\\OpenVPN Connect.lnk\" -Force"
        ]
    },
    "bin": "ovpnconnector.exe",
    "checkver": {
        "url": "https://openvpn.net/vpn-server-resources/openvpn-connect-for-windows-change-log/",
        "regex": "Release notes for ([\\d.]+) \\((\\d+)\\)",
        "replace": "${1}.${2}"
    },
    "autoupdate": {
        "architecture": {
            "64bit": {
                "url": "https://swupdate.openvpn.net/downloads/connect/openvpn-connect-$version_signed.msi",
                "hash": {
                    "url": "https://openvpn.net/client-connect-vpn-for-windows/",
                    "regex": "(?sm)v3-windows\\.msi.*?$sha256"
                }
            },
            "32bit": {
                "url": "https://swupdate.openvpn.net/downloads/connect/openvpn-connect-$version_signed_x86.msi",
                "hash": {
                    "url": "https://openvpn.net/client-connect-vpn-for-windows/",
                    "regex": "(?sm)v3-windows-x86\\.msi.*?$sha256"
                }
            }
        }
    }
}
