views:

655

answers:

3

I have two questions about Package Maker on Leopard. I installed Xcode 3.1.4. I exported my Java app out of Eclipse into an app bundle and made an installation program for it. I know little about Macs so I am going off of random sites right now on how to use this tool.

1) Is there a way using Package Maker or alter the "Info.plist" to register a specific file extension to your app by default when it is installed? Right now it gives the "There is no default application specified to open this document".

2) Where is the program installed to by default on the HD? I tried installing with the setting "User selected Volume" as well as "User home directory" and I cannot find my application anywhere.

The program said installed successfully but nothing is in the "/Applications" directory or the "/Users/Username/" directory. I see the BOM in the "/Library/Reciepts/boms/" directory but there is no app folder with the app bundle.

UPDATE: This question is completed. Part 1 I posted my answer to below, and part 2 was answered by Nate.

+1  A: 

Maybe this thread can help regarding issue 2:

http://lists.apple.com/archives/installer-dev/2009/Sep/msg00036.html

Nate
Thanks a lot. This does solve part 2 of my question.
Ken
A: 

Here is the answer to part 1 of my post above, and Part 2 was solved with the link from Nate in the other answer.

To solve part one I altered the info.plist file of the application bundle. I only included the relevant parts of the plist file, and my specific file types were archive file (made up extensions). Both keys were needed for it to register the types.

<key>CFBundleDocumentTypes</key>
        <array>
            <dict>
                 <key>CFBundleTypeExtensions</key>
                 <array>
                        <!-- Enter as "txt" for example, not ".txt" -->
                    <string>yourExtension1</string>
               <string>yourExtension2</string>
                 </array>
                 <key>CFBundleTypeName</key>
                 <string>YourType document</string>
                 <key>CFBundleTypeRole</key>
                 <string>Viewer</string>

      <!-- The LSItemContentTypes key is ignored in Mac OS X v10.4 because it’s introduced in 10.5. -->
                 <key>LSItemContentTypes</key>
                 <array>
                     <string>public.archive</string>
               <string>public.data</string>
               <string>public.content</string>
                 </array>

                 <!-- The NSExportableTypes key is ignored in Mac OS X 10.4 -->
                 <key>NSExportableTypes</key>
                 <array>
                     <string>public.archive</string>
               <string>public.data</string>
               <string>public.content</string>
                 </array>

      <!-- The LSHandlerRank key is ignored in Mac OS X 10.4 -->
      <key>LSHandlerRank</key>
      <string>Owner</string>
            </dict>
         </array>

<key>UTExportedTypeDeclarations</key>
    <array>

     <dict>
      <key>UTTypeIdentifier</key>
      <string>public.archive</string>
      <key>UTTypeReferenceURL</key>
      <string>http://www.yourSite.com&lt;/string&gt;
      <key>UTTypeDescription</key>
      <string>yourType Document</string>
      <key>UTTypeConformsTo</key>
      <array>
       <string>public.content</string>
       <string>public.data</string>
       <string>public.archive</string>
      </array>
      <key>UTTypeTagSpecification</key>
      <dict>
       <key>com.apple.ostype</key>
       <string>public.archive</string>
       <key>public.filename-extension</key>
       <array>
        <string>yourExtension1</string>
        <string>yourExtension2</string>
       </array>
      </dict>
     </dict>
    </array>
Ken
A: 

Also see my question for a bit more documentation and elaboration:

http://stackoverflow.com/questions/1575190/double-click-document-file-in-mac-os-x-to-open-java-application

I've also been using Spotlight to find and remove all old versions of my program for a cleaner testing environment.

steve