mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-02-06 15:04:58 +00:00
Update system.js
This commit is contained in:
parent
2572cd5876
commit
6ff0f3cbd3
|
@ -27,7 +27,22 @@ exports.createProcess = function(cmd) {
|
|||
};
|
||||
|
||||
exports.getEnvString = function(envName) {
|
||||
return WSH.ExpandEnvironmentStrings('%' + envName + '%');
|
||||
var envName = envName.toUpperCase();
|
||||
var resolvedEnvString = WSH.ExpandEnvironmentStrings('%' + envName + '%');
|
||||
|
||||
// Fixed: [lib/system] A few environment variables cannot be referenced in ScriptControl mode. #79
|
||||
if (resolvedEnvString == "") {
|
||||
resolvedEnvString = (function(s) {
|
||||
switch(s) {
|
||||
case "PROGRAMFILES":
|
||||
return WSH.ExpandEnvironmentStrings("%HOMEDRIVE%\\Program Files");
|
||||
case "PROGRAMFILES(X86)":
|
||||
return WSH.ExpandEnvironmentStrings("%HOMEDRIVE%\\Program Files (x86)");
|
||||
}
|
||||
})(envName);
|
||||
}
|
||||
|
||||
return resolvedEnvString;
|
||||
};
|
||||
|
||||
exports.get32BitFolder = function() {
|
||||
|
|
Loading…
Reference in New Issue
Block a user