|
|
@@ -95,6 +95,7 @@ catch(e) { |
|
|
|
// WScript.Echo('-val=' + WScript.Arguments.Named(argEnumerator.item()) + '=val-') // Value |
|
|
|
// } |
|
|
|
|
|
|
|
// cscript elxr/i.win.js /all:true |
|
|
|
var all = WScript.Arguments.Named('all'); |
|
|
|
|
|
|
|
console = { |
|
|
@@ -849,6 +850,7 @@ function __main( selectedinstance ){ |
|
|
|
var downloadtasks = []; |
|
|
|
var installtasks = []; |
|
|
|
prerequisites.forEach(function(preq) { |
|
|
|
WScript.Echo(all) |
|
|
|
if(!all && preq.optional) return |
|
|
|
var p = preq.exists().then(function(exists) { |
|
|
|
if (exists) console.log( preq.shellcmd + ' exists'); |
|
|
@@ -1214,29 +1216,7 @@ function __main( selectedinstance ){ |
|
|
|
, installcmd: ['MSIEXEC.exe', ['/i' |
|
|
|
, path.normalize(downloadsdir + '/' + 'python-2.7.18.amd64.msi') |
|
|
|
, 'ACCEPT=YES', '/passive']] |
|
|
|
// , preinstallsteps : function() { return Promise.resolve(true) } |
|
|
|
, preinstallsteps: function() { |
|
|
|
var self = this; |
|
|
|
console.log(self.shellcmd + ' preinstall steps') |
|
|
|
console.log(selectedinstance.root + '/.elxr/run-' + runtimestamp + '/download.bat' + ' ' + self.url + ' ' + downloadsdir + '/' + self.installer) |
|
|
|
var steps = []; |
|
|
|
steps.push( |
|
|
|
function(){ |
|
|
|
if (!existsSync(downloadsdir + '/' + self.installer)) { |
|
|
|
console.log(selectedinstance.root + '/.elxr/run-' + runtimestamp + '/download.bat', [self.url, downloadsdir + '/' + self.installer]) |
|
|
|
return nodeShellExec(selectedinstance.root + '/.elxr/run-' + runtimestamp + '/download.bat', [self.url, downloadsdir + '/' + self.installer] |
|
|
|
, { waitmsg : 'downloading ' + self.shellcmd + ' please wait' }) |
|
|
|
} |
|
|
|
else { |
|
|
|
console.log(self.installer + ' Already exits Download skipped.') |
|
|
|
return Promise.resolve(true) |
|
|
|
} |
|
|
|
} |
|
|
|
) |
|
|
|
|
|
|
|
return any(steps) |
|
|
|
// return any([any(steps), any(prompts)]) |
|
|
|
} |
|
|
|
, preinstallsteps : function() { return Promise.resolve(true) } |
|
|
|
, install : function() { |
|
|
|
var self = this; |
|
|
|
var ifns = [self.installcmd] |
|
|
@@ -1264,18 +1244,54 @@ function __main( selectedinstance ){ |
|
|
|
, '/VERYSILENT' |
|
|
|
// , '/MERGETASKS=!runcode' // This is required only for vscode... |
|
|
|
]] |
|
|
|
// , preinstallsteps : function() { return Promise.resolve(true) } |
|
|
|
, preinstallsteps : function() { return Promise.resolve(true) } |
|
|
|
, install : function() { |
|
|
|
var self = this; |
|
|
|
var ifns = [self.installcmd] |
|
|
|
if(!ifns.map) ifns.map = map; |
|
|
|
console.log('Installing') |
|
|
|
return any(ifns.map(callsheltask))['catch'](function(e){ |
|
|
|
if(e.code === 1602) { |
|
|
|
console.warn("Installation was probably cancelled.") |
|
|
|
} |
|
|
|
else throw e |
|
|
|
}).then(function(){ |
|
|
|
return self.postinstallsteps() |
|
|
|
}) |
|
|
|
} |
|
|
|
, postinstallsteps : function() { return sysAddPathVar('%USERPROFILE%\\AppData/Local\\Microsoft\\WindowsApps') } |
|
|
|
, exists : exists |
|
|
|
} |
|
|
|
, { |
|
|
|
shellcmd: 'mysql', |
|
|
|
url: 'https://dev.mysql.com/get/Downloads/MySQLInstaller/mysql-installer-community-8.0.29.0.msi' |
|
|
|
, installer: 'mysql-installer-community-8.0.29.0.msi' |
|
|
|
, installcmd: ['MSIEXEC.exe', ['/i' |
|
|
|
, path.normalize(downloadsdir + '/' + 'mysql-installer-community-8.0.29.0.msi') |
|
|
|
, 'ACCEPT=YES', '/passive']] |
|
|
|
, install : function() { |
|
|
|
var self = this; |
|
|
|
var ifns = [self.installcmd] |
|
|
|
if(!ifns.map) ifns.map = map; |
|
|
|
return any(ifns.map(callsheltask))['catch'](function(e){ |
|
|
|
if(e.code === 1602) { |
|
|
|
console.warn("Installation was probably cancelled.") |
|
|
|
} |
|
|
|
else throw e |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
, exists : exists |
|
|
|
, preinstallsteps: function() { |
|
|
|
var self = this; |
|
|
|
console.log(self.shellcmd + ' preinstall steps') |
|
|
|
console.log(selectedinstance.root + '/.elxr/run-' + runtimestamp + '/download.bat' + ' ' + self.url + ' ' + downloadsdir + '/' + self.installer) |
|
|
|
console.log('mysql preinstall steps') |
|
|
|
|
|
|
|
var steps = []; |
|
|
|
steps.push( |
|
|
|
function(){ |
|
|
|
if (!existsSync(downloadsdir + '/' + self.installer)) { |
|
|
|
console.log(selectedinstance.root + '/.elxr/run-' + runtimestamp + '/download.bat', [self.url, downloadsdir + '/' + self.installer]) |
|
|
|
return nodeShellExec(selectedinstance.root + '/.elxr/run-' + runtimestamp + '/download.bat', [self.url, downloadsdir + '/' + self.installer] |
|
|
|
, { waitmsg : 'downloading ' + self.shellcmd + ' please wait' }) |
|
|
|
, { waitmsg : 'downloading mysql please wait' }) |
|
|
|
} |
|
|
|
else { |
|
|
|
console.log(self.installer + ' Already exits Download skipped.') |
|
|
@@ -1287,22 +1303,6 @@ function __main( selectedinstance ){ |
|
|
|
return any(steps) |
|
|
|
// return any([any(steps), any(prompts)]) |
|
|
|
} |
|
|
|
, install : function() { |
|
|
|
var self = this; |
|
|
|
var ifns = [self.installcmd] |
|
|
|
if(!ifns.map) ifns.map = map; |
|
|
|
console.log('Installing') |
|
|
|
return any(ifns.map(callsheltask))['catch'](function(e){ |
|
|
|
if(e.code === 1602) { |
|
|
|
console.warn("Installation was probably cancelled.") |
|
|
|
} |
|
|
|
else throw e |
|
|
|
}).then(function(){ |
|
|
|
return self.postinstallsteps() |
|
|
|
}) |
|
|
|
} |
|
|
|
, postinstallsteps : function() { return sysAddPathVar('%USERPROFILE%\\AppData/Local\\Microsoft\\WindowsApps') } |
|
|
|
, exists : exists |
|
|
|
} |
|
|
|
, { |
|
|
|
shellcmd: 'elxr' |