Reload environment on runtime
I would like to know if possible to reload the environment on runtime. Imagine the following situation. The application start and this add a path to the system, so How Do I reload the environment again that my application can see the new path?
Thanks for your help
I saw that option but looks only apply if you are running some Qprocess later. But in my case I am running an external app using ShellExecuteEx of windows. I don't know if I can use it, I tried before without success.
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
env.insert("TMPDIR", "C:\MyApp\temp"); // Add an environment variable
env.insert("PATH", env.value("Path") + ";C:\Bin");
I have a button that contain the following code:
qDebug() << env ;
With my app still running I added a new path from System Property ->environment variable.
So I click in the button but my new path doesn't show up, any ideas?
Nope. Unfortunately the only possibility I saw.