vscode: Portable mode: VSCODE_PORTABLE not available for uninstall script

  • VSCode Version: 1.25.1
  • OS Version: Any

Steps to Reproduce:

  1. Uninstall any extension that provides a vscode:uninstall script
  2. Inspect process.env.
  3. process.env.VSCODE_PORTABLE is missing

Does this issue occur when all extensions are disabled?: Yes

When trying to support Portable Mode on vscode-icons, process.env.VSCODE_PORTABLE is very handy to determine if the vscode instance is started in portable mode (thus finding where the user-data directory is). Unfortunately the same can not be achieved for the uninstall script.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 24 (24 by maintainers)

Most upvoted comments

@joaomoreno After trying to implement settings storage using ExtensionContext.storagePath I came upon the following cases:

  • storagePath is undefined when a workspace is not loaded
  • storagePath is different for every workspace loaded

Therefore using ExtensionContext.storagePath to store extension settings is not a viable solution, as a constant path is required.

The offer for the statue still stands.

I see it now. Guilty as charged. Just for the record, I’ve seen other extensions storing files where they shouldn’t too. We are going to adjust our code to use the API instead. And let’s hope we will get the API for the uninstall script real soon.

Having access to vscode API is a plus, and would help in cleaning up the settings.json properly. But what about the scenario that we want to delete a file that was put in the User directory by the extension? And that proposal surely doesn’t justify a statue. 😄