The forum

POL_Install_steam fails due to a bash syntax problem

No Subnautica for me :(

Author Replies
mgedmin Friday 1 February 2019 at 13:02
mgedminAnonymous

Hello!

I'm trying to install Subnautica on my Ubuntu 18.10 laptop.  I've installed PlayOnLinux 4.2.12-1 from the official Ubuntu archive, found Subnautica in the list of installable programs, went through the install wizard a few times, and it always fails (wine cannot find steam.exe).  I've also tried with a git checkout of the POL-POM-4 repository, with the same result.

It looks like the problem is caused by a bug in the POL_Install_steam script, which causes it to fail to install Steam.  Once the corefonts and DLL overrides steps are done, I see this error in the console where I launched ./playonlinux:

POL_Install_steam: eilutė 70: įspėjimas: here-document at line 21 delimited by end-of-file (wanted `EOF')
POL_Install_steam: eilutė 71: sintaksės klaida: netikėta failo pabaiga

I don't expect y'all to read Lithuanian, so I'll translate:

POL_Install_steam: eilutė 70: warning: here-document at line 21 delimited by end-of-file (wanted `EOF')
POL_Install_steam: eilutė 71: syntax error: unexpected end of file

I've found a ~/.PlayOnLinux/tmp/POL_Install_steam, and I see it looks like this starting from line 20:

if ["$POL_ARCH" == "amd64"]then;
        cat << EOF > fix.reg
        REGEDIT4
  
        [HKEY_CURRENT_USER\Software\Wine\AppDefaults\Steam.exe]
        "Version"="winxp64"
   
        [HKEY_CURRENT_USER\Software\Wine\AppDefaults\steamwebhelper.exe]
        "Version"="winxp64"
  
        EOF

The bash that I have on Ubuntu 18.10 is version 4.4.19(1)-release, and it doesn't accept indented "EOF" as the here-document delimiter.  The manual page says you can indent the delimiter (with tabs only???) if you use the <<-EOF syntax instead of just << EOF.

I'm new to the PlayOnLinux community, so I'd appreciate pointers if this is not the right place to report bugs.  I'd also appreciate suggestions for workarounds, because I'd really like to play Subnautica (e.g. can I edit the script in ~/tmp or will it be re-downloaded from somewhere else every time?).

 

Regards,

Marius Gedminas

 

mgedmin Friday 1 February 2019 at 13:55
mgedminAnonymous

I've discovered the function overrides mechanism:

1. edit ~/.PlayOnLinux/playonlinux.cfg and add ALLOW_FUNCTION_OVERRIDES=TRUE on a new line

2. copy ~/.PlayOnLinux/tmp/POL_Install_steam into ~/.PlayOnLinux/configurations/function_overrides/

3. fix all bash errors in ~/.PlayOnLinux/configurations/function_overrides/POL_Install_steam (there are many more than what I originally reported!

- the `if` statement syntax  was very wrong on line 20; bash is very particular to spaces and semicolons.  It should look like `if [ "$POL_ARCH" == "amd64" ]; then`

- both EOF lines (line 30 and line 44) must have no indendation

- the sed line that tries to change config.vdf in place should use sed -i ... config.vdf instead of trying to both read and write it

 

4. run the installer again, headdesk a few other times for unrelated reasons (e.g. it's a Bad Idea to uncheck the 'Run steam' checkbox in the Steam installer, as that'll confuse the script; then for some reason my fixed sed line didn't take and I had to add the list of content servers to config.vdf manually, while steam.exe was not running)

But now I have a working Steam that is halfway through downloading Subnautica, so fingers crossed!

 

Regards,

Marius Gedminas

Quentin PÂRIS Friday 1 February 2019 at 14:51
Quentin PÂRISAnonymous

Thanks for the report! And the investigation!

Can you suggest a script improvement?