move eula prompt post azdata discovery (#12532)

* new download location of azdata.msi

* move eula prompt post azdata discovery

* unacceptEula - test change

* Revert "unacceptEula - test change"

This reverts commit f84a3f5e41797de25b38f87143d66f7041b5c4ec.
This commit is contained in:
Arvind Ranasaria
2020-09-21 12:56:03 -07:00
committed by GitHub
parent db902beb24
commit 21d9485ca7

View File

@@ -31,21 +31,21 @@ export async function activate(context: vscode.ExtensionContext): Promise<azdata
eulaAccepted = !!context.globalState.get<boolean>(constants.eulaAccepted); // fetch eula acceptance state from memento
await vscode.commands.executeCommand('setContext', constants.eulaAccepted, eulaAccepted); // set a context key for current value of eulaAccepted state retrieved from memento so that command for accepting eula is available/unavailable in commandPalette appropriately.
Logger.log(loc.eulaAcceptedStateOnStartup(eulaAccepted));
if (!eulaAccepted) {
// Don't block on this since we want extension to finish activating without requiring user actions.
// If EULA has not been accepted then we will check again while executing azdata commands.
promptForEula(context.globalState)
.then(async (userResponse: boolean) => {
eulaAccepted = userResponse;
})
.catch((err) => console.log(err));
}
// Don't block on this since we want the extension to finish activating without needing user input
checkAndInstallAzdata() // install if not installed and user wants it.
.then(async azdataTool => {
localAzdata = azdataTool;
if (localAzdata !== undefined) {
if (!eulaAccepted) {
// Don't block on this since we want extension to finish activating without requiring user actions.
// If EULA has not been accepted then we will check again while executing azdata commands.
promptForEula(context.globalState)
.then(async (userResponse: boolean) => {
eulaAccepted = userResponse;
})
.catch((err) => console.log(err));
}
try {
//update if available and user wants it.
if (await checkAndUpdateAzdata(localAzdata)) { // if an update was performed