openfin-launcher
Advanced tools
Comparing version 1.4.1 to 1.4.2
{ | ||
"name": "openfin-launcher", | ||
"version": "1.4.1", | ||
"version": "1.4.2", | ||
"description": "OpenFin launcher", | ||
@@ -36,5 +36,2 @@ "author": "Ricardo de Pena <ricardo.depena@gmail.com>", | ||
}, | ||
"optionalDependencies": { | ||
"windows": "0.0.6" | ||
}, | ||
"scripts": { | ||
@@ -41,0 +38,0 @@ "test": "grunt" |
@@ -5,3 +5,2 @@ var os = require('os'); | ||
var xpLocation = '\\Local Settings\\Application Data\\OpenFin'; | ||
@@ -12,8 +11,2 @@ var winEightOrGreater = '\\AppData\\Local\\OpenFin'; | ||
// Resolves out environment paths (%localappdata%) | ||
function resolveToAbsolutePath(path) { | ||
return path.replace(/%([^%]+)%/g, function(_, key) { | ||
return process.env[key]; | ||
}); | ||
} | ||
@@ -26,20 +19,4 @@ function expand(options) { | ||
if (isWindows) { | ||
var windows = require('windows'); //This is Windows specific module and will NOT work on other OS flavors. | ||
var isXP = isWindows && (+os.release().split('.')[0]) < 6; | ||
var defaultAppData = path.join(process.env['USERPROFILE'], isXP ? xpLocation : winEightOrGreater); | ||
try { | ||
var openFinRvmRegistry = windows.registry('HKCU/Software/OpenFin/RVM/Settings/Deployment'); | ||
// if a custom rvmInstallDirectory registry key is set, use its value instead of default location | ||
if (openFinRvmRegistry.rvmInstallDirectory !== undefined) { | ||
defaultAppData = path.normalize(resolveToAbsolutePath(openFinRvmRegistry.rvmInstallDirectory.value.toString())); | ||
console.log("rvmInstallDirectory found. Using RVM Location: ", defaultAppData); | ||
} | ||
} catch (err) { | ||
console.log('deployment group policy not found, launching from:', defaultAppData); | ||
} | ||
defaultOptions.rvmPath = path.resolve(defaultAppData, 'OpenFinRVM.exe'); | ||
@@ -53,4 +30,5 @@ } | ||
return _.defaults(_.clone(options), defaultOptions); | ||
} | ||
module.exports = expand; |
@@ -57,3 +57,3 @@ var spawn = require('child_process').spawn; | ||
of.stdout.on('data', function(data) { | ||
of .stdout.on('data', function(data) { | ||
var sData = '' + data; | ||
@@ -68,8 +68,7 @@ | ||
} | ||
}); | ||
of.stderr.on('data', function(data) { | ||
}); of .stderr.on('data', function(data) { | ||
console.log('' + data); | ||
}); | ||
of.on('exit', function(code) { | ||
of .on('exit', function(code) { | ||
console.log(code); | ||
@@ -76,0 +75,0 @@ deffered.resolve(code); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
5
8
24006
525