fix: Windows installer server launch and auto-start issues

- Remove --tray flag from LaunchServer() on Windows (notray build)
- Switch schtasks from PowerShell Register-ScheduledTask to schtasks CLI
  for Chinese Windows compatibility
- Remove /RL HIGHEST from schtasks (requires admin privileges)
- Add install log output to %TEMP%/edgeai-install.log
- Add critical flag to install steps (critical failures abort)
- Fix extractDir: create parent dirs before writing files
- Improve findPython3: skip Windows Store stub, auto-install via winget
- Enhance installLibusb: extract bundled DLL, fallback to winget

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
jim800121chen 2026-03-09 19:04:08 +08:00
parent 551dee46cc
commit 53e0ba025c
2 changed files with 8 additions and 3 deletions

View File

@ -614,7 +614,12 @@ func (inst *Installer) LaunchServer() (string, error) {
binPath := filepath.Join(installDir, binName)
// Read config to get relay args
args := []string{"--tray"}
// Note: on Windows the server is built with CGO_ENABLED=0 -tags notray,
// so --tray is not available. On macOS the tray-enabled build is used.
var args []string
if runtime.GOOS != "windows" {
args = append(args, "--tray")
}
cfgPath := filepath.Join(platformConfigDir(), "config.json")
if data, err := os.ReadFile(cfgPath); err == nil {
var cfg map[string]interface{}

View File

@ -137,11 +137,11 @@ func installAutoRestart(installDir string) error {
// Use schtasks instead of PowerShell Register-ScheduledTask
// to avoid XML parsing issues on non-English Windows
// Note: do not use /RL HIGHEST — it requires admin privileges
cmd := exec.Command("schtasks", "/Create",
"/TN", taskName,
"/TR", fmt.Sprintf(`"%s" --tray`, binPath),
"/TR", fmt.Sprintf(`"%s"`, binPath),
"/SC", "ONLOGON",
"/RL", "HIGHEST",
"/F",
)
if out, err := cmd.CombinedOutput(); err != nil {