macOS Ventura 13.6.7
Apple M1
I tested @bmeerdink's suggestion on my system, and was successful in getting GOG Galaxy to run.
Here's what I found:
The 'GalaxyCommunication' program will exit after about 30 seconds when nothing is connected to it, but will run indefinitely while a connection is established.
The 'GOG Galaxy' program takes several seconds to start up before attempting to connect to 'GalaxyCommunication'. The amount of time varies, but on my system it's somewhere around 10 seconds.
Taking the above information into account (with some trial and error) I wrote a bash script to launch and synchronize the two programs:
$ cat /Applications/gogGalaxyLauncher.app/Contents/MacOS/gog_galaxy_launcher.sh
---
#!/bin/bash
open /Applications/GOG\ Galaxy.app &
sleep 10
/Users/Shared/GOG.com/Galaxy/redists/GalaxyCommunication &
---
You may need to adjust the 'sleep 10' amount (I use 10 seconds) if GOG Galaxy is slower to start on your system.
I made the script executable (current user only) using the 'chmod' command in a terminal:
$ chmod u+x /Applications/gogGalaxyLauncher.app/Contents/MacOS/gog_galaxy_launcher.sh
And packaged it as a macOS app:
$ tree /Applications/gogGalaxyLauncher.app
---
/Applications/gogGalaxyLauncher.app
└── Contents
.......├── MacOS
.......|.......└── gog_galaxy_launcher.sh
.......├── Resources
.......│......└── AppIcon.icns
.......└── info.plist
4 directories, 3 files
---
Here is the info.plist file I used:
$ cat /Applications/gogGalaxyLauncher.app/Contents/info.plist
---
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN">
<plist version="1.0">
<dict>
<key>CFBundleExecutable</key>
<string>gog_galaxy_launcher.sh</string>
<key>CFBundleIconFile</key>
<string>AppIcon.icns</string>
</dict>
</plist>
---
For more information on creating macOS apps from shell scripts, you can search stackoverflow with this search term (keep the quotes): "Converting a Shell Script Into a .app File"
You can also run the script by itself if you don't want to construct an entire macOS app, or even just run the commands in a terminal like so:
---
open /Applications/GOG\ Galaxy.app &
sleep 10
/Users/Shared/GOG.com/Galaxy/redists/GalaxyCommunication &
---
When GOG Galaxy is closed, it will terminate its connection to GalaxyCommunication, and about 30 seconds later GalaxyCommunication will exit, so nothing gets left running in the background unnecessarily.
Thanks @bmeerdink for identifying what GOG Galaxy was failing to establish a connection to, your solution works well for me.
Also, when I open the app as installed, the GalaxyCommunication program never runs at all, and I don't see anything in the GOG Galaxy logs indicating that an attempt has been made to open it ¯\_(ツ)_/¯
Note: I don't know if it's possible to format posts in this forum as code blocks or even just monospaced, so some of the formatting is a bit wonky, be cautious if you attempt to replicate what I've done, if you don't understand something do some searches until you find an explanation that makes sense to you. Thanks!
One other thing, for completeness: I have the "GOG Galaxy.app" and "GOG Sp. z o.o." entries enabled in my system settings (Settings -> General -> Login Items -> Allow in the Background). [update: I have since disabled these and the app still seems to run ok] [further update: 'GOG Sp. z o.o.' seems to be required, I have re-enabled it]
bmeerdink: On macOS Sonoma, I had this annoying error. GOG Galaxy starts up fine, but after a little while: "GOG Galaxy - Error / Connection blablabla / Galaxy will now shutdown" (modal window)
Running /Users/Shared/GOG.com/Galaxy/redists/GalaxyCommunication in a terminal beforehand will help, but that's a bad way to solve the problem. Seems just sloppy programming.