Hi,
I downloaded vkQuake the other day: it's an open-source engine for running the classic game Quake. Unfortunately, it's a bit stupid: by default it looks for the game resources in the same directory as the app itself. This means that I need to put Quake's "ID1" folder in my Applications folder, which feels like clutter to me.
There's a command-line argument you can pass in that makes it look elsewhere. As far as I can tell, there's no simple way to tell MacOS to launch an app with arguments, so I ended up going a little bit hacky with a solution from Stack Overflow:
I put a script in the app bundle's MacOS folder called launch.sh which runs the vkquake executable with the right argument. I did a chmod +x on it, then updated the app's Info.plist to run launch.sh instead of vkquake.
So far, so good. I can double-click on the vkQuake icon and all is well.
Except... some time later (and I haven't yet determined how long it is, although less than two days) if I double-click on vkQuake it'll immediately crash. I'm not in front of my Mac right now but the crash log says something like "SIGKILL: Invalid code signature". I wondered what had triggered this (after all, the binary code itself is unchanged) but I deleted and reinstalled vkQuake again, reapplied launch.sh, and once again all was well. Then a couple of days later I tried to run it and it crashed again.
What is going on here? It would seem that some sort of security feature is getting in the way, but I don't understand why it works for a while in the first place.
I tried re-signing the app ("codesign --force --deep --sign - /Applications/vkQuake.app") but it reported something like "certificate not in keychain". Although just now while writing this I stumbled upon something saying I should do "codesign --remove-signature" first, so I'll need to try that.
This has got a bit long and rambly, but I suppose my question is "What is the 'best' way to pass arguments to an application, without it breaking?".