create desktop shortcut, add application to Dock after install on Mac OS

Posted:
in macOS edited January 2014
Hello everybody, I've ported my Qt 4.3 application on Mac OS and it works correctly fine. After I've created a setup which install my application and other required files. Now I'm searching help for 3 things :

1) How I can customize my application icon and give it a specific icon

2) How to create a desktop shotcut of my application after installation

3) How to add my application to the Dock.

I'm on Mac X 10.4.6, I'm using Xcode 2.0 and I've created the setup with PackageMaker.

Many thanks for your collaboration.

Best regards.

Comments

  • Reply 1 of 7
    Quote:
    Originally Posted by mourad View Post


    Hello everybody, I've ported my Qt 4.3 application on Mac OS and it works correctly fine. After I've created a setup which install my application and other required files. Now I'm searching help for 3 things :

    1) How I can customize my application icon and give it a specific icon

    2) How to create a desktop shotcut of my application after installation

    3) How to add my application to the Dock.

    I'm on Mac X 10.4.6, I'm using Xcode 2.0 and I've created the setup with PackageMaker.

    Many thanks for your collaboration.

    Best regards.



    Aside from creating a custom icon, this is poor form in the OS X context. I would be really annoyed if every shareware program suddenly started installing icons in my dock and on my desktop! Heck, I'm really annoyed when Windows does this. The first thing I do is delete those.



    If the program is useful and important enough to Mac users, we all know very well how to create aliases and add icons to the dock manually, thankyouverymuch.
  • Reply 2 of 7
    lundylundy Posts: 4,466member
    Quote:
    Originally Posted by mourad View Post


    Hello everybody, I've ported my Qt 4.3 application on Mac OS and it works correctly fine. After I've created a setup which install my application and other required files. Now I'm searching help for 3 things :

    1) How I can customize my application icon and give it a specific icon

    2) How to create a desktop shotcut of my application after installation

    3) How to add my application to the Dock.

    I'm on Mac X 10.4.6, I'm using Xcode 2.0 and I've created the setup with PackageMaker.

    Many thanks for your collaboration.

    Best regards.



    Custom icon is made with Icon Composer, in the Utilities folder in the Developer folder.



    The icon file goes in the Resources directory of the app bundle. It should be named with the extension "icns". Then open the "Info.plist" file in Xcode and add the following lines somewhere in the file:

    Code:




    <key>CFBundleIconFile</key>

    <string>Your Icon File Name.icns</string>









    I agree, don't put a desktop alias and don't put anything in the Dock. This drives users nuts.



    In fact, don't use PackageMaker at all if you can avoid it. Just let the user drag-install your bundle to wherever they want. Distribute it as an internet-enabled disk image.



    Put all read-only data files in the app bundle itself. Never write to the app bundle - it is signed and cannot be modified.



    Use the defaults system to store other data in the "com.yourcompany.yourappname.plist" file in ~/Library/Preferences. See Cocoa documentation for NSUserDefaults.



    Put other writeable data files in ~/Library/Application Support.
  • Reply 3 of 7
    mouradmourad Posts: 10member
    Thank for your response, it is really very usefull. For the icon I've done like you sade and it works fine. For the desktop alias and the Dock, I Agree with you, it is for the user to customize them. But For the setup witch I'll make will PakageMaker, I've not udersand very well what you mean. For me I've 4 elements to install : A package containing my application and the Database files, an other package for the Database application and 2 files to copy on a definied location. I'm now trying to create a metapackage witch lets me to choose what I want to install.

    Have you an other idea to do better. Many thanks.

    Best Regards.
  • Reply 4 of 7
    outsideroutsider Posts: 6,008member
    Quite a few applications run a first-run installation the first time they are executed. You can store those files in the bundle.
  • Reply 5 of 7
    mouradmourad Posts: 10member
    Hello everybody, I've just a question, Can I put 2 icon file in the same .plist.

    In fact the plist I'm using is called by 2 applications and I want to attribute to each application its own icon.

    Can anyone tell me how to do.

    Many thanks
  • Reply 6 of 7
    lundylundy Posts: 4,466member
    Quote:
    Originally Posted by mourad View Post


    Thank for your response, it is really very usefull. For the icon I've done like you sade and it works fine. For the desktop alias and the Dock, I Agree with you, it is for the user to customize them. But For the setup witch I'll make will PakageMaker, I've not udersand very well what you mean. For me I've 4 elements to install : A package containing my application and the Database files, an other package for the Database application and 2 files to copy on a definied location. I'm now trying to create a metapackage witch lets me to choose what I want to install.

    Have you an other idea to do better. Many thanks.

    Best Regards.



    OK, in that case you do need the Installer package. Things to remember:



    - The application package (the file/directory ending in ".app") must not contain anything writeable - it is read-only (you can probably get away with it for now, but Apple could forbid writing to an app bundle at any time). So if your .app bundle's "database files" are to be written to, install them in ~/Library/Application Support.



    If some of the items are optional installs, then yes a metapackage is the way to go.



    Xcode 3.x uses a completely new Installer/PackageMaker, which is more flexible, so if you run into difficulties with the old Installer, you might need to take a look at it.
  • Reply 7 of 7
    lundylundy Posts: 4,466member
    Quote:
    Originally Posted by mourad View Post


    Hello everybody, I've just a question, Can I put 2 icon file in the same .plist.

    In fact the plist I'm using is called by 2 applications and I want to attribute to each application its own icon.

    Can anyone tell me how to do.

    Many thanks



    No, there is no need nor ability to do that. In Xcode, just have each application have its own Info.plist file.



    However, if a single application generates data files, you can use Xcode to do a Get Info on your Target and enter different icons for different document types.
Sign In or Register to comment.