PDA

View Full Version : SB10 Feature Request



NewsArchive
06-27-2019, 05:39 AM
It could be useful to some folks if the compiler captured the
pertinant parts of the output from SignTool, especially the error
messages.

e.g. instead of "Error 1", having the output below could save someone
some time, some time, sometimes<g>:

SignTool Error: SignedCode::Sign returned error: 0x800700C1
%1 is not a valid Win32 application.
SignTool Error: An error occurred while attempting to sign:
C:\MyAppDist\MyApp.exe


Showing the entire signtool commandline (as generated/passed by SB10)
might also be useful when errors are encountered.

Thanks.

Jeff Slarve
www.jssoftware.com

Ones and Zeros are my Heroes

NewsArchive
06-27-2019, 05:39 AM
Hi Jeff,

> It could be useful to some folks if the compiler captured the
> pertinant parts of the output from SignTool, especially the error
> messages.
>
> e.g. instead of "Error 1", having the output below could save someone
> some time, some time, sometimes<g>:
>
> SignTool Error: SignedCode::Sign returned error: 0x800700C1
> %1 is not a valid Win32 application.
> SignTool Error: An error occurred while attempting to sign:
> C:\MyAppDist\MyApp.exe

Unfortunately, you can't catch this return code at all.

There are only three possible return values (exit codes):

0 = Execution was successful.
1 = Execution has failed.
2 = Execution has completed with warnings.

> Showing the entire signtool commandline (as generated/passed by SB10)
> might also be useful when errors are encountered.

Good idea!

Friedrich

NewsArchive
06-28-2019, 08:38 AM
Hi Friedrich -

>
>
>Unfortunately, you can't catch this return code at all.
>
>There are only three possible return values (exit codes):
>
>0 = Execution was successful.
>1 = Execution has failed.
>2 = Execution has completed with warnings.

Rick Martin wrote a Clarionmag article about capturing output
https://clarionmag.jira.com/wiki/spaces/archive/pages/399447/ClarionMag+monthly+PDFs+and+source+ZIPs+2008?previ ew=%2F399447%2F401932%2Fcmag-2008-01.pdf


>> Showing the entire signtool commandline (as generated/passed by SB10)
>> might also be useful when errors are encountered.
>
>Good idea!

Jeff Slarve
www.jssoftware.com

Ones and Zeros are my Heroes

NewsArchive
06-28-2019, 08:38 AM
> Rick Martin wrote a Clarionmag article about capturing output

That is the problem. There is not any output.

Only if you call some kind of command line prompt. There is no output if
you use ShellExecute and "wait" for the signtool.exe termination.

Friedrich

NewsArchive
06-28-2019, 08:39 AM
> There is no output if you use ShellExecute and "wait" for the
> signtool.exe termination.

As far as I know <g>.

Friedrich

NewsArchive
06-28-2019, 08:40 AM
> Rick Martin wrote a Clarionmag article about capturing output
> https://clarionmag.jira.com/wiki/spaces/archive/pages/399447/ClarionMag+monthly+PDFs+and+source+ZIPs+2008?previ ew=%2F399447%2F401932%2Fcmag-2008-01.pdf

I tried the link on different Win10 machines, but that's the only thing I
see (it's sitting there for 10 minutes now).

Friedrich

NewsArchive
06-28-2019, 08:40 AM
Yeah. Been there.<g>

If you download the PDF, you can view it.

Jeff Slarve
www.jssoftware.com

Ones and Zeros are my Heroes

NewsArchive
06-28-2019, 08:41 AM
>> Showing the entire signtool commandline (as generated/passed by SB10)
>> might also be useful when errors are encountered.
>
>Good idea!

But then won't you be disclosing the Certificate password in clear text? And some my
not want that!

JohnG

NewsArchive
06-28-2019, 08:41 AM
Leaving that part out or replacing with ****** would be ok.

At least, on the EV cert, you leave the password blank and let safenet
manage the password.

Not sure if SB passes the password through the commandline or stuffs
into a dialog that pops up. But if it's passed through the command
line, of course it would be best to obscure on the compile log.

Jeff Slarve
www.jssoftware.com

Ones and Zeros are my Heroes

NewsArchive
06-28-2019, 08:43 AM
Hi Friedrich,

> Unfortunately, you can't catch this return code at all.

I have never used SignTool on the command line, but is it possible to
redirect the output to a dummy file in temp folder and then upon
receiving 1 or 2 check for that file for additional information? I.e.

signtool.exe ... > %temp%/signtool_result.txt

Best regards,

--
Arnor Baldvinsson
Icetips Alta LLC

NewsArchive
06-28-2019, 08:44 AM
Hi Friedrich,

> I have never used SignTool on the command line, but is it possible to
> redirect the output to a dummy file in temp folder and then upon

If there IS any output! Don't know if there is or isn't.

Best regards,


--
Arnor Baldvinsson
Icetips Alta LLC

NewsArchive
06-28-2019, 08:44 AM
Other than that I put some of the output in my original message

Jeff Slarve
www.jssoftware.com

Ones and Zeros are my Heroes

NewsArchive
06-28-2019, 08:46 AM
>> If there IS any output! Don't know if there is or isn't.


OddJob vs Rick
https://www.screencast.com/t/9nK6iamesQ

<Note: I created the error for the test, and added ExitCode (LONG) to
the response>

David Bratovich

NewsArchive
06-28-2019, 08:47 AM
Hi Jeff,

> Other than that I put some of the output in my original message
Oops, missed it! :( I do this in many of my BA scripts, where I
construct BAT files that do all sorts of stuff and redirect output to a
specific file and then grab the data from that file from the target.

Best regards,

--
Arnor Baldvinsson
Icetips Alta LLC

NewsArchive
06-30-2019, 04:27 AM
>> Rick Martin wrote a Clarionmag article about capturing output
>>
https://clarionmag.jira.com/wiki/spaces/archive/pages/399447/ClarionMag+monthly+PDFs+and+source+ZIPs+2008?previ ew=%2F399447%2F401932%2Fcmag-2008-01.pdf
>
>I tried the link on different Win10 machines, but that's the only thing I
>see (it's sitting there for 10 minutes now).

You need a faster machine! <g>



Regards,
Wolfgang Orth
www.odata.de

Please note:
From time to time it happens, that I overlook a reply to my postings.
Please don't be angry.
In case of an emergency, try to contact me via mail.

Bitte beachten:
Von Zeit zu Zeit passiert es mir, dass ich Antworten auf meine Postings übersehe.
Bitte nicht böse sein.
Im Notfall bitte Kontakt per Mail versuchen.

NewsArchive
06-30-2019, 04:27 AM
>Leaving that part out or replacing with ****** would be ok.

Agreed, that would be the best approach.
We will see what Friedrich comes up with. I am guessing he is busy this weekend in
Austria at the Formula1. C'mon Ricciardo :-)

JohnG

NewsArchive
06-30-2019, 04:29 AM
Hi Friedrich,

> Only if you call some kind of command line prompt. There is no output if
> you use ShellExecute and "wait" for the signtool.exe termination.

There is, but you can't redirect the output with ShellExecute only with
CreateProcess. Which I why I create BAT files on the fly with BA and
then execute those to redirect output to a file. CreateProcess works
fine except when elevating - it can't do that. But with CreateProcess
you can redirect output.

Best regards,

--
Arnor Baldvinsson
Icetips Alta LLC

NewsArchive
06-30-2019, 04:30 AM
Hi Friedrich,

> I tried the link on different Win10 machines, but that's the only thing I
> see (it's sitting there for 10 minutes now).

When I clicked on the link, that's exactly what happened. Removed the
"?preview..." from the link so I got a list and then I was able to get
things going.

Atlassian has been making changes to Jira recently and those changes may
have affected links for some reason. My client and I use Jira for issue
tracking, so I'm in and out of it every day.

Best regards,

--
Arnor Baldvinsson
Icetips Alta LLC

NewsArchive
10-05-2019, 11:43 AM
Hi Arnor,

>> Only if you call some kind of command line prompt. There is no output if
>> you use ShellExecute and "wait" for the signtool.exe termination.
>
> There is, but you can't redirect the output with ShellExecute only with
> CreateProcess. Which I why I create BAT files on the fly with BA and then
> execute those to redirect output to a file. CreateProcess works fine
> except when elevating - it can't do that. But with CreateProcess you can
> redirect output.

I think we can handle this now. We are already using a similar method in
Remote Deploy.

The next SB update can capture the output and display it in the compiler
window.

Thanks all for your ideas and your help.

Friedrich