Change Key Location from Roaming

Hi, I installed GNU Privacy Guard (2.2.25) and Gpg4win (3.1.14) in our test environment some time ago to be used to encrypt files with our file transfer application. We have our own domain account to access the server and the file transfer app runs under a separate domain account.
I installed it on the E drive instead of the default C drive ie. E:\program files\GnuPG. The is where the key rings are also stored.
When logged onto the test server with my account or with the transfer app’s account and I did a gpg --list-keys it always shows E:/Program Files/GnuPG/pubring.kbx and then the list of keys

Since the file transfer application uses the command line to encrypt i.e. Gnupg\bin\gpg.exe, I thought it was simplest to just copy the GnuPG folder and it’s contents from test to production. However, when logged onto the production server with my account and I issue a Gpg --list-keys command (cd to e:\program files\gnupg), it creates a key file under my account\roaming\gnupg) which is blank; however, when I’m logged onto the production server with the file transfer account and issue gpg --list-keys through a command prompt, I see E:/Program Files/GnuPG/pubring.kb and the list of all the keys that were imported on the test server.
I checked the roaming folder\gnupg under my account and the file transfer app account on the test server and it is empty.

The file transfer app does encrypt and decrypt files using GnuPG since it’s finding the key ring on the E drive, but I would like to be able to see the keys when using my account. Any ideas?

Hi @shemeshg,

the crypto engine GnuPG uses a home directory.
gpg --version will show you which one it currently uses.

There are several methods to change the home directory temporarily or permanently. See Agent Options (Using the GNU Privacy Guard) . I think your transfer account will have used one of those.

Note the current version of Gpg4win is 4.3.1 and the above link to the documentation is for the most current version. You should consider upgrading.

Best Regards,
Bernhard

Thanks!
So running gpg --version shows the home is set to my accounts roaming folder path.
I had already set the GNUPGHOME environment variable to E:\Program Files\GnuPG.
There are no registry settings for either my account or the file transfer account.
That being said, while logged onto the server with my account I entered gpg --homedir "E:\program files\GnuPG", it said something along the lines of not understanding the command and trying to guess what I meant with a prompt to enter text.
I closed the command prompt down as I couldn’t escape from it. I started another prompt up and entered in gpg --version. It now shows E:\program files\GnuPG as the home directory. I can now see the list of keys. I’m not entirely sure what happened there, but so far all is good…

You are welcome! Good that things are working now!

while logged onto the server with my account I entered gpg --homedir “E:\program files\GnuPG”, it said something along the lines of not understanding the command and trying to guess what I meant with a prompt

This is normal, as you have not given a command like “–decrypt” or “–encrypt” or “–version”. So gpg guesses that you would want to do depending on the input type.

I’m not entirely sure what happened there

Maybe a restart of something made earlier changes active.