ci and general changes
This commit is contained in:
12
main.go
12
main.go
@@ -63,10 +63,12 @@ var cfg *Config
|
||||
|
||||
func main() {
|
||||
if !admin.Admin() {
|
||||
fmt.Println("not running as administrator relaunching")
|
||||
if err := admin.RunSelfElevated(); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
os.Exit(0)
|
||||
return // just incase
|
||||
}
|
||||
|
||||
cfg = loadConfig()
|
||||
@@ -138,9 +140,13 @@ func fillGrid(grid *fyne.Container, parent fyne.Window) {
|
||||
grid.Hide()
|
||||
defer grid.Show()
|
||||
grid.RemoveAll()
|
||||
for _, profile := range profiles {
|
||||
profilename := filepath.Base(profile)
|
||||
grid.Add(widget.NewButton(profilename, makeIFunc(profile, archive, parent)))
|
||||
if admin.Admin() {
|
||||
for _, profile := range profiles {
|
||||
profilename := filepath.Base(profile)
|
||||
grid.Add(widget.NewButton(profilename, makeIFunc(profile, archive, parent)))
|
||||
}
|
||||
} else {
|
||||
grid.Add(widget.NewLabel("not running as administrator"))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user