diff --git a/cmd/arcdps-log-uploader/main.go b/cmd/arcdps-log-uploader/main.go index 629724f..8b50df3 100644 --- a/cmd/arcdps-log-uploader/main.go +++ b/cmd/arcdps-log-uploader/main.go @@ -3,16 +3,34 @@ package main import ( + "github.com/lxn/walk" log "github.com/sirupsen/logrus" + "os" ) func main() { setupLogging() log.Info("Starting") - err := startUi() + if runningWithAdminPrivileges() { + walk.MsgBox(nil, "Administrator mode is not supported", "Due to windows security constraints, drag & drop is not supported for applications running in administrative mode.", walk.MsgBoxOK|walk.MsgBoxIconWarning|walk.MsgBoxTaskModal) + } else { + start() + } + log.Info("Bye") +} + +func start() { + var err = startUi() if err != nil { panic(err) } - log.Info("Bye") +} + +func runningWithAdminPrivileges() bool { + _, err := os.Open("\\\\.\\PHYSICALDRIVE0") + if err != nil { + return false + } + return true }