I have a service that needs to start when the installer is done. However, the installer needs to modify a file before I can start the service. So I need to install some files, modify one of them, and then start a service.
I tried using "edit INI file" (since the file to modify is a .ini) but we don't use section tags (i.e. [general] or [win32]) so it wouldn't modify the file.
So I'm using the EditFile plugin after ApplyInstall but that means that I can't use ControlService to start the service.
I tried using RunProgram with the command line "NET START IntelliServer" (which works on a normal command line) after EditFile but that isn't starting it either.
So my possible solutions are to include a dummy section tag in the ini file, or do a second ApplyInstall to start the service. I would rather not do the dummy tag since the ini file may turn to XML later. Would a second ApplyInstall ruin the uninstall if it only started the service? Would it be better to do an ApplyInstall for the ini file only, edit the file, then ApplyInstall for everything else (including starting the service)? Am I using RunProgram wrong? It feels like I have a few possible work arounds but not a fix. Is there a better solution that I'm not thinking of?
Modify file, then start service (problem)
I am using Run Program to start a service at the end of the install as well.
The way I did it was after the Apply Install set it up so:
Run Program: $WINSYSDIR$\\net.exe
Hide Program Window: Checked
Command Line: start myservicename
Wait for Program to Finish: Checked
Return Result in Variable: SRVSTART
Then I check to ensure it started. If not, error it to the user and let them manually do it.
Works great. It hasn't errored out to the user yet.
The way I did it was after the Apply Install set it up so:
Run Program: $WINSYSDIR$\\net.exe
Hide Program Window: Checked
Command Line: start myservicename
Wait for Program to Finish: Checked
Return Result in Variable: SRVSTART
Then I check to ensure it started. If not, error it to the user and let them manually do it.
Works great. It hasn't errored out to the user yet.
---
Regards,
Dana Epp
Regards,
Dana Epp
Who is online
Users browsing this forum: No registered users and 99 guests