Problem launching SIGNCODE.EXE from ASP.NET

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;
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top