Skip to content

Commit

Permalink
Update autoupdate.js
Browse files Browse the repository at this point in the history
  • Loading branch information
hschneider committed Jan 2, 2024
1 parent a95521a commit 7815995
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions resources/js/neutralino-autoupdate/autoupdate.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class NeutralinoAutoupdate {
// opt lang: Dialog language, defaults to en
// opt customLang: A custom language dict

this.version = '1.1.8';
this.version = '1.1.9';
this.debug = opt.debug || true;

this.urlManifest = urlManifest; // Manifest URL
Expand All @@ -32,7 +32,11 @@ class NeutralinoAutoupdate {

this.appId = NL_APPID; // App ID
this.appVersion = NL_APPVERSION; // App current version
this.appPath = NL_PATH; // App root path

this.appRoot = NL_PATH; // App root path
this.appReources = this.appRoot + '/resources'; // App resources path
this.appReourcesJS = this.appReources + '/js'; // App JS resources
this.appResourcesBIN = this.appReources + '/bin'; // App BIN resources

this.headers = new Headers(); // Custom request headers
if(this.token !== '') {
Expand Down Expand Up @@ -91,12 +95,12 @@ class NeutralinoAutoupdate {
// Initialize modal dialog.
// Injects HTML, CSS and installs onCLick handler.

let d = await Neutralino.filesystem.readFile(this.appPath + '/resources/js/neutralino-autoupdate/styles.css');
let d = await Neutralino.filesystem.readFile(this.appReourcesJS + '/neutralino-autoupdate/styles.css');
let e = document.createElement('style');
e.appendChild(document.createTextNode(d));
document.head.appendChild(e);

d = await Neutralino.filesystem.readFile(this.appPath + '/resources/js/neutralino-autoupdate/modal.html');
d = await Neutralino.filesystem.readFile(this.appReourcesJS + '/neutralino-autoupdate/modal.html');

// Expand variables
//
Expand Down Expand Up @@ -314,7 +318,7 @@ class NeutralinoAutoupdate {
}
await Neutralino.os.execCommand(cmd);

cmd = this.appPath + '/resources/bin/curl -k -o ' + this.pathDownload + f + ' -JL ' + url;
cmd = this.appReourcesBIN + '/curl -k -o ' + this.pathDownload + f + ' -JL ' + url;
let res = await Neutralino.os.execCommand(cmd);

// -- Validate
Expand Down Expand Up @@ -354,7 +358,7 @@ class NeutralinoAutoupdate {
cmd = "unzip -o " + this.pathDownload + f + " -d " + this.pathDownload;
}
else {
cmd = this.appPath + "/resources/bin/unzip -o " + this.pathDownload + f + " -d " + this.pathDownload;
cmd = this.appReourcesBIN + "/unzip -o " + this.pathDownload + f + " -d " + this.pathDownload;
}
res = await Neutralino.os.execCommand(cmd);
if(res.exitCode === 1) {
Expand Down

0 comments on commit 7815995

Please sign in to comment.