Documentation
¶
Overview ¶
Package wininstall installs the desktop app on Windows for one user, without an administrator (spec_electron_038 EL-81): the app's zip, carried at the end of the setup program (Payload), unpacked in %LOCALAPPDATA%\Programs\Blitz (Unpack, Place), and its entry in Add or remove programs (Entry, in the registry on Windows). The setup program (apps/electron/winsetup) and the tray's updates use it; what isn't the registry works, and is tested, everywhere.
Index ¶
- Constants
- Variables
- func AppendPayload(w io.Writer, zipData []byte) error
- func DefaultRoot(localAppData string) string
- func DeleteEntry() error
- func Payload(exe io.ReaderAt, size int64) (*zip.Reader, error)
- func Place(staged, root string) error
- func SetDisplayVersion(string) error
- func Size(dir string) int64
- func TrayVersion(out string) string
- func Unpack(zr *zip.Reader, dest, strip string) error
- func WriteEntry(Entry) error
- type Entry
Constants ¶
const ( // UninstallKey is the app's entry in Add or remove programs, under // HKEY_CURRENT_USER. UninstallKey = `Software\Microsoft\Windows\CurrentVersion\Uninstall\Blitz` // Uninstaller is the setup program's name in the installed app, where // it uninstalls (it's in the zip, so an update keeps it). Uninstaller = "Uninstall Blitz.exe" // App is the app's program in its folder. App = "Blitz.exe" )
Variables ¶
var ErrNoPayload = errors.New("no app in this program")
ErrNoPayload means the program carries no zip: it's the uninstaller.
Functions ¶
func AppendPayload ¶
AppendPayload writes zip after what's already been written to w (the setup program), followed by its length and magic.
func DefaultRoot ¶
DefaultRoot is where the app goes: %LOCALAPPDATA%\Programs\Blitz, as other per-user installs do.
func Place ¶
Place puts the unpacked app (staged) at root: an app already there is moved aside first and removed after, so a failure leaves one in place.
func SetDisplayVersion ¶
SetDisplayVersion updates the entry's version (nothing to do but on Windows).
func TrayVersion ¶
TrayVersion is the version in blitz-tray --version's line ("" when it isn't one).
func Unpack ¶
Unpack writes the zip's files under dest, without the folder they're in (the zip's Blitz\). A file that would land outside dest is refused.
func WriteEntry ¶
WriteEntry writes the app's entry in Add or remove programs (Windows only).