|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function __main( selectedinstance ){ |
|
|
function __main( selectedinstance ){ |
|
|
var downloadsdir = selectedinstance.root + '\\..\\Downloads'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var downloadsdir = path.dirname(selectedinstance.root) + '\\Downloads'; |
|
|
var callsheltask = function(args) { |
|
|
var callsheltask = function(args) { |
|
|
// console.log('callsheltask : ' + args) |
|
|
// console.log('callsheltask : ' + args) |
|
|
return function() { return nodeShellExec.apply(null, args) } } |
|
|
return function() { return nodeShellExec.apply(null, args) } } |
|
|
|
|
|
|
|
|
// console.log('-------------exists=======================') |
|
|
// console.log('-------------exists=======================') |
|
|
// console.dir(exists) |
|
|
// console.dir(exists) |
|
|
// console.log(self.shellcmd) |
|
|
// console.log(self.shellcmd) |
|
|
// console.log(exists.messages.join(' ').indexOf(self.shellcmd)) |
|
|
|
|
|
// console.log(exists + ' ' + self.shellcmd + ' exists') |
|
|
|
|
|
if(exists && (exists.messages.join(' ').indexOf(self.shellcmd) > -1) ) { |
|
|
|
|
|
|
|
|
// console.log(exists.messages.join(' ').toLowerCase().indexOf(self.shellcmd.toLowerCase())) |
|
|
|
|
|
if(exists && (exists.messages.join(' ').toLowerCase().indexOf(self.shellcmd.toLowerCase()) > -1) ) { |
|
|
|
|
|
console.log(' ' + self.shellcmd + ' exists') |
|
|
return true; |
|
|
return true; |
|
|
} |
|
|
} |
|
|
else return false |
|
|
|
|
|
|
|
|
else { |
|
|
|
|
|
console.log(' ' + self.shellcmd + ' doesnt exist') |
|
|
|
|
|
return false |
|
|
|
|
|
} |
|
|
})['catch'](function(e){ |
|
|
})['catch'](function(e){ |
|
|
// console.log('-------------exists catch=======================') |
|
|
// console.log('-------------exists catch=======================') |
|
|
console.dir(e) |
|
|
console.dir(e) |
|
|
|
|
|
|
|
|
, preinstallsteps: function() { |
|
|
, preinstallsteps: function() { |
|
|
var self = this; |
|
|
var self = this; |
|
|
console.log('Node preinstall steps') |
|
|
console.log('Node preinstall steps') |
|
|
|
|
|
|
|
|
|
|
|
// console.log(this.installcmd) |
|
|
|
|
|
// console.log(path.normalize(downloadsdir + '/' + 'node-v14.17.3-x64.msi')) |
|
|
var steps = []; |
|
|
var steps = []; |
|
|
steps.push( |
|
|
steps.push( |
|
|
function(){ |
|
|
|
|
|
|
|
|
function(){ |
|
|
if (!existsSync(downloadsdir + '/' + self.installer)) { |
|
|
if (!existsSync(downloadsdir + '/' + self.installer)) { |
|
|
return nodeShellExec(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 '+ self.shellcmd +' please wait' }) |
|
|
|
|
|
|
|
|
, { |
|
|
, { |
|
|
// C:\Program Files (x86)\Microsoft SQL Server Management Studio 18\Common7\IDE\Ssms.exe |
|
|
// C:\Program Files (x86)\Microsoft SQL Server Management Studio 18\Common7\IDE\Ssms.exe |
|
|
// SQL Management studio 2018 |
|
|
// SQL Management studio 2018 |
|
|
shellcmd: 'Ssms.exe', |
|
|
|
|
|
|
|
|
shellcmd: 'sqlcmd.exe', // 'Ssms.exe', |
|
|
url: 'https://aka.ms/ssmsfullsetup' |
|
|
url: 'https://aka.ms/ssmsfullsetup' |
|
|
, installer: 'SSMS-Setup-ENU.exe' |
|
|
, installer: 'SSMS-Setup-ENU.exe' |
|
|
, installcmd: ['cmd', ['/c', 'start', |
|
|
, installcmd: ['cmd', ['/c', 'start', |
|
|
|
|
|
|
|
|
//, 'SSMSInstallRoot=%systemdrive%\\Program Files (x86)\\Microsoft SQL Server\\140\\Tools\\Binn\\ManagementStudio' |
|
|
//, 'SSMSInstallRoot=%systemdrive%\\Program Files (x86)\\Microsoft SQL Server\\140\\Tools\\Binn\\ManagementStudio' |
|
|
]] |
|
|
]] |
|
|
, install : install |
|
|
, install : install |
|
|
, exists : function(){ |
|
|
|
|
|
var self = this; |
|
|
|
|
|
var installedpath = 'C:\\Program Files (x86)\\Microsoft SQL Server Management Studio 18\\Common7\\IDE\\Ssms.exe' |
|
|
|
|
|
console.log('checking existence of ' + installedpath) |
|
|
|
|
|
return Promise.resolve(existsSync(installedpath)) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
, exists : exists |
|
|
, preinstallsteps: function() { |
|
|
, preinstallsteps: function() { |
|
|
var self = this; |
|
|
var self = this; |
|
|
console.log('smss 2018 preinstall steps') |
|
|
console.log('smss 2018 preinstall steps') |
|
|
|
|
|
|
|
|
// return any([any(steps), any(prompts)]) |
|
|
// return any([any(steps), any(prompts)]) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
, { |
|
|
|
|
|
// C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\ManagementStudio\Ssms.exe |
|
|
|
|
|
shellcmd: 'Ssms.exe', // SQL Mgmt Studo 2017 |
|
|
|
|
|
url: 'https://go.microsoft.com/fwlink/?linkid=2043154&clcid=0x409' |
|
|
|
|
|
, installer: 'SSMS-Setup-ENU-2017.exe' |
|
|
|
|
|
, installcmd: ['cmd', ['/c', 'start', |
|
|
|
|
|
'/WAIT', downloadsdir + '/' + 'SSMS-Setup-ENU-2017.exe' |
|
|
|
|
|
, '/IAcceptSQLServerLicenseTerms' |
|
|
|
|
|
//, 'SSMSInstallRoot=%systemdrive%\\Program Files (x86)\\Microsoft SQL Server\\140\\Tools\\Binn\\ManagementStudio' |
|
|
|
|
|
]] |
|
|
|
|
|
, install : install |
|
|
|
|
|
, exists : function(){ |
|
|
|
|
|
return Promise.resolve(false) |
|
|
|
|
|
var self = this; |
|
|
|
|
|
// var installedpath = 'C:\\Program Files (x86)\\Microsoft SQL Server Management Studio 18\\Common7\\IDE\\Ssms.exe' |
|
|
|
|
|
var installedpath = 'C:\\Program Files (x86)\\Microsoft SQL Server\\140\\Tools\\Binn\\ManagementStudio\\Ssms.exe' |
|
|
|
|
|
console.log('checking existence of ' + installedpath) |
|
|
|
|
|
return Promise.resolve(existsSync(installedpath)) |
|
|
|
|
|
} |
|
|
|
|
|
, preinstallsteps: function() { |
|
|
|
|
|
var self = this; |
|
|
|
|
|
console.log('smss preinstall steps') |
|
|
|
|
|
|
|
|
|
|
|
var steps = []; |
|
|
|
|
|
steps.push( |
|
|
|
|
|
function(){ |
|
|
|
|
|
if (!existsSync(downloadsdir + '/' + self.installer)) { |
|
|
|
|
|
console.log(self.url) |
|
|
|
|
|
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)]) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
, { |
|
|
, { |
|
|
shellcmd: 'sqlservr.exe', |
|
|
shellcmd: 'sqlservr.exe', |
|
|
url: 'https://go.microsoft.com/fwlink/?linkid=866658' |
|
|
url: 'https://go.microsoft.com/fwlink/?linkid=866658' |