Installation for Server Core (2019)

Does anyone have gpg4win installed and working in a Server Core environment? I installed it with choco, but had a couple errors from Outlook plugin (expected). Everything seems to work other than trying to enter passwords for keys. I get an error that there is no pinentry.exe. I’m struggling trying to modify the environment so that it can use pinentry-basic.exe which seems to be the only .exe available in the gnupg\bin folder.

But even with pinentry-basic you need some kind of UI to enter the password interactively. It is probably best to use the parameters “–pinentry-mode loopback” together with the option “–password-file” to provide the password for the key to the server application.

Thanks. That turned out not to be the issue.

gpgconf (see below for comparison) showed a default location for pinentry.exe that didn’t exist. After some further research, I ended up removing gpg4win and installing gnupg. That doesn’t have all the GUI add-ons and didn’t have any errors when installing through choco. gpg4win definitely needs the Desktop Experience on the server to work, which I think is understandable.

When I checked gpgconf after installing gnupg, pinentry was now referencing pinentry-basic.exe in the correct path. Manual gpg commands that required a password successfully launched pinentry and accepted my password. My code does have --pinentry-mode loopback option and it works properly now. I had that option removed for troubleshooting.

gpgconf output from gpg4win
gpg:OpenPGP:C%3a\Program Files (x86)\GnuPG\bin\gpg.exe
gpgsm:S/MIME:C%3a\Program Files (x86)\GnuPG\bin\gpgsm.exe
keyboxd:Public Keys:C%3a\Program Files (x86)\GnuPG\bin\keyboxd.exe
gpg-agent:Private Keys:C%3a\Program Files (x86)\GnuPG\bin\gpg-agent.exe
scdaemon:Smartcards:C%3a\Program Files (x86)\GnuPG\bin\scdaemon.exe
dirmngr:Network:C%3a\Program Files (x86)\GnuPG\bin\dirmngr.exe
pinentry:Passphrase Entry:C%3a\Program Files (x86)\GnuPG..\Gpg4win\bin\pinentry.exe

gpgconf output from gnupg
gpg:OpenPGP:C%3a\Program Files (x86)\gnupg\bin\gpg.exe
gpgsm:S/MIME:C%3a\Program Files (x86)\gnupg\bin\gpgsm.exe
keyboxd:Public Keys:C%3a\Program Files (x86)\gnupg\bin\keyboxd.exe
gpg-agent:Private Keys:C%3a\Program Files (x86)\gnupg\bin\gpg-agent.exe
scdaemon:Smartcards:C%3a\Program Files (x86)\gnupg\bin\scdaemon.exe
dirmngr:Network:C%3a\Program Files (x86)\gnupg\bin\dirmngr.exe
pinentry:Passphrase Entry:C%3a\Program Files (x86)\gnupg\bin\pinentry-basic.exe