mojira.dev
MCL-20059

Unable to start new launcher with --workDir or other program arguments

The new launcher cannot be started using the --workDir command line parameter, because it is installed from the WindowsStore and you cannot start WIndowsStore apps using command line parameters.

I have a custom shortcut with the old launcher which is set to "C:\Program Files (x86)\Minecraft Launcher\MinecraftLauncher.exe" --workDir "C:\Users\<username>\Games\Minecraft\AppData"

Observed Behavior

It is impossible to change workdir

Expected Behavior

A setting in the launcher to change the workDir would be a sufficient change. Possibly other arguments as well, but I am not sure how relevant they are for regular users.

Here is a list of launch parameters:

-w, --workDir arg  Launcher working directory
  -l, --lockDir arg  Restrict launcher to directory
  -c, --config arg   Launcher configuration
  -h, --help         Display this message
      --disableGPU   Disable GPU acceleration in the launcher
      --debugGPU     Debug video drivers in the launcher

Linked issues

Comments 5

possible relation to MCL-19984 
May be the java authentication issue with Microsoft / Microsoft Store preventing it from launching altogether.

There is no way to start it with command line parameters, so the issue is not that it doesn't start, it's simply that the old functionality is not supported in any way.

can't they simply put an option to launcher settings to change workdir?

@unknown Yes, this is also my suggested fix.

Hello all, I think I've found a little bit of a solution to help change the work directory of the new launcher...You need to use PowerShell for this however. Change the bold part to whatever you want --workDir to point towards. You might need to add single quotes (') around the directory if there's any spaces, however I haven't tested it so I'm not sure if it'll play nice with that.

 

$WScriptShell = New-Object -ComObject WScript.Shell
$Shortcut = $WScriptShell.CreateShortcut("$env:USERPROFILE\Desktop\MinecraftLauncher.lnk")
$Shortcut.WindowStyle = 4
$Shortcut.TargetPath = "shell:AppsFolder\Microsoft.4297127D64EC6_8wekyb3d8bbwe!Minecraft"
$Shortcut.Arguments = "--workDir={*}D:\Minecraft\.minecraft{*}"
$Shortcut.Save()

 

Explanation for what everything does (at least what I know of, I mainly use python not VBscript) so it's at least slightly less likely to get removed.

First line, I'm not entirely sure, I think it's loading up a class to use commands functions in it.

Second, It's preparing to create a shortcut in the location of your desktop folder. ($env:USERPROFILE points toward your user folder, so in my case it's pointing toward "C:\Users\User")

Third, it's creating a normal sized window. I believe 0 is minimized, and 7 is maximized, iirc.

Next, this is where the shortcut is pointing towards. So you could use this same script to create a shortcut to an .EXE file using a normal file directory path, except since this is a store app, we need to use "shell:AppsFolder" to access it. Microsoft.429...etc. is the family name (basically an App ID) for the store Minecraft Launcher. The exclamation point, I'm not sure why, but it in connection with the actual App ID is used to indicate we're launching the app, instead of viewing it's folder.

Next is pretty self explanatory, we're passing an argument over to the app. You can add others at the end by adding a space obviously. Mine is obviously using --workDir, and pointing towards where I like to keep my Minecraft folder, D:\Minecraft\.minecraft as indicated earlier in the bold text.

Finally, saving it, well, saves it. If you copy and paste this exact code, you'll get a shortcut file placed on your current logged in user's desktop to the UWP Minecraft Launcher with the --workDir argument pointing toward D:\Minecraft\.minecraft.

This shortcut you create WILL NOT work in the taskbar, unless you manually copy the shortcut into "%userprofile%\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar", and even then, it'll show the launcher window as a separate window in the taskbar from the shortcut.

NeunEinser

(Unassigned)

Community Consensus

Retrieved