Monkey-patch os.hostname on Windows 7
This commit is contained in:
parent
82dad0d7f7
commit
96b864d6a9
11 changed files with 51 additions and 17 deletions
13
ts/util/patchWindows7Hostname.ts
Normal file
13
ts/util/patchWindows7Hostname.ts
Normal file
|
@ -0,0 +1,13 @@
|
|||
// Copyright 2022 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import semver from 'semver';
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
const os = require('os');
|
||||
|
||||
// os.hostname() doesn't work on Windows 7 anymore
|
||||
// See: https://github.com/electron/electron/issues/34404
|
||||
if (process.platform === 'win32' && semver.satisfies(os.release(), '6.1.x')) {
|
||||
os.hostname = () => 'Desktop';
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue