Modify file, then start service (problem)

Got a problem you cannot solve? Try here.
Guest

Modify file, then start service (problem)

Postby Guest » Tue Nov 22, 2005 11:19 am

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?

Dana Epp
Posts: 29
Joined: Wed Dec 01, 2004 2:27 pm

Postby Dana Epp » Tue Nov 22, 2005 2:30 pm

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.
---
Regards,
Dana Epp

Guest

Postby Guest » Tue Nov 22, 2005 2:54 pm

Sweet. :D I figured that the command line text box was if you wanted to run something from the command line. I didn't have anything in the Run Program text box. Thanks.

Suggestion to InstallAware: Change that label from "Command Line" to "Command Line Arguments" so us morons don't get confused. :wink:

sinan
Site Admin
Posts: 1020
Joined: Sat Nov 13, 2004 8:12 am
Contact:

Postby sinan » Tue Nov 22, 2005 3:26 pm

Sorry for the confusion :) v5 will have the text updated.


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 48 guests