Hello Sree and welcome to our forums,
A service could be started or stopped by "net start" / "net stop" command line. Your scenario could be implemented by creating a desktop shortcut to a batch file contained by your package. This batch could have a selection menu for the three requested operations : start, stop, reset service
You could use this code for your batch:
Code: Select all
@ECHO OFF
C:
CD\
CLS
:MENU
CLS
ECHO 1. Stop Service
ECHO 2. Start Service
ECHO 3. Restart Service
ECHO PRESS 'x' TO QUIT
ECHO.
SET INPUT=
SET /P INPUT=Please select a number:
IF /I '%INPUT%'=='1' GOTO Selection1
IF /I '%INPUT%'=='2' GOTO Selection2
IF /I '%INPUT%'=='3' GOTO Selection3
IF /I '%INPUT%'=='x' GOTO Quit
CLS
ECHO Please select a number from the Main
echo Menu [1-3] or select 'x' to quit.
ECHO -------------------------------------
ECHO Press any key to continue
PAUSE > NUL
GOTO MENU
:Selection1
net stop "YOUR SERVICE NAME"
pause
:Selection2
net start "YOUR SERVICE NAME"
pause
:Selection3
net stop "YOUR SERVICE NAME"
net start "YOUR SERVICE NAME"
pause
:Quit
CLS
ECHO Press any key to continue
PAUSE>NUL
EXIT
You should add the BAT file as a resource in "Files and Folders" page. Then you should right click on it and go to "New Shortcut To - Installed file". Select Desktop in "Shortcut folder" field. By doing this the install will create the shortcut to your batch.
Best regards,
Sorin