I understand what you mean. However, the problem I am facing has a more general character: in the version created with pp I have the problem to "link" any sort of file to my executable (for example a SQLite database the app creates the first time it is run). This fails because of the issue with the path. I actually would like the executable to behave like my Terminal script in terms of paths. Just a side note: on Windows I do not have this issue.
| [reply] |
Maybe you should have a configuration file in user's home dir pointing to all your resources, read-only, like icons but also re-writable like the SQLlite file! This solves also the problem of when you want to preserve the contents of the database for the next run. An installer of some sort (can just be a shell script) will also allow you taking care of different users.
Alternatively, create a shell script which will call your perl pp file from within a certain folder which you will know that program resources (ro/rw) are located. You achieve this via a "cd" (change dir) first. Call that script instead of the pp executable from anywhere you like, it will first cd to proper dir. Firefox for example does this: 1) install resources to user dir, 2) install firefox binary and libs in system bindir, 3) create a shell script (mine is /usr/bin/firefox) which finds resources, checks things and then it calls the real firefox binary. However, that "cd" I do not like.
p.s. for joining filenames and paths in different OS, I use the portable File::Spec->catfile.
p.s. 2 in windows I often found that two bugs combined together could result in correct program flow!
| [reply] |
use if $ENV{PAR_PROGNAME}, File::ShareDir::PAR => 'global';
use File::UserConfig;
my $configdir = File::UserConfig->configdir;
...
| [reply] [d/l] |