diff options
| author | Andrej Mihajlov <and@mullvad.net> | 2018-06-29 11:22:48 +0200 |
|---|---|---|
| committer | Andrej Mihajlov <and@mullvad.net> | 2018-07-03 13:37:54 +0200 |
| commit | da08e7752430feb58848172cd76176141e9af82f (patch) | |
| tree | 6ad4f9ea7a6ec5613d5d2b061b2f6acd78c85ebd /app/lib | |
| parent | 01edba25d502ebaefedaa245ee4b48b888db811d (diff) | |
| download | mullvadvpn-da08e7752430feb58848172cd76176141e9af82f.tar.xz mullvadvpn-da08e7752430feb58848172cd76176141e9af82f.zip | |
Add productName to package.json and migrate to using app.getName()
Diffstat (limited to 'app/lib')
| -rw-r--r-- | app/lib/rpc-address-file.js | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/app/lib/rpc-address-file.js b/app/lib/rpc-address-file.js index 6eec716591..6ff920b8df 100644 --- a/app/lib/rpc-address-file.js +++ b/app/lib/rpc-address-file.js @@ -2,6 +2,7 @@ import fs from 'fs'; import path from 'path'; +import { app } from 'electron'; import { promisify } from 'util'; import { getSystemTemporaryDirectory } from './tempdir'; @@ -9,22 +10,16 @@ const fsReadFileAsync = promisify(fs.readFile); const POLL_INTERVAL = 200; -const appDirectoryName = 'Mullvad VPN'; - export type RpcCredentials = { connectionString: string, sharedSecret: string, }; export class RpcAddressFile { - _filePath: string; + _filePath = getRpcAddressFilePath(); _pollIntervalId: ?IntervalID; _pollPromise: ?Promise<void>; - constructor() { - this._filePath = getRpcAddressFilePath(); - } - get filePath(): string { return this._filePath; } @@ -88,7 +83,7 @@ function getRpcAddressFilePath() { // Windows: %ALLUSERSPROFILE%\{appname} const programDataDirectory = process.env.ALLUSERSPROFILE; if (programDataDirectory) { - const appDataDirectory = path.join(programDataDirectory, appDirectoryName); + const appDataDirectory = path.join(programDataDirectory, app.getName()); return path.join(appDataDirectory, rpcAddressFileName); } else { throw new Error('Missing %ALLUSERSPROFILE% environment variable'); |
