AlyxMoon / lunar-factorio-mod-manager

A mod manager for Factorio, programmed using the Electron framework.
MIT License
5 stars 2 forks source link

Added Linux support #82

Closed Danacus closed 7 years ago

Danacus commented 7 years ago

I hope it's not a problem that I'm still on the develop branch, but I think you can merge it. Should I go to the React / Redux branch or should I stay on the develop branch for now?

Danacus commented 7 years ago

I'm having some trouble with the AppImage file (executable). It won't save profiles, I'll try to fix it, but it works perfectly when I use npm start.

Danacus commented 7 years ago

Added a tar.gz file with the binary files for linux, you can download it and upload it on your branch if you want to.

AlyxMoon commented 7 years ago

So about saving profiles, I notice you're using asar to package the app. The Electron docs state that asar is read-only, so since the app currently relies on saving files into the directory it won't work. You can check out the asar documentation here:
https://electron.atom.io/docs/tutorial/application-packaging/

In order to resolve that, you'll either need to not use asar, or save data outside of the app directory (the second approach is better long-term). I was going to use a library like electron-json-storage to save data once I got around to rewriting this portion of the app. You can try bringing that into the project if you want.

Danacus commented 7 years ago

Oh yes, of course! I totally forgot that asar is read only. I know I've had the same problem before. Maybe we can just save these files inside the factorio folder? Or somewhere else? And maybe you should take a look at fs-jetpack, I prefer it over normal node fs, but it's just a suggestion.

AlyxMoon commented 7 years ago

I don't think saving to the Factorio folder is a good idea (I want to ensure that the app is as non-invasive as possible). I'll bump up my priority to switching to electron-json-storage and that will definitely fix the problem. I'll take a look at fs-jetpack and see if it will help out the project at all.

If there aren't any bugs without using asar, then I'd say things are good, and we can move towards making that compatible later. Can you confirm there aren't any breaking bugs when not packing the files into an asar archive? If so, I'll merge things in.

Danacus commented 7 years ago

Yes, everything seems to work when it's not packed in an asar archive.