MultiMC / Launcher

A custom launcher for Minecraft that allows you to easily manage multiple installations of Minecraft at once
https://multimc.org/
Other
4.3k stars 882 forks source link

It is not clear that the .application on macOS contains all data! #1457

Open Gamerocker77 opened 8 years ago

Gamerocker77 commented 8 years ago

The hard disk on my iMac died, and I had to get a new (used) computer. Everything was copied onto the new one. However, when I try to launch MultiMC, it quits instantly. How do I fix this?

Process:         launchd [6122]
Path:            /Applications/MultiMC.app/Contents/MacOS/MultiMC
Identifier:      org.multimc.MultiMC5
Version:         ??? (???)
Code Type:       X86-64 (Native)
Parent Process:  launchd [113]

Date/Time:       2016-02-07 08:37:28.146 -0600
OS Version:      Mac OS X 10.7.5 (11G63)
Report Version:  9

Interval Since Last Report:          55505 sec
Crashes Since Last Report:           15
Per-App Crashes Since Last Report:   14
Anonymous UUID:                      35520E6D-029C-4CAC-9210-7D98613F98E5

Crashed Thread:  Unknown

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x00007fff5fc01028

Backtrace not available

Unknown thread crashed with X86 Thread State (64-bit):
  rax: 0x0000000000000055  rbx: 0x0000000000000000  rcx: 0x0000000000000000  rdx: 0x0000000000000000
  rdi: 0x0000000000000000  rsi: 0x0000000000000000  rbp: 0x0000000000000000  rsp: 0x0000000000000000
   r8: 0x0000000000000000   r9: 0x0000000000000000  r10: 0x0000000000000000  r11: 0x0000000000000000
  r12: 0x0000000000000000  r13: 0x0000000000000000  r14: 0x0000000000000000  r15: 0x0000000000000000
  rip: 0x00007fff5fc01028  rfl: 0x0000000000010203  cr2: 0x00007fff5fc01028
Logical CPU: 10

Binary images description not available

External Modification Summary:
  Calls made by other processes targeting this process:
    task_for_pid: 1
    thread_create: 0
    thread_set_state: 0
  Calls made by this process:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0
  Calls made by all processes on this machine:
    task_for_pid: 871
    thread_create: 0
    thread_set_state: 0

Model: MacPro4,1, BootROM MP41.0081.B07, 8 processors, Quad-Core Intel Xeon, 2.66 GHz, 16 GB, SMC 1.39f5
Graphics: NVIDIA GeForce GT 120, NVIDIA GeForce GT 120, PCIe, 512 MB
Memory Module: DIMM 1, 2 GB, DDR3 ECC, 1066 MHz, 0x802C, 0x31384A53463235363732415A2D3147314431
Memory Module: DIMM 2, 2 GB, DDR3 ECC, 1066 MHz, 0x802C, 0x31384A53463235363732415A2D3147314431
Memory Module: DIMM 3, 2 GB, DDR3 ECC, 1066 MHz, 0x802C, 0x31384A53463235363732415A2D3147314431
Memory Module: DIMM 4, 2 GB, DDR3 ECC, 1066 MHz, 0x802C, 0x31384A53463235363732415A2D3147314431
Memory Module: DIMM 5, 2 GB, DDR3 ECC, 1066 MHz, 0x802C, 0x31384A53463235363732415A2D3147314431
Memory Module: DIMM 6, 2 GB, DDR3 ECC, 1066 MHz, 0x802C, 0x31384A53463235363732415A2D3147314431
Memory Module: DIMM 7, 2 GB, DDR3 ECC, 1066 MHz, 0x802C, 0x31384A53463235363732415A2D3147314431
Memory Module: DIMM 8, 2 GB, DDR3 ECC, 1066 MHz, 0x802C, 0x31384A53463235363732415A2D3147314431
AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0x8E), Broadcom BCM43xx 1.0 (5.106.198.19.22)
Bluetooth: Version 4.0.8f17, 2 service, 11 devices, 1 incoming serial ports
Network Service: Ethernet 1, Ethernet, en0
PCI Card: NVIDIA GeForce GT 120, sppci_displaycontroller, Slot-1
Serial ATA Device: HL-DT-ST DVD-RW GH41N
Serial ATA Device: WDC WD1001FALS-41K1B0, 1 TB
USB Device: BRCM2046 Hub, 0x0a5c  (Broadcom Corp.), 0x4500, 0x5a100000 / 2
USB Device: Bluetooth USB Host Controller, apple_vendor_id, 0x8215, 0x5a110000 / 4
USB Device: Hub in Apple Extended USB Keyboard, apple_vendor_id, 0x1003, 0x3d100000 / 2
USB Device: Apple Optical USB Mouse, apple_vendor_id, 0x0306, 0x3d110000 / 4
USB Device: Apple Extended USB Keyboard, apple_vendor_id, 0x020b, 0x3d130000 / 3
FireWire Device: built-in_hub, 800mbit_speed
peterix commented 8 years ago

The current version of MultiMC is built for 10.9 and newer.

You should upgrade the OS - 10.7 is no longer supported by Apple.

You can also grab the version that works with 10.7 here: https://files.multimc.org/downloads/mmc-stable-osx64-0.4.7-553.zip

The instances and other data is stored inside the .app - despite its appearance, it's a plain old folder. So you should be able to get into it and copy over your data to the same places in the 0.4.7 .app.

See: https://workflowy.com/s/yg09sEmNtv

Gamerocker77 commented 8 years ago

I upgraded to OS 10.11.3, the latest operating system. I was now able to open MultiMC. However, all my instances are gone. Did I do something wrong? How do I get them back?

peterix commented 8 years ago

The old .app should still have everything in it.

Gamerocker77 commented 8 years ago

Please forgive my ignorance. I think I found the old app. It is difficult to tell because when the old hard drive died, I had to have a data recover guy move all my stuff to a newer computer. So it looks like everything is new on my computer because the dates got changed. I can't figure out how to find the instances.

peterix commented 8 years ago

OK.

If you CMD+click or right-click (depending on whether you have one button or multiple button mouse), you should get the option of 'Show Package Contents'. If you have that, use it. You should be able to locate the instances and settings inside.

If not, you can always use the terminal :)

Let's say your application is in /Applications/MultiMC.app

Open up a terminal and then:

cd /Applications/MultiMC.app
find . -type d | grep -e 'instances/[^/]\+$'

That should give you all the instances inside. For example:

[mrazekp@laptop MultiMC.app]$ find . -type d | grep -e 'instances/[^/]\+$'
./Constents/MacOS/instances/16w04a
./Constents/MacOS/instances/Nodus
./Constents/MacOS/instances/1.8.8
./Constents/MacOS/instances/1.8.9
./Constents/MacOS/instances/1.8
./Constents/MacOS/instances/1.6.4
./Constents/MacOS/instances/Deth001
./Constents/MacOS/instances/16w05b
./Constents/MacOS/instances/1.7.10
./Constents/MacOS/instances/Optifine

If you see your instances, you can proceed to copy them elsewhere. I'm using the folder all the data is in as a variable here. It's quite possible yours will be the same.

mkdir ~/MultiMC-data
cp -ar ./Constents/MacOS/{accounts,assets,cache,icons,instances,libraries,mods,versions,accounts.json,metacache,multimc.cfg,notifications.json}  ~/MultiMC-data/

You can then use a similar command to copy that into the new .app:

cp -ar ~/MultiMC-data/* /Applications/MultiMC-new.app/Contents/MacOS/

Or you can do it directly without the extra created folder:

cp -ar /Applications/MultiMC-old.app/Contents/MacOS/{accounts,assets,cache,icons,instances,libraries,mods,versions,accounts.json,metacache,multimc.cfg,notifications.json} /Applications/MultiMC-new.app/Contents/MacOS/
peterix commented 8 years ago

If you want to just find all instances on the computer, no matter where they are:

find / -type d 2> /dev/null | grep -e 'instances/[^/]\+$'
peterix commented 8 years ago

Looking at this, it is quite a lot to deal with... I'll see what can be done to make the storage local to the machine. It would likely be a separate download though.

Let's say the portable download will be as it is now. And the 'system-wide' download will contain a special file that will say that all the data and configuration is system-wide.

On Windows, we would have an installer that installs MultiMC only for the current user and puts the binaries along with the special 'system wide marker' file in the per-user program files folder, while the data would be in a per-user application data folder.

On linux, the packaged versions would all be system-wide and using the existing system dependencies, while the generic package would remain as is.

On OSX, the system-wide .app would have the extra 'system wide marker' file and would use data in your home folder.

While updating the application, the marker file would not be touched.

This would ensure that no existing installation would be broken.

Gamerocker77 commented 8 years ago

Well, I was able to open a terminal window. Then I pasted this: / -type d 2> /dev/null | grep -e 'instances/[^/]+$'

Gamerocker77 commented 8 years ago

Sheryls-Mac-Pro:~ sheryl$ find/-type -bash: find/-type: No such file or directory Sheryls-Mac-Pro:~ sheryl$ Sheryls-Mac-Pro:~ sheryl$ Sheryls-Mac-Pro:~ sheryl$ find / -type d 2> /dev/null | grep -e 'instances/[^/]+$'

peterix commented 8 years ago

it won't work without that \+

peterix commented 8 years ago

Plus it's pretty slow on a normal magnetic harddrive. Anyway, if you know where the instances should be, just look in there. It's much faster and easier.

Gamerocker77 commented 8 years ago

It won't work without what? Did I type something incorrectly? I have no idea where to look for the instances.

peterix commented 8 years ago

I am sorry to put you through all this unfamiliar terminal stuff.

You have to get your hands on the original MultiMC application folder, wherever it is now - the one that started failing after the system swap. Your instances are there.

peterix commented 8 years ago

All this does is search through your whole computer and find any 'instances' folder and folders inside it - the instances. They should be recognizable by name.

find / -type d 2> /dev/null | grep -e 'instances/[^/]\+$'

Copy and paste that into the terminal, exactly as it shows up.

peterix commented 8 years ago

Were you able to find or recover those instances?

Gamerocker77 commented 8 years ago

No. I couldn't figure out how to find them. And I can't get the updated MultiMC to work either. I keep getting the error message, "To use the "java" command-line tool you need to install a JDK." But I did install it.

peterix commented 8 years ago

Well, if the find command above didn't work at all, then they are likely gone.

The second thing: Go into the java settings in MultiMC and click 'Auto-detect'. It should give you a list of java installs to pick from.

peterix commented 8 years ago

So, another idea... Document how to backup and restore MultiMC data. Show that to people on first run of the application. Because it's important.

Gamerocker77 commented 8 years ago

Thank you. Through a series of somewhat random steps I was able to properly update Java and get MultiMC to work. So now I am back in search of my instances... I think they are still there, just hiding. Maybe in the wrong folder.

Gamerocker77 commented 8 years ago

I did not find the instances yet, but I did find some of my mods, they were in the download folder. I was able to recreate some of my instances, but of course the saved worlds are not there.

stcollins commented 7 years ago

This is pretty precarious — downloading a new version of the app and updating it manually will wipe all instances. User data should all be stored in ~/Library/Application Support/multimc/. 👍🏻

thecodewarrior commented 5 years ago

https://github.com/Homebrew/homebrew-cask/issues/66273

The ~/Library/Application Support/MultiMC directory is where stuff like this would normally be stored. While it may seem simpler to put the saves inside the application bundle, it's contrary to how almost every other app operates. I don't think most people expect to move their saves by copying the .app bundle, and definitely don't expect to delete them when they download and replace the .app.

Solving this could probably be done relatively easily. I don't know how all your systems interact, but you have a setting, so it seems to me like you could change the default and move saves out of the application bundle, if they're located there, when updating.

haykam821 commented 4 years ago

Let's say the portable download will be as it is now. And the 'system-wide' download will contain a special file that will say that all the data and configuration is system-wide.

In Settings → MultiMC → Features → Folders, perhaps a field for the root folder can be configured.

Folders configuration

The other folders in this menu could be resolved relative to the root folder, along with the rest of the non-configurable paths.

The default could be $APP_DIR/Contents/MacOS (on Mac) as it is now, and adjustable to something such as ~/Library/Application Support/MultiMC (on Mac) to make the data global. This would allow MultiMC to continue to have only one version, while still allowing users to remove the portability aspect.

In the setup, perhaps an additional step to configure this would be helpful, with the options being 'portable' and 'global'. This would allow MultiMC to have global defaults while setting the default global path for each platform, in addition to warning the user about upgrading the application, especially through Homebrew.

magicus commented 4 years ago

I just fell pray to this! Even though I'm an experienced user, and I've been poking around in the MultiMC folder before (and noted the oddity that it stored data in /Applications), when I wanted to downgrade MultiMC to try to replicate another bug, I just did as you normally do -- drop the "new" (in this case "old", though) app over in Applications, think "yada yada" and press "Replace" on the dialog box. And to my horror, discover that all my MultiMC instances and worlds had disappeared! 😱 Thank god for TimeMachine.

This really needs to be fixed! A relatively simple approach might be to move the data to /Library/Application Support. That will mimic the current behavior with a system-wide data storage, but will not hide it under the Application structure. As others have suggested, moving it to a per-user storage is probably more in line with what is expected of modern apps, but it might be a bigger change requiring more testing.