Merge pull request #5238 from electron/felix/appx-detection
Add Windows Store Detection
This commit is contained in:
commit
c92e622ce0
2 changed files with 11 additions and 0 deletions
|
@ -10,6 +10,8 @@ upstream node:
|
||||||
* `process.resourcesPath` String - Path to JavaScript source code.
|
* `process.resourcesPath` String - Path to JavaScript source code.
|
||||||
* `process.mas` Boolean - For Mac App Store build, this value is `true`, for
|
* `process.mas` Boolean - For Mac App Store build, this value is `true`, for
|
||||||
other builds it is `undefined`.
|
other builds it is `undefined`.
|
||||||
|
* `process.windowsstore` Boolean - If the app is running as a Windows Store app (appx), this value is `true`, for
|
||||||
|
other builds it is `undefined`.
|
||||||
|
|
||||||
## Events
|
## Events
|
||||||
|
|
||||||
|
|
|
@ -44,3 +44,12 @@ if (process.type === 'browser') {
|
||||||
global.setTimeout = wrapWithActivateUvLoop(timers.setTimeout)
|
global.setTimeout = wrapWithActivateUvLoop(timers.setTimeout)
|
||||||
global.setInterval = wrapWithActivateUvLoop(timers.setInterval)
|
global.setInterval = wrapWithActivateUvLoop(timers.setInterval)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If we're running as a Windows Store app, __dirname will be set
|
||||||
|
// to C:/Program Files/WindowsApps.
|
||||||
|
//
|
||||||
|
// Nobody else get's to install there, changing the path is forbidden
|
||||||
|
// We can therefore say that we're running as appx
|
||||||
|
if (process.platform === 'win32' && __dirname.indexOf('\\Program Files\\WindowsApps\\') === 2) {
|
||||||
|
process.windowsstore = true
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue