Passing a parameter to the installer via installutil

I am trying to write a power shell script to install a service, but this service requires an additional command line transmitter. I am having trouble getting this.

Here is a service installer that uses the parameter;

this.serviceInstaller.ServiceName = string.Format("My brill service {0}",this.Context.Parameters["environment"]) 

And I tried passing paramiter in two ways:

 C:\Windows\Microsoft.NET\Framework64\v4.0.30319\InstallUtil.exe "C:\foo\bar.exe /environment:tomtest" 

(this gives an error "invalid directory on URL")

 C:\Windows\Microsoft.NET\Framework64\v4.0.30319\InstallUtil.exe /environment:tomtest "C:\foo\bar.exe" 

(this just adds the service name)

Any ideas? Thanks

+7
source share
1 answer

I was very close, he was not equal :. Those.;

 C:\Windows\Microsoft.NET\Framework64\v4.0.30319\InstallUtil.exe /environment=tomtest "C:\foo\bar.exe" 
+7
source

All Articles