SPM/register_unix.go
2025-03-01 17:59:26 +01:00

37 lines
904 B
Go

// run_default.go
//go:build !windows
// +build !windows
package spm
import (
"fmt"
"os"
"path/filepath"
)
// RegisterApp is not supported on non-Windows platforms.
func RegisterApp() error {
return fmt.Errorf("RegisterApp is only available on Windows")
}
// UnregisterApp is not supported on non-Windows platforms.
func UnregisterApp() error {
return fmt.Errorf("UnregisterApp is only available on Windows")
}
// IsRegistered returns true if the application is detected as installed.
// On Linux, we assume it is installed if the main executable exists in the install directory.
func IsRegistered() bool {
installDir, err := GetInstallDir()
if err != nil {
return false
}
// Assume the executable is named "spitfire" and is located in installDir.
exePath := filepath.Join(installDir, "browser", "spitfire")
if _, err := os.Stat(exePath); err == nil {
return true
}
return false
}