Service Working Directory - Advanced Installer Community
setsune
Posts: 10
Joined: Sat May 25, 2019 4:27 am

Service Working Directory

I am trying to use Advanced Installer to install NATS as a service which uses a config file. This config file has paths to certificates NATS can use, which could be absolute paths or relative paths. The service installation works perfectly fine when I use absolute paths in this config file, however when I use relative paths it fails because the working directory is not set to the path the executable resides in. Is there some way for advanced installer to specify the working directory of a service to be installed? Thanks.
Catalin
Posts: 7852
Joined: Wed Jun 13, 2018 7:49 am

Re: Service Working Directory

Hello,

Unfortunately, we do not have predefined support to set the service's working directory.

However, you could try to use the "Launch EXE with working directory" custom action.

For instance, the behavior from the "Services" page can be replicated by using the system tool sc.exe.

The custom action should be scheduled between the "InstallServices" and "MsiConfigureServices" standard actions, with its execution time being of "When the system is being modified (deferred)".

By default, the above specified standard actions do not show in the "Custom Actions" page --> "Install Execution Stage". In order to show them, please right click on any action group --> "Show Standard Action" --> "Add Resources" --> select "Install Services". Now please repeat this steps for the "MsiConfigureServices" as well.

In order to schedule your custom action between these two, simply drag and drop it accordingly.

Hope this helps.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”