mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Add support for installing azdata on Windows (#11387)
* Add support for installing azdata on Windows * Don't run startup code when in test context since it blocks on UI input * restart checks * Disable calls for now
This commit is contained in:
@@ -3,8 +3,36 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as vscode from 'vscode';
|
||||
import { findAzdata, downloadAndInstallAzdata } from './azdata';
|
||||
import * as loc from './localizedConstants';
|
||||
import { ExitCodeError } from './common/childProcess';
|
||||
|
||||
export async function activate(): Promise<void> {
|
||||
const outputChannel = vscode.window.createOutputChannel('azdata');
|
||||
if (false) {
|
||||
await checkForAzdata(outputChannel);
|
||||
}
|
||||
}
|
||||
|
||||
export function deactivate(): void {
|
||||
async function checkForAzdata(outputChannel: vscode.OutputChannel): Promise<void> {
|
||||
try {
|
||||
const azdata = await findAzdata(outputChannel);
|
||||
vscode.window.showInformationMessage(loc.foundExistingAzdata(azdata.path, azdata.version));
|
||||
} catch (err) {
|
||||
const response = await vscode.window.showErrorMessage(loc.couldNotFindAzdataWithPrompt, loc.install, loc.cancel);
|
||||
if (response === loc.install) {
|
||||
try {
|
||||
await downloadAndInstallAzdata(outputChannel);
|
||||
vscode.window.showInformationMessage(loc.azdataInstalled);
|
||||
} catch (err) {
|
||||
// 1602 is User Cancelling installation - not unexpected so don't display
|
||||
if (!(err instanceof ExitCodeError) || err.code !== 1602) {
|
||||
vscode.window.showWarningMessage(loc.installError(err));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export function deactivate(): void { }
|
||||
|
||||
Reference in New Issue
Block a user