Files
App-Installer-For-Windows-8…/shared/html/settings/appinstaller/preinit.js
Bruce d1813637c5 Organized the project files.
And also fixed some bugs.
2025-12-08 16:06:13 +08:00

35 lines
1.2 KiB
JavaScript

(function(global) {
var storage = Bridge.External.Storage;
var path = storage.path;
var root = path.getDir(path.program);
var exepath = path.combine(root, "appinstaller.exe");
var id = "App";
var ve = Bridge.External.VisualElements.get(id);
var slideback = ve["BackgroundColor"];
global.slideback = slideback;
global.exepath = exepath;
global.visual = ve;
var strutil = Bridge.External.String;
var nstrutil = Bridge.NString;
var boolTrue = ["true", "1", "yes", "on", "y", "t", "zhen", "真"];
var boolFalse = ["false", "0", "no", "off", "n", "f", "jia", "假"];
global.parseBool = function(str) {
str = "" + str;
for (var i = 0; i < boolTrue.length; i++) {
if (nstrutil.equals(str, boolTrue[i])) {
return true;
}
}
for (var i = 0; i < boolFalse.length; i++) {
if (nstrutil.equals(str, boolFalse[i])) {
return false;
}
}
return null;
};
Object.defineProperty(global, "cmdargs", {
get: function() {
return JSON.parse(Bridge.External.cmdArgs);
}
});
})(this);