TAP_PATH Environmental variable is not getting updated

Hi Team,

Steps to reproduce this bug.

  1. Install TestAutomation.9.11.1+53284f62 32 Bit
  2. Check the TAP_PATH environmental variable, it will be C:\Program Files (x86)\Keysight\Test Automation
  3. Unistall TestAutomation
  4. Install TestAutomation.9.11.1+53284f62 64 Bit
  5. Check the TAP_PATH environmental variable, it will be same as previous value C:\Program Files (x86)\Keysight\Test Automation

Please let us know, if we are doing something wrong or do we need to follow certain steps.

We got this bug while some of our team members were swithching from 32 to 64 bit.

Please help us to fix this issue.

Note: If we delete TAP_PATH manually after uninstall, then we dont have this bug.

Jestin CI

1 Like

@justin_c_i this is actually an intentional change and was implemented to support some legacy systems. Because of various changes the environment variable is no longer required to be used.
The current behavior will not overwrite the TAP_PATH variable if it already exists (again to support better side by side support with legacy systems).

We are updated the documentation, but you can see some of the options for finding the install path here:

Can one of these approaches meet your needs? If not, if you can share some more details about what you need the TAP_PATH for and how you are currently using we can recommend an alternative.

1 Like

Hi Brennen

From an external application we will be copying xml files to TAP_PATH/Settings.
Currently we use TAP_PATH to get the Tap installed directory.

Also we use TAP_PATH inside install shield for copying Instrument.xml, editor.chm etc to the installed directorty of OpenTap.

So we need to change this?

Jestin CI

1 Like

I think it will be more reliable going forward, especially if you are changing from 32 to 64 bit. It would probably be best in your case to use the registry entry:

    public string GetTapPath()
        // Todo: Add null checks as needed.
        RegistryKey tapInstallPath = Registry.LocalMachine.OpenSubKey("SOFTWARE\\Keysight\\Test Automation\\Installations\\");
        var subkeyCount = tapInstallPath.SubKeyCount;
        var subkeyName = tapInstallPath.GetSubKeyNames()[0];
        var installPathKey = tapInstallPath.OpenSubKey(subkeyName);
        var path = installPathKey.GetValue("Path");
        return path;

Thanks for the information, We will modify the code accrdingly.

Sorry one more doubt, Is this regisry entry same for 32 and 64?


Yes it should be the same for both.

1 Like

Thanks for the Update.


@brennen_direnzo Nice function! I may use it as well. Our projects also use TAP_PATH, and every once in a while I bump into the same issue as @justin_c_i.