Documentation
¶
Overview ¶
Package registry processes .reg files and generates WiX registry components.
Index ¶
- Constants
- type Component
- type Processor
- func (p *Processor) BuildAllPreservedIDs(components []*Component) []map[string]int
- func (p *Processor) GeneratePreservationXML(components []*Component, allPreservedIDs []map[string]int) string
- func (p *Processor) GenerateXML(components []*Component, setPermissions bool) string
- func (p *Processor) GenerateXMLWithPreservedIDs(components []*Component, setPermissions bool, allPreservedIDs []map[string]int) string
- func (p *Processor) Process(reg ir.Registry) ([]*Component, error)
- type RegistryKey
- type RegistryValue
- type RemovalEntry
Constants ¶
const DefaultSDDL = "O:BAG:SYD:(A;CIOI;GA;;;SY)(A;CIOI;GA;;;BU)(A;CIOI;GA;;;AU)(A;CIOI;GA;;;LA)(A;CIOI;GA;;;LS)"
DefaultSDDL is the default security descriptor for registry keys. Grants generic access to System, Built-in Users, Authenticated Users, Local Admin, and Local Service.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Component ¶
type Component struct {
ID string
GUID string
Permanent bool
Preserve bool
Condition string
SDDL string
Keys []*RegistryKey
}
Component represents a WiX registry component.
type Processor ¶
type Processor struct {
// contains filtered or unexported fields
}
Processor handles registry file parsing and WiX generation.
func NewProcessor ¶
NewProcessor creates a new registry processor. The upgradeCode is used to make component GUIDs product-unique, preventing shared component conflicts between different products.
func (*Processor) BuildAllPreservedIDs ¶
BuildAllPreservedIDs pre-builds preservation ID maps for all components. Returns a slice parallel to the components slice, where each entry is either nil (non-preserved) or a map of "keyPath+valueName" -> preserve ID. This must be called before GenerateXML and GeneratePreservationXML to ensure both methods use the same IDs.
func (*Processor) GeneratePreservationXML ¶
func (p *Processor) GeneratePreservationXML(components []*Component, allPreservedIDs []map[string]int) string
GeneratePreservationXML generates Property+RegistrySearch elements for preserved registry values. These elements must appear at Package level (before components) so that existing registry values are read before the install writes new ones. If a value already exists, it's preserved; otherwise the default from the .reg file is used.
func (*Processor) GenerateXML ¶
GenerateXML generates WiX XML for the components.
type RegistryKey ¶
type RegistryKey struct {
Root string // HKLM, HKCU, etc.
Key string // Path without root
Values []*RegistryValue
SubKeys []*RegistryKey
RemoveFlag bool
}
RegistryKey represents a WiX RegistryKey element.
type RegistryValue ¶
type RegistryValue struct {
ID string
Name string // Empty for default value
Type string // string, integer, binary, expandable, multiString
Value string // For simple types
MultiValue []string // For multiString type
RemoveFlag bool
}
RegistryValue represents a WiX RegistryValue element.
type RemovalEntry ¶
type RemovalEntry struct {
IsKey bool // true for key removal, false for value removal
Root string // HKLM, HKCU, etc.
Key string // Registry key path
Name string // Value name (empty for key removal or default value)
}
RemovalEntry represents a registry key or value to be removed.