Init
This commit is contained in:
commit
d0187f94d7
23 changed files with 2489 additions and 0 deletions
37
spm/register_unix.go
Normal file
37
spm/register_unix.go
Normal file
|
@ -0,0 +1,37 @@
|
|||
// 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("[WARN] RegisterApp() is only available on Windows")
|
||||
}
|
||||
|
||||
// UnregisterApp is not supported on non-Windows platforms.
|
||||
func UnregisterApp() error {
|
||||
return fmt.Errorf("[WARN] 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
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue