-
Notifications
You must be signed in to change notification settings - Fork 13
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
Configure correct MacOS icon (.icns file) to be used by build-mac target #127
base: main
Are you sure you want to change the base?
Conversation
Thank you for the exploration and PR. It looks like I'm missing something. The application icon isn't present when running from Netbeans (17) or from the dist folder (Ventura 13.2.1). Steps to reproduce:
The change is present in the code when building, the application icon is properly visible from Finder (not from Netbeans which doesn't support preview of icns file). How did you manage to display a proper icon on Mac? |
Yes, I noticed this too, the build-zip target (used to package as zip distribution) on MacOS use directly .icns file from
while build-mac copies the file indicated in app.icon.icns property to
and use this as icon for application, the default value of app.icon.icns is the same file in netbeans-plat, below you can see two lines from suite.xml that perform the "magic" on build-mac target (the first to define the default value of app.icon.icns, the second to perform the copy)
and my solution is effective only for build-mac target, but I'm investigating if there is a "standard" way to customize the icon even in the case of "zip" packaging on MacOS, if I find anything I will open a new PR (to keep two scopes separate) and also post a comment here with link to the other PR |
I'm wrong about how application, when packaged as zip, load icon for MacOS, in the trgtd launcher (trgtd/bin/trgtd) when program is started one of parameters passed to executable is
where $progdir is the launcher path (trgtd/bin) but it is certainly not correct because $progdir/../../ go out from the program tree, I think this can be a netbeans platform bug, I've updated this PR with my proposal of solution
|
@thegamer87 @RadekCap I'd like to avoid maintaining a copy of the Netbeans provided There already is a dedicated ant build file for creating the application for mac:
I tried running The target relies on some files that need to be present in the following path
Jeremy configured that target to prepare The path Now for the trgtd.icns: @thegamer87 The one you have created seems to not be fully compliant with the specs. I noticed it using inkscape to open the file. It works well with the one provided by Netbeans but fails with your version. I found a reference that only certain png sizes should be included in the icns file: 16x16, 32x32, 128x128, 256x256, 512x512 and 1024x1024 (see here). I managed to create such an trgtd.icns file that can be opened using inkscape. However, I suggest we re-use the trgtd.icns file that was bundled with the installer of thinking rock 3.7.0. The same for the trgtd.conf file: Let's use one that comes with 3.7.0 and let's see if and how it differs from the one in nbproject. Would you be able to follow this path and see how far we get? |
Thanks for digging into this @thegamer87. Don't worry about delays, especially not if it's about spending time with your daughter. I think it would be helpful if you could push your current state, so others with Mac can have a look. If you think, this path is the right one, you could revert the first two commits in this PR (we can still get it back if needed later) and add the current state as one or more new commits. If you want to follow both paths in parallel, you could create a new PR from a feature branch in your repo that does not include the first two commits. I don't work on Macs, so I don't have lot's to contribute here, but a few questions:
Thanks a lot for your contributions. |
Yes I can for sure revert my older commit, for the current state the only files added are into |
I've reverted my older commits and removed from gitignore and committed the folder "nbproject/packaging/macosx". |
@thegamer87 Thanks for applying those changes. They are a good starting point for further evaluation. I would assume that with the current files, it does not work yet. For a starter, the config files in Somebody with a mac should simply try out if
runs successfully and if the resulting installer is functional. Until that works, those settings need tweaking. I am not a Mac user, so I hope that others will invest time here... |
Yes, I confirm (like I wrote two mine comments above) that with those files the build succeed and the installer works on my Mac. Maybe another Mac user can make a try (@degrown for example) |
Sorry, I missed that statement. But that's good news. I am somewhat surprised that the Also, I'm not sure where
I add it here just as a reference. |
in fact
|
That's certainly true if you trigger ant with the config file But my main point was rather: I did not find the place where the property |
Here we are, I'm again recovering past discussions... |
I cannot provide the installer, unfortunately, as the current ticket requires a Mac to build it. |
Thank you and don't worry about that...I'll ask to @thegamer87, we'll find a way to do it. |
@degrown I'll prepare ZIP distribution for testing. |
I've an update: I've tried to uninstall openjdk (installed via homebrew) and installed JDK (20) from https://www.oracle.com/java/technologies/downloads/#jdk20-mac (pkg installer) with this jdk tr application installed through installer generated by can be launched directly by double click on application (with openjdk the application could only be launched from a terminal with jdkhome env var set). I'll share my tr installer with @degrown and we perform some tries on his mac. |
@thegamer87 @degrown What will be the next steps to be able to advance this issue? What were your findings when testing together? |
added MacOS icon ".icns" file (converted from a frame.gif icon in the repo used for linux) and configured app.icon.icns in project.properties to allow the replace of MacOS icon during the build of target "build-mac"