Re: NotebookDirectory for package (.m) files?
- To: mathgroup at smc.vnet.net
- Subject: [mg110524] Re: NotebookDirectory for package (.m) files?
- From: Hannes Kessler <HannesKessler at hushmail.com>
- Date: Wed, 23 Jun 2010 01:52:47 -0400 (EDT)
- References: <hviao8$h51$1@smc.vnet.net>
On 19 Jun., 13:47, "M.Roellig" <markus.roel... at googlemail.com> wrote: > Hi group, > > i would like to create an application package that included a data > directory that can should be accessable for commands in the > application. Of course I can hard-code the path in my .m file but what > is the proposed way to do this in case I would like to provide the > package to other users which might install the package in a completely > different directory? > > At first I thought that the Workbench should offer some capability of > replacing Workbench$Path variables when the package is deployed to a > folder, but this is not the case. > > I then thought about appending the data directory to the path using > something like > AppendTo[$Path, NotebookDirectory[]<>"/Data"] > in the .m file which fails because a package file is not a notebook or > has never been saved as on. > > Is there any way to derive the installation directory of an > application from within the application? > > Cheers, > > Markus System`Private`$InputFileName is another possibility although it may change in the future: http://groups.google.de/group/comp.soft-sys.math.mathematica/browse_thread/thread/6eeff3e9ed2b51cf/f9507690fde98eec?pli=1 Best regards, Hannes Ke=DFler