vcsjones / AzureSignTool

SignTool Library and Azure Key Vault Support
MIT License
272 stars 85 forks source link

This program cannot be run in DOS mode error. #152

Closed stuarts-exmos closed 2 years ago

stuarts-exmos commented 2 years ago

Running the AzuresignTool via powershell prompt on Windows 10. I'm getting an error:

PS D:\Downloads\AzureSignTool-3.0.0\src\AzureSignTool\bin\Release\netcoreapp3.1> .\AzureSignTool.exe sign -du "https://www.foobar.com" -fd sha384 -kvu "https://foobarkeyvault.vault.azure.net/" -kvi *** -kvt *** -kvs *** -kvc "FooBarDevCodeSigning" -tr http://timestamp.digicert.com -td sha384 -v -ifl ".\DevTestHelloWorld.exe"

File 'MZ?♥♦???@?▼??     ?!?☺L?!This program cannot be run in DOS mode.' does not exist.
Specify --help for a list of available options and commands.

The file DevTestHelloWorld.exe exists.

I tried wrapping the argument values in "" as well, same error.

What am I doing wrong ?

I also tried running via admin powershell script and a VS2019 developer command prompt.

This is using the AzureSignTool.exe in the release folder after building from source with a Release build.

Same error trying to debug via VS, stepping through it gets to SignCommand.cs line 97 then immediately exist with the above error printed to console. I think it's failing when trying to parse the file list for the -ifl parameter.

I've tried

-ifl .\DevTestHelloWorld.exe
-ifl DevTestHelloWorld.exe
-ifl "DevTestHelloWorld.exe"
-ifl "D:\Downloads\AzureSignTool-3.0.0\src\AzureSignTool\bin\Release\netcoreapp3.1\DevTestHelloWorld.exe"
-ifl D:\Downloads\AzureSignTool-3.0.0\src\AzureSignTool\bin\Release\netcoreapp3.1\DevTestHelloWorld.exe

Any ideas ?

stuarts-exmos commented 2 years ago

I should RTFM more closely.

vcsjones commented 2 years ago

Heh. I must admit that one confused me for a minute too. I'll see if I can make -ifl "fail better".

otykier commented 2 months ago

What was the solution here?