Documentation
¶
Overview ¶
Package userpath edits the current user's Windows PATH.
Index ¶
Constants ¶
const InstallerFlag = "--installer-user-path"
InstallerFlag is the hidden argument the Windows installer passes to the app: "<exe> --installer-user-path add|remove".
Variables ¶
var ErrMalformed = errors.New("userpath: unbalanced quote in PATH")
ErrMalformed indicates an unbalanced quote in the PATH value.
Functions ¶
func Add ¶
Add returns value with dir appended as one more entry of a Windows PATH list, and whether it changed. dir is quoted when it contains ';'.
func Remove ¶
Remove returns value without the entries that name dir, and whether it changed. Other entries, including empty ones, keep their exact text.
func RunInstaller ¶
RunInstaller handles args when they are the installer's hidden command and returns the process exit code: 0 on success (changed or already right), 1 on failure, 2 on bad arguments. ok is false for any other args.
Types ¶
This section is empty.