PDA

View Full Version : Installing and Starting a Service



NewsArchive
08-23-2010, 01:03 AM
Friedrich

In my Script I have

Run Command Line
%SB_INSTALLDIR%\gpptserve.exe /iss !ISS Install and Start Service

Wait = true
Show Window = False

Which is how the time server is started with nettalk.

Tried it on my dev machine, but the service did not get installed and
running - Vista Maybe?
--

Dan Scott
C55 C6.3 C7.1 LEGACY
www.garagepartner.com

King of questions for Clarion Third Party

Plan A is always more effective when the device you are working on
understands that Plan B involves a larger hammer

NewsArchive
08-23-2010, 01:04 AM
Hi Dan,

> In my Script I have
>
> Run Command Line
> %SB_INSTALLDIR%\gpptserve.exe /iss !ISS Install and Start Service
>
> Wait = true
> Show Window = False
>
> Which is how the time server is started with nettalk.
>
> Tried it on my dev machine, but the service did not get installed and
> running - Vista Maybe?

I would suggest to check the error code (%_SB_ERRORCODE%) to see if it
returns a code -- this should provide more information. BTW, "Run Command
Line" is a wrapper around the "CreateProcess" Windows API.

Isn't it possible to use "Edit Service (Start Service)" to start the
service?

Friedrich

NewsArchive
08-24-2010, 12:42 AM
Friedrich

Tried Start Service Using

Display Message Box "Create and start Timer service now." -- "Start
Service"
Start Service "%SB_INSTALLDIR%\gpptserv.exe /iss" ! Tried without
/iss also
If %_SB_ERRORCODE% Does Not Equal "0" Then
Display Message Box "Error code %_SB_ERRORCODE%" -- "Service did not
start"
Else
Display Message Box "Error code %_SB_ERRORCODE%" -- "Service did
supposedly started"
End

Returns 0 %_SB_ERRORCODE% , but service is not started.
I can start it manually from the cmd line.

Dan

--

Dan Scott
C55 C6.3 C7.1 LEGACY
www.garagepartner.com

King of questions for Clarion Third Party

Plan A is always more effective when the device you are working on
understands that Plan B involves a larger hammer

NewsArchive
08-24-2010, 12:42 AM
Dan,

I would suggest to check this with CapeSoft. Perhaps they know why the
CreateProcess Windows API does not start their service.

As an alternative, you can try the "Run Program..." function with the "Use
ShellExecuteEx" option enabled. This will then use ShellExecuteEx Windows
API instead of CreateProcess.

BTW, please note that your own CMD line (the "DOS Box") runs non-elevated --
but your installer runs elevated (by default). So perhaps your service
can't be started from an elevated running application? If this is the case,
use "Run Program..." with the "Launch non-elevated under UAC" option
enabled.

Hope this helps.

--
Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

SetupBuilder is Windows 7 installation -- "point. click. ship"

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
08-24-2010, 12:43 AM
Thanks Friedrich

Dan

--

Dan Scott
C55 C6.3 C7.1 LEGACY
www.garagepartner.com

King of questions for Clarion Third Party

Plan A is always more effective when the device you are working on
understands that Plan B involves a larger hammer

NewsArchive
08-24-2010, 12:44 AM
Dan,

In SB did you do a "Create Service" before "Start Service"?

--
Lee White

RPM Report Viewer.: http://www.cwaddons.com/products/rpm/
RPM Review........: http://www.clarionmag.com/cmag/v11/v11n06rpm.html
Report Faxing.....: http://www.cwaddons.com/products/afe/
---Enroll Today---: http://CWaddons.com

Enhanced Reporting: http://www.cpcs-inc.com

NewsArchive
08-24-2010, 12:45 AM
Lee

Never saw create Service <g>

Tried it now and it does not create or start the service

I am asking Capesoft if there is a problem using create and start in SB

Thanks

--

Dan Scott
C55 C6.3 C7.1 LEGACY
www.garagepartner.com

King of questions for Clarion Third Party

Plan A is always more effective when the device you are working on
understands that Plan B involves a larger hammer

NewsArchive
08-24-2010, 12:46 AM
Dan,

> Tried it now and it does not create or start the service

Make sure you're using the correct "Service Name:" for all three
locations as shown on the attached image.

If you can register the service from a command prompt then open the
services list and verify the Service name to use within SB.

I fought with this before but once I figured out the correct Service
Name it all fell into place.

--
Lee White

RPM Report Viewer.: http://www.cwaddons.com/products/rpm/
RPM Review........: http://www.clarionmag.com/cmag/v11/v11n06rpm.html
Report Faxing.....: http://www.cwaddons.com/products/afe/
---Enroll Today---: http://CWaddons.com

Enhanced Reporting: http://www.cpcs-inc.com

NewsArchive
08-24-2010, 12:47 AM
Thanks Lee

That is a little different than what I have been doing, hard coding
service name.

Service Name: gpptserv.exe
Display Name: gptimeserver
Exec Path: %_SB_INSTALLDIR%

Do I need to put the Service Name to a Variable?

Dan

--

Dan Scott
C55 C6.3 C7.1 LEGACY
www.garagepartner.com

King of questions for Clarion Third Party

Plan A is always more effective when the device you are working on
understands that Plan B involves a larger hammer

NewsArchive
08-24-2010, 12:47 AM
Dan,

> Service Name: gpptserv.exe
> Display Name: gptimeserver
> Exec Path: %_SB_INSTALLDIR%

Don't confuse Service Name with Display Name. That's what got me in
trouble.

You said you could register this manually. If you can do so and then
look at the "Service Name" from the service properties dialog.

The top piece of that image I sent was from this service properties
dialog. If you look at it you'll notice the service name is
"FaxManService" and that's what's in the %SERVICENAME% variable for
the other SetupBuilder dialogs.

%SERVICE_FILEPATH% contains "%CURDIR%\faxman4.exe" in my install.
Notice the EXE name is not the Service Name.

The Display Name is the text, which can have spaces, that is displayed
in the list of services.


> Do I need to put the Service Name to a Variable?

Not necessary. I had other uses for it so I did.

--
Lee White

RPM Report Viewer.: http://www.cwaddons.com/products/rpm/
RPM Review........: http://www.clarionmag.com/cmag/v11/v11n06rpm.html
Report Faxing.....: http://www.cwaddons.com/products/afe/
---Enroll Today---: http://CWaddons.com

Enhanced Reporting: http://www.cpcs-inc.com

NewsArchive
08-24-2010, 12:48 AM
Ah, maybe that is the key

Thanks Lee

Dan

--

Dan Scott
C55 C6.3 C7.1 LEGACY
www.garagepartner.com

King of questions for Clarion Third Party

Plan A is always more effective when the device you are working on
understands that Plan B involves a larger hammer

NewsArchive
08-24-2010, 12:49 AM
>
> Thanks Friedrich
>

Just for fun, please try the following:

1. In Windows Vista (or "7", etc), in the "Start Search" field enter cmd
2. This will find cmd.exe
3. Right-click the cmd.exe item and select "Run as administrator"
4. This will start your CMD elevated.
5. Try to start your gpptserv.exe service -- does this work?

Friedrich

NewsArchive
08-24-2010, 12:50 AM
Friedrich

Yes, this allows service to be installed - started and also removed.
So does running it normally

Dan

--

Dan Scott
C55 C6.3 C7.1 LEGACY
www.garagepartner.com

King of questions for Clarion Third Party

Plan A is always more effective when the device you are working on
understands that Plan B involves a larger hammer

NewsArchive
08-24-2010, 12:50 AM
Dan,

> Yes, this allows service to be installed - started and also removed.
> So does running it normally

Okay. Then I would suggest to try the "Run Program..." script function with
ShellExecuteEx enabled. Perhaps the CapeSoft service does not like to be
launched via CreateProcess.

BTW, also make sure you do not run your install in TEST mode. The test mode
installer does not execute external programs.

Friedrich

NewsArchive
08-24-2010, 12:51 AM
Thanks Friedrich

I have an email to Capesoft to see if there is an problem using create
and start service

I will pull back until I get an answer

Dan

--

Dan Scott
C55 C6.3 C7.1 LEGACY
www.garagepartner.com

King of questions for Clarion Third Party

Plan A is always more effective when the device you are working on
understands that Plan B involves a larger hammer

NewsArchive
08-24-2010, 12:51 AM
Are you testing for errors?

Jeff Slarve

NewsArchive
08-24-2010, 12:52 AM
Yes, the latest attempt reported no errors, but the service did not start.
Previously I was receiving -1 errors
Dan

--

Dan Scott
C55 C6.3 C7.1 LEGACY
www.garagepartner.com

King of questions for Clarion Third Party

Plan A is always more effective when the device you are working on
understands that Plan B involves a larger hammer

NewsArchive
08-24-2010, 12:52 AM
Are you redirecting MESSAGE(), STOP(), etc via PROP:MessageHook, etc ?

Maybe your service app is tanking because it's waiting for someone to
click "ok" or whatever. Are all of the necessary dlls available to the
service?

Jeff Slarve

NewsArchive
08-24-2010, 12:53 AM
Jeff

No messages or buttons - all dll's are in place.

Dan

--

Dan Scott
C55 C6.3 C7.1 LEGACY
www.garagepartner.com

King of questions for Clarion Third Party

Plan A is always more effective when the device you are working on
understands that Plan B involves a larger hammer

NewsArchive
08-24-2010, 12:54 AM
I don't think you understood the question.

Look at these User Tips, in particular #3:
http://www.capesoft.com/docs/SelfService/selfservice.htm#UserTips


Jeff Slarve

NewsArchive
08-24-2010, 12:55 AM
Jeff

I have no management app. The app doesn't interact with the end user.
I just have a service that runs without any user interaction.

Is that what you meant?

Dan

--

Dan Scott
C55 C6.3 C7.1 LEGACY
www.garagepartner.com

King of questions for Clarion Third Party

Plan A is always more effective when the device you are working on
understands that Plan B involves a larger hammer

NewsArchive
08-24-2010, 12:55 AM
No

Jeff Slarve

NewsArchive
08-24-2010, 12:56 AM
Hi Dan,

> Yes, the latest attempt reported no errors, but the service did not start.
> Previously I was receiving -1 errors

BTW, the return value "0" (no errors) only means that the CreateProcess or
ShellExecuteEx successfully launched the gpptserv.exe application. So I
assume that "something" is going wrong in gpptserv.exe itself (and it does
not return an error code back to the calling application).

Friedrich

NewsArchive
08-25-2010, 01:09 AM
Friedrich

Ok, that is where I stand now.
I stopped the service manually from the commandline
Then I tried starting the service via SB. No errorcodes, but service
still shows stopped.

Dan

--

Dan Scott
C55 C6.3 C7.1 LEGACY
www.garagepartner.com

King of questions for Clarion Third Party

Plan A is always more effective when the device you are working on
understands that Plan B involves a larger hammer

NewsArchive
08-25-2010, 01:09 AM
Dan,

> Ok, that is where I stand now.
> I stopped the service manually from the commandline
> Then I tried starting the service via SB. No errorcodes, but service still
> shows stopped.

That means the CreateProcess or ShellExecuteEx (whatever you used) executed
the service without any problem (otherwise, you would have received an error
code, e.g. -1 for "file not found"). But the service did not start
"itself".

Friedrich

NewsArchive
08-25-2010, 01:10 AM
BTW, as I understand it, the "Edit Service..." function (which makes use of
native Windows service APIs to install, start, stop, resume, etc.) does also
not work for you. So I think there is a problem with your service
application.

Friedrich

NewsArchive
08-25-2010, 01:10 AM
Which gets back to my suggestion of reading that nettalk page.

Jeff Slarve

NewsArchive
08-25-2010, 01:11 AM
errr SelfService.

Jeff Slarve

NewsArchive
08-25-2010, 01:11 AM
>
> Which gets back to my suggestion of reading that nettalk page.
>

Yes! :)

Friedrich

NewsArchive
08-25-2010, 01:12 AM
Re Reading it again

Dan

--

Dan Scott
C55 C6.3 C7.1 LEGACY
www.garagepartner.com

King of questions for Clarion Third Party

Plan A is always more effective when the device you are working on
understands that Plan B involves a larger hammer

NewsArchive
08-26-2010, 12:53 AM
>
> Re Reading it again
>

Just curious, any news on this?

Friedrich

--
Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

SetupBuilder is Windows 7 installation -- "point. click. ship"

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
08-26-2010, 12:56 AM
Friedrich

I haven't heard anything from capesoft and I am getting discouraged.
May have to go another route and not have a service at all. vuFileTools
has a function to return
the server time without using a service at all.
Why isn't everything easy <g>
Thanks
Dan

--

Dan Scott
C55 C6.3 C7.1 LEGACY
www.garagepartner.com

King of questions for Clarion Third Party

Plan A is always more effective when the device you are working on
understands that Plan B involves a larger hammer

NewsArchive
08-26-2010, 12:56 AM
> I haven't heard anything from capesoft and I am getting discouraged.
> May have to go another route and not have a service at all. vuFileTools
> has a function to return the server time without using a service at
> all.
> Why isn't everything easy <g>

I have no idea <bg>

Please keep us posted.

Friedrich

NewsArchive
08-26-2010, 12:57 AM
> Why isn't everything easy <g>
> Thanks
> Dan

Because then some of us would have to get real jobs.

And I'd HATE that!

jf

NewsArchive
08-26-2010, 12:58 AM
Brother I've been trying to get a service to work using [Capesoft] SelfService
and Replicate for about a month now with no success. I feel your pain! I
don't know if it has something to do with [Capesoft] SelfService, Replicate,
or Windows 7 Home Premium. In my case, the service will start but
the "process" (really the EXE running in the background) does not run. I
have given every permission on my machine to every directory, EXE, etc.,
that I can. No dice.

Good luck with your. I hope you get it going.

Don

NewsArchive
08-27-2010, 01:49 AM
Don

I gave up and used vuFileTools vuServerTime()

Dan

--

Dan Scott
C55 C6.3 C7.1 LEGACY
www.garagepartner.com

King of questions for Clarion Third Party

Plan A is always more effective when the device you are working on
understands that Plan B involves a larger hammer