manifest

package
v0.0.0-...-aba5822 Latest Latest
Warning

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

Go to latest
Published: May 6, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChocoSpec

type ChocoSpec struct {
	ID             string `json:"id,omitempty"`
	Title          string `json:"title,omitempty"`
	Authors        string `json:"authors,omitempty"`
	Owners         string `json:"owners,omitempty"`
	Description    string `json:"description,omitempty"`
	ProjectURL     string `json:"project-url,omitempty"`
	Tags           string `json:"tags,omitempty"`
	LicenseURL     string `json:"license-url,omitempty"`
	IconURL        string `json:"icon-url,omitempty"`
	RequireLicense bool   `json:"require-license,omitempty"`
	MsiFile        string `json:"-"`
	MsiSum         string `json:"-"`
	BuildDir       string `json:"-"`
	ChangeLog      string `json:"-"`
}

ChocoSpec is the struct to decode the choco key of a wix.json file.

type Condition

type Condition struct {
	Condition string `json:"condition"`
	Message   string `json:"message"`
}

Condition describes a condition to check before installation.

type Directory

type Directory struct {
	ID          int         `json:"-"`
	Name        string      `json:"name,omitempty"`
	Files       []File      `json:"files,omitempty"`
	Directories []Directory `json:"directories,omitempty"`
}

Directory stores a list of files and a list of sub-directories.

type Environment

type Environment struct {
	Name      string `json:"name"`
	Value     string `json:"value"`
	Permanent string `json:"permanent"`
	System    string `json:"system"`
	Action    string `json:"action"`
	Part      string `json:"part"`
	Condition string `json:"condition,omitempty"`
}

Environment is the struct to decode environment variables of the wix.json file.

type File

type File struct {
	ID             int      `json:"-"`
	Path           string   `json:"path,omitempty"`
	Service        *Service `json:"service,omitempty"`
	NeverOverwrite bool     `json:"never_overwrite,omitempty"`
	Permanent      bool     `json:"permanent,omitempty"`
}

File is the struct to decode a file.

type Hook

type Hook struct {
	Command       string `json:"command,omitempty"`
	CookedCommand string `json:"-"`
	When          string `json:"when,omitempty"`
	Return        string `json:"return,omitempty"`
	Condition     string `json:"condition,omitempty"`
	Impersonate   string `json:"impersonate,omitempty"`
	Execute       string `json:"execute,omitempty"`
}

Hook describes a command to run on install / uninstall.

type Info

type Info struct {
	Comments         string `json:"comments,omitempty"`
	Contact          string `json:"contact,omitempty"`
	HelpLink         string `json:"help-link,omitempty"`
	SupportTelephone string `json:"support-telephone,omitempty"`
	SupportLink      string `json:"support-link,omitempty"`
	UpdateInfoLink   string `json:"update-info-link,omitempty"`
	Readme           string `json:"readme,omitempty"`
	Size             int64  `json:"-"` // in kilobytes
}

Info lists the control panel program information. Each member data is named after the matching column name in the uninstall program list.

type Property

type Property struct {
	ID       string    `json:"id"`
	Registry *Registry `json:"registry,omitempty"`
	Value    *Value    `json:"value,omitempty"`
}

Property describes a property to initialize.

type Registry

type Registry struct {
	Path string `json:"path"`
	Root string `json:"-"`
	Key  string `json:"-"`
	Name string `json:"name,omitempty"`
}

Registry describes a registry entry.

type RegistryItem

type RegistryItem struct {
	Registry
	Values    []RegistryValue `json:"values,omitempty"`
	Condition string          `json:"condition,omitempty"`
}

RegistryItem is the struct to decode a registry item.

type RegistryValue

type RegistryValue struct {
	Name  string `json:"name"`
	Type  string `json:"type,omitempty"` // string (default if omitted), integer, ...
	Value string `json:"value"`
}

RegistryValue is the struct to decode a registry value.

type Service

type Service struct {
	Name         string   `json:"name"`
	Bin          string   `json:"-"`
	Start        string   `json:"start"`
	Delayed      bool     `json:"-"`
	DisplayName  string   `json:"display-name,omitempty"`
	Description  string   `json:"description,omitempty"`
	Arguments    string   `json:"arguments,omitempty"`
	Dependencies []string `json:"dependencies,omitempty"`
}

Service is the struct to decode a service.

type Shortcut

type Shortcut struct {
	Name        string             `json:"name"`
	Description string             `json:"description"`
	Location    string             `json:"location"`
	Target      string             `json:"target"`
	WDir        string             `json:"wdir,omitempty"`
	Arguments   string             `json:"arguments,omitempty"`
	Icon        string             `json:"icon,omitempty"`
	Condition   string             `json:"condition,omitempty"`
	Properties  []ShortcutProperty `json:"properties,omitempty"`
}

Shortcut is the struct to decode shortcut value of the wix.json file.

type ShortcutProperty

type ShortcutProperty struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

ShortcutProperty stands for a key value association.

type Value

type Value string

Value describes a simple string value

type Version

type Version struct {
	User    string
	Display string
	MSI     string
	Hex     int64
}

Version stores version related data in various formats.

type WixManifest

type WixManifest struct {
	Compression string  `json:"compression,omitempty"`
	Product     string  `json:"product"`
	Company     string  `json:"company"`
	Version     Version `json:"-"`
	License     string  `json:"license,omitempty"`
	Banner      string  `json:"banner,omitempty"`
	Dialog      string  `json:"dialog,omitempty"`
	Icon        string  `json:"icon,omitempty"`
	Info        *Info   `json:"info,omitempty"`
	UpgradeCode string  `json:"upgrade-code"`
	Directory
	Environments []Environment  `json:"environments,omitempty"`
	Registries   []RegistryItem `json:"registries,omitempty"`
	Shortcuts    []Shortcut     `json:"shortcuts,omitempty"`
	Choco        ChocoSpec      `json:"choco"`
	Hooks        []Hook         `json:"hooks,omitempty"`
	Properties   []Property     `json:"properties,omitempty"`
	Conditions   []Condition    `json:"conditions,omitempty"`
}

WixManifest is the struct to decode a wix.json file.

func (*WixManifest) Load

func (wixFile *WixManifest) Load(p string) error

Load the manifest from given file path, if the file path is empty, reads from wix.json

func (*WixManifest) NeedGUID

func (wixFile *WixManifest) NeedGUID() bool

NeedGUID tells if the manifest json file is missing guid values.

func (*WixManifest) Normalize

func (wixFile *WixManifest) Normalize() error

Normalize appropriately fixes some values within the decoded json. It applies defaults values on the wix/msi property to generate the msi package. It applies defaults values on the choco property to generate a nuget package.

func (*WixManifest) RewriteFilePaths

func (wixFile *WixManifest) RewriteFilePaths(out string) error

RewriteFilePaths reads files and directories of the wix.json file and turn their values into a relative path to out where out is the path to the wix templates files.

func (*WixManifest) SetGuids

func (wixFile *WixManifest) SetGuids(force bool) (bool, error)

SetGuids generates and apply guid values appropriately

func (*WixManifest) Write

func (wixFile *WixManifest) Write(p string) error

Write the manifest to the given file, if file is empty, writes to wix.json

Jump to

Keyboard shortcuts

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