Detect location of the base directory correctly if it is service installation
Set file permissions correctly to files for the service