Skip to content

Support Windows package identity to ensure device permissions #254613

Open

Description

In order to retain microphone permissions necessary for VS Code Speech, we should enforce the use of package identity on Windows installations.

cc Benjamin Pasero (@bpasero)

Activity

  1. added
    windows
    on Jul 8, 2025
  2. deepak1556 commented on Jul 8, 2025

    @deepak1556
    Collaborator

    After some investigation on the devbox João Moreno (@joaomoreno) had issues from the appx package, we narrowed the problem at install time is from the RemoveAppxPackage being always called even when the package was not previously installed resulting in the powershell command to throw an error and trigger the WER dialog.

  3. deepak1556 commented on Jul 8, 2025

    @deepak1556
    Collaborator

    We currently ship AppxPackage with manifest needed for the file explorer context menu action https://github.com/microsoft/vscode-explorer-command/blob/main/template/AppxManifest.xml, this is optional at install time and also only available to insiders.

    Whereas we want this identity for privacy controls to be always available,

    1. Is it possible to condition the file explorer manifest items in the same manifest ?
    2. If not, can we have multiple appx manifest for the same application. Like one main and the other like addons.
  4. shmuelie commented on Jul 8, 2025

    @shmuelie

    We currently ship AppxPackage with manifest needed for the file explorer context menu action https://github.com/microsoft/vscode-explorer-command/blob/main/template/AppxManifest.xml, this is optional at install time and also only available to insiders.

    Whereas we want this identity for privacy controls to be always available,

    1. Is it possible to condition the file explorer manifest items in the same manifest ?
    2. If not, can we have multiple appx manifest for the same application. Like one main and the other like addons.

    You cannot condition the manifest item. You can either have multiple manifests (PowerToys does this) or you can specify ECS_HIDDEN for the command to hide them when not enabled

  5. added
    feature-request
    on Jul 9, 2025
  6. deepak1556 commented on Jul 9, 2025

    @deepak1556
    Collaborator

    Thanks Shmueli Englard (@shmuelie) , for the main package identity does everything we have today in the current package manifest (minus the extension block https://github.com/microsoft/vscode-explorer-command/blob/3ee1d2ccc598b09932c7583b6ed9e47d8560a9fb/template/AppxManifest.xml#L62) be sufficient or anything else we need to add ?

  7. shmuelie commented on Jul 9, 2025

    @shmuelie
    1. You'll need to add the DeviceCapability for microphone.
    2. The app that actually uses the microphone needs to have the package identity too. Easiest way would be for the package to have an Application element for that app, and that app also have the fusion manifest updated to include the MSIX element
  8. deepak1556 commented on Jul 9, 2025

    @deepak1556
    Collaborator
    1. Great, thanks!
    2. Microphone gets used from an extension that runs in a child process of the VSCode application, so in this case a single package identity for VSCode application should be sufficient IIUC ?
  9. shmuelie commented on Jul 9, 2025

    @shmuelie

    That will work then :)

  10. deepak1556 commented on Jul 24, 2025

    @deepak1556
    Collaborator

    Shmueli Englard (@shmuelie) whats the best way to test that the package identity and the declared permissions are respected by the OS. Thanks!

  11. deepak1556 commented on Jul 24, 2025

    @deepak1556
    Collaborator

    Another followup from the doc related to the application element, I see

    Add an Application element as shown for each executable associated with your application
    Ensure TrustLevel is mediumIL and RuntimeBehavior is win32App as shown for Win32 compatibility

    We have extensions that run from a child process of our application (the exe of the child process will be registered in the application element) can bring in their own exe files which they inturn spawn as separate processes, would those be affected in anyway since we cannot register them in our application manifest.

  12. shmuelie commented on Jul 24, 2025

    @shmuelie

    @shmuelie whats the best way to test that the package identity and the declared permissions are respected by the OS. Thanks!

    I would check if you see VS Code in the Microphone settings (ms-settings:privacy-microphone), and if you disable its permissions, it should not work.

    Another followup from the doc related to the application element, I see

    Add an Application element as shown for each executable associated with your application
    Ensure TrustLevel is mediumIL and RuntimeBehavior is win32App as shown for Win32 compatibility

    We have extensions that run from a child process of our application (the exe of the child process will be registered in the application element) can bring in their own exe files which they inturn spawn as separate processes, would those be affected in anyway since we cannot register them in our application manifest.

    Should be fine as by default child processes inherit the package identity of the starting process.

  13. deepak1556 commented on Jul 25, 2025

    @deepak1556
    Collaborator

    Shmueli Englard (@shmuelie) I am testing a full signed product build with appx identity from #257741, however even after installing the package I only see the global switch in privacy settings to toggle and not a per application switch. Is there a particular build of windows I should be testing with, I am currently on 26100.4652

  14. shmuelie commented on Jul 25, 2025

    @shmuelie

    @shmuelie I am testing a full signed product build with appx identity from #257741, however even after installing the package I only see the global switch in privacy settings to toggle and not a per application switch. Is there a particular build of windows I should be testing with, I am currently on 26100.4652

    Which action do I need to get the build results from?

  15. deepak1556 commented on Jul 25, 2025

    @deepak1556
    Collaborator

    You can download from https://vscode.download.prss.microsoft.com/dbazure/download/insider/cd69bbfa533e1c63f4ef427be4c2e1367218ee33/VSCodeUserSetup-x64-1.103.0-insider.exe

    In the install flow, select Add to windows explorer context menu to get the appx installed. This build is from a older commit, in a future commit I have changed it to always install the appx package.

    Image

    Get-AppxPackage -Name Microsoft.VisualStudioCodeInsiders should be valid once installation succeeds.

  16. deepak1556 commented on Jul 25, 2025

    @deepak1556
    Collaborator

    Here is a build from the latest commit where appx will always get installed for the application irrespective of the context menu choice from the installer https://vscode.download.prss.microsoft.com/dbazure/download/insider/4c546e90565870f1f9d54571800cb8e720af53c6/VSCodeUserSetup-x64-1.103.0-insider.exe

  17. deepak1556 commented on Jul 28, 2025

    @deepak1556
    Collaborator

    Sandbox process crashes when app identity is registered, my suspicion is on

    uap10:TrustLevel="mediumIL"
    given it only affects process that change their integrity level on launch like gpu, renderer etc. Starting the application with --no-sandbox doesn't crash. Will investigate further and get back.

    Shmueli Englard (@shmuelie) did Edge mention any issue related to the integrity level interfering with chromium sandbox ?

  18. removed this from the August 2025 milestone on Sep 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

feature-requestwindows

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions