currently i have a deb installer, built with Cmake->Cpack, that runs a postinst script, which calls another script to in /etc/profile.d that sets a few environmental variables to allow our application to run.
the issue is after installing, it requires the user to reboot/logout-login their system to run the application (whether from the terminal or Applications page).
i'd like it so that it isn't necessary to reboot/logout-login their current session after an initial install and that from the current instance, be able to launch their application
postinst script in my Cpack/Cmake project
#!/bin/bash
source /etc/profile.d/configset.sh
desktop-file-install /usr/share/applications/myApp.desktop
udevadm control --reload-rules && udevadm trigger
configset.sh script
#!/bin/sh
MYAPP_BIN_PATH="/opt/myApp/bin"
MYAPP_LIB_PATH="/opt/myApp/lib"
MYAPP_DIR="/opt/myApp"
export PATH="$PATH":${MYAPP_BIN_PATH}
export MYAPP_DIR
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH":${MYAPP_LIB_PATH}
The issue here is that after installing the application, several shared libraries that contain dependencies that need to be met (hence the need to reboot/logout-login the computer to run the configset.sh script to link the deps)
Is there a way to get the configset.sh script to run across the system without a reboot after a deb install?
I am aware that running source /etc/profile.d/configset.sh
from the current bash terminal instance and then launching the application from there is one way, but this isn't a feasible solution for a user that just wants to install the .deb and immediately launch it from Ubuntu's Applications page.
So not only do I want my environmental variables to be set immediately, system wide, on the post deb install, but also have it persist after reboot.
I would like to keep my solution contained within the following toolset : CMake, CPack, shell and bash scripts. No python.