installer

package
v0.0.0-...-f334f84 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2023 License: GPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const InstallerReleaseUrl = "https://api.github.com/repos/Vencord/Installer/releases/latest"
View Source
const InstallerReleaseUrlFallback = "https://vencord.dev/releases/installer"
View Source
const OpenAsarDownloadLink = "https://github.com/GooseMod/OpenAsar/releases/download/nightly/app.asar"
View Source
const ReleaseUrl = "https://api.github.com/repos/Vendicated/Vencord/releases/latest"
View Source
const ReleaseUrlFallback = "https://vencord.dev/releases/vencord"

Variables

View Source
var (
	Home        string
	DiscordDirs []string
)
View Source
var BaseDir string
View Source
var FilesDir string
View Source
var FilesDirErr error
View Source
var GithubDoneChan chan bool
View Source
var GithubError error
View Source
var InstalledHash = "None"
View Source
var InstallerGitHash = "Unknown"
View Source
var InstallerTag = "Unknown"
View Source
var IsDevInstall bool
View Source
var LatestHash = "Unknown"
View Source
var LinuxDiscordNames = []string{
	"Discord",
	"DiscordPTB",
	"DiscordCanary",
	"DiscordDevelopment",
	"discord",
	"discordptb",
	"discordcanary",
	"discorddevelopment",
	"discord-ptb",
	"discord-canary",
	"discord-development",

	"com.discordapp.Discord",
	"com.discordapp.DiscordPTB",
	"com.discordapp.DiscordCanary",
	"com.discordapp.DiscordDevelopment",
}
View Source
var PackageJson = []byte(`{
	"name": "discord",
	"main": "index.js"
}
`)
View Source
var Patcher string
View Source
var UserAgent = "VencordInstaller/" + InstallerGitHash + " (https://github.com/Vencord/Installer)"

Functions

func ArrayIncludes

func ArrayIncludes[T comparable](arr []T, v T) bool

func CheckForOwnership

func CheckForOwnership(path string) bool

func CheckIfErrIsCauseItsBusyRn

func CheckIfErrIsCauseItsBusyRn(err error) error

func CheckScuffedInstall

func CheckScuffedInstall() bool

func ExistsFile

func ExistsFile(path string) bool

func FindAsarFile

func FindAsarFile(dir string) (*os.File, error)

func FindDiscords

func FindDiscords() []any

func FixOwnership

func FixOwnership(p string) error

FixOwnership fixes file ownership on Linux

func GetBranch

func GetBranch(name string) string

func HandleScuffedInstall

func HandleScuffedInstall()

func InitGithubDownloader

func InitGithubDownloader()

func InstallLatestBuilds

func InstallLatestBuilds() error

func IsDirectory

func IsDirectory(path string) bool

func IsSafeToDelete

func IsSafeToDelete(path string) error

IsSafeToDelete returns nil if path is safe to delete. In other cases, the returned error should give more info

func PreparePatch

func PreparePatch(di *DiscordInstall)

func Ptr

func Ptr[T any](v T) *T

func Ternary

func Ternary[T any](b bool, ifTrue, ifFalse T) T

func Unwrap

func Unwrap[T any](v T, err error) T

Types

type DiscordData

type DiscordData struct {
	Branch     string `json:"branch"`
	Path       string `json:"path"`
	IsPatched  bool   `json:"isPatched"`
	IsOpenAsar bool   `json:"isOpenAsar"`
}

type DiscordInstall

type DiscordInstall struct {
	// contains filtered or unexported fields
}

func ParseDiscord

func ParseDiscord(p, _ string) *DiscordInstall

func (*DiscordInstall) InstallOpenAsar

func (di *DiscordInstall) InstallOpenAsar() error

func (*DiscordInstall) IsOpenAsar

func (di *DiscordInstall) IsOpenAsar() (retBool bool)

func (*DiscordInstall) UninstallOpenAsar

func (di *DiscordInstall) UninstallOpenAsar() error

type GithubRelease

type GithubRelease struct {
	Name    string `json:"name"`
	TagName string `json:"tag_name"`
	Assets  []struct {
		Name        string `json:"name"`
		DownloadURL string `json:"browser_download_url"`
	} `json:"assets"`
}
var ReleaseData GithubRelease

func GetGithubRelease

func GetGithubRelease(url, fallbackUrl string) (*GithubRelease, error)

type Installer

type Installer struct {
	// contains filtered or unexported fields
}

func NewInstaller

func NewInstaller() *Installer

func (*Installer) CheckForOwnershipDarwin

func (i *Installer) CheckForOwnershipDarwin(path string) bool

func (*Installer) ChooseCustomInstall

func (i *Installer) ChooseCustomInstall() (string, error)

func (*Installer) GetBaseDir

func (i *Installer) GetBaseDir() string

func (*Installer) GetInstalledVersion

func (i *Installer) GetInstalledVersion() string

func (*Installer) GetLatestVersion

func (i *Installer) GetLatestVersion() string

func (*Installer) InstallOpenAsar

func (i *Installer) InstallOpenAsar(path string) error

func (*Installer) ListInstalls

func (i *Installer) ListInstalls() []DiscordData

func (*Installer) Patch

func (i *Installer) Patch(path string) error

func (*Installer) PromptForChown

func (i *Installer) PromptForChown(path string) bool

func (*Installer) Repair

func (i *Installer) Repair(path string) error

func (*Installer) Startup

func (i *Installer) Startup(ctx context.Context)

func (*Installer) UninstallOpenAsar

func (i *Installer) UninstallOpenAsar(path string) error

func (*Installer) Unpatch

func (i *Installer) Unpatch(path string) error

Jump to

Keyboard shortcuts

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