Documentation ¶
Overview ¶
The wine package helps manage a Wineprefix and run Wine.
Index ¶
- Variables
- type Cmd
- type Prefix
- func (p *Prefix) AppDataDir() (string, error)
- func (p *Prefix) Command(name string, arg ...string) *Cmd
- func (p *Prefix) Dir() string
- func (p *Prefix) Init() error
- func (p *Prefix) Kill() error
- func (p *Prefix) RegistryAdd(key, value string, rtype RegistryType, data string) error
- func (p *Prefix) RegistryDelete(key, value string) error
- func (p *Prefix) SetDPI(dpi int) error
- func (p Prefix) String() string
- func (p *Prefix) Update() error
- func (p *Prefix) Version() string
- func (p *Prefix) Wine(exe string, arg ...string) *Cmd
- func (p *Prefix) Winetricks() error
- type RegistryType
Constants ¶
This section is empty.
Variables ¶
var ( ErrWineNotFound = errors.New("wine64 not found in $PATH or wineroot") ErrPrefixNotAbs = errors.New("prefix directory is not an absolute path") )
Functions ¶
This section is empty.
Types ¶
type Cmd ¶
Cmd is is a struct wrapper that overrides methods to better interact with a Wineprefix.
For further information, refer to exec.Cmd.
type Prefix ¶
type Prefix struct { // Path to a wine installation. Root string // Stdout and Stderr specify the descendant Prefix's Command // Stdout and Stderr. This is mostly reserved for logging purposes. // By default, they will be set to their os counterparts. Stderr io.Writer Stdout io.Writer // contains filtered or unexported fields }
Prefix is a representation of a Wineprefix, which is where Wine stores its data and is equivalent to a C:\ drive.
func New ¶
New returns a new Prefix.
The given directory must be owned by the current user, and must be an absolute path, otherwise running Wine will fail.
func (*Prefix) AppDataDir ¶
AppDataDir returns the current user's AppData within the Prefix.
func (*Prefix) Command ¶
Command returns the Cmd struct to execute the named program with the given arguments within the Prefix. It is reccomended to use [Wine] to run wine as opposed to Command.
For further information, refer to exec.Command.
func (*Prefix) RegistryAdd ¶
func (p *Prefix) RegistryAdd(key, value string, rtype RegistryType, data string) error
RegistryAdd adds a new registry key to the Wineprefix with the named key, value, type, and data.
func (*Prefix) RegistryDelete ¶
RegistryDelete deletes a registry key of the named key and value to be removed from the Wineprefix.
func (*Prefix) Wine ¶
Wine returns a new Cmd with the prefix's Wine as the named program.
The Wine executable used is a path to the system or Prefix's Root's 'wine64' if present. an attempt to resolve for a ULWGL launcher will be made if it is present and necessary environment variables will be set to the command.
func (*Prefix) Winetricks ¶
Winetricks runs winetricks within the Prefix.
type RegistryType ¶
type RegistryType string
RegistryType is the type of registry that the wine 'reg' program can accept.
const ( REG_SZ RegistryType = "REG_SZ" REG_MULTI_SZ RegistryType = "REG_MULTI_SZ" REG_EXPAND_SZ RegistryType = "REG_EXPAND_SZ" REG_DWORD RegistryType = "REG_DWORD" REG_QWORD RegistryType = "REG_QWORD" REG_BINARY RegistryType = "REG_BINARY" REG_NONE RegistryType = "REG_NONE" )