add 50_Pico8

This commit is contained in:
cuu
2023-01-26 07:17:15 +00:00
parent 94b7bf121a
commit 9f70638d99
8 changed files with 225 additions and 16 deletions

View 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
}
}