Re: TCL Paths in Apple bundles
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.tcl archive

Re: TCL Paths in Apple bundles

From: SM Ryan <wyrmwif@tango-sierra-oscar-foxtrot-tango.fake.org>
Date: Mon Feb 27 2006 - 03:53:04 CET

"Brett the James" <djSmell@gmail.com> wrote:
# Hi, I was wondering if anyone knew how to pull a path out of an apple
# bundle.
#
# I've packaged a program in an apple bundle (which is really just a
# file) and I'm letting people start it via the user interface. The
# trouble is, there are dependent files, both other tcl files and files
# that require processing. I access these files both through TCL commands
# and exec commands, like CP and such. The trouble is, once the program
# starts, it's not sensitive to the starting path.

My wish apps tend to look something like

Contents
        Info.plist
        MacOS
                Wish
        PkgInfo
        Resources
                application.icns
                bin
                        ...
                lib
                        pkgIndex.tcl
                        plugh.tcl
                        plover.dylib
                        ...
                Scripts
                        AppMain.tcl
                        xapplication
                Wish.rsrc
                ...
        SharedFrameworks
                Tcl.framework
                Tk.framework

AppMain.tcl is
        set Contents [file dir [file dir [lindex $tcl_libPath 0]]]
        append env(PATH) :$Contents/Resources/bin
        set auto_path [concat [list $Contents/Resources/lib] $auto_path]
        source $Contents/Resources/Scripts/xapplication

and the xapplication begins with
        #!/usr/bin/wish
        ...
        x-windows and aqua application script
        ...

--
SM Ryan http://www.rawbw.com/~wyrmwif/
This is one wacky game show.
Received on Sun Apr 30 02:16:29 2006