{
    "version": "4.1.9.30",
    "description": "Free messaging and calling app by Tencent",
    "homepage": "https://www.wechat.com/",
    "license": {
        "identifier": "Proprietary",
        "url": "https://www.wechat.com/en/service_terms.html"
    },
    "architecture": {
        "64bit": {
            "url": "https://github.com/cscnk52/wechat-windows-versions/releases/download/v4.1.9.30/weixin_4.1.9.30.exe#/dl.7z",
            "hash": "81d05e79ead9d310bdf00b64e94809fe808adbe21d95588bf3a52395c29c52bd"
        }
    },
    "installer": {
        "script": [
            "Expand-7zipArchive \"$dir\\install.7z\" \"$dir\" -Removal",
            "Remove-Item \"$dir\\`$*\", \"$dir\\Uninst*\" -Force -Recurse",
            "$config_path = \"$env:APPDATA\\Tencent\\xwechat\\config\"",
            "ensure \"$config_path\" | Out-Null",
            "Set-Content -NoNewline -Path \"$config_path\\51a1fffea11325a1e4104c6b3de47af7.ini\" -Value \"$persist_dir\"",
            "$reg_path = \"HKCU:Software\\Tencent\\Wexin\"",
            "if (!(Test-Path \"$reg_path\")) {",
            "    New-Item -Path \"$reg_path\" -Type Directory -Force | Out-Null",
            "}",
            "New-ItemProperty -Path $reg_path -Name \"FileSavePath\" -Value \"$persist_dir\" -Force | Out-Null",
            "New-Item -Path $reg_path -Name \"InstallPath\" -Value \"$dir\" -Force -ErrorAction SilentlyContinue | Out-Null"
        ]
    },
    "uninstaller": {
        "script": [
            "Remove-Item -Path \"$env:APPDATA\\Tencent\\xwechat\\config\\51a1fffea11325a1e4104c6b3de47af7.ini\" -Force | Out-Null",
            "Remove-ItemProperty -Path \"HKCU:Software\\Tencent\\Wexin\" -Name \"FileSavePath\" -Force | Out-Null"
        ]
    },
    "shortcuts": [
        [
            "Weixin.exe",
            "WeChat"
        ]
    ],
    "persist": "xwechat_files",
    "checkver": {
        "github": "https://github.com/cscnk52/wechat-windows-versions"
    },
    "autoupdate": {
        "architecture": {
            "64bit": {
                "url": "https://github.com/cscnk52/wechat-windows-versions/releases/download/v$version/weixin_$version.exe#/dl.7z"
            }
        }
    }
}
