Loading
Problems installing a Windows service
I need to install a Windows service using installutil, but I don't know the best way to do this. When I tried using batch files, I couldn't figure out how to get .bat files to run at certain times; both the install and the uninstall batch files were running at installation. I tried using the "Install NT Services" feature under the "Components" section, but then it wasn't equivalent to running installutil.

 

How should I go about getting the functionality of installutil through InstallShield?

  • When you mentioned InstallUtil, it is .Net way of installing a service via the command line. The Install Shield (IS) IDE is suppose to have all the functionality of InstallUtil. I should also mention that if you need more control and you are using an IS script project, then I would highly recommend using the function call "ServiceAddService".

     

    I hope this helps.
    Expand Post
  • I don't think I need more control, but I when I used "Install NT Services", it did not produce the same result as when I used installutil. The service I am installing interacts with Message Queuing, and installutil correctly reflects this interaction, but using the IDE's installation does not.

     

    I'll try making this into a script project though to see how that works.

     

    EDIT: I made it into a script with "ServiceAddService", and again, it correctly installed the service, but it did not show any changes in Message Queuing. Also, I don't know how to make sure that the service is removed upon uninstallation, but that is a lower priority right now.
    Expand Post
  • There is always the ServiceRemoveService function call, but you won't need to. Any functions used in Install Shield (IS) or used in the IDE will automatically logged and will will be used for the uninstall.
  • I think this might clear up what my problem is a little better:

     

    protected override void OnBeforeInstall(System.Collections.IDictionary savedState)

     

    {

     

    base.OnBeforeInstall(savedState);

     

    File.Create(@"C:\test.txt");

     

    }

     

    I added that to the service's executable that I am trying to install, and only installutil actually makes the text-file. Both "InstallNTServices" and "ServiceAddService" do not create the file, but they register the service in my list of services. What could be wrong?
    Expand Post
  • " TheTraveler wrote:

     

    There is always the ServiceRemoveService function call, but you won't need to. Any functions used in Install Shield (IS) or used in the IDE will automatically logged and will will be used for the uninstall. "

     

    ServiceAddService alone did not remove the service from the list for me upon uninstalling, but maybe that was because it was a Basic MSI project and not an InstallScript project.

     

    I still cannot figure out the problem I described in my last post about why installutil would create the text-file but nothing else will.
    Expand Post

Loading
Problems installing a Windows service