UNPKG

nwixtoolset

Version:

Node module wrapper around the WIX Toolset executables.

45 lines (44 loc) 2.32 kB
"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", { value: true }); const run_1 = require("./run"); const util_1 = require("./util"); /** * Performs a diff to generate a transform (.wixmst or .mst) for XML outputs (.wixout or .wixpdb) or .msi files. * * @param targetInput The target input to process. * @param updatedInput The updated input to process. * @param [options] Options for the compiler. */ function torch(targetInput, updatedInput, options = {}) { return __awaiter(this, void 0, void 0, function* () { const args = ["-nologo"]; util_1.addArgument(args, "-a", options.admin); yield util_1.addPathArgument(args, "-ax", options.adminExtract); util_1.addArgument(args, "-notidy", options.notidy); util_1.addArgument(args, "-p", options.preserve); util_1.addArgument(args, "-pedantic", options.pedantic); util_1.addArgument(args, "-serr", options.suppressError); util_1.addArgument(args, "-t", options.transformValidation); util_1.addArgument(args, "-val", options.validation); util_1.addArgument(args, "-x", options.extract); util_1.addArgument(args, "-xi", options.inputWix); util_1.addArgument(args, "-xo", options.outputWix); util_1.addCommonArguments(args, options); yield util_1.addPathFile(args, [targetInput, updatedInput]); yield util_1.addPathArgument(args, "-o", options.out); if (!util_1.undef(options.overridesTemp)) { process.env.WIX_TEMP = options.overridesTemp; } return run_1.raw.torch(args, options); }); } exports.torch = torch;