dat.tran
Posts: 5
Joined: Tue Oct 25, 2022 10:12 am

Service Install and Run

Tue Oct 25, 2022 10:20 am

Hi everyone,

I just purchased a license and started to use Advanced Installer to create a MSI installer. While the installation process, I wanted to installed a service to run a .exe application. Therefore, I filled up the Services section as in the attachment.

However, the service can not run. I think, it is because of the service argument. My application has to be executed with the following command:

For example:
app.exe -c .\app.ini -v

With which format should I fill up the Argument section?

Thank you a lot for your help!
Attachments
advanced_installer_support.PNG
advanced_installer_support.PNG (19.24KiB)Viewed 3760 times

Catalin
Posts: 6542
Joined: Wed Jun 13, 2018 7:49 am

Re: Service Install and Run

Tue Oct 25, 2022 1:39 pm

Hello and welcome to our forums,

Please note I have already answered your email.

If possible, please try avoiding duplicate threads (i.e. posting on forum and emailing our support address as well) as that can lead to multiple team members working on the same ticket.

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

dat.tran
Posts: 5
Joined: Tue Oct 25, 2022 10:12 am

Re: Service Install and Run

Thu Oct 27, 2022 10:47 am

Hi Catalin,

Thank for your fast reponse :)

Sorry for the confusion. Let me put it another way.

I have 1 exe file (myapp.exe) and 1 configuration file (myapp.ini). They are both located at C:\Program Files\myorginization\myapp\bin\

To get my application running, I usually do the following step:
- open Windows Powershell
- go to the right directory with command cd 'C:\Program Files\myorginization\myapp\bin\'
- finally, run it by passing some arguments : .\myapp.exe -c .\myapp.ini -v

However, It would be more convenient to automate those above steps with a Window Service to run myapp.exe whenever the system boots up. AdvancedInstaller has a very nice feature to allow user to create a service. I'm working on it right now but still not sucessful yet. After sucessful installation, I tried to start the service and windows service always throws me an error:

Error 1053: The service did not respond to the start or control request in a timely fashion

So, I came to a conclusion that the problem is because of the syntax for passing argument, which I'm entering to AdvancedInstaller, is not correct. Could you please check it for me (I attached an Image to show you how I filled up the form in AdvancedInstaller)

Best
Dat
Attachments
AI_service_support2.PNG
AI_service_support2.PNG (22.54KiB)Viewed 3742 times
AI_service_support1.PNG
AI_service_support1.PNG (28.87KiB)Viewed 3742 times

Catalin
Posts: 6542
Joined: Wed Jun 13, 2018 7:49 am

Re: Service Install and Run

Thu Oct 27, 2022 12:44 pm

Hello Dat,

Thank you for your followup on this, as I now understand your scenario better.

I see you are trying to create a service for your executable so it is always run when the user starts his machine.

This is indeed a correct approach for your need. However, please note that not all the EXEs can be run as services.

In order for an EXE to be run as a service, you will need to configure it accordingly. It has to implement the interface that the Windows service manager expects. For instance, your executable should know how to respond to the "Start"/"Stop" commands received by the Service Manager.

A solution that is very similar to what you want to achieve and that does not require any code modifications would be using the Windows Task Scheduler.

Basically, you can create a scheduled task that will run your executable at each user logon, with the required parameters.

Advanced Installer offers predefined support for this, in the Enterprise suite, through the "Scheduled Tasks Page".

So, in your case, we have two approaches:

- either configure your executable so it can run as a service

- create a scheduled task that basically does the same

Hope this helps!

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

dat.tran
Posts: 5
Joined: Tue Oct 25, 2022 10:12 am

Re: Service Install and Run

Wed Nov 02, 2022 10:26 am

Hi Catalin,

Thank you a lot for your support. Let me follow the approaches that you suggested. I believe that this problem will be solved soon :)

Kindly Regards,
Dat

Catalin
Posts: 6542
Joined: Wed Jun 13, 2018 7:49 am

Re: Service Install and Run

Thu Nov 03, 2022 3:54 pm

You are always welcome, Dat! :)

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

Return to “Common Problems”