@echo off
setlocal
set "LOG=%USERPROFILE%\Desktop\DirectPay_GPG_Discovery.txt"
set "GPG_EXE=%ProgramFiles%\DirectPay\GnuPG\gpg.exe"
set "GNUPG_HOME=%ProgramData%\DirectPay\GnuPG"

>%LOG% echo === DirectPay GPG Discovery ===
>>%LOG% echo GPG_EXE   = %GPG_EXE%
>>%LOG% echo GNUPG_HOME= %GNUPG_HOME%
>>%LOG% echo.
if exist "%GPG_EXE%" (
  "%GPG_EXE%" --homedir "%GNUPG_HOME%" --version >>"%LOG%" 2>&1
  echo.>>"%LOG%"
  "%GPG_EXE%" --homedir "%GNUPG_HOME%" --list-keys >>"%LOG%" 2>&1
) else (
  >>%LOG% echo gpg.exe not found at that path.
)
start notepad "%LOG%"
