Ship the native app window and start from Luminary.exe
A tester saw Edge open and start syncing his Microsoft account; the bundle carried no WebView2 host, so the launcher fell back to Edge's app mode. The window host is now built and shipped, the fallback prefers Chrome over Edge, and the installer's Start Luminary, shortcuts and start-at-login use Luminary.exe so they no longer depend on Windows Script Host, which policy can disable.
This commit is contained in:
@@ -156,8 +156,20 @@ function Open-Browser([string]$url) {
|
||||
|
||||
# Edge is part of Windows 10/11, so a chromeless app window costs no extra
|
||||
# runtime. Chrome is the second choice; anything else falls back to a tab.
|
||||
# Chrome first, then Edge: both are Chromium, but Edge's first run asks for a
|
||||
# Microsoft account and starts syncing settings, which reads as an unwanted
|
||||
# browser taking over the machine.
|
||||
function Find-AppWindowBrowser {
|
||||
$candidates = @()
|
||||
if ($env:LOCALAPPDATA) {
|
||||
$candidates += (Join-Path $env:LOCALAPPDATA 'Google\Chrome\Application\chrome.exe')
|
||||
}
|
||||
if ($env:ProgramFiles) {
|
||||
$candidates += (Join-Path $env:ProgramFiles 'Google\Chrome\Application\chrome.exe')
|
||||
}
|
||||
if (${env:ProgramFiles(x86)}) {
|
||||
$candidates += (Join-Path ${env:ProgramFiles(x86)} 'Google\Chrome\Application\chrome.exe')
|
||||
}
|
||||
if (${env:ProgramFiles(x86)}) {
|
||||
$candidates += (Join-Path ${env:ProgramFiles(x86)} 'Microsoft\Edge\Application\msedge.exe')
|
||||
}
|
||||
@@ -166,13 +178,6 @@ function Find-AppWindowBrowser {
|
||||
}
|
||||
if ($env:LOCALAPPDATA) {
|
||||
$candidates += (Join-Path $env:LOCALAPPDATA 'Microsoft\Edge\Application\msedge.exe')
|
||||
$candidates += (Join-Path $env:LOCALAPPDATA 'Google\Chrome\Application\chrome.exe')
|
||||
}
|
||||
if ($env:ProgramFiles) {
|
||||
$candidates += (Join-Path $env:ProgramFiles 'Google\Chrome\Application\chrome.exe')
|
||||
}
|
||||
if (${env:ProgramFiles(x86)}) {
|
||||
$candidates += (Join-Path ${env:ProgramFiles(x86)} 'Google\Chrome\Application\chrome.exe')
|
||||
}
|
||||
foreach ($candidate in $candidates) {
|
||||
if ($candidate -and (Test-Path -LiteralPath $candidate)) { return $candidate }
|
||||
|
||||
@@ -582,8 +582,10 @@ func openBrowser(url string) {
|
||||
_ = exec.Command("rundll32", "url.dll,FileProtocolHandler", url).Start()
|
||||
}
|
||||
|
||||
// Edge ships with Windows 10/11, so a chromeless app window costs no extra
|
||||
// runtime. Chrome is the second choice; anything else falls back to a tab.
|
||||
// Chrome comes first, then Edge: both are Chromium and cost no extra runtime,
|
||||
// but starting Edge prompts for the Microsoft account and settings sync, which
|
||||
// reads as an unwanted browser taking over the machine. Anything else falls
|
||||
// back to a normal tab.
|
||||
func findAppBrowser() string {
|
||||
candidates := []string{}
|
||||
add := func(dir string, rest ...string) {
|
||||
@@ -591,12 +593,12 @@ func findAppBrowser() string {
|
||||
candidates = append(candidates, filepath.Join(append([]string{dir}, rest...)...))
|
||||
}
|
||||
}
|
||||
for _, key := range []string{"ProgramFiles(x86)", "ProgramFiles", "LOCALAPPDATA"} {
|
||||
add(os.Getenv(key), "Microsoft", "Edge", "Application", "msedge.exe")
|
||||
}
|
||||
for _, key := range []string{"LOCALAPPDATA", "ProgramFiles", "ProgramFiles(x86)"} {
|
||||
add(os.Getenv(key), "Google", "Chrome", "Application", "chrome.exe")
|
||||
}
|
||||
for _, key := range []string{"ProgramFiles(x86)", "ProgramFiles", "LOCALAPPDATA"} {
|
||||
add(os.Getenv(key), "Microsoft", "Edge", "Application", "msedge.exe")
|
||||
}
|
||||
for _, candidate := range candidates {
|
||||
if info, err := os.Stat(candidate); err == nil && info.Size() > 0 {
|
||||
return candidate
|
||||
|
||||
Reference in New Issue
Block a user