Danas sam bas zainteresovan za ovaj vid komunikacije.
Ali daccu ti primer u c#, ja to koristim. Nadam se da necce iti problem. Sledecci primer startuje Windows service nakon instalacije
Code:
public override void Commit(System.Collections.IDictionary savedState)
{
try
{
if (Context.Parameters["LAUNCH"] == "1")
{
this.StartService("Dsm.LT Service");
}
base.Commit(savedState);
}
catch
{
throw;
}
}
private void StartService(string p_ServiceName)
{
try
{
System.Diagnostics.ProcessStartInfo oParam = new System.Diagnostics.ProcessStartInfo();
oParam.FileName = "NET";
oParam.Arguments = string.Format("START \"{0}\"", p_ServiceName);
oParam.UseShellExecute = false;
oParam.RedirectStandardOutput = true;
oParam.CreateNoWindow = true;
System.Diagnostics.Process oProcess = new System.Diagnostics.Process();
oProcess.StartInfo = oParam;
oProcess.Start();
System.Threading.Thread.Sleep(500);
}
catch
{
//throw;
}
}
moracces samo linije
Code:
oParam.FileName = "NET";
oParam.Arguments = string.Format("START \"{0}\"", p_ServiceName);
da zamenis nekom komandom koja tebi treba. Konmanda NET.exe START ImeServisa startuje Windows service sa imenom koji mu prosledis. Tebi cce FileName biti regsvr32, a argument ime COM-a.
evo ti jedan dobar clanak koji cce ti pojasniti Context.Parameters kolekciju, kao i mnoge druge stvari o Deploy projektima:
http://www.codeproject.com/dotnet/CustomizingInstallers.asp