@jasonscheirer/electron-forge-maker-msix
Version:
An `electron-forge` maker for MSIX that supports `electron-forge` v6 and can be used as a replacement for `electron-builder`. Supports code-signing.
42 lines • 1.57 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.walk = walk;
exports.findInWindowsKits = findInWindowsKits;
const fs_extra_1 = __importDefault(require("fs-extra"));
const node_path_1 = __importDefault(require("node:path"));
async function* walk(dir) {
for await (const d of await fs_extra_1.default.opendir(dir)) {
const entry = node_path_1.default.join(dir, d.name);
if (d.isDirectory()) {
yield* walk(entry);
}
else if (d.isFile()) {
yield entry;
}
}
}
async function findInWindowsKits(exename) {
const searchPath = 'C:\\Program Files (x86)\\Windows Kits\\10';
const foundExes = [];
const foundPreferredExes = [];
for await (const fileName of walk(searchPath)) {
if (node_path_1.default.basename(fileName).toLowerCase() === exename) {
foundExes.push(fileName);
if (fileName.toLowerCase().includes('x64')) {
foundPreferredExes.push(fileName);
}
}
}
const exesToSort = foundPreferredExes.length > 0 ? foundPreferredExes : foundExes;
if (exesToSort.length > 0) {
const returnVal = exesToSort.sort().pop();
if (returnVal) {
return returnVal;
}
}
throw new Error(`Could not file ${exename} on this development machine. Is the Windows 10 SDK installed?`);
}
//# sourceMappingURL=walk.js.map