winstall

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 26, 2023 License: GPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	Command         string
	Args            []string
	Stdout          *os.File
	Stderr          *os.File
	SysProcAttr     *syscall.SysProcAttr
	IsInstalledFunc func(installer Installer) (bool, error)
}

func (Command) Install

func (i Command) Install(installer Installer) (err error)

func (Command) IsInstalled

func (i Command) IsInstalled(installer Installer) (bool, error)

type Copy

type Copy struct {
	From string
	To   string
}

func (Copy) Install

func (i Copy) Install(installer Installer) error

func (Copy) IsInstalled

func (i Copy) IsInstalled(installer Installer) (bool, error)

type Directory

type Directory struct {
	Path string
}

func (Directory) Install

func (i Directory) Install(installer Installer) error

func (Directory) IsInstalled

func (i Directory) IsInstalled(installer Installer) (bool, error)

type File

type File struct {
	Filename string
	Path     string
	Data     []byte
}

func (File) Install

func (i File) Install(installer Installer) (err error)

func (File) IsInstalled

func (i File) IsInstalled(installer Installer) (bool, error)

type IOFile

type IOFile struct {
	Filename   string
	Path       string
	ReaderFunc func(path, name string) (io.Reader, error)
}

func (IOFile) Install

func (i IOFile) Install(installer Installer) error

func (IOFile) IsInstalled

func (i IOFile) IsInstalled(installer Installer) (bool, error)

type Installation

type Installation interface {
	Install(installer Installer) error
	IsInstalled(installer Installer) (bool, error)
}

type Installer

type Installer struct {
	Directory       string
	Installations   []Installation
	OnFinish        func()
	IsInstalledFunc func() (bool, error)

	Flags InstallerFlags
}

func (*Installer) Install

func (i *Installer) Install() error

func (*Installer) InstallCommand

func (i *Installer) InstallCommand(command string, args ...string)

func (*Installer) InstallCopiedFile

func (i *Installer) InstallCopiedFile(from, to string)

func (*Installer) InstallDirectory

func (i *Installer) InstallDirectory(path string)

func (*Installer) InstallFile

func (i *Installer) InstallFile(filename, path string, data []byte)

func (*Installer) InstallFileReader

func (i *Installer) InstallFileReader(filename, path string, readerFunc func(path, name string) (reader io.Reader, err error))

func (*Installer) InstallRegistryKey

func (i *Installer) InstallRegistryKey(key registry.Key, path string, access uint32) *Regkey

func (*Installer) InstallShortcut

func (i *Installer) InstallShortcut(from, to string)

func (*Installer) IsInstalled

func (i *Installer) IsInstalled() (bool, error)

func (Installer) MakePath

func (i Installer) MakePath(paths ...string) string

func (*Installer) NewInstallation

func (i *Installer) NewInstallation(installations ...Installation)

type InstallerFlags

type InstallerFlags uint32
const (
	F_PRIVILEGED InstallerFlags = 1 << iota
	F_FORCESAVE
)

func (InstallerFlags) ForceInstall

func (i InstallerFlags) ForceInstall() bool

func (InstallerFlags) NeedsAdministrator

func (i InstallerFlags) NeedsAdministrator() bool

type RegistryValue

type RegistryValue struct {
	Name       string
	Value      any
	SetterFunc SetterFunc
}

type Regkey

type Regkey struct {
	Key    registry.Key
	Path   string
	Access uint32
	Values []RegistryValue
}

func NewRegKey

func NewRegKey(key registry.Key, path string, access uint32) *Regkey

func (*Regkey) AddValue

func (i *Regkey) AddValue(setterFunc SetterFunc, name string, value any)

func (*Regkey) Install

func (i *Regkey) Install(installer Installer) error

func (*Regkey) IsInstalled

func (i *Regkey) IsInstalled(installer Installer) (bool, error)

type SetterFunc

type SetterFunc int8
const (
	SetNoValue SetterFunc = iota
	SetDWordValue
	SetQWordValue
	SetStringValue
	SetExpandStringValue
	SetStringsValue
	SetBinaryValue
)

type Shortcut

type Shortcut struct {
	From string
	To   string
}

func (Shortcut) Install

func (i Shortcut) Install(installer Installer) (err error)

func (Shortcut) IsInstalled

func (i Shortcut) IsInstalled(installer Installer) (bool, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL