Bring the Wails desktop shell to feature parity with the CLI for provider and alias management while keeping the browser fallback working. Wire tray, notifications, autostart, and GUI warnings so desktop flows behave predictably.
27 lines
592 B
Go
27 lines
592 B
Go
//go:build windows
|
|
|
|
package config
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
|
|
"golang.org/x/sys/windows"
|
|
)
|
|
|
|
func lockTestFile(file *os.File) error {
|
|
var overlapped windows.Overlapped
|
|
if err := windows.LockFileEx(windows.Handle(file.Fd()), windows.LOCKFILE_EXCLUSIVE_LOCK, 0, 1, 0, &overlapped); err != nil {
|
|
return fmt.Errorf("lock file ex: %w", err)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func unlockTestFile(file *os.File) error {
|
|
var overlapped windows.Overlapped
|
|
if err := windows.UnlockFileEx(windows.Handle(file.Fd()), 0, 1, 0, &overlapped); err != nil {
|
|
return fmt.Errorf("unlock file ex: %w", err)
|
|
}
|
|
return nil
|
|
}
|