Friends, I'm writing a script which does a lot of stuff - install my application + other opensource software, set up s/w as service, execute batch files to do some stuff etc.
- I set some environment variables at the start. They of course do not take effect till the Inno script finishes execution (i.e the installation finishes).
- The environment variables are needed to install a service.
- The commands to install, configure and start the service are in a batch file which I need to execute after installation is complete. I need to execute this batch file just once.
How do I execute this batch file after installation is complete, using Inno? It can be immediately after user finishes the install process or run once at system restart. Is it achievable through Inno script?
Or is there a way for my environment variables to take effect so that my batch file can run ?
I know there are installation programs that do part of installation after user has finished install process and system has restarted. Does Inno support that kind of functionality?
I'm not sure if CurStepChanged
+ ssPostInstall
method will work here as it will essentially be the same environment that Inno began with and my variables are not yet in effect.
If this cannot be achieved through Inno script, I will place the batch file at system startup - in that case I will need to check if the service is already installed/running and take appropriate action. But that would be crude.
Please help with any pointers/suggestions.
Thanks.
SetEnvironmentVariable
function to set it for setup process (processes created from it will inherit that). – TLama