Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: GUI + side-load install option #46

Merged
merged 29 commits into from
Jan 23, 2024
Merged

feat: GUI + side-load install option #46

merged 29 commits into from
Jan 23, 2024

Conversation

jasonjgardner
Copy link
Collaborator

Installer v2

This PR adds an easily invokable installer with new features and installation workflow:

  • Adds installer GUI
  • Adds .mcpack import
  • Adds drag and drop import
  • Includes API usage
  • Has translation options
  • Alerts users of missing translations (and links to contribution details!)
  • Creates backups
  • Caches API data and presets
  • Has uninstall procedure
  • Refactored workspace into v1 and v2 directories
  • Closes Add ability to select installation folder to support MCLauncher #45

This branch should be stable enough to merge into main. It may need a couple adjustments before it can be tagged v2.0.0, such as more translations and minor UI changes. Any bug fixes should be added to this PR, but other changes should be made on a new branch.

I updated the README, but the URL shown in the example command will still point to the v1 installer until the next release. iwr works on the GitHub permalink to the script.

- Added form to installer
- Refactored installation process to support sideloaded instances
- Added locale data
- Removed checkboxes in favor of flow layout + list
- Added setup and help menus
- Hide setup menu if user has prerequisites
- Added menu button which creates backups of selected instances
- Moved so Localized directory can be found easier
- Download translation files when invoked by web request
- Added API integration for downloading presets
- Added directories for v1 and v2 scripts
- Moved contents of root directory into v1
- Caches API and locale data in LocalAppData/graphics.bedrock directory
- Added process to uninstall anything downloaded by the script. Restores original content upon uninstallation
- Added new info and instructions to README.md
@jasonjgardner jasonjgardner added the enhancement New feature or request label Jan 17, 2024
@jasonjgardner jasonjgardner self-assigned this Jan 17, 2024
Copy link
Member

@ABUCKY0 ABUCKY0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merging into the prerelease branch is preferable, but we can just sync the branch with main if you don't want to recreate the PR

If you don't want to merge into the prerelease branch, then we either need to merge the commits from the prerelease branch into main or rebase your changes on top of the Prerelease branch, or copy the files below

https://github.com/BetterRTX/BetterRTX-Installer/blob/prerelease/LICENSE.md

https://github.com/BetterRTX/BetterRTX-Installer/blob/prerelease/CREDITS.md

I will note that i'm not good with git so if rebasing isn't an option then don't worry about that part.

@ABUCKY0
Copy link
Member

ABUCKY0 commented Jan 17, 2024

We may also consider adding colors to Write-Host to indicate errors, but that can come later.

@ABUCKY0
Copy link
Member

ABUCKY0 commented Jan 17, 2024

image
Noticed that this error is thrown when running the script using iwr, we might consider adding a try-catch block or an if-else statement just to make sure nobody attempts to report it as a bug.

@ABUCKY0
Copy link
Member

ABUCKY0 commented Jan 17, 2024

Also if possible i'd put Minecraft for Windows 10 before Preview edition by default, and have a default selection shown on screen.

@ABUCKY0
Copy link
Member

ABUCKY0 commented Jan 17, 2024

Also adding an administrator checking code to the installer would be a good way to ensure that nobody attempts to run it in a normal console window

@ABUCKY0
Copy link
Member

ABUCKY0 commented Jan 17, 2024

I also installed without using an admin Powershell window and it threw an error in the powershell console but the GUI showed successful, not sure if that's a bug

@ABUCKY0
Copy link
Member

ABUCKY0 commented Jan 17, 2024

image
With an admin Powershell window this error still appeared, and IObit Unlocker never appeared, so that will need more testing

v2/installer.ps1 Outdated Show resolved Hide resolved
v2/installer.ps1 Outdated Show resolved Hide resolved
v2/installer.ps1 Outdated Show resolved Hide resolved
@jasonjgardner
Copy link
Collaborator Author

image Noticed that this error is thrown when running the script using iwr, we might consider adding a try-catch block or an if-else statement just to make sure nobody attempts to report it as a bug.

It looks like there may be a cached version of the installer served from the branch URL. Try it with this permalink URL for the latest version:

iwr "https://raw.githubusercontent.com/BetterRTX/BetterRTX-Installer/69afe7f1ad972f28a289e0931276a7d4a415c2f3/v2/installer.ps1" -useb | iex

@ABUCKY0
Copy link
Member

ABUCKY0 commented Jan 17, 2024

image Noticed that this error is thrown when running the script using iwr, we might consider adding a try-catch block or an if-else statement just to make sure nobody attempts to report it as a bug.

It looks like there may be a cached version of the installer served from the branch URL. Try it with this permalink URL for the latest version:

iwr "https://raw.githubusercontent.com/BetterRTX/BetterRTX-Installer/69afe7f1ad972f28a289e0931276a7d4a415c2f3/v2/installer.ps1" -useb | iex

Nope still the same issue

- Check for script root when trying local locale fallback
@jasonjgardner
Copy link
Collaborator Author

Regarding admin access: It's only required for IOBit in theory. If you have a previously side-loaded instance you don't need admin access to copy to that location.

Startup errors were warning messages regarding the translation fallbacks, so the rest of the application should still function. The instances are sorted according to their directory name and the label is provided by the Minecraft package itself. I think this will help with localization efforts.

@jasonjgardner jasonjgardner requested a review from ABUCKY0 January 17, 2024 23:49
@ABUCKY0
Copy link
Member

ABUCKY0 commented Jan 18, 2024

The installer still fails to use IObit Unlocker and as such doesn't install BetterRTX

@jasonjgardner
Copy link
Collaborator Author

I stand corrected! A wildcard was required (just after the \ instead). IOBit should be working now.

@ABUCKY0
Copy link
Member

ABUCKY0 commented Jan 18, 2024

image
I'm getting a different error now, I think something about your path resolution is broken

@ABUCKY0
Copy link
Member

ABUCKY0 commented Jan 19, 2024

@jasonjgardner Made this script that should resolve IOBit Unlocker to it's location properly https://gist.github.com/ABUCKY0/31b0b5b8691858930fccffa06da39b46

- Added status label change for deletion and copying
- Added exit at end of script
- Comma-separated delete command works, but comma-separated copy command doesn't. Updated to copy files individually in loop
- Using function based on gist by @ABUCKY0 to find IOBit Unlocker path
@ABUCKY0
Copy link
Member

ABUCKY0 commented Jan 20, 2024

From my very limited testing it seems to work, if everything works for you I think it's good to merge to Prerelease and make a new Prerelease version.

Copy link
Member

@ABUCKY0 ABUCKY0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually no, [IObit Unlocker] only pops up 3 times for some reason, I won't be able to test any more this weekend, I might be able to do some testing Monday.

I recommend adding some Debug Logging just in case.

@jasonjgardner
Copy link
Collaborator Author

Actually no, [IObit Unlocker] only pops up 3 times for some reason, I won't be able to test any more this weekend, I might be able to do some testing Monday.

I recommend adding some Debug Logging just in case.

Three times is correct. One prompt is to delete the files, which IOBit can do in one command with a comma-separated list of file paths.

Allegedly, the same list can be used in the /Copy command; however, that does not seem to work – even in a terminal.

So copying the files must be in done in a loop, and you'll get a prompt for each file to copy.

@ABUCKY0
Copy link
Member

ABUCKY0 commented Jan 20, 2024

Actually no, [IObit Unlocker] only pops up 3 times for some reason, I won't be able to test any more this weekend, I might be able to do some testing Monday.
I recommend adding some Debug Logging just in case.

Three times is correct. One prompt is to delete the files, which IOBit can do in one command with a comma-separated list of file paths.

Allegedly, the same list can be used in the /Copy command; however, that does not seem to work – even in a terminal.

So copying the files must be in done in a loop, and you'll get a prompt for each file to copy.

Oh I didn't know that. I've just been doing it on the old PS script with four. The more you know.

Copy link
Member

@ABUCKY0 ABUCKY0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything looks good to me

@jasonjgardner jasonjgardner merged commit cf08044 into main Jan 23, 2024
4 checks passed
@jasonjgardner jasonjgardner deleted the feat/gui branch January 23, 2024 17:49
@jasonjgardner jasonjgardner mentioned this pull request Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add ability to select installation folder to support MCLauncher
2 participants