Skip to content
This repository has been archived by the owner on Apr 3, 2020. It is now read-only.

Windows: Create WiX wxs file in project root #118

Merged
merged 1 commit into from
Mar 24, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion windows/lib/WinPlatform.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ function(configId, args, callback) {
var nComponents = manifest.appVersion.split(".").length;
var versionPadding = new Array(4 - nComponents + 1).join(".0");

var sdk = new WixSDK(manifest, this.output);
var sdk = new WixSDK(this.application.rootPath, manifest, this.output);
var indicator = output.createInfiniteProgress("Building package");
sdk.onData = function(data) {
this.logOutput.write(data);
Expand Down
14 changes: 8 additions & 6 deletions windows/lib/WixSDK.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@ var ShellJS = require("shelljs");

/**
* Creates WixSDK object.
* @param {String} rootPath Root path for project
* @param {Manifest} manifest Web manifest
* @param {OutputIface} output Output
* @constructor
*/
function WixSDK(manifest, output) {
function WixSDK(rootPath, manifest, output) {

this._rootPath = rootPath;
this._manifest = manifest;
this._output = output;
}
Expand Down Expand Up @@ -357,13 +359,13 @@ function(app_path, xwalk_path, meta_data, callback) {

var xml_str = root.end({ pretty: true });
var basename = meta_data.product + "-" + meta_data.version;
fs.writeFileSync(basename + '.wxs', xml_str);
this.runWix(InQuotes(basename), function(success) {
var wxsPath = path.join(this._rootPath, basename + '.wxs');
fs.writeFileSync(wxsPath, xml_str);
this.runWix(InQuotes(basename), wxsPath, function(success) {
if (success) {
// Pass back built package
meta_data.msi = path.resolve(basename + ".msi");
// Only delete on success, for debugging reasons.
ShellJS.rm("-f", basename + ".wxs");
ShellJS.rm("-f", basename + ".wixobj");
ShellJS.rm("-f", basename + ".wixpdb");
}
Expand All @@ -372,9 +374,9 @@ function(app_path, xwalk_path, meta_data, callback) {
};

WixSDK.prototype.runWix =
function(basename, callback) {
function(basename, wxsPath, callback) {

var candle = "candle -v " + basename + ".wxs";
var candle = "candle -v " + wxsPath;
this._output.info("Running '" + candle + "'");
var child = child_process.exec(candle);

Expand Down