{
    "##": "Please keep the key properties of games/prismlauncher and versions/prismlauncher-git in sync.",
    "version": "11.0-2338455",
    "description": "An open source Minecraft launcher with the ability to manage multiple instances, accounts and mods. Focused on user freedom and free redistributability.",
    "homepage": "https://prismlauncher.org/",
    "license": "GPL-3.0-only",
    "notes": [
        "Add Prism Launcher file association options for .ZIPs and .MRPACKS by running:",
        "reg import \"$dir\\install-associations.reg\""
    ],
    "suggest": {
        "vcredist": "extras/vcredist2022"
    },
    "architecture": {
        "64bit": {
            "url": "https://nightly.link/PrismLauncher/PrismLauncher/workflows/build/develop/PrismLauncher-Windows-MinGW-w64-Portable-2338455-Debug.zip",
            "hash": "50d6fae7147252222239206d0005647ac0866c16e38d1592c8cbd333b527cdaf"
        },
        "arm64": {
            "url": "https://nightly.link/PrismLauncher/PrismLauncher/workflows/build/develop/PrismLauncher-Windows-MinGW-arm64-Portable-2338455-Debug.zip",
            "hash": "649a28b29771e5720cde226d567e60579471ff21cb0dc2b023e05fb01694922f"
        }
    },
    "pre_install": [
        "# Hardlinks cannot work properly here, as this app would create a new file instead of writing directly.",
        "# Please keep the file list the same in both pre_install and pre_uninstall scripts.",
        "$contents = @{",
        "    'metacache' = '{}'",
        "}",
        "'accounts.json', 'metacache', 'prismlauncher.cfg' | ForEach-Object {",
        "    if (Test-Path \"$persist_dir\\$_\") {",
        "        Copy-Item \"$persist_dir\\$_\" \"$dir\\$_\" -Force",
        "    } else {",
        "        Set-Content -Path \"$dir\\$_\" -Value $contents[$_]",
        "    }",
        "}",
        "Remove-Item -Path $dir\\prismlauncher_updater.exe -Force -ErrorAction Ignore"
    ],
    "post_install": [
        "'install-associations', 'uninstall-associations' | ForEach-Object {",
        "    if (Test-Path \"$bucketsdir\\versions\\scripts\\prismlauncher-git\\$_.reg\") {",
        "        $exePath = \"$dir\\prismlauncher.exe\".Replace('\\', '\\\\')",
        "        $content = (Get-Content \"$bucketsdir\\versions\\scripts\\prismlauncher-git\\$_.reg\").Replace('$EXEPATH', $exePath)",
        "        if ($global) { $content = $content.Replace('HKEY_CURRENT_USER', 'HKEY_LOCAL_MACHINE') }",
        "        Set-Content \"$dir\\$_.reg\" $content -Encoding Ascii -Force",
        "    }",
        "}"
    ],
    "bin": "prismlauncher.exe",
    "shortcuts": [
        [
            "prismlauncher.exe",
            "Prism Launcher"
        ]
    ],
    "persist": [
        "assets",
        "cache",
        "catpacks",
        "icons",
        "iconthemes",
        "instances",
        "java",
        "libraries",
        "logs",
        "meta",
        "mods",
        "skins",
        "themes",
        "translations"
    ],
    "pre_uninstall": [
        "# Hardlinks cannot work properly here, as this app would create a new file instead of writing directly.",
        "# Please keep the file list the same in both pre_install and pre_uninstall scripts.",
        "'accounts.json', 'metacache', 'prismlauncher.cfg' | ForEach-Object {",
        "    if (Test-Path -Path \"$dir\\$_\") {",
        "        Copy-Item -Path \"$dir\\$_\" -Destination \"$persist_dir\\$_\" -Force",
        "    }",
        "}",
        "if ($cmd -eq 'uninstall') { reg import \"$dir\\uninstall-associations.reg\" }"
    ],
    "checkver": {
        "github": "https://api.github.com/repos/PrismLauncher/PrismLauncher/actions/workflows/build.yml/runs?branch=develop&status=success&event=push",
        "script": [
            "$workflows = $page | ConvertFrom-Json",
            "$fullSha = $workflows.workflow_runs[0].head_sha",
            "$cmakeContent = Invoke-WebRequest \"https://raw.githubusercontent.com/PrismLauncher/PrismLauncher/$fullSha/CMakeLists.txt\" | Select-Object -ExpandProperty Content",
            "$majorVersion = [regex]::Match($cmakeContent, 'set\\(Launcher_VERSION_MAJOR (\\d+)\\)').Groups[1].Value",
            "$minorVersion = [regex]::Match($cmakeContent, 'set\\(Launcher_VERSION_MINOR (\\d+)\\)').Groups[1].Value",
            "$version = \"$majorVersion.$minorVersion-$fullSha\"",
            "$version"
        ],
        "regex": "(?<version>[\\d.]+)-(?<sha>[a-f0-9]{7,7})",
        "replace": "${version}-${sha}"
    },
    "autoupdate": {
        "architecture": {
            "64bit": {
                "url": "https://nightly.link/PrismLauncher/PrismLauncher/workflows/build/develop/PrismLauncher-Windows-MinGW-w64-Portable-$matchSha-Debug.zip"
            },
            "arm64": {
                "url": "https://nightly.link/PrismLauncher/PrismLauncher/workflows/build/develop/PrismLauncher-Windows-MinGW-arm64-Portable-$matchSha-Debug.zip"
            }
        }
    }
}
