Documentation ¶
Overview ¶
Package appregistry accesses the list of unpackaged (aka "Classic" or "Desktop") applications in the Windows registry.
Example ¶
package main import ( "fmt" "github.com/gentlemanautomaton/winapp/unpackaged/appregistry" ) func main() { for _, view := range appregistry.Views { fmt.Printf("---- %s ----\n", view.Name()) apps, err := view.List() if err != nil { fmt.Printf("Error: %v\n", err) continue } for _, app := range apps { line := string(app.ID) attrs := app.Attributes if name := attrs.GetString("DisplayName"); name != "" { line += ": " + name } if version := attrs.GetString("DisplayVersion"); version != "" { line += " [" + version + "]" } fmt.Printf(" %s\n", line) } } }
Output:
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
var ( // Global32 accesses the 32-bit global application registry. Global32 = global32 // Global64 accesses the 64-bit global application registry. Global64 = global64 // User32 accesses the 32-bit user application registry. User32 = user32 // User64 accesses the 64-bit user application registry. User64 = user64 )
Views is a slice of all available application views.
Functions ¶
This section is empty.
Types ¶
type View ¶
type View struct {
// contains filtered or unexported fields
}
View provides a view of the global or user application registry, either 32-bit or 64-bit.
func (View) Add ¶
func (v View) Add(app unpackaged.App) error
Add attempts to add the given unpackaged app to the Windows registry.
It returns an error if an application or component with the given ID already exists.
func (View) Get ¶
func (v View) Get(id unpackaged.AppID) (unpackaged.App, error)
Add attempts to add the given application component to the Windows registry.
func (View) List ¶
func (v View) List() (unpackaged.AppList, error)
Add attempts to add the given application component to the Windows registry.
It returns an error if a component with the given ID already exists.
func (View) Remove ¶
func (v View) Remove(id unpackaged.AppID) error
Remove attempts to remove the given unpackaged app ID from the Windows registry.
It does _not_ run the component's uninstall command. It is the caller's responsibility to properly remove the component's files before removing it from the registry.