Skip to content

Commit

Permalink
Remove Redownload button in favour of Reinstall button
Browse files Browse the repository at this point in the history
  • Loading branch information
Vendicated committed Jul 14, 2023
1 parent a5b7ef9 commit ca03a38
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 16 deletions.
8 changes: 6 additions & 2 deletions cli.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//go:build cli

/*
* SPDX-License-Identifier: GPL-3.0
* Vencord Installer, a cross platform gui/cli app for installing Vencord
Expand Down Expand Up @@ -34,10 +35,10 @@ func main() {
discords = FindDiscords()

var installFlag = flag.Bool("install", false, "Install Vencord on a Discord install")
var updateFlag = flag.Bool("reinstall", false, "Reinstall & update Vencord")
var uninstallFlag = flag.Bool("uninstall", false, "Uninstall Vencord from a Discord install")
var installOpenAsar = flag.Bool("install-openasar", false, "Install OpenAsar on a Discord install")
var uninstallOpenAsar = flag.Bool("uninstall-openasar", false, "Uninstall OpenAsar from a Discord install")
var updateFlag = flag.Bool("update", false, "Update your local Vencord files")
var locationFlag = flag.String("location", "", "Select the location of your Discord install")
var branchFlag = flag.String("branch", "", "Select the branch of Discord you want to modify [auto|stable|ptb|canary]")
flag.Parse()
Expand All @@ -64,7 +65,10 @@ func main() {
} else if *uninstallFlag {
_ = PromptDiscord("unpatch", *locationFlag, *branchFlag).unpatch()
} else if *updateFlag {
_ = installLatestBuilds()
err := installLatestBuilds()
if err == nil {
PromptDiscord("repatch", *locationFlag, *branchFlag).patch()
}
} else if *installOpenAsar {
discord := PromptDiscord("patch", *locationFlag, *branchFlag)
if !discord.IsOpenAsar() {
Expand Down
32 changes: 18 additions & 14 deletions gui.go
Original file line number Diff line number Diff line change
Expand Up @@ -466,26 +466,31 @@ func renderInstaller() g.Widget {
Size((w-40)/4, 50),
Tooltip("Patch the selected Discord Install"),
),
g.Style().
SetColor(g.StyleColorButton, DiscordRed).
To(
g.Button("Uninstall").
OnClick(handleUnpatch).
Size((w-40)/4, 50),
Tooltip("Unpatch the selected Discord Install"),
),
g.Style().
SetColor(g.StyleColorButton, DiscordBlue).
SetDisabled(IsDevInstall || GithubError != nil).
SetDisabled(GithubError != nil).
To(
g.Button(Ternary(GithubError == nil && LatestHash == InstalledHash, "Re-Download Vencord", "Update")).
g.Button("Reinstall / Repair").
OnClick(func() {
if err := InstallLatestBuilds(); err == nil {
g.OpenPopup("#downloaded")
if IsDevInstall {
handlePatch()
} else {
err := InstallLatestBuilds()
if err == nil {
handlePatch()
}
}
}).
Size((w-40)/4, 50),
Tooltip("Update your local Vencord files"),
Tooltip("Reinstall & Update Vencord"),
),
g.Style().
SetColor(g.StyleColorButton, DiscordRed).
To(
g.Button("Uninstall").
OnClick(handleUnpatch).
Size((w-40)/4, 50),
Tooltip("Unpatch the selected Discord Install"),
),
g.Style().
SetColor(g.StyleColorButton, Ternary(isOpenAsar, DiscordRed, DiscordGreen)).
Expand All @@ -498,7 +503,6 @@ func renderInstaller() g.Widget {
),
),

InfoModal("#downloaded", "Successfully Downloaded", "The Vencord files were successfully downloaded!"),
InfoModal("#patched", "Successfully Patched", "If Discord is still open, fully close it first.\n"+
"Then, start it and verify Vencord installed successfully by looking for its category in Discord Settings"),
InfoModal("#unpatched", "Successfully Unpatched", "If Discord is still open, fully close it first. Then start it again, it should be back to stock!"),
Expand Down

0 comments on commit ca03a38

Please sign in to comment.