Jump to content

Unofficial Linux Install Script for the Net-7 Entertainment Inc. Earth & Beyond Emulator


Recommended Posts

First of all, a huge thanks to @Nimsy for her excellent detailed install guide without which this script would not be possible.  I banged my head against the wall for quite awhile before finding her guide buried on page 7 of the existing thread.

 

Once the GMs have a chance to review this and some people have been able to give it a try I would like for this post to replace the venerable "Linux(maybe mac?)/Wine install guide." as I spent a ridiculous (seriously, if my wife hears Megan's voice in the installer one more time she will divorce me) amount of time trying to incorporate everything I could find in that thread into one cohesive fully-automated script.  I looked briefly into supporting MacOS (Darwin) but it doesn't seem possible, especially on recent MacOS versions; Apple is working hard to kill off OpenGL and replace it with Metal and the WINE builds I could find have no 32-bit support which is a requirement.

 

I would also like to see the FAQ updated, specifically the "Game play and issues" section, to bifurcate the "How do I get in the game !!" topic into Windows and Linux versions where the latter is just a disclaimer about Linux not being officially supported and a link to this post.  This would make it much easier for my future Linux brethren to find this and hopefully spend a lot less time installing the game and a lot more time playing it!

 

For updates, issues, and PRs:
https://github.com/ciphersimian/enb-linux-installer

 

To install (I strongly encourage you to review the script first, you should never run a script directly from the internet like this without reviewing it first!):

sh <(curl --fail --silent --show-error --location https://raw.githubusercontent.com/ciphersimian/enb-linux-installer/master/install-enb-linux.sh)

-or-

sh <(wget --no-verbose --output-document=- https://raw.githubusercontent.com/ciphersimian/enb-linux-installer/master/install-enb-linux.sh)

 

Long Live Tux! 🐧

Link to comment
Share on other sites

Ubuntu 22.04 seems to be missing wine-gecko package.

 

Isn't it better to use msi installer for that?

 

wine-staging also got installed into /opt/wine-staging (might be my system tho) and so script failed to find 'wine' (that dir not in path)

Link to comment
Share on other sites

In general it worked, but had to make few modification for it to work in my test container

- no wine-gecko (installed it when net7launcher poped up first and got the wine prompt to do so)

- add_exit_cmd broken in "Net7 Unified Installer", "DER_CERT_REG", and "Net7 Launcher to perform updates" phases

- disabled gsettings as that broke (possibly because I dont have gnome?)

 

Was able to log into game, so good job putting this together.

Link to comment
Share on other sites

Thanks for testing it out, can you provide all the output of the failures you ran into and I can try to get that stuff fixed?

 

17 hours ago, karu said:

Ubuntu 22.04 seems to be missing wine-gecko package.

 

Isn't it better to use msi installer for that?

 

Alright, I found a way to handle this if there is no wine-gecko package using the msi installer as you suggested.

 

 

17 hours ago, karu said:

wine-staging also got installed into /opt/wine-staging (might be my system tho) and so script failed to find 'wine' (that dir not in path)

 

Ah, I see the problem:

https://github.com/wine-staging/wine-staging

> On most distributions the wine-staging package is installed to /opt/wine-staging, such that multiple Wine versions can be installed in parallel. If this is the case for your distribution, you will have to type /opt/wine-staging/bin/wine instead of just wine.

 

I'll add a check to try and find both (starting with `/opt/wine-staging/bin/wine`) and use whichever I find first.


 

15 hours ago, karu said:

add_exit_cmd broken in "Net7 Unified Installer", "DER_CERT_REG", and "Net7 Launcher to perform updates" phases


I'm definitely curious about the exact error you got here; all this is trying to do is cleanup some temporary files at the end.  This is the one thing I'm not sure how to handle so if you could provide the log for this it would be a big help.

 

 

15 hours ago, karu said:

disabled gsettings as that broke (possibly because I dont have gnome?)


Hmm, I do have a check in there for that which should have skipped that section if gsettings doesn't exist; though perhaps it exists for you even though you don't have gnome, e.g. you either had gnome in the past, or your distro includes that and doesn't remove it even when you switch to another WM.  I will investigate a more foolproof check for gnome there.

Edited by Codemonkeyx
Link to comment
Share on other sites

@karu I put in some fixes for everything above except for the `add_exit_cmd` issue as I don't have anything to go on there and it seems to be working exactly as expected for me.  I'll need more info to understand what's going on there.  Thanks again for giving this a try!

Link to comment
Share on other sites

  • karu pinned this topic

"Check wine version" does not use WINE_EXEC 😉

wine-gecko always redownloads the msi

 

Ubuntu winetricks depends on 'wine' aswell, so both wine and wine-staging gets installed.

If package not installed, then maybe just pull winetricks from github directly and stuck it in wine-enb for example.

 

add_exit_cmd is heavily bash dependant, but ubuntu uses dash for '/bin/sh', if you change it to /bin/bash then it will work.

Not sure what you trying to do with 'eval "set -- $(pf trap) | ...."' and later with shift's.

 

e&b/net7 config default seems to be "640x480 fullscreen". Fullscreen anything with linux is usually bad idea, especially when user is running 3 monitors and app is not built for xrandr 😉 (got one of monitors set to 640x480 when config ran hehe)

 

Automation broke this time when launcher ran (worked yesterday), but manually patching worked.

 

Link to comment
Share on other sites

Ah, the joys of cross-platform shell scripting.

 

22 hours ago, karu said:

"Check wine version" does not use WINE_EXEC 😉

 

doh, I remember seeing that too but when I got around to making that replacement I did it by " wine "  🤦‍♂️
 

 

22 hours ago, karu said:

wine-gecko always redownloads the msi


fixed


 

22 hours ago, karu said:

Ubuntu winetricks depends on 'wine' aswell, so both wine and wine-staging gets installed.

If package not installed, then maybe just pull winetricks from github directly and stuck it in wine-enb for example


🤦‍♂️  I went ahead and implemented your suggestion


 

22 hours ago, karu said:

add_exit_cmd is heavily bash dependant, but ubuntu uses dash for '/bin/sh', if you change it to /bin/bash then it will work.

Not sure what you trying to do with 'eval "set -- $(pf trap) | ...."' and later with shift's.

 

set is POSIX, as is trap; there should not be anything bash specific about that function... indeed, the goofiness of it is specifically to make it POSIX-compliant, doing this in pure bash is much easier because you can just use an array, e.g. https://www.shellcheck.net/wiki/SC2124

 

from `man set`:

 

Quote

The remaining arguments shall be assigned in order to the positional parameters. The special parameter '#' shall be set to reflect the number of positional parameters. All positional parameters shall be unset before any new values are assigned.


from `man trap`:

 

Quote

The trap command with no operands shall write to standard output a list of commands associated with each condition.
...
          "trap -- %s %s ...\n", <action>, <condition> ...


I'm just using it to easily modify the EXIT trap without having to deal with a nightmare of unquoting and re-quoting.  This is a pretty standard way of doing this in bourne shell to make it cross-platform.


trap by itself just lists the traps that have been set, so I'm grepping for the EXIT trap, then saving it into the positional args with set, it just sets $1, $2, $3, etc. but since trap begins each line with `trap -- ` I shift twice to get rid of those, so the whole thing looks like this:

 

$ bash
$ trap 'rm -f /tmp/some_file' EXIT
$ trap 'some other trap' INT
$ trap
trap -- 'rm -f /tmp/some_file' EXIT
trap -- 'some other trap' SIGINT
$ trap | grep -E 'EXIT$' | sed 's/ EXIT$//'
trap -- 'rm -f /tmp/some_file'
$ set -- $(trap | grep -E 'EXIT$' | sed 's/ EXIT$//')
$ echo $1
trap
$ echo $2
--
$ echo $3
'rm
$ echo $4
-f
$ echo $5
/tmp/some_file'
$ shift
$ shift
$ echo $1
'rm
$ echo $2
-f
$ echo $3
/tmp/some_file'

 

then I add the new exit command and append the original commands back on.

 

The problem seems to be that dash has some very weird behavior with both pipes and command substitutions which do not follow the POSIX spec imho:

 

$ dash
$ trap 'rm -f /tmp/some_file' EXIT
$ trap 'some other trap' INT
$ trap
trap -- 'rm -f /tmp/some_file' EXIT
trap -- 'some other trap' INT
$ trap | grep .
$ echo $(trap)

$ trap > /tmp/saved_traps
$ cat /tmp/saved_traps	
trap -- 'rm -f /tmp/some_file' EXIT
trap -- 'some other trap' INT


so I should be able to fix this by redirecting to a temporary file instead (oh the irony).

 

 

22 hours ago, karu said:

e&b/net7 config default seems to be "640x480 fullscreen". Fullscreen anything with linux is usually bad idea, especially when user is running 3 monitors and app is not built for xrandr 😉 (got one of monitors set to 640x480 when config ran hehe)

 

I think you might be confusing the config with the Character & Starship Creator?  e&b/net7 config are just basic windows applications with a single panel.  Or perhaps you mean the resolution that they default the game to?  I do have a change in the script where I'm trying to default it to windowed @1312x984 by changing the registry, e.g.

 

[HKEY_LOCAL_MACHINE\Software\Westwood Studios\Earth and Beyond\Render]
"RenderDeviceWidth"=dword:00000520
"RenderDeviceHeight"=dword:000003D8
"RenderDeviceWindowed"=dword:00000001

 

But the Character & Starship Creator is fixed at 640x480 which is damn annoying; I tried to get around that by creating a wine virtual desktop with `explorer /desktop=...,800x600` which seems to work for me... but before I added that I was having the same problem you describe when launching the CSC.


The only other thing I can think of is if this new default resolution is causing you an issue (1312x984) if the old one worked (1400x1050), but that would be dependent on you switching it from windowed to fullscreen since it should be defaulting to windowed.


If you can provide more details on this it would be helpful.

 

 

22 hours ago, karu said:

Automation broke this time when launcher ran (worked yesterday), but manually patching worked.

 

I've seen that happen intermittently as well but I've had no luck tracking down what's happening; it seems like the autohotkey script is getting stuck somehow.  I tried one thing out which may fix it if it somehow skipped over my loop break condition.

Edited by Codemonkeyx
Link to comment
Share on other sites

8 hours ago, Codemonkeyx said:

I think you might be confusing the config with the Character & Starship Creator?  e&b/net7 config are just basic windows applications with a single panel.

 

e&b/net7 config will run short benchmark (vidtest) which switches to selected mode to find out polygons/sec metrics, and the default happened to be fullscreen.

 

--


I used clean test container for testing and there some issues.

 

Because wine is not in PATH, winetricks can't find it. Adding "export PATH=$(dirname $WINE_EXEC):$PATH" after "WINE_EXEC=$(install_wine)" will fix it. Worst case, it adds /usr/bin there twice.

There's also missing cabextract as it might of been installed by winetricks. Winetricks does suggest installing cabextract when it fails to install fonts (i think).

 

You also cant do "WINE_EXEC=$(install_wine)" because if wine-staging is not installed, then WINE_EXEC will contain all the text displayed at install time.

You could do something like this

WINE_EXEC=$(find_wine)

if [ -z "$WINE_EXEC" ]; then install_wine ; WINE_EXEC=$(find_wine) ; ... if still not found, error out; fi

 

apt install command should probably be "sudo DEBIAN_FRONTEND=noninteractive apt --assume-yes install --install-recommends " as I was getting hidden dialog options that required me to press enter blindly.

Link to comment
Share on other sites

22 hours ago, karu said:

e&b/net7 config will run short benchmark (vidtest) which switches to selected mode to find out polygons/sec metrics, and the default happened to be fullscreen.

 

Alright, I spent a ton of time digging into this and trying some different things out, but ultimately I think it's because the config app checks the resolution against something and if it decides it's invalid / not-supported it reverts back to defaults.  On my system 1312x984 was working, but obviously it doesn't on yours.  If I set it to 1x1 I see the same behavior you're describing where it goes back to 640x480 fullscreen... so I changed the default again to 1280x960 windowed which should at least be visible for anyone and they can adjust from there.

 

 

22 hours ago, karu said:

Because wine is not in PATH, winetricks can't find it.

 

It turns out winetricks has a built-in mechanism for handling this, I just had to set WINE when I call it.

 

 

23 hours ago, karu said:

There's also missing cabextract

 

This is a winetricks dependency that is usually installed along with the winetricks package, so yeah, I had to add an explicit check to install it separately.

 

 

23 hours ago, karu said:

if wine-staging is not installed, then WINE_EXEC will contain all the text displayed at install time.

 

I sent all the installer output to stderr.

 

 

23 hours ago, karu said:

apt install command should probably be "sudo DEBIAN_FRONTEND=noninteractive

 

added

 

 

Amazing how difficult Ubuntu is making everything... seems like everything we try and do to solve one problem just causes two more.  Thanks again for all the testing.  Hopefully we're getting close to the center of this onion 😅

Link to comment
Share on other sites

21 minutes ago, karu said:
6 hours ago, Codemonkeyx said:

I sent all the installer output to stderr.

 

Don't do that. Fix the script instead.

 

I'm not sure I understand; that did fix the script.  The output will still show up on the console, it just won't go into the WINE_EXEC variable.  What are you concerned about?

 

$ echo $(echo stdout; echo stderr 1>&2)
stderr
stdout

 

Edited by Codemonkeyx
Link to comment
Share on other sites

1 hour ago, karu said:
13 hours ago, Codemonkeyx said:

What are you concerned about?

 

Errors go to stderr, not basic output from programs.

 

If that were true it would certainly make my life a lot easier! :P

Seriously though, it's from the perspective of the program or function... POSIX says only:
 

https://pubs.opengroup.org/onlinepubs/9699919799/functions/stderr.html

Quote

standard output (for writing conventional output), and standard error (for writing diagnostic output). When opened, the standard error stream is not fully buffered; the standard input and standard output streams are fully buffered if and only if the stream can be determined not to refer to an interactive device.

 

which obviously comes ultimately from C.  So stderr is somewhat poorly named as diagnostic messages are not all errors.

This stack overflow poster summarized it well:

https://stackoverflow.com/a/74896844

Quote

stdout is the "output" or "result" of a program. (This is why shell piping applies to stdout.)
stderr is the "logging" or "diagnostics" of a program. (This is why stderr is usually unbuffered.)

 

So from the perspective of installing the Earth & Beyond Emulator all of this extra output is logging/diagnostics.  I didn't spend a whole lot of time ensuring all the superfluous output goes to stderr, but many of the large wine/winetricks actions for example are wrapped in blocks like this:
 

output=$(... 2>&1) || { rc="${?}"; err "rc: ${rc}, output: ${output}"; exit "${rc}" }

 

which will not be printed at all unless there is an error because wine is incredibly spammy and there is little to nothing of value in there if you aren't a wine or winetricks dev, which, tbf, I did feel like at times during the development of this, heh.  I think it would be completely defensible to do the same thing to these installs, but I decided to at least leave the output on stderr since they're somewhat "unexpected" or abnormal, or at least represent a larger change to the system beyond just the expected items going into `~/.wine-enb`.

 

Anyway, thanks again for all the feedback and your concern, I do appreciate it, and you definitely helped make this script much better.  Hopefully it will work more seamlessly for people on yet other distros.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...