[comp.sys.next] file packages, NXMapFile

brinkley@synapse.biostr.washington.edu (Jim Brinkley) (02/03/90)

I have two questions:
	1. I'd like to create a file package similar to Librarian.app for an application I'm writing, 

so I can include a help file in the package.  I couldn't find any documention on how to
 actually create a file package, so I just made a directory called Myapp.app, and put the
 executable Myapp together with the help file in Myapp.app. That seems to work ok - when
 I double click on Myapp.app the correct application starts up. However,  the icon
 associated with Myapp.app is the generic application icon rather than the custom one I 

associated with Myapp. So what I'd like to know is, 1) how do you get a  custom 

application icon to be associated with the file package,  and 2) is there some other way I'm 

supposed to create file packages?

        2. When I do NXMapFile(filename, NX_WRITEONLY), the routine fails (ie can't open 

filename) unless it already exists. So  I have to create an empty file with standard Unix 

commands first, after which the routine works. This doesn't seem to be the behaviour you'd
 want - so is this a bug or a feature, or am I doing something wrong?

Thanks
Jim Brinkley
Dept. Biological Structure
University of Washington

aozer@next.com (Ali Ozer) (02/09/90)

In article <1219@shelby.Stanford.EDU> Jim Brinkley writes:
>I'd like to create a file package similar to Librarian.app for an
>application I'm writing, so I can include a help file in the package.
>I couldn't find any documention on how to actually create a file
>package, so I just made a directory called Myapp.app, and put the
>executable Myapp together with the help file in Myapp.app. That seems
>to work ok - when I double click on Myapp.app the correct application
>starts up. However, the icon associated with Myapp.app is the generic
>application icon rather than the custom one I associated with Myapp.
>So what I'd like to know is, 1) how do you get a custom application
>icon to be associated with the file package, and 2) is there some
>other way I'm supposed to create file packages?

What you need to do is specify that files named MyApp.app have the same icon
as the executable named MyApp.  To do this, you need to perform a little 
surgery on your IB-generated iconheader file --- add the following line:

F	MyApp.app	MyApp	app

Note that the fields are separated by tabs.

Unfortunately IB doesn't help you too much with packaged apps, so you should
do some work on your Makefile.postamble; maybe by defining an "install::" rule
that creates the .app directory and moves the executable into it.  You also
need to make sure your custom .iconheader file isn't blown away everytime you
edit your project.

Ali (Ali_Ozer@NeXT.com)

rogerj@batcomputer.tn.cornell.edu (Roger Jagoda) (02/13/90)

In article <109@next.com> Ali_Ozer@NeXT.com (Ali Ozer) writes:
>In article <1219@shelby.Stanford.EDU> Jim Brinkley writes:
>>So what I'd like to know is, 1) how do you get a custom application
>>icon to be associated with the file package, and 2) is there some
>>other way I'm supposed to create file packages?
>
>What you need to do is specify that files named MyApp.app have the same icon
>as the executable named MyApp.  To do this, you need to perform a little 
>surgery on your IB-generated iconheader file --- add the following line:
>
>F	MyApp.app	MyApp	app
>
>Note that the fields are separated by tabs.
>
>Unfortunately IB doesn't help you too much with packaged apps, so you should
>do some work on your Makefile.postamble; maybe by defining an "install::" rule
>that creates the .app directory and moves the executable into it.  You also
>need to make sure your custom .iconheader file isn't blown away everytime you
>edit your project.
 
Ali, thanks. Now, a follow-up to that question is that we'd like to add
a certain body of texts to the DL. How do we change the icon so that under
the DL, there's something other than just the directory folder of the
text (i.e. the standard NeXTStep dir folder if OK, but....)
 
Secondly, what tell NeXTStep what icon to put on a file. For example, I can
change the file MyFile.xyz (which would have a normal NeXTStep "text paper"
icon) to MyFile.ps where it would have the Preview PostScript icon. What we're
after is a way to make compressed binaries (MyFile.Z) have a different
icon for our professors to notice instead of having to check the full
path name which sometimes isn't viewable in total in the Browser. This way,
someone could double-click our magic "Z" icon and uncompress would fire up
to unpack the file. Well, is this possible or are we just asking for too much.
 
Thanks in advance!
 
--Roger Jagoda
--Cornell University
--FQOJ@CORNELLA.CIT.CORNELL.EDU