Documentation ¶
Overview ¶
Package msi contains helper functions to work with msi packages
Package msi contains helper functions to work with msi packages
Index ¶
- func IsProductInstalled(productName string) bool
- func RemoveProduct(productName string) error
- type Msiexec
- type MsiexecOption
- func Install() MsiexecOption
- func Uninstall() MsiexecOption
- func WithAdditionalArgs(additionalArgs []string) MsiexecOption
- func WithDdAgentUserName(ddagentUserName string) MsiexecOption
- func WithLogFile(logFile string) MsiexecOption
- func WithMsi(target string) MsiexecOption
- func WithMsiFromPackagePath(target, product string) MsiexecOption
- func WithProduct(productName string) MsiexecOption
- type Product
- type TextRange
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsProductInstalled ¶
IsProductInstalled returns true if the given productName is installed
func RemoveProduct ¶
RemoveProduct uses the registry to try and find a product and use msiexec to remove it. It is different from msiexec in that it uses the registry and not the stable/experiment path on disk to uninstall the product. This is needed because in certain circumstances the installer database stored in the stable/experiment paths does not reflect the installed version, and using those installers can lead to undefined behavior (either failure to uninstall, or weird bugs from uninstalling a product with an installer from a different version).
Types ¶
type Msiexec ¶
Msiexec is a type wrapping msiexec
func Cmd ¶
func Cmd(options ...MsiexecOption) (*Msiexec, error)
Cmd creates a new Msiexec wrapper around cmd.Exec that will call msiexec
func (*Msiexec) FireAndForget ¶
FireAndForget starts msiexec and doesn't wait for it to finish. The log file won't be read at the end and post execution actions will not be executed.
type MsiexecOption ¶
type MsiexecOption func(*msiexecArgs) error
MsiexecOption is an option type for creating msiexec command lines
func Install ¶
func Install() MsiexecOption
Install specifies that msiexec will be invoked to install a product
func Uninstall ¶
func Uninstall() MsiexecOption
Uninstall specifies that msiexec will be invoked to uninstall a product
func WithAdditionalArgs ¶
func WithAdditionalArgs(additionalArgs []string) MsiexecOption
WithAdditionalArgs specifies additional arguments for msiexec
func WithDdAgentUserName ¶
func WithDdAgentUserName(ddagentUserName string) MsiexecOption
WithDdAgentUserName specifies the DDAGENTUSER_NAME to use
func WithLogFile ¶
func WithLogFile(logFile string) MsiexecOption
WithLogFile specifies the log file for msiexec
func WithMsi ¶
func WithMsi(target string) MsiexecOption
WithMsi specifies the MSI target for msiexec
func WithMsiFromPackagePath ¶
func WithMsiFromPackagePath(target, product string) MsiexecOption
WithMsiFromPackagePath finds an MSI from the packages folder
func WithProduct ¶
func WithProduct(productName string) MsiexecOption
WithProduct specifies the product name to target for msiexec
type Product ¶
type Product struct { // Code is the software product code Code string // UninstallString is the string that can be executed to uninstall the software. May be empty. UninstallString string }
Product represents a software from the Windows Registry
func FindProductCode ¶
FindProductCode looks for the productName in the registry and returns information about it
type TextRange ¶
type TextRange struct {
// contains filtered or unexported fields
}
TextRange is a simple struct to represent a range of text in a file.
func Combine ¶
Combine processes input using multiple logFileProcessors and merges their output ranges.
func FindAllIndexWithContext ¶
func FindAllIndexWithContext(r *regexp.Regexp, input []byte, contextBefore, contextAfter int) []TextRange
FindAllIndexWithContext is similar to FindAllIndex but expands the matched range for a number of lines before and after the TextRange (called contextBefore and contextAfter).