Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to know user wide code installation running or System wide installation #66029

Closed
shanalikhan opened this issue Jan 4, 2019 · 12 comments
Closed
Assignees
Labels
install-update VS Code installation and upgrade system issues under-discussion Issue is under discussion for relevance, priority, approach

Comments

@shanalikhan
Copy link

Is there any way to check if the code is running a user wide or system wide mode via API.

@vscodebot vscodebot bot added the install-update VS Code installation and upgrade system issues label Jan 4, 2019
@shanalikhan shanalikhan changed the title How to know user wide code installation running on System wide installation How to know user wide code installation running or System wide installation Jan 5, 2019
@joaomoreno
Copy link
Member

There isn't any way of knowing since it is an installation-time feature. Can I ask: what is the goal you are trying to achieve?

@joaomoreno joaomoreno added the info-needed Issue requires more information from poster label Jan 7, 2019
@shanalikhan
Copy link
Author

shanalikhan commented Jan 7, 2019

Settings sync needs to know in order to setup and get User folder and code binary for reading / writing the settings and extensions respectively.

I can read the code binary location at process.argv0 but need to get User folder location.
There should be some variable like currently for Portable mode there is process.env.VSCODE_PORTABLE that gives you path, but not for OSS and NON OSS versions.

Or atleast some identifier on which I can setup Settings Sync on read / write user level by hard code as currently in Settings Sync I have hard coded paths for System Level, Portable, OSS and Non OSS based on Operating Systems due to unavailability of such things.

Currently I'm reading the user

https://github.com/shanalikhan/code-settings-sync/blob/master/src/environmentPath.ts#L110

@joaomoreno
Copy link
Member

Settings sync needs to know in order to setup and get User folder and code binary for reading / writing the settings and extensions respectively.

You shouldn't need to know about user/system at all. What you need are the paths to two directories: user-data-dir and extensions-dir.

@jrieken What do you think about exposing them via API?

@sandy081 Any objections?

@joaomoreno joaomoreno added under-discussion Issue is under discussion for relevance, priority, approach and removed info-needed Issue requires more information from poster labels Jan 7, 2019
@shanalikhan
Copy link
Author

Similar issue opened that also focused on Settings Sync years ago.

#2741

This issue needs to be solved on priority because whenever User Based Installation becomes default way of installing Code, Settings Sync wont work.

@sandy081
Copy link
Member

sandy081 commented Jan 7, 2019

Is it safe/ok to assume the parent of the extension dir as extensions-dir?

@joaomoreno
Copy link
Member

@sandy081 Not in extension development scenarios.

@shanalikhan
Copy link
Author

@joaomoreno whats the update, when you do think it will be fixed ?

@joaomoreno
Copy link
Member

@shanalikhan Notice this is a feature request, not a bug.

@jrieken What do you think about #66029 (comment)?

@jrieken
Copy link
Member

jrieken commented Jan 23, 2019

I think it's dangerous - we don't really want extensions to copy binaries from the extensions folder, right?

@joaomoreno
Copy link
Member

@jrieken They are already doing it, unfortunately. But the way they get there is through path magic.

@shanalikhan
Copy link
Author

Settings Sync unable to work with code OSS versions due to this reason that user-data-dir and extensions-dir. These is no way to get that.

Please discuss this ticket in your upcoming sprint/release planning sessions.

@gandarez
Copy link

gandarez commented Apr 16, 2019

There's already a function to detect if portable is set and it's defined into process.env['VSCODE_PORTABLE']

https://github.com/Microsoft/vscode/blob/master/src/bootstrap.js#L239
https://github.com/Microsoft/vscode/blob/master/src/bootstrap.js#L277

@vscodebot vscodebot bot locked and limited conversation to collaborators Sep 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
install-update VS Code installation and upgrade system issues under-discussion Issue is under discussion for relevance, priority, approach
Projects
None yet
Development

No branches or pull requests

5 participants