Skip to content

Commit 3e44e34

Browse files
authored
Merge pull request microsoft#159488 from microsoft/dev/joyceerhl/inevitable-porcupine
Polish protocol handler flow when VS Code is not installed
2 parents a13e5e1 + ae2fde2 commit 3e44e34

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

src/vs/workbench/browser/window.ts

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -203,9 +203,7 @@ export class BrowserWindow extends Disposable {
203203

204204
invokeProtocolHandler();
205205

206-
// We cannot know whether the protocol handler succeeded.
207-
// Display guidance in case it did not, e.g. the app is not installed locally.
208-
if (matchesScheme(href, this.productService.urlProtocol)) {
206+
const showProtocolUrlOpenedDialog = async () => {
209207
const showResult = await this.dialogService.show(
210208
Severity.Info,
211209
localize('openExternalDialogTitle', "All done. You can close this tab now."),
@@ -223,8 +221,22 @@ export class BrowserWindow extends Disposable {
223221
if (showResult.choice === 0) {
224222
invokeProtocolHandler();
225223
} else if (showResult.choice === 1) {
226-
await this.openerService.open(URI.parse(`http://aka.ms/vscode-install`));
224+
// Route the user to the appropriate install link
225+
await this.openerService.open(URI.parse(
226+
this.productService.quality === 'stable'
227+
? `http://aka.ms/vscode-install`
228+
: `http://aka.ms/vscode-install-insiders`
229+
));
230+
231+
// Re-show the dialog so that the user can come back after installing and try again
232+
showProtocolUrlOpenedDialog();
227233
}
234+
};
235+
236+
// We cannot know whether the protocol handler succeeded.
237+
// Display guidance in case it did not, e.g. the app is not installed locally.
238+
if (matchesScheme(href, this.productService.urlProtocol)) {
239+
await showProtocolUrlOpenedDialog();
228240
}
229241
}
230242

0 commit comments

Comments
 (0)