Skip to content

Golang example of using a manifest file to prompt "Run as administrator" on Windows

Notifications You must be signed in to change notification settings

mozey/run-as-admin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

run-as-admin

Golang example of using a manifest file to prompt "Run as administrator"

Build app with manifest

Install rsrc tool for embedding binary resources in Go programs

go get github.com/akavel/rsrc

Generates a .syso file with embedded resources

rsrc -manifest app.exe.manifest -o app.syso

Build executable

GOOS="windows" GOARCH="386" go build -o app.exe

Reference

how-to-ask-for-administer-privileges-on-windows-with-go

check-if-application-is-running-as-administrator-in-golang

Without a manifest

See this technique, "...run as a standard user in most cases, and only elevate when needed. I use this in command line tools where most functions don't need admin rights"

About

Golang example of using a manifest file to prompt "Run as administrator" on Windows

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages