Skip to content

Commit ca03a38

Browse files
committed
Remove Redownload button in favour of Reinstall button
1 parent a5b7ef9 commit ca03a38

File tree

2 files changed

+24
-16
lines changed

2 files changed

+24
-16
lines changed

cli.go

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
//go:build cli
2+
23
/*
34
* SPDX-License-Identifier: GPL-3.0
45
* Vencord Installer, a cross platform gui/cli app for installing Vencord
@@ -34,10 +35,10 @@ func main() {
3435
discords = FindDiscords()
3536

3637
var installFlag = flag.Bool("install", false, "Install Vencord on a Discord install")
38+
var updateFlag = flag.Bool("reinstall", false, "Reinstall & update Vencord")
3739
var uninstallFlag = flag.Bool("uninstall", false, "Uninstall Vencord from a Discord install")
3840
var installOpenAsar = flag.Bool("install-openasar", false, "Install OpenAsar on a Discord install")
3941
var uninstallOpenAsar = flag.Bool("uninstall-openasar", false, "Uninstall OpenAsar from a Discord install")
40-
var updateFlag = flag.Bool("update", false, "Update your local Vencord files")
4142
var locationFlag = flag.String("location", "", "Select the location of your Discord install")
4243
var branchFlag = flag.String("branch", "", "Select the branch of Discord you want to modify [auto|stable|ptb|canary]")
4344
flag.Parse()
@@ -64,7 +65,10 @@ func main() {
6465
} else if *uninstallFlag {
6566
_ = PromptDiscord("unpatch", *locationFlag, *branchFlag).unpatch()
6667
} else if *updateFlag {
67-
_ = installLatestBuilds()
68+
err := installLatestBuilds()
69+
if err == nil {
70+
PromptDiscord("repatch", *locationFlag, *branchFlag).patch()
71+
}
6872
} else if *installOpenAsar {
6973
discord := PromptDiscord("patch", *locationFlag, *branchFlag)
7074
if !discord.IsOpenAsar() {

gui.go

+18-14
Original file line numberDiff line numberDiff line change
@@ -466,26 +466,31 @@ func renderInstaller() g.Widget {
466466
Size((w-40)/4, 50),
467467
Tooltip("Patch the selected Discord Install"),
468468
),
469-
g.Style().
470-
SetColor(g.StyleColorButton, DiscordRed).
471-
To(
472-
g.Button("Uninstall").
473-
OnClick(handleUnpatch).
474-
Size((w-40)/4, 50),
475-
Tooltip("Unpatch the selected Discord Install"),
476-
),
477469
g.Style().
478470
SetColor(g.StyleColorButton, DiscordBlue).
479-
SetDisabled(IsDevInstall || GithubError != nil).
471+
SetDisabled(GithubError != nil).
480472
To(
481-
g.Button(Ternary(GithubError == nil && LatestHash == InstalledHash, "Re-Download Vencord", "Update")).
473+
g.Button("Reinstall / Repair").
482474
OnClick(func() {
483-
if err := InstallLatestBuilds(); err == nil {
484-
g.OpenPopup("#downloaded")
475+
if IsDevInstall {
476+
handlePatch()
477+
} else {
478+
err := InstallLatestBuilds()
479+
if err == nil {
480+
handlePatch()
481+
}
485482
}
486483
}).
487484
Size((w-40)/4, 50),
488-
Tooltip("Update your local Vencord files"),
485+
Tooltip("Reinstall & Update Vencord"),
486+
),
487+
g.Style().
488+
SetColor(g.StyleColorButton, DiscordRed).
489+
To(
490+
g.Button("Uninstall").
491+
OnClick(handleUnpatch).
492+
Size((w-40)/4, 50),
493+
Tooltip("Unpatch the selected Discord Install"),
489494
),
490495
g.Style().
491496
SetColor(g.StyleColorButton, Ternary(isOpenAsar, DiscordRed, DiscordGreen)).
@@ -498,7 +503,6 @@ func renderInstaller() g.Widget {
498503
),
499504
),
500505

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

0 commit comments

Comments
 (0)