Calinou / scoop-games

Scoop bucket for open source/freeware games and game-related tools
Creative Commons Zero v1.0 Universal
293 stars 151 forks source link

[Bug]: Minecraft does not use persist directory, saving everything in AppData #1072

Open brawaru opened 11 months ago

brawaru commented 11 months ago

Prerequisites

Package Name

minecraft

Expected/Current Behaviour

Minecraft launcher has --workDir argument that can be used to override directory used to save all the files, including account and profile data, and installations themselves. Minecraft package in this repository does not make use of that, making the package save everything in %AppData%\.minecraft.

While this may be an expected behaviour with normal installation of Minecraft launcher, most scoop packages are generally expected to persist such data in the special persist directory whenever possible. Which something like prismlauncher does.

Steps to Reproduce

PS> scoop install games/minecraft
Scoop was updated successfully!
WARN  This is a nightly version. Downloaded files won't be verified.
Installing 'minecraft' (nightly-20231211) [64bit] from games bucket
Minecraft.exe (3,2 MB) [======================================================================================] 100%
Linking ~\scoop\apps\minecraft\current => ~\scoop\apps\minecraft\nightly-20231211
Creating shim for 'Minecraft'.
Creating shortcut for Minecraft (Minecraft.exe)
Running post_install script...
'minecraft' (nightly-20231211) was installed successfully!
Notes
-----
This is only the launcher; a premium account is required to play Minecraft.
PS> Test-Path "$env:AppData/.minecraft" -PathType Container
False
PS> minecraft
PS> Test-Path "$env:AppData/.minecraft" -PathType Container
True

Possible Solution

Shim should use --workDir argument of the launcher binary to make it save all its files into the persist directory.

Scoop and Buckets Version

PS> scoop --version
Current Scoop version:
v0.3.1 - Released at 2022-11-15

'extras' bucket:
f01c03097 (HEAD -> master, origin/master, origin/HEAD) ungoogled-chromium: Update to version 120.0.6099.71-1.1

'fonts' bucket:
2c261d6 (HEAD -> master, origin/master, origin/HEAD) juliamono: Update to version 0.052

'games' bucket:
840222f8c (HEAD -> master, origin/master, origin/HEAD) yuzu: Update to version 0-1647

'java' bucket:
fea17b31 (HEAD -> master, origin/master, origin/HEAD) temurin11-nightly-jre: Update to version 11.0.22-6.0.202312091720

'main' bucket:
5ede4e1fe (HEAD -> master, origin/master, origin/HEAD) pipx: Add version 1.3.3 (#5315)

'sysinternals' bucket:
c788fc6 (HEAD -> main, origin/main, origin/HEAD) sysinternals-suite: Update to version 2023.12.07

'versions' bucket:
8a5ad474a (HEAD -> master, origin/master, origin/HEAD) firefox-nightly: Update to version 122.0a1.20231210093611

Scoop Config

PS> scoop config

last_update                       scoop_branch scoop_repo
-----------                       ------------ ----------
2023-12-11T06:09:05.0794033+11:00 master       https://github.com/ScoopInstaller/Scoop

PowerShell Version

PS> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.22621.2428
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.22621.2428
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Additional Softwares

No response

Calinou commented 11 months ago

I suppose this needs creating a wrapper script that always passes --workDir with the required argument, and this wrapper script is added to the shortcuts and bin.