{
    "##": "The license will be inside the app directory after installation.",
    "version": "11.40b",
    "homepage": "https://www.petges.lu",
    "description": "A Windows Explorer shell extension that allows users to easily change file and folder properties with a right-click.",
    "license": "Freeware",
    "notes": [
        "BRAZILIAN PORTUGUESE is unavailable due to the developer removing support for the language.",
        "",
        "IMPORTANT FOR NON-ENGLISH SPEAKERS!!!",
        "If you want this application translated to your native language, please run the following command:",
        "change-ac-language.ps1 <language_id>",
        "",
        "1 = CZECH       5 = HUNGARIAN    9 = POLISH       13 = ENGLISH",
        "2 = DANISH      6 = ITALIAN     10 = SPANISH",
        "3 = FRENCH      7 = KOREAN      11 = SWEDISH",
        "4 = GERMAN      8 = DUTCH       12 = TURKISH",
        "",
        "Ex. If you want the Attribute Changer interface language to Czech, you would run:",
        "change-ac-language.ps1 1"
    ],
    "url": "https://www.petges.lu/pubfiles/ac-11_40b.exe",
    "hash": "md5:16bf84bb8e68853a05a000140e4ee6b4",
    "innosetup": true,
    "architecture": {
        "64bit": {
            "pre_install": [
                "if (!(is_admin)) { error \"$app requires admin rights to $cmd\"; break }",
                "Get-ChildItem \"$dir\\*,1*\" -Include '*.exe', '*.dll' | Remove-Item",
                "Get-ChildItem \"$dir\\*,2*\" -Include '*.exe', '*.dll' | Rename-Item -NewName { $_ -replace '\\,2', '' }",
                "Start-Process 'regsvr32' -ArgumentList @(\"$dir\\acshell.dll\", '/s') -Verb 'RunAs' -Wait; Stop-Process -Name 'explorer' -ErrorAction 'SilentlyContinue' -Force",
                "Start-Sleep -Seconds 2"
            ]
        },
        "32bit": {
            "pre_install": [
                "if (!(is_admin)) { error \"$app requires admin rights to $cmd\"; break }",
                "Get-ChildItem \"$dir\\*,2*\" -Include '*.exe', '*.dll' | Remove-Item",
                "Get-ChildItem \"$dir\\*,1*\" -Include '*.exe', '*.dll' | Rename-Item -NewName { $_ -replace '\\,1', '' }",
                "Start-Process 'regsvr32' -ArgumentList @(\"$dir\\acshell.dll\", '/s') -Verb 'RunAs' -Wait; Stop-Process -Name 'explorer' -ErrorAction 'SilentlyContinue' -Force",
                "Start-Sleep -Seconds 2"
            ]
        }
    },
    "installer": {
        "script": [
            "$value = @\"",
            "if (!(`$args.Count -eq 1)) { Write-Host 'INVALID USAGE! Please run ``scoop info attribute-changer`` for help on proper command usage.'; exit }",
            "`$ac_language = `$args[0].toString()",
            "Copy-Item \"$dir\\messages,`$ac_language.ini\" \"$dir\\messages.ini\" -Force",
            "Copy-Item \"$dir\\ac,`$ac_language.pdf\" \"$dir\\ac.pdf\" -Force",
            "\"@",
            "Set-Content \"$dir\\change-ac-language.ps1\" $value -Encoding 'utf8' -Force"
        ]
    },
    "bin": [
        "acmain.exe",
        "change-ac-language.ps1"
    ],
    "shortcuts": [
        [
            "acmain.exe",
            "Attribute Changer"
        ]
    ],
    "post_install": [
        "$documents = (Get-ChildItem $dir -Filter '*.pdf').Length; $subtract = $documents - 5",
        "Copy-Item \"$dir\\template.ini\" \"$dir\\messages,$documents.ini\"; Copy-Item \"$dir\\template.ini\" \"$dir\\messages.ini\"; Copy-Item \"$dir\\ac,$(($documents - $subtract) - 2).pdf\" \"$dir\\ac.pdf\"",
        "Remove-Item \"$dir\\ac,$(($documents - $subtract) - 2).pdf\"; Copy-Item \"$dir\\messages,$(($documents - $subtract) - 2).ini\" \"$dir\\messages.ini\" -Force",
        "$Value = $documents - $subtract",
        "for ($count = 0; $count -le ($documents - 3); $count++) {",
        "    $OriginalValue = $Value + $count; $NewValue = $OriginalValue - 1; Rename-Item \"$dir\\ac,$OriginalValue.pdf\" \"ac,$NewValue.pdf\" -ErrorAction 'SilentlyContinue'",
        "}",
        "Copy-Item \"$dir\\ac.pdf\" \"$dir\\ac,$documents.pdf\""
    ],
    "pre_uninstall": [
        "if (!(is_admin)) { error \"$app requires admin rights to $cmd\"; break }",
        "Start-Process 'regsvr32' -ArgumentList @('/u', \"$dir\\acshell.dll\", '/s') -Verb 'RunAs' -Wait; Stop-Process -Name 'explorer' -Force",
        "Stop-Process -Name 'dllhost' -ErrorAction 'SilentlyContinue' -Force; Start-Sleep -Seconds 2"
    ],
    "checkver": "(?:v|V)ersion\\s([\\w.]+)",
    "autoupdate": {
        "url": "https://www.petges.lu/pubfiles/ac-$underscoreVersion.exe",
        "hash": {
            "url": "https://www.petges.lu/download/",
            "regex": "(?s)$version.*?MD5\\sChecksum\\:\\s$md5"
        }
    }
}
