S
Scott Zabolotzky
I'm using the following code to launch SIGNCODE.EXE to sign a CAB
provisioning file from an ASP.NET app. When I run the code the
exit code comes back as -1. I have not been able to determine what
this exit code means (other than Error, as the CAB file does not
get signed).
No exceptions are thrown and I've verified that the app can read
and write to the c:\mps\provdata directory. It seems as if it's
not a permissions problem as the executable is actually getting
launched for but for some reason it's returning an error. The
sign.out file is never created.
Any ideas on how to debug this or get more detailed info from signcode?
If I run the command from the command prompt it signs the CAB file
fine.
Help!
Process proc = new Process();
proc.StartInfo.FileName = "c:\mps\provdata\signcode.exe";
proc.StartInfo.Arguments = "-spc c:\mps\provdata\SDKSamplePrivDeveloper.cer -v c:\mps\provdata\SDKSamplePrivDeveloper.pvk c:\mps\provdata\a.cab > c:\mps\provdata\sign.out";
proc.StartInfo.UseShellExecute = false;
proc.StartInfo.WindowStyle = ProcessWindowStyle.Normal;
try
{
bool bResult = proc.Start();
if (bResult)
{
proc.WaitForExit();
info.ErrorCode = proc.ExitCode;
}
else
{
System.Diagnostics.Trace.WriteLine("Error launching external process: "+sPath + " " + sParmList);
info.ErrorCode = (Int32)EpsEventRetCodes.EXTERNALCMDLAUNCHERROR;
info.ErrorText = "Error launching external process: "+sPath + " " + sParmList;
}
}
catch (Exception e)
{
info.ErrorCode = (Int32)EpsEventRetCodes.CONFIGURATIONERROR;
info.ErrorText = e.Message;
System.Diagnostics.Trace.WriteLine("Exception when launching external process: "+sPath + " " + sParmList);
System.Diagnostics.Trace.WriteLine(e.Message);
while (e.InnerException != null)
{
System.Diagnostics.Trace.WriteLine(e.InnerException.Message);
e = e.InnerException;
}
return info;
}
provisioning file from an ASP.NET app. When I run the code the
exit code comes back as -1. I have not been able to determine what
this exit code means (other than Error, as the CAB file does not
get signed).
No exceptions are thrown and I've verified that the app can read
and write to the c:\mps\provdata directory. It seems as if it's
not a permissions problem as the executable is actually getting
launched for but for some reason it's returning an error. The
sign.out file is never created.
Any ideas on how to debug this or get more detailed info from signcode?
If I run the command from the command prompt it signs the CAB file
fine.
Help!
Process proc = new Process();
proc.StartInfo.FileName = "c:\mps\provdata\signcode.exe";
proc.StartInfo.Arguments = "-spc c:\mps\provdata\SDKSamplePrivDeveloper.cer -v c:\mps\provdata\SDKSamplePrivDeveloper.pvk c:\mps\provdata\a.cab > c:\mps\provdata\sign.out";
proc.StartInfo.UseShellExecute = false;
proc.StartInfo.WindowStyle = ProcessWindowStyle.Normal;
try
{
bool bResult = proc.Start();
if (bResult)
{
proc.WaitForExit();
info.ErrorCode = proc.ExitCode;
}
else
{
System.Diagnostics.Trace.WriteLine("Error launching external process: "+sPath + " " + sParmList);
info.ErrorCode = (Int32)EpsEventRetCodes.EXTERNALCMDLAUNCHERROR;
info.ErrorText = "Error launching external process: "+sPath + " " + sParmList;
}
}
catch (Exception e)
{
info.ErrorCode = (Int32)EpsEventRetCodes.CONFIGURATIONERROR;
info.ErrorText = e.Message;
System.Diagnostics.Trace.WriteLine("Exception when launching external process: "+sPath + " " + sParmList);
System.Diagnostics.Trace.WriteLine(e.Message);
while (e.InnerException != null)
{
System.Diagnostics.Trace.WriteLine(e.InnerException.Message);
e = e.InnerException;
}
return info;
}