|
|
@@ -888,8 +888,7 @@ catch(e) { |
|
|
|
} |
|
|
|
|
|
|
|
function __main( selectedinstance ){ |
|
|
|
var downloadsdir = selectedinstance.root + '\\..\\Downloads'; |
|
|
|
|
|
|
|
var downloadsdir = path.dirname(selectedinstance.root) + '\\Downloads'; |
|
|
|
var callsheltask = function(args) { |
|
|
|
// console.log('callsheltask : ' + args) |
|
|
|
return function() { return nodeShellExec.apply(null, args) } } |
|
|
@@ -1005,12 +1004,15 @@ function __main( selectedinstance ){ |
|
|
|
// console.log('-------------exists=======================') |
|
|
|
// console.dir(exists) |
|
|
|
// 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; |
|
|
|
} |
|
|
|
else return false |
|
|
|
else { |
|
|
|
console.log(' ' + self.shellcmd + ' doesnt exist') |
|
|
|
return false |
|
|
|
} |
|
|
|
})['catch'](function(e){ |
|
|
|
// console.log('-------------exists catch=======================') |
|
|
|
console.dir(e) |
|
|
@@ -1354,10 +1356,11 @@ function __main( selectedinstance ){ |
|
|
|
, preinstallsteps: function() { |
|
|
|
var self = this; |
|
|
|
console.log('Node preinstall steps') |
|
|
|
|
|
|
|
// console.log(this.installcmd) |
|
|
|
// console.log(path.normalize(downloadsdir + '/' + 'node-v14.17.3-x64.msi')) |
|
|
|
var steps = []; |
|
|
|
steps.push( |
|
|
|
function(){ |
|
|
|
function(){ |
|
|
|
if (!existsSync(downloadsdir + '/' + self.installer)) { |
|
|
|
return nodeShellExec(selectedinstance.root + '/.elxr/run-' + runtimestamp + '/download.bat', ['"' + self.url + '"', downloadsdir + '/' + self.installer] |
|
|
|
, { waitmsg : 'downloading '+ self.shellcmd +' please wait' }) |
|
|
@@ -1443,7 +1446,7 @@ function __main( selectedinstance ){ |
|
|
|
, { |
|
|
|
// C:\Program Files (x86)\Microsoft SQL Server Management Studio 18\Common7\IDE\Ssms.exe |
|
|
|
// SQL Management studio 2018 |
|
|
|
shellcmd: 'Ssms.exe', |
|
|
|
shellcmd: 'sqlcmd.exe', // 'Ssms.exe', |
|
|
|
url: 'https://aka.ms/ssmsfullsetup' |
|
|
|
, installer: 'SSMS-Setup-ENU.exe' |
|
|
|
, installcmd: ['cmd', ['/c', 'start', |
|
|
@@ -1452,12 +1455,7 @@ function __main( selectedinstance ){ |
|
|
|
//, 'SSMSInstallRoot=%systemdrive%\\Program Files (x86)\\Microsoft SQL Server\\140\\Tools\\Binn\\ManagementStudio' |
|
|
|
]] |
|
|
|
, 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() { |
|
|
|
var self = this; |
|
|
|
console.log('smss 2018 preinstall steps') |
|
|
@@ -1481,48 +1479,6 @@ function __main( selectedinstance ){ |
|
|
|
// 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', |
|
|
|
url: 'https://go.microsoft.com/fwlink/?linkid=866658' |