Update winlibs.js

This commit is contained in:
Namhyeon Go 2020-07-29 14:51:39 +09:00
parent d29bd6c515
commit 8065234bfc

View File

@ -9,6 +9,32 @@ exports.require = global.require;
var SHELL = require("lib/shell");
var FILE = require("lib/file");
/**
* @param {string} LIB
* @return {string} clsid
*/
exports.createManifest = function(FN, clsid) {
var manifestPath = FN + ".manifest";
if (typeof(clsid) !== "undefined") {
clsid = "4B72FC46-C543-4101-80DB-7777848DACDC";
}
var lines = [
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>",
"<assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersion=\"1.0\">",
"<file name=\"" + FN + ".dll\">",
"<comClass clsid=\"{" + clsid + "}\" threadingModel=\"Apartment\" progid=\"" + FN + "\" />",
"</file>",
"</assembly>"
];
// write a manifest file
FILE.writeFile(manifestPath, lines.join("\r\n"), "utf-8");
return FILE.fileExists(manifestPath);
};
/**
* @param {string} LIB
* @return {function}