mirror of
https://github.com/clockworkpi/LauncherGoDev.git
synced 2026-09-09 15:04:39 +02:00
add 50_Pico8
This commit is contained in:
44
sysgo/UI/comercial_package.go
Normal file
44
sysgo/UI/comercial_package.go
Normal file
@@ -0,0 +1,44 @@
|
||||
package UI
|
||||
|
||||
import (
|
||||
"path/filepath"
|
||||
)
|
||||
|
||||
type CommercialSoftwarePackage struct {
|
||||
BinLocation string
|
||||
MenuLocation string
|
||||
}
|
||||
|
||||
func NewCommercialSoftwarePackage(b,m string) *CommercialSoftwarePackage{
|
||||
return &CommercialSoftwarePackage{b,m}
|
||||
}
|
||||
|
||||
func (self *CommercialSoftwarePackage) Init() {
|
||||
|
||||
script := filepath.Join(self.MenuLocation,"Setup.sh")
|
||||
MakeExecutable(script)
|
||||
script = filepath.Join(self.MenuLocation,"Run.sh")
|
||||
MakeExecutable(script)
|
||||
}
|
||||
|
||||
func (self *CommercialSoftwarePackage) IsInstalled() bool {
|
||||
return FileExists(self.BinLocation)
|
||||
}
|
||||
|
||||
func (self *CommercialSoftwarePackage) IsConfiged() bool {
|
||||
return FileExists(filepath.Join(self.MenuLocation,".done"))
|
||||
}
|
||||
|
||||
func (self *CommercialSoftwarePackage) GetRunScript() string {
|
||||
return filepath.Join(self.MenuLocation,"Run.sh")
|
||||
}
|
||||
|
||||
func (self *CommercialSoftwarePackage) RunSetup() {
|
||||
if self.IsConfiged() == false {
|
||||
script := filepath.Join(self.MenuLocation,"Setup.sh")
|
||||
MakeExecutable(script)
|
||||
System(script) /// Scripts with very short runtime
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user