Documentation ¶
Index ¶
- Variables
- func AsLocalFile(f eos.File) (*os.File, error)
- func CheckExitCode(exitCode int, err error) error
- func HasSuspiciouslySetupLikeName(name string) bool
- 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 *htfs.File
func CheckExitCode ¶
func HasSuspiciouslySetupLikeName ¶
cf. https://blogs.msdn.microsoft.com/oldnewthing/20100726-00/?p=13323
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 *boar.Info Entries []*savior.Entry }
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.