Page MenuHomePhabricator

RunInstalledApp.sh should not step into the install dir
Closed, ResolvedPublic

Description

In BlueBerry, CMake/FunctionCreateBlueBerryApplication.cmake:207 generates a startup script for the application on Unix, based on a template in the MITK source:

CMake/RunInstalledApp.sh

This script steps into the directory where the application is installed, then run it from there.

We had two problems recently with this solution. Many times the install directory is not writeable for the user. In this case if the application crashes, the core file cannot be generated, since it would be written into the working directory. This makes the debugging difficult.

The second problem was that if the user specified an image file on the command line, relative to the directory where he stands, the image won't be opened, since the working directory is changed in the script.

I suggest to remove the 'cd' command and run the application with absolute path. I will send a pull request soon.

Event Timeline

I think your fix makes sense.

Changing into the app dir was done before we added the LD_LIBRARY_PATH variable (in order to resolve the linker dependencies). With LD_LIBRARY_PATH being set, this should not be necessary any more.

New remote branch pushed: bug-16074-run-app-from-current-dir

[e92593]: Merge branch 'bug-16074-run-app-from-current-dir'

Merged commits:

2013-09-15 11:48:56 Miklos Espak [ddc4a7]
Unix start script launches the app from the working dir