[
    {
        "UpdateStageName": "Userraw Directory Creation",
        "UpdateSourcePlatform": "All",
        "UpdateSource": "CreateDirectory",
        "UpdateSourceArgs": "{{$FullBaseDir}}userraw",
        "SkipOnFailure": false
    },
    {
        "UpdateStageName": "Mods Directory Creation",
        "UpdateSourcePlatform": "All",
        "UpdateSource": "CreateDirectory",
        "UpdateSourceArgs": "{{$FullBaseDir}}mods"
    },
    {
        "UpdateStageName": "SteamCMD Game Download",
        "UpdateSourcePlatform": "All",
        "UpdateSource": "SteamCMD",
        "UpdateSourceData": "10190",
        "UpdateSourceArgs": "10190",
        "ForceDownloadPlatform": "Windows",
        "SkipOnFailure": false
    },
    {
        "UpdateStageName": "IW4x Launcher Download",
        "UpdateSourcePlatform": "Windows",
        "UpdateSource": "FetchURL",
        "UpdateSourceData": "https://github.com/iw4x/launcher/releases/download/v1.1.6/iw4x-launcher.exe",
        "UpdateSourceTarget": "{{$FullBaseDir}}",
        "OverwriteExistingFiles": true,
        "SkipOnFailure": false
    },
    {
        "UpdateStageName": "IW4x Launcher Download",
        "UpdateSourcePlatform": "Linux",
        "UpdateSource": "FetchURL",
        "UpdateSourceData": "https://github.com/iw4x/launcher/releases/download/v1.1.6/iw4x-launcher-x86_64-unknown-linux-gnu.tar.gz",
        "UpdateSourceTarget": "{{$FullBaseDir}}",
        "UnzipUpdateSource": true,
        "OverwriteExistingFiles": true,
        "DeleteAfterExtract": true,
        "SkipOnFailure": false
    },
    {
        "UpdateStageName": "Client Installation",
        "UpdateSourcePlatform": "Windows",
        "UpdateSource": "Executable",
        "UpdateSourceData": "powershell.exe",
        "UpdateSourceArgs": "-NoProfile -Command \"Set-Location -Path '{{$FullBaseDir}}'; & ./iw4x-launcher.exe --update --skip-self-update --force --path=\\\"{{$FullBaseDir}}\\\"\"",
        "SkipOnFailure": false
    },
    {
        "UpdateStageName": "Client Installation",
        "UpdateSourcePlatform": "Linux",
        "UpdateSource": "Executable",
        "UpdateSourceData": "/bin/bash",
        "UpdateSourceArgs": "-c \"cd ./call-of-dutymw2/10190 && chmod +x iw4x-launcher && ./iw4x-launcher --update --skip-self-update --force --path=\\\"{{$FullBaseDir}}\\\"\"",
        "SkipOnFailure": false
    },
    {
        "UpdateStageName": "Config File Download",
        "UpdateSourcePlatform": "All",
        "UpdateSource": "FetchURL",
        "UpdateSourceData": "https://raw.githubusercontent.com/CubeCoders/AMPTemplates/main/call-of-dutymw2server.cfg",
        "UpdateSourceArgs": "server.cfg",
        "UpdateSourceTarget": "{{$FullBaseDir}}userraw",
        "OverwriteExistingFiles": false,
        "SkipOnFailure": false
    },
    {
        "UpdateStageName": "Initialise Wine",
        "UpdateSourcePlatform": "Linux",
        "UpdateSource": "Executable",
        "UpdateSourceData": "/bin/bash",
        "UpdateSourceArgs": "-c \"rm -rf \\\"{{$FullRootDir}}.wine\\\" >/dev/null 2>&1; WINEPREFIX=\\\"{{$FullRootDir}}.wine\\\" WINEARCH=win32 WINEDEBUG=-all /usr/bin/wineboot --init\"",
        "SkipOnFailure": false
    },
    {
        "UpdateStageName": "Disable Prefix Sound",
        "UpdateSourcePlatform": "Linux",
        "UpdateSource": "Executable",
        "UpdateSourceData": "/bin/bash",
        "UpdateSourceArgs": "-c \"cd call-of-dutymw2 && [[ -f winetricks ]] && rm -f winetricks; wget -q https://raw.githubusercontent.com/Winetricks/winetricks/refs/tags/20260125/src/winetricks && chmod +x winetricks; export WINEPREFIX=\\\"{{$FullRootDir}}.wine\\\"; export WINEARCH=win32; ./winetricks sound=disabled > winescript_log.txt 2>&1\"",
        "SkipOnFailure": true
    }
]