Open cdeli opened 6 years ago
I'm going to file this under "I think I know what I'm doing," but I was able to get the launcher to function under Unix and macOS with only a moderate degree of issues.
I've been rewriting portions of the RoC Launcher for Sentinels Republic: https://github.com/DesporoWace/SR-Launcher
For the SWGEmu.exe and SWGEmu_Setup running, see: https://github.com/DesporoWace/SR-Launcher/blob/master/renderer.js
~159:
const os = require('os'); // plop this near the top of your renderer.js
function play() {
// code here with args and env that is the same as RoC and I'm omitting because clutter
if (os.platform() === 'win32') { // === 'darwin' for macOS
const child = process.spawn("SWGEmu.exe", args, {cwd: config.folder, env: env, detached: true, stdio: 'ignore'});
child.unref();
} else { // Unix
const child = process.exec('wine SWGEmu.exe', {cwd: config.folder, env: env, detached: true, stdio: 'ignore'}, function(error, stdout, stderr){});
child.unref();
}
}
See ~176 for SWGEmu_Setup.exe, it's mildly different, omitted env.
The gist is, instead of spawning the process, I run "wine SWGEmu.exe" via terminal. As long as the user has wine installed, it works. If they don't, it fails miserably.
For building, see package.json, this isn't my final version, I'm still testing this. Don't throw this into production just yet. https://github.com/DesporoWace/SR-Launcher/blob/master/package.json
"scripts": {
"start": "electron .",
"build-win": "build --win --ia32 -p always",
"build-linux": "build --linux --x64",
"build-mac": "build --mac --x64"
},
run "npm run-script build-linux" in your terminal or command prompt.
I removed "-p always" as to not publish the changes. I have no idea how I'm going to managing updating these versions. This is my first time with Electron.
Here's my user how to setup and the current list of problems, macOS has a bunch of them (freaking Apple): http://www.swgsremu.com/forum/viewtopic.php?f=63&t=1280#p3177
Debian 9 was really easy to setup once Wine was installed. Run and done. (might need to allow execution for the AppImage)
I'm calling this all "Alpha" as I bang out the rest of the issues.
If anyone knows how to solve the macOS permission issue or can think of a better way of doing this, PLEASE respond. <3
I will need to look into this tonight when I get home, this may be a solution I was looking for.
Good to know since I dabble on SR (Iwifia btw). Moved to Linux a few weeks ago and seems that the Infinity version of the launcher does not want to load at all even with WINE. I was able to get the SWGEMU Launcher to work via the native client but when I dropped the files into the folder for Infinity, it just would fail constantly.
Having a launcher working on Linux native may fix this issue.
Hey Iwifia, I go by Tyclo on SR.
You're free to dig through the SR Launcher, use the code above and improve upon it or request its implementation on another server's launcher.
SR had a macOS player who tried running the SR Launcher in Wine. Wine apparently hates Electron, but thankfully a native application was easy enough. At least for Linux it was, macOS and Apple are still being a pain. The update process with Electron Builder is also still an unknown...
I might just force manual updates.
You can also message me on the SR Discord if you have any questions.
Gave the linux launcher for SR a try, don't have a ton of time to play with it since I am going to a wedding in a moment. Receiving a "Segmentation Fault" error when I try and run the program via terminal.
Any idea on how to get around that?
If you follow the Linux install directions here: http://www.swgsremu.com/forum/viewtopic.php?f=63&t=1280#p3177 - You shouldn't need to run anything launcher related via terminal. (Wine is a different story..)
Unless this is something distro specific for running AppImages, of which, I don't know much about, any errors following the seg fault or logs you can provide? (I know there probably isn't, but I'm going to ask anyway, lol)
When is the seg fault occurring?
What's your distro and version? 32 or 64bit? In the guide above, the AppImage is complied for 64bit.
Are you trying to build it yourself from source? Did you run "npm install" first?
Segfault error ended with "Core Dumped"
I am using Ubuntu 18.10 x64. No I am not trying to build it from source at this time, though I can if needed.
Yeah followed the guide, have the latest version of WINE currently. I did double check and the appimage is executable.
Ah, I see. I was confused because you are using terminal to open the AppImage, I didn't realize that Ubuntu doesn't give you an error if you double clickeon the AppImage to open it. I made a 18.10 VM to debug this and came to that realization when I tried opening the file and nothing happened. Used terminal and got the seg fault core dump.
Figured it out, turns out it was an issue with Electron: https://github.com/electron/electron/pull/13988 (I'm just happy it wasn't anything I coded..) Electron 2.0.8 and above have a fix for this.
I updated it to the latest version and after some dependency fuss, it seems to be working. Here's the latest AppImage: http://www.ode-guild.com/swg/sr-launcher-0.9.9-x86_64-Ubuntu.AppImage
Let me know if that works.
Sorry for the inconvenience.
No no its cool. I would rather find the issue than someone less technical personally! I will take a look at it and dig into the launcher a bit more to see what I can do to modify it for Infinity. Appreciate the help, expect to hear from me on Discord for questions and assistance.
Any chance of a Linux version of the launcher? I know the EMU team has a linux launcher but some servers cannot download the patches through that version A linux version of the launcher would allow those of us who use Nix to not have to run a VM to play SWG.