I have some MacOS client/server software that originally installed as a folder containing two separate .app folders; one for the client, and one for the server.
That worked fine, except that it meant that I had to include a separate copy of every bundled shared library in each *.app/Contents/Frameworks sub-folder; and given that both apps have a Qt-based GUI, that was a substantial amount of overhead.
Someone suggested that instead of shipping the two programs as separate .app folders, I simply move the server's executable file (TheServer.app/Contents/MacOS/TheServer) into the client's Resources folder (TheClient.app/Contents/Resources/) and then add a "Launch Server" button to the client GUI that launches TheClient.app/Contents/Resources/TheServer as a child process when clicked.
I did that, and that also works well, and reduces my application's .pkg size by about 25 megabytes.
The only downside is that now when TheServer runs, its icon in the Dock is a generic Terminal icon (see attached screenshot) rather than its intended custom icon; presumably this is because TheServer no longer has an associated Info.plist file in which to declare its CFBundleIconFile attribute specifying where its .icns file is.
My question is, is there any way to remedy this situation and allow TheServer's GUI to have its custom Dock icon again? Or am I just out of luck here?

.pkg, you might be able to work some kind of magic with a symlink.info.plistgo?TheClient.appinto theTheServer.app/Contents/Resources, and that gets me the icon; of course it also gets me two copies of all the shared libraries again, which I was trying to avoid. To fix that, I deletedTheClient.app/Contents/Resources/TheServer.app/Frameworks, and then usedinstall_name_toolto retargetTheServerto reference the shared libraries inTheClient.app/Contents/Resourcesinstead. Remarkably, neither Gatekeeper nor the notarization server seem to mind this (I suppose because the shared libraries are still within the overall package)