Page 1 of 1

Second call to Apply install causes reboot

Posted: Mon Sep 18, 2006 4:43 pm
by uptime
I need to start 2 services. The dependencies are as follows:
service1<-executable<-service2
The executable will populate the database which the second service needs. The first service is to start the db.

I have this:

Code: Select all

 
  [other code to create  folders,install files, extract files etc....]
  Control Service Database:  start on install [wait for completion]
  Apply Install (get result into variable SUCCESS)
  Run Program populateDatabase.exe (WAIT)
  Control Service Service2 start on install [wait for completion]
  Apply Install (get result into variable SUCCESS)


I notice that after the last apply install it forces the Finish dialog to prompt the user to reboot as opposed to the finish checkbox.

I *think* the second call to Apply Install triggers the creating/installing of files again, which might make the windows installer think to reboot since it's overwriting files, but I'm not sure.

Posted: Mon Sep 18, 2006 8:48 pm
by MichaelNesmith
That would certainly be the cause. You may use load order groups to work around this problem. This way, one service will be initialized before another one, in the order you specify.

Posted: Tue Sep 19, 2006 12:00 am
by uptime
Even if I use "Install Service" won't I still need to call Apply Install before it will be started? Also, to install as a service I need to pass some command line arguments, I don't see where I can do that.

Also, I need to run an executable between starts of services.

Posted: Tue Sep 19, 2006 12:38 am
by uptime
I see where I can put in command line arguments :D

Judging by the service groups you can put precedence, however I don't see how you will be able to run an executable between starting the services.

Posted: Tue Sep 19, 2006 3:10 am
by MichaelNesmith
Ah, I see - if you need to run a program in between, there doesn't seem to be another way to do this, really.

Posted: Tue Sep 19, 2006 11:05 am
by uptime
I'm going to force the SUCESS variable to COMLPLETE after the second apply install. Are there any harmful consequences by doing that?

Posted: Tue Sep 19, 2006 2:00 pm
by MichaelNesmith
No harmful side effects whatsoever. That variable just helps you know what the outcome of the installation attempt was. You can even use a different variable in its place in the Apply Changes command - its just an ordinary variable.

Posted: Tue Sep 19, 2006 4:18 pm
by uptime
I noticed though that having a second call to Apply Install will re-copy all my files though. Which now doubles the install time. I know I can set it to not to overwrite if the files exists within Install Files command, however on an upgrade will need to overwrite those files.

Is there any way to install files only once, during multiple calls to Apply Install?

Posted: Tue Sep 19, 2006 6:27 pm
by MichaelNesmith
Nope.

Posted: Tue Sep 19, 2006 9:59 pm
by uptime
hmmmm....ok thanks Michael :D

Posted: Thu Sep 21, 2006 3:51 pm
by uptime
I found a solution. Instead of using "Control Service" which is dependant on Apply install, I'm using windows' Net command to start a service, so Now I do "run program Net Start ServiceName".

Just to let you all know if you need to start a registered service use:
net start ServiceName

To stop:
net stop ServiceName

Now things are working ok.