init commit

This commit is contained in:
2026-03-31 14:40:03 +03:00
commit 41c8e186ef
37 changed files with 5420 additions and 0 deletions

30
core/settings_windows.go Normal file
View File

@@ -0,0 +1,30 @@
//go:build windows
package core
import (
"os"
"golang.org/x/sys/windows/registry"
)
const regRunKey = `SOFTWARE\Microsoft\Windows\CurrentVersion\Run`
// ApplyStartupRegistry adds or removes the app from Windows startup registry.
func (s *AppSettings) ApplyStartupRegistry() {
key, err := registry.OpenKey(registry.CURRENT_USER, regRunKey, registry.SET_VALUE)
if err != nil {
return
}
defer key.Close()
if s.RunOnStartup {
exePath, err := os.Executable()
if err != nil {
return
}
_ = key.SetStringValue("kettuRay", `"`+exePath+`"`)
} else {
_ = key.DeleteValue("kettuRay")
}
}