-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add macOS bundle support + Assets #107
base: master
Are you sure you want to change the base?
Conversation
07123e0
to
8991d6f
Compare
Fixes the github workflow and adds the option to install Lovey on macOS as an app bundle in the user applications folder, complete with a unique icon. Updates Readme to accomodate.
8991d6f
to
3bfa328
Compare
Wow, excellent work. I have no way of testing this currently but let me search around for someone who can. |
.github/workflows/release.yml
Outdated
echo "|Mac (Arm)|[lovely-aarch64-apple-darwin.tar.gz](https://github.com/ethangreen-dev/lovely-injector/releases/download/${{ github.ref_name }}/lovely-aarch64-apple-darwin.tar.gz)|" >> NOTE.md | ||
echo "|Mac (Arm) (Installer)|[lovely-aarch64-apple-darwin-installer.tar.gz](https://github.com/ethangreen-dev/lovely-injector/releases/download/${{ github.ref_name }}/lovely-aarch64-apple-darwin-installer.tar.gz)|" >> NOTE.md | ||
echo "|Mac (x86)|[lovely-x86_64-apple-darwin.tar.gz](https://github.com/ethangreen-dev/lovely-injector/releases/download/${{ github.ref_name }}/lovely-x86_64-apple-darwin.tar.gz)|" >> NOTE.md | ||
echo "|Mac (x86) (Installer)|[lovely-x86_64-apple-darwin-installer.tar.gz](https://github.com/ethangreen-dev/lovely-injector/releases/download/${{ github.ref_name }}/lovely-x86_64-apple-darwin-installer.tar.gz)|" >> NOTE.md |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe renaming these to "Mac Installer" would be more attention-grabbing? Furthermore should these be reordered to make the mac installers come first?
README.md
Outdated
@@ -14,6 +14,15 @@ Lovely is a lua injector which embeds code into a [LÖVE 2d](https://love2d.org/ | |||
|
|||
### Mac | |||
|
|||
#### Bundle Installation (Easy) | |||
1. Download the [latest release](https://github.com/ethangreen-dev/lovely-injector/releases) for Mac. If you have an M-series CPU (M1, M2, etc.) then this will be `lovely-aarch64-apple-darwin-installer.tar.gz`. If you have an Intel CPU then it will be `lovely-x86_64-apple-darwin-installer.tar.gz` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This step should explicitly mention the installer variant, not just any one of the mac releases. Some people won't get it otherwise.
Your additions push back hard against my "make lovely as game-agnostic as much as possible", but I think that's moreso an indication that we need to adapt our installation experience to support the specific needs of individual games. It's also not realistic to assume that lovely is being used in anything BUT Balatro, so I think this is all more than fine for now. Maybe we should revisit this problem at a later date to more a more generic Mac OS installer? |
Current installation instructions seem targeted towards Balatro, to the point the scripts in the main repository pointed specifically to Balatro, even before my changes. If anything my changes laid groundwork for them to be more adaptable. Albeit they too are currently tailored to Balatro. The main problem with adapting to other games, from a Mac perspective, is customizing the bundle(s) to a particular game. In theory you could read the values from the app bundle for a game that's being modded, including info from its My experience with multi-game modding is usually you have a "client" that can launch multiple games. Since lovely is a simple framework injection that seems aggressive, however. But it is something to think about, if plans are to expand beyond balatro; a front end to install mods and launch games would probably work better than creating a custom "+ Mods" bundle per game. I'll play around with this in the coming week, and make some of the changes requested. I do appreciate you taking this seriously though. I have some ideas based on your feedback I can test. One in particular is having the installer script run from any directory and having the user drag-and-drop the modded-to-be app into the terminal window to set up the launcher bundle. — This would at least make it game-agnostic enough to no longer rely on steam install directories or the game name. I'll need to confirm that I can read the relevant values from the plist however. The motivation behind this PR was basically convenience; no having to browse game files constantly, run an "ugly" script, or differentiate between modded & unmodded games. But it is a very Mac user nitpick, I suppose, to want to have a clean app bundle instead of folders and scripts. |
Haha yep, the flaws are pretty obvious. I appreciate your input and I agree in that we can make some positive changes towards improving this in the future, but it's all going to feel "weird" with how minimal lovely is at the moment.
Keep me posted on what you find out. If you can find out a generic way to do it then great, otherwise this PR is good as it is (barring the changes I previously requested). At the end of the day it comes down to providing as much of a "Mac"-like experience as we can, of which I think you've nailed. |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
f821b5c
to
05ab018
Compare
Converts the lovely injector into an agnostic script, with both capabilities to run the injector a single time, and to create an application bundle which serves as a launcher for the modded application.
05ab018
to
5348c4b
Compare
The script is pretty hefty now, in comparison to before, haha, but in testing I haven't noticed any bugs, and I tried to account for any failures and fail safely at multiple points. I also heavily documented the script for ease of readability and understandability, and tried to be sure the individual steps were understandable by users. Likewise, the As far as the icon I worked on, I figured the system could actually be extended in a way so that the script could ship with custom icons (at your discretion) for multiple games, based on your own criteria. As such, the icon was renamed to its internal application identifier and placed in the Test Release ➜Built using GitHub Workflow Automation |
Was able to get around to testing this. Some feedback:
|
Oh also what is the process of updating lovely when the user has already built an application bundle? |
This was mainly to reduce the number of steps required and to prevent jumping around in the instructions. This also represents the ideal order the steps should be taken in, as the mods should ideally be installed before injecting. However, maybe installing mods should be a separate section all together? With variations in path based on Windows, Linux & Mac. That might make more sense, separating injection steps themself from mod installation.
Oh I didn't even know this was a feature of GitHub. How lovely. Thank you.
Ah. Uh, I'm honestly going to have to look into how to handle that. This script uses Bash functions and a while loop, so what appears to be happening is For possible explanation on why it breaks, the global variables within the script are essentially "dirty" at this point, having not been cleared at the end of the process. I'm surprised it breaks so fantastically though. There's other cases where the bundle step exits early, where this doesn't happen. So... I'm not sure what I will be honest, I don't get why you would If you kill Balatro it returns to the menu. If you want to exit the script, just close the terminal window/tab.
I don't really see what you mean. That's what the bundle is for. Are you suggesting the script take on a more traditional cli like mode of operation? so instead of walking you through the steps, you run something like Maybe the scope of this should be changed if so; I'm not sure what @ethangreen-dev would prefer; a user-friendly wizard? Or a traditional cli script with arguments?The design philosophy with how I structured this script is heavily in the former, which means things like returning to the main menu when a process is completed (e.g. you run first just to see what it's like, then bundle after). Things someone unfamiliar with a CLI application would expect. (This is also why the
It asks you if you want to overwrite the bundle. If Y it deletes the old one and regenerates it. If N it returns to the menu. The bundle is just a proxy that includes liblovely, a symlink to the game being injected into, and a script as its main executable that injects the library and launches the game. I'll continue working on this. I got something good, but it needs more time in the oven. |
Motivation
Whilst installing Lovely is fairly simple, it is a bit inelegant to require launching from the installation directory as a script. Likewise, the script does not take into account the possibility that Balatro is installed in a different location.
Changes
./crates/resources-mac
, which contains the unique launch script, unique application icon, andinfo.plist
installer_lovely.sh
script, which:Balatro + Mods.app
, in the user'sApplications
folder andcd
's to it.Contents/Resources/
info.plist
toContents/
run_lovely.sh
asrun_lovely
toContents/MacOS/
liblovely.dylib
toContents/MacOS/
Balatro.app
toContents/MacOS/
Contents/MacOS/run_lovely
as executable then signs it "ad-hoc" (locally) withcodesign
codesign
is thankfully, as far as I know, a built-in system utility, no tools requiredinstall_lovely.sh
andassets/
from game folderbuild-macos-bundle
stepsbuild-macos
steps due to name changes in recent masterlovely-mac
➜lovely-unix
run_lovely.sh
➜run_lovely_macos.sh
run_lovely_macos.sh
to check the launch directory of the script first for Balatro.app, followed by the default install directory. If it cannot be found, it outputs an error, rather than running a nonexistent binary.Has this been tested?
Yes!