NotebookDirectory for package (.m) files?
- To: mathgroup at smc.vnet.net
- Subject: [mg110454] NotebookDirectory for package (.m) files?
- From: "M.Roellig" <markus.roellig at googlemail.com>
- Date: Sat, 19 Jun 2010 07:47:31 -0400 (EDT)
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