Ami
Ami

Reputation: 4259

How to start batch file using nsis script?

I have successfully created exe file using NSIS.I have installed my application as windows service using following code:

Exec "$INSTDIR\bin\batch.bat"

I have checked this path

Start Menu -> Control Panel -> Administrative Tools -> Services.

My service name successfully installed. Final step of my installation process start the application using following code:

!define MUI_FINISHPAGE_RUN net start servicename

But this code did not working well.If i select the checkbox it does not start the services.

My scenario is:

Final step of my installation process is, I have one checkbox.If the user select checkbox then the service started immediately.else dont start the service.but both the cases the service must be installed.How to solve this? How to start the service using nsis scrit?

Upvotes: 2

Views: 1240

Answers (1)

Anders
Anders

Reputation: 101569

The correct code would be:

!define MUI_FINISHPAGE_RUN net
!define MUI_FINISHPAGE_RUN_PARAMETERS "start servicename"

or if you want to put the net command in a batch file or otherwise hide the console window, see this answer to one of your old questions...

Upvotes: 1

Related Questions