Repositories/EigenverftModule/VSCodeRuntime.json

{
  "$schema": "./eigenverft-module-package-definition-1.2.schema.json",
  "schemaVersion": "1.2",
  "id": "VSCodeRuntime",
  "display": {
    "default": {
      "name": "Visual Studio Code",
      "publisher": "Microsoft",
      "corporation": "Microsoft Corporation",
      "summary": "Code editor"
    }
  },
  "packageTargets": [
    {
      "id": "VSCodeRuntime-win32-x64-stable",
      "channel": "stable",
      "platformTarget": "win32-x64",
      "constraints": {
        "os": [
          "windows"
        ],
        "cpu": [
          "x64"
        ]
      },
      "versionSelection": {
        "strategy": "latestByVersion",
        "allowPrerelease": false
      },
      "artifactDefaults": {
        "fileNameTemplate": "VSCode-win32-x64-{version}.zip",
        "artifactSources": [
          {
            "kind": "packageDepot",
            "searchOrder": 100,
            "verification": {
              "mode": "optional"
            }
          },
          {
            "kind": "download",
            "sourceId": "vsCodeUpdateService",
            "searchOrder": 900,
            "sourcePath": "{version}/win32-x64-archive/stable",
            "verification": {
              "mode": "required"
            }
          }
        ]
      }
    },
    {
      "id": "VSCodeRuntime-win32-arm64-stable",
      "channel": "stable",
      "platformTarget": "win32-arm64",
      "constraints": {
        "os": [
          "windows"
        ],
        "cpu": [
          "arm64"
        ]
      },
      "versionSelection": {
        "strategy": "latestByVersion",
        "allowPrerelease": false
      },
      "artifactDefaults": {
        "fileNameTemplate": "VSCode-win32-arm64-{version}.zip",
        "artifactSources": [
          {
            "kind": "packageDepot",
            "searchOrder": 100,
            "verification": {
              "mode": "optional"
            }
          },
          {
            "kind": "download",
            "sourceId": "vsCodeUpdateService",
            "searchOrder": 900,
            "sourcePath": "{version}/win32-arm64-archive/stable",
            "verification": {
              "mode": "required"
            }
          }
        ]
      }
    }
  ],
  "versionCatalog": [
    {
      "version": "1.116.0",
      "channels": [
        "stable"
      ],
      "artifactsByTarget": {
        "VSCodeRuntime-win32-x64-stable": {
          "releaseId": "vsCode-win-x64-stable",
          "contentHash": {
            "algorithm": "sha256",
            "value": "365c3d275deb3a1c0a1aa626f274824b8db15ee150d567a7323b8dbce2cdfa8f"
          }
        },
        "VSCodeRuntime-win32-arm64-stable": {
          "releaseId": "vsCode-win-arm64-stable",
          "contentHash": {
            "algorithm": "sha256",
            "value": "6712506c9541823e2c9a52aec6efcfb2f95df4247606eaa9fbade2b08df84fe7"
          }
        }
      }
    }
  ],
  "discovery": {
    "files": [
      "Code.exe",
      "bin/code.cmd"
    ],
    "directories": [
      "data"
    ],
    "commands": [
      {
        "name": "code",
        "relativePath": "bin/code.cmd",
        "required": true,
        "exposed": true,
        "stateChecks": [
          {
            "arguments": [
              "--version"
            ],
            "outputPattern": "(?m)^(?<value>\\d+\\.\\d+\\.\\d+)\\s*$",
            "expectedValue": "{version}"
          }
        ]
      }
    ],
    "apps": [
      {
        "name": "Code",
        "relativePath": "Code.exe",
        "required": true,
        "exposed": true
      }
    ],
    "metadataFiles": [],
    "signatures": [
      {
        "relativePath": "Code.exe",
        "requireValid": true,
        "subjectContains": "Microsoft Corporation"
      }
    ],
    "fileDetails": [
      {
        "relativePath": "Code.exe",
        "productName": "Visual Studio Code",
        "fileDescription": "Visual Studio Code"
      }
    ],
    "registry": []
  },
  "stateDiscovery": {
    "installed": {
      "enableDetection": true,
      "searchLocations": [
        {
          "kind": "command",
          "name": "code.cmd"
        },
        {
          "kind": "command",
          "name": "code"
        },
        {
          "kind": "path",
          "path": "%ProgramFiles%/Microsoft VS Code/bin/code.cmd"
        },
        {
          "kind": "path",
          "path": "%LOCALAPPDATA%/Programs/Microsoft VS Code/bin/code.cmd"
        }
      ],
      "installRootRules": [
        {
          "match": {
            "kind": "fileName",
            "value": "code.cmd"
          },
          "installRootRelativePath": ".."
        },
        {
          "match": {
            "kind": "fileName",
            "value": "Code.exe"
          },
          "installRootRelativePath": "."
        }
      ]
    }
  },
  "upstreamSources": {
    "vsCodeUpdateService": {
      "kind": "download",
      "baseUri": "https://update.code.visualstudio.com"
    }
  },
  "packageOperations": {
    "shared": {
      "ownershipPolicy": {
        "allowAdoptExternal": true,
        "upgradeAdoptedInstall": true,
        "requirePackageOwnership": false
      },
      "compatibility": {
        "checks": [
          {
            "kind": "osVersion",
            "operator": ">=",
            "value": "10.0"
          }
        ]
      }
    },
    "assigned": {
      "kind": "expandArchive",
      "installDirectory": "vscode-runtime/{channel}/{version}/{platformTarget}",
      "pathRegistration": {
        "mode": "user",
        "source": {
          "kind": "shim",
          "use": "discovery.commands"
        }
      },
      "expandedRoot": "auto",
      "createDirectories": [
        "data"
      ],
      "installedStateCheck": {
        "use": "discovery",
        "expectedVersion": "{version}",
        "require": {
          "files": true,
          "directories": true,
          "commands": true,
          "apps": true,
          "metadataFiles": true,
          "signatures": true,
          "fileDetails": true,
          "registry": true
        }
      },
      "versionUpdatePolicy": {
        "whenAssigned": "trackSelectedVersion",
        "onSameSelectedVersion": "reuseOrRepair",
        "onNewSelectedVersion": "replacePackageOwnedInstall"
      }
    },
    "removed": {
      "operation": {
        "kind": "deleteInstallDirectory"
      },
      "verifyAbsent": {
        "use": "discovery",
        "require": {
          "files": true,
          "directories": false,
          "commands": true,
          "apps": false,
          "metadataFiles": false,
          "signatures": false,
          "fileDetails": false,
          "registry": false
        }
      },
      "cleanup": {
        "inventory": true,
        "shims": true,
        "path": true,
        "workDirectories": true
      }
    }
  }
}