macosutils

package module
v0.0.0-...-8670db8 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2022 License: MIT Imports: 9 Imported by: 0

README

macosutils

Utilities for doing various things on macOS, such as mounting a dmg, installing an apple pkg, etc.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InstallApp

func InstallApp(appPath string, appName string) error

InstallApp installs a .app to /Applications from the specified path.

func InstallPkg

func InstallPkg(pkgPath string, pkgName string) error

InstallPkg runs installed on the specified pkg path.

func MountPoint

func MountPoint(mountinfo SystemEntities) string

MountPoint returns the filepath where the dmg is mounted

Types

type BackingStoreInfo

type BackingStoreInfo struct {
	ChecksumType      string              `plist:"Checksum Type"`
	ChecksumValue     string              `plist:"Checksum Value"`
	ClassName         string              `plist:"Checksum Name"`
	Format            string              `plist:"Format"`
	FormatDescription string              `plist:"Format Description"`
	Properties        DiskImageProperties `plist:"Properties"`
}

BackingStoreInfo Stores all info about the disk image

type DMG

type DMG struct {
	MountPoint string
	ImageInfo  BackingStoreInfo
	Pkgs       []string
	Apps       []string
	// contains filtered or unexported fields
}

DMG reprents a macOS DMG image

func NewDMG

func NewDMG(path string, opts ...DMGOption) (*DMG, error)

NewDMG will create a new DMG object, with various utility functions

func (*DMG) GetInstallables

func (d *DMG) GetInstallables()

GetInstallables will show all valid installer types inside the dmg

func (*DMG) HasSLA

func (d *DMG) HasSLA() bool

HasSLA returns true if the DMG has an SLA

func (*DMG) IsWritable

func (d *DMG) IsWritable() bool

IsWritable returns true if the DMG is in a writable format

func (*DMG) Mount

func (d *DMG) Mount() error

Mount the DMG

func (*DMG) Unmount

func (d *DMG) Unmount(dmgPath string) error

Unmount the DMG

type DMGOption

type DMGOption func(*DMG)

DMGOption allows the passing of dmg mounting options that differ from default

func WithLogger

func WithLogger(logger *log.Logger) DMGOption

WithLogger allows you to pass a custom logger to the NewDMG function

type DiskEntries

type DiskEntries struct {
	Disk *string `plist:"mount-point"`
}

DiskEntries contains all mount points for the dmg

type DiskImageProperties

type DiskImageProperties struct {
	Checksummed              bool `plist:"Checksummed"`
	Compressed               bool `plist:"Compressed"`
	Encrypted                bool `plist:"Encrypted"`
	KernelCompatible         bool `plist:"Kernel Compatible"`
	Partitioned              bool `plist:"Partitioned"`
	SoftwareLicenseAgreement bool `plist:"Software License Agreement"`
}

DiskImageProperties represents the properties of a disk image

type SystemEntities

type SystemEntities struct {
	Disks []DiskEntries `plist:"system-entities"`
}

SystemEntities contains an array of volumes

Jump to

Keyboard shortcuts

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