microsoft/vscode-react-native

Public

mirrored from https://github.com/microsoft/vscode-react-nativeAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
dev/v-peq/remove-ios-relative-project-path

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

src/extension/services/validationService/checks/devmode.ts

44lines · modecode

1// Copyright (c) Microsoft Corporation. All rights reserved.
2// Licensed under the MIT license. See LICENSE file in the project root for details.
3
4import * as nls from "vscode-nls";
5import { executeCommand } from "../util";
6import { IValidation, ValidationCategoryE, ValidationResultT } from "./types";
7
8nls.config({
9 messageFormat: nls.MessageFormat.bundle,
10 bundleFormat: nls.BundleFormat.standalone,
11})();
12const toLocale = nls.loadMessageBundle();
13
14const label = "DeveloperMode";
15
16async function test(): Promise<ValidationResultT> {
17 const command =
18 "reg query HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\AppModelUnlock /v AllowDevelopmentWithoutDevLicense";
19 const data = await executeCommand(command);
20 if (data.stdout) {
21 if (data.stdout.includes(" 0x1"))
22 return {
23 status: "success",
24 };
25 }
26
27 return {
28 status: "failure",
29 comment: "Developer mode is disabled",
30 };
31}
32
33const main: IValidation = {
34 label,
35 platform: ["win32"],
36 description: toLocale(
37 "DeveloperModeTestDescription",
38 "Required for launching and debugging RNW apps",
39 ),
40 category: ValidationCategoryE.Windows,
41 exec: test,
42};
43
44export default main;
45