
agd135311.5524940749575366E12 asked a question.
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?
I hope this helps.
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.
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?
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.