GnuPG and CreateProcess in Delphi Service
Trying to use GnuPG with Delphi (Win32). I need to sign a file with a console command like this:
"C:\Program Files\GNU\GnuPG\gpg.exe" -a -u Alex --passphrase secretpassword --yes --clearsign -o C:\Result.asc C:\InputFile.txt
I first created a normal VCL Forms application and used a function CreateProcess
, everything was fine, but when I passed this code to my service application, gpg.exe exits with code 2. Maybe I am missing something? Any ideas?
Update
Just in case someone has such a problem. GnuPG stores keys in C:\Documents And Settings\<username>\Application Data\gnupg\
, but when the service is started from a different user account (SYSTEM) it cannot find your key. GL and HF