Documentation ¶
Index ¶
- Variables
- func AsLocalFile(f eos.File) (*os.File, error)
- func CheckExitCode(exitCode int, err error) error
- func IsWindowsInstaller(typ InstallerType) bool
- func RegisterManager(m Manager)
- func RunCommand(consumer *state.Consumer, cmdTokens []string) (int, error)
- func RunElevatedCommand(consumer *state.Consumer, cmdTokens []string) (int, error)
- type Any
- type InstallParams
- type InstallResult
- type InstallerInfo
- type InstallerType
- type Manager
- type OnResultFunc
- type RunSelfParams
- type RunSelfResult
- type UninstallParams
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNeedLocal = errors.New("install source needs to be available locally")
Functions ¶
func AsLocalFile ¶
AsLocalFile takes an eos.File and tries to cast it to an *os.File. If that fails, it returns `ErrNeedLocal`. Consumers of functions that call + relay AsLocalFile's errors are expected to know how to download a file to disk and call again with an *os.File instance instead of, say, an httpfile.HTTPFile
func CheckExitCode ¶
func IsWindowsInstaller ¶
func IsWindowsInstaller(typ InstallerType) bool
func RegisterManager ¶
func RegisterManager(m Manager)
func RunCommand ¶
RunCommand starts and waits for an *exec.Cmd to finish, and goes through a weird type-casting dance to retrieve the actual exit code.
Types ¶
type InstallParams ¶
type InstallParams struct { // An archive file, .exe setup file, .dmg file etc. File eos.File // The existing receipt, if any ReceiptIn *bfs.Receipt // A folder we can use to store temp files StageFolderPath string // The folder we're installing to InstallFolderPath string // Listener for progress events, logging etc. Consumer *state.Consumer InstallerInfo *InstallerInfo // For cancellation Context context.Context }
type InstallResult ¶
type InstallerInfo ¶
type InstallerInfo struct { Type InstallerType ArchiveInfo *archive.ArchiveInfo }
func GetInstallerInfo ¶
type InstallerType ¶
type InstallerType string
const ( InstallerTypeNaked InstallerType = "naked" InstallerTypeArchive InstallerType = "archive" InstallerTypeDMG InstallerType = "dmg" InstallerTypeInno InstallerType = "inno" InstallerTypeNsis InstallerType = "nsis" InstallerTypeMSI InstallerType = "msi" InstallerTypeUnknown InstallerType = "unknown" InstallerTypeUnsupported InstallerType = "unsupported" )
type Manager ¶
type Manager interface { Install(params *InstallParams) (*InstallResult, error) Uninstall(params *UninstallParams) error Name() string }
func GetManager ¶
type OnResultFunc ¶
type OnResultFunc func(res Any)
type RunSelfParams ¶
type RunSelfParams struct { Consumer *state.Consumer Args []string OnResult OnResultFunc }
type RunSelfResult ¶
func RunSelf ¶
func RunSelf(params *RunSelfParams) (*RunSelfResult, error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.