Add download task for SsmsMin (#5460)

* Add SsmsMin files

* no message

* Add script to install extension
This commit is contained in:
Charles Gagnon
2019-05-10 14:08:43 -07:00
committed by GitHub
parent 5a48fd80cd
commit 34eef8e97d
5 changed files with 42 additions and 1 deletions

View File

@@ -703,3 +703,25 @@ function installService() {
gulp.task('install-sqltoolsservice', () => {
return installService();
});
function installSsmsMin() {
let config = require('../extensions/admin-tool-ext-win/src/config.json');
return platformInfo.getCurrent().then(p => {
let runtime = p.runtimeId;
// fix path since it won't be correct
config.installDirectory = path.join(__dirname, '..', 'extensions', 'admin-tool-ext-win', config.installDirectory);
var installer = new serviceDownloader(config);
let serviceInstallFolder = installer.getInstallDirectory(runtime);
console.log('Cleaning up the install folder: ' + serviceInstallFolder);
return del(serviceInstallFolder + '/*').then(() => {
console.log('Installing the service. Install folder: ' + serviceInstallFolder);
return installer.installService(runtime);
}, delError => {
console.log('failed to delete the install folder error: ' + delError);
});
});
}
gulp.task('install-ssmsmin', () => {
return installSsmsMin();
});

View File

@@ -2,3 +2,4 @@ out/test/**
src/**
.gitignore
tsconfig.json
InstallSsmsMin.bat

View File

@@ -0,0 +1,4 @@
@echo off
REM Run this command to install SsmsMin for local development testing
gulp install-ssmsmin

View File

@@ -0,0 +1,12 @@
{
"downloadUrl": "https://sqlopsextensions.blob.core.windows.net/tools/ssmsmin/{#version#}/{#fileName#}",
"version": "15.0.18120.0",
"downloadFileNames": {
"Windows_64": "SsmsMin-15.0.18120.0-win-x64.zip",
"Windows_86": "SsmsMin-15.0.18120.0-win-x86.zip"
},
"installDirectory": "ssmsmin/{#platform#}/{#version#}",
"executableFiles": [
"SsmsMin.exe"
]
}

View File

@@ -12,6 +12,8 @@ import { doubleEscapeSingleQuotes, backEscapeDoubleQuotes } from './utils';
import { ChildProcess, exec } from 'child_process';
const localize = nls.loadMessageBundle();
const ssmsMinVer = JSON.parse(JSON.stringify(require('./config.json'))).version;
let exePath: string;
const runningProcesses: Map<number, ChildProcess> = new Map<number, ChildProcess>();
@@ -66,7 +68,7 @@ export async function activate(context: vscode.ExtensionContext): Promise<void>
// This is for Windows-specific support so do nothing on other platforms
if (process.platform === 'win32') {
Telemetry.sendTelemetryEvent('startup/ExtensionActivated');
exePath = path.join(context.extensionPath, 'ssmsmin', 'ssmsmin.exe');
exePath = path.join(context.extensionPath, 'ssmsmin', 'Windows', ssmsMinVer, 'ssmsmin.exe');
registerCommands(context);
}
}