-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Emit a warning when on an unsupported Windows platform (#1759)
Some Windows Server versions (Nano Server and Server Core) lack the needed dependencies to run Chrome. This commit adds a check for this case (based on the information in #1575 (comment)), displaying a warning in the console when it occurs. Specifically, it checks for the availability of the `Server-Media-Foundation` feature (only available on server editions, not client) with non-installed state. This commit adds a new dependency ([wmi-client](https://www.npmjs.com/package/wmi-client)) to `package.json`. In order to use this package and pass linting, we needed to create a declaration file for its types. This is `packages/ado-extension/src/wmic.d.ts`, which declares the `"wmi-client"` `module` and its `wmic` `class`. Addresses #1575. Co-authored-by: madalynrose <[email protected]>
- Loading branch information
1 parent
325baf3
commit ca56b88
Showing
5 changed files
with
79 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
// #1575: This file is used to declare types for the wmi-client module that doesn't have type declarations. | ||
// This module is used in install-runtime-dependencies.ts only on windows clients to check if | ||
// the platform has the necessary dependencies to run Chrome. | ||
declare module 'wmi-client' { | ||
export = wmic; | ||
class wmic { | ||
constructor(options?: WMICOptions); | ||
private _getArgs; | ||
private _getArgsForLinux; | ||
private _getArgsForWindows; | ||
/** | ||
* Prepeare WQL query | ||
* @param wql | ||
* @param namespace | ||
* @param callback | ||
* @returns {wmic} | ||
*/ | ||
query(query: string, callback: (err: string, features: Feature[]) => void): wmic; | ||
wql: string; | ||
namespace: string; | ||
private _exec; | ||
private _wql2wmic; | ||
} | ||
|
||
interface WMICOptions { | ||
host: string | null; | ||
username: string; | ||
password: string; | ||
namespace: string; | ||
timeout: number; | ||
wmic: string; | ||
ntlm2: boolean; | ||
cwd: string; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters