How to deploy a FireMonkey Application for Mac OSX?

前端 未结 2 561
一向
一向 2020-12-31 05:57

I can run a FireMonkey Application on Mac OSX with PAServer. But now, I would like to deploy the application Mac OS (something like MSI under Windows). How can I do this?

2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-31 06:29

    You'll want to read more about Application Bundles.

    Using the application bundle that Delphi creates and deploys via PAServer

    Since you're using the PAServer, you'll find that it has already created an application bundle for you. After you run the program via the PAServer, look in the following folder on the Mac for the application bundle:

    /Users/[username]/Applications/Embarcadero/PAServer/scratch-dir/[profilename]

    If your project is named Project1, you'll see an application bundle in that folder named Project1.

    If you read the above wiki article, you'll know that Project1 has a "hidden" extension of .app, and the whole thing is really a folder with all of the required files to run the application.

    Go ahead and run this application bundle directly on the Mac. If it complains about missing dylibs, such as libmidas.dylib, simply copy them from the PAServer folder into the application bundle's MacOS folder.

    To the Mac OS user, the application bundle appears as a single program file, complete with an icon. The user can double-click the application bundle to run the application, drag it to their dock, etc.

    Changing the icon

    The application bundle will have the Delphi icon by default, but you can replace it with your own icon. On the Mac, simply right-click on the application bundle in Finder, and select Show Package Contents. In there, look in the Contents/Resources folder for the .icns file.

    Use the Icon Composer application that was installed with XCode to create your .icns icon file from existing image files.

    Peeking inside the bundle

    Peek around inside at the rest of the contents. You'll see the required dylib, your program file, and the Info.plist file, which is a text file with things like application IDs, signatures, and other important things.

    More about deployment

    If your application can be self contained in an app bundle, the standard method is to put the application bundle inside a disk image .dmg file, which allows the user to drop the application into the applications folder.

    If your application requires the installation of additional files, libraries, databases, or frameworks, etc., you should create a package. You can utilize PackageMaker to do this. A package is similar to the "msi" installer on Windows that you mention.

    When the user double-clicks the package, it's run by Installer. It has a wizard style interface and walks the user through installing the application. You can also sign the package with your code signing certificate.

    If you want to include your application bundle in the app store, you'll need to sign it. You'll also need to sandbox it.

    Sandboxing and the Mac App Store - Nov 2, 2011

    The vast majority of Mac users have been free from malware and we're working on technologies to help keep it that way. As of March 1, 2012 all apps submitted to the Mac App Store must implement sandboxing. Sandboxing your app is a great way to protect systems and users by limiting the resources apps can access and making it more difficult for malicious software to compromise users' systems. Learn more by visiting the App Sandbox page.

提交回复
热议问题