[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference decwet::windows-nt

Title:Windows NT
Notice:See note 15.0 for HCL location
Moderator:TARKIN::LIN.com::FOLEY
Created:Thu Oct 31 1991
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:6086
Total number of notes:31449

5631.0. "How to start a service non-interactively" by CRONIC::LEMONS (And we thank you for your support.) Mon Feb 03 1997 12:24

    Hi
    
    I'm trying to build an InstallShield installation kit for a product
    that does create its own service, but doesn't start it.  How can I
    start the service, other than having a human drive Control Panel ->
    Service to do it?
    
    Thanks!
    tl
T.RTitleUserPersonal
Name
DateLines
5631.1Net command may workCANDOO::GRIEBMon Feb 03 1997 12:554
system("net start service_name"); ?????


5631.2REGENT::N2ITIV::LEEAndy Lee (Park facing out)Mon Feb 03 1997 14:198
Check out OpenService() and StartService()




-Andy

5631.38153::tecotoo.mro.dec.com::mayerDanny MayerMon Feb 03 1997 14:246
> Check out OpenService() and StartService()

	Under the current version of InstallShield, you'd have to write a DLL
  to make these calls to do this.  Not hard, just a pain.

	Danny
5631.4CRONIC::LEMONSAnd we thank you for your support.Mon Feb 03 1997 14:356
    Hmm.  I only have InstallShield SDK and the time-bombed version of
    InstallShield Express available.  Can I write a DLL using either one of
    these?
    
    Thanks!
    tl
5631.58153::tecotoo.mro.dec.com::mayerDanny MayerMon Feb 03 1997 15:479
>    Hmm.  I only have InstallShield SDK and the time-bombed version of
>    InstallShield Express available.  Can I write a DLL using either one of
>    these?

	I can't answer that.  What does the SDK Documentation say?  I have the
  full professional version and it's documented how to do it.  The SDK version
  may not allow you to do that.

		Danny
5631.6InstallShield CallDLLFx() is in SDK versCOOKIE::KELLERMon Feb 03 1997 17:0019
    Having just done this, I can state that it is possible to call a DLL from
    the InstallShield SDK version to start a Windows NT service. Some
    things to watch:
    
    	Make sure your DLL functions are declared as required by
    	InstallShield SDK version.
    
    	Verify they are correctly exported in the DLL, use NT explorer 'quick
       	view' function to check the exports.  Also, make sure the DLL name
    	is in upcase (I ended up needing a linker DEF file to force correct
    	attributes)
    
    If the DLL is not setup correctly, you will just get a -1 back from
    InstallShield CallDLLFx() with no other info.
    
    Feel free to send me mail and I can send you some code if needed, good
    luck.	
    	Greg
                                                                          
5631.7CRONIC::LEMONSAnd we thank you for your support.Mon Feb 03 1997 22:0416
    Hi
    
    Thanks, all, for this dialogue.  It's very helpful.
    
    Please talk down to me; I'm not a C++ programmer.  In another life, I
    was COBOL programmer, so doing this task may be beyond what I should be
    attempting.
    
    That said, how do I create a DLL?  Do I need to create some C++ code to
    do this?  Thanks to those who poasted the calls, I've sorta got any
    idea of the Win32 API machinery I need.  But I don't know how to create
    the DLL that will include it.
    
    Thanks, again, for any help!
    
    tl
5631.88153::tecotoo.mro.dec.com::mayerDanny MayerTue Feb 04 1997 09:0823
>    Hi
>    
>    Thanks, all, for this dialogue.  It's very helpful.
>    
>    Please talk down to me; I'm not a C++ programmer.  In another life, I
>    was COBOL programmer, so doing this task may be beyond what I should be
>    attempting.
>    
>    That said, how do I create a DLL?  Do I need to create some C++ code to
>    do this?  Thanks to those who poasted the calls, I've sorta got any
>    idea of the Win32 API machinery I need.  But I don't know how to create
>    the DLL that will include it.
>    
>    Thanks, again, for any help!
>    
>    tl

	I don't think anyone needs to talk down to you.  I do think someone
  should provide you with the C++ code to make this happen along with the
  file to make this a DLL.  Maybe someone can post this.  It's a useful
  set of functions to have around for installations.

		Danny
5631.9CRONIC::LEMONSAnd we thank you for your support.Tue Feb 04 1997 12:2214
    Actually, thanks to Danny's help, I know now that a NT service can be
    started with the command:
    
    		NET START servicename
    
    So, rather than seek a DLL that specifically works with a service, I
    now would like to find a generic DLL that would take a command (like
    NET START servicename), execute it, wait until it was done (maybe this
    could be a option) and return a status code.
    
    Does this exist?
    
    Thanks!
    tl