How to copy additional files to OSX - macos

I have a simple FireMonkey application which loads an image file. It's my first try with OSX. It's started on OSX via paserver from the "scratch-dir". But my image file is obviously not there and cannot be loaded. What do I have to do to make Delphi copy this image file to OSX or bundle it?

You can use the Project-Deployment option to add addtional files

If you manually copy the image to the Resource folder into the application bundle on your Mac, your application can access the file without specifying a path.
Unfortunately, I don't know a way to get Delphi to include the file automatically.

Related

macOS: QFileIconProvider icon(QFileInfo) get icons for non-existent files

I'm trying to implement a file explorer that will display a list of remote files(stored on another network server). And I use QFileIconProvider.icon(QFileInfo) to get the file icon.
The QFileInfo is constructed from a single filename(no path information):
for example: QFileInfo fi("test.jpg");
and that works on both Windows and Linux(I tested it on a Ubuntu machine), but it doesn't work on the macOS. On macOS, I always get the warning
Path given to -[NSWorkspace iconForFile:] is not a full path.
I have checked the solution here: Qt 4.8 - QFileIconProvider, Getting icon for non-existent file (based on extension), but it's for the Windows platform.
I was able to make it work if I created a temporary file on my working directory with the same remote filename. But the temporary needs to be kept. If I deleted the temporary file after calling QFileIconProvider::Icon, I will get the warning above when the QTableView tries to display the QIcon in the UI.
Is there any working solution for my case?
Thanks all.
Since there is no "correctly" solution, I just make a workaround:
Create a temporary file for each file extension, and keep them here, only delete these temporary files when you ensure you don't need them anymore. (I choose to delete them before my app quit.
At least, it works for me.
Thanks!

Creating Dropbox like DMG package

Does anyone suggest a freeware tool/script/manual_way of creating Dropbox like DMG -
Need to ask couple of questions --
I want double clicking the Folder-Icon should copy the folder(which would contain installer and uninstaller .app files of my application) into the system's /Applications folder.
Solution -- This has been solved using Applescript and changing icon of that applescript file to the folder-icon(i.e double clicking that script will move our folder(which would be present in a hidden folder) to /Applications.Any suggestions for second and third part?
Is it possible to show hyperlink of actual dropbox.com to actually open it's website?
And how we can customize volume's/Drive icon?
You can find a way to do it by reading this: Packaging a Mac OS X Application Using a DMG » asmaloney.com
I believe you can also use the trick of naming a shellscript file something.command in order to make it double clickable, (but maybe it will open the terminal, -I haven't tried it).

How to make swf file including other resources to a application bundle in osx?

I'm new to Mac OS X, so these questions may seem to be stupid.
I have googled for nearly half a day, but can't find the exact answers.
About applications on Mac OS X:
Does any application must be placed in the /Applications folder to execute it?
If not, how does Mac OS know what applications I have installed and show them all in the Launch Panel?
What should I do to install an "nake" foo.app ?
Is this possible and how to implement it? or any other suggestions?
I downloaded the "Flash Player.app" from Adobe's site, and got a .swf file and some other resource files that will be loaded by the .swf file.
I want to bundle the "Flash Player.app" and the swf file including its resource files together to form an MySwf.app using AppleScript. So that the .swf file can be opened on any other Mac without the "Flash Player.app" having to be installed.
Thanks a lot! :)
My final resolution:
run.app, compiles from an AppleScript whose content is as follow:
set myPath to path to me
tell application "Finder"
set folderPath to container of myPath as string
open (folderPath & "Source:minigame.swf") using (folderPath & "Source:Flash Player.app")
end tell
Source folder which contains Flash Player.app and minigame.swf.
When I zip them and give the zip archive to other guy, he just need to unzip it and double click the run.app before opening the minigame.swf.
At first, I tried to put both Flash Player.app and minigame.swf in the run.app bundle which was unfortunately failed. There may be some 'tricks' I don't know yet...
You need to run the Flash installer to make the Flash Player work. Flash gets disabled every now and then. So, you will have to rely on the user to install and update flash. It doesn't make sense to install Flash Player.app only.
Applications don't need to be installed in /Applications to be executable. You can execute them from anywhere, as long as the file has the necessary permissions.
When an .app package is written to disk, Mac OS X recognises this and updates the desktop files using the bundle identifier that is in the package. THat's how OSX knows which app to use to open a particular file.
Apps don't get added to the launch panel automatically. Their installers have to take care of this. You can add apps to the launch panel manually.

Xcode 4 exported app gives error 'Can't Open Application...Classic Environment Not supported'?

I made a simple app, archived it and went into organizer. From there I clicked Distribute -> Export As Application -> Don't Resign and then saved it to my desktop. It runs fine then, but if I upload it to Mediafire and try to download it I get the error You can't open the application X because the Classic environment is no longer supported. when trying to run it. I didn't change any default settings.
How did you upload it? Did you wrap it in a zip archive or did you just upload the raw app bundle?
If you just uploaded the raw app then you will have destroyed the permissions and extended attributes on the executables, causing the app to fail to work when downloaded.
The system will see your main executable as a non-executable file, and the "Classic Environment" error message is just the default error message in this situation as it's the most likely reason for this issue.
Wrapping the app in a zip works because the zip format retains the permissions information for the files in the zip archive.
Hm for whatever reason I had to zip up the file before uploading it. Don't know exactly why, but that works.

About multi Flash.ocx versions in one machine

I have a application using Flash.ocx to get the frame picture from SWF file, after updating adobe flash player to the newest, the frame picture is totally wrong.
Is there a way to keep the old Flash.ocx in my running folder and my application will use that instead of the one in the system folder? I tried add the flash.ocx within application manifest file, but it doesn't work.
You can try to use flash wrapper: F-IN-BOX. I didn’t use it, but it has version compatibility feature.

Resources