Hi all-

I have an app I'm trying to package and everything works great so far except the very last step.  This app has a service that needs to be installed, and the only way provided by the developer is to call the EXE with an argument.  The following arguments are supported:

-RegisterService, -UnregisterService, -StartService, -StopService, -quiet (here's where the problem is).

So, to register and start the service, two commands would be required:

ica.exe -RegisterService followed by ica.exe -StartService.

The -quiet (or -silent) argument can be added to suppress the confirmation message that pops up when the service is registered (or unregistered).  So far so good, except that I can't make it work.  I've tried every CA type in my msi for running a exe, tried evoking a batch file with those commands, tried a vbscript, every combination of syntax I know, and if I include BOTH the -RegisterService AND -quiet I get an error message every time that says "Windows cannot find the file '-RegisterService -quiet' ".

If I use just the single -RegisterService argument, it works just fine, and if I run the command manually with both arguments it works, too.  It's clear that when triggered from within the msi it's not able to process two arguments.  I've found very little information about this online, but I have seen examples of CAs that call exe's with multiple arguments.

Am I missing something obvious here?

I'm not using any packaging suite to work on this, just editing the tables with InstEd It!  If I can't make this work, I'm back to pushing a scripted install via SCCM, which I'd rather not have to do.


Answer Summary:
3 Comments   [ + ] Show Comments


  • Have you tried wrapping the entire command in quotation marks?
  • Yes, in every way imaginable...
  • Have you tried using the ServiceInstall and ServiceControl tables instead?
Please log in to comment



I think you need to use the ServiceInstall table. Here is a good how to:


Answered 11/27/2013 by: tecrumors
Sixth Degree Black Belt

  • Unfortunately I tried that, too. But I'll take another look at it using your link as a reference in case I missed something.
Please log in to comment

Thanks to tecrumors and VBScab who suggested I look again at the ServiceInstall/ServiceControl tables!  I tried those early on but couldn't get them to work.  Basically I didn't get an error but the service just wouldn't install.  Looking again I found the answer.  I used Appdeploy Repackager to capture the files for the install.  It creates a separate component for each file, but doesn't set the KeyPath field.

Turns out in the ServiceInstall table, the foreign key to the component only works if the KeyPath field is set in the Component table.  As soon as I set that field, the service installs and works as expected.

I'm still confused about my original issue (multiple arguments when launching EXE), but obviously this is a more elegant and better solution, so for now I'll be moving on to the other 3 dozen projects I have :-)

Answered 11/27/2013 by: MrH
Orange Belt

Please log in to comment
Answer this question or Comment on this question for clarity