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

Adopt mac policy support #241773

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/vs/base/common/product.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ export interface IProductConfiguration {

readonly 'editSessions.store'?: Omit<ConfigurationSyncStore, 'insidersUrl' | 'stableUrl'>;
readonly darwinUniversalAssetId?: string;
readonly darwinBundleIdentifier?: string;
readonly profileTemplatesUrl?: string;

readonly commonlyUsedSettings?: string[];
Expand Down
13 changes: 10 additions & 3 deletions src/vs/code/electron-main/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,16 @@ class CodeMain {
fileService.registerProvider(Schemas.vscodeUserData, new FileUserDataProvider(Schemas.file, diskFileSystemProvider, Schemas.vscodeUserData, userDataProfilesMainService, uriIdentityService, logService));

// Policy
const policyService = isWindows && productService.win32RegValueName ? disposables.add(new NativePolicyService(logService, productService.win32RegValueName))
: environmentMainService.policyFile ? disposables.add(new FilePolicyService(environmentMainService.policyFile, fileService, logService))
: new NullPolicyService();
let policyService: IPolicyService | undefined;
if (isWindows && productService.win32RegValueName) {
policyService = disposables.add(new NativePolicyService(logService, productService.win32RegValueName));
} else if (isMacintosh && productService.darwinBundleIdentifier) {
policyService = disposables.add(new NativePolicyService(logService, productService.darwinBundleIdentifier));
} else if (environmentMainService.policyFile) {
policyService = disposables.add(new FilePolicyService(environmentMainService.policyFile, fileService, logService));
} else {
policyService = new NullPolicyService();
}
services.set(IPolicyService, policyService);

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❗ Requires picking up microsoft/vscode-policy-watcher#44

// Configuration
Expand Down
Loading