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

Commit

Permalink
Merge pull request #118 from r0b5t4/XWALK-6606
Browse files Browse the repository at this point in the history
Windows: Create WiX wxs file in project root
  • Loading branch information
r0b5t4 committed Mar 24, 2016
2 parents 51478f8 + 4c1e7bc commit c28c661
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
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

0 comments on commit c28c661

Please sign in to comment.