Please update registry on software update

Answered

When installing the TeamCity server or the build agent, some info is added to the registry (e.g. install.log of the build agent):

WriteRegStr: "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\JetBrains TeamCity Agent" "DisplayName"="JetBrains TeamCity Build Agent 2019.2"
WriteRegStr: "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\JetBrains TeamCity Agent" "UninstallString"=""c:\BuildAgent\Uninstall.exe""
WriteRegStr: "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\JetBrains TeamCity Agent" "DisplayIcon"=""c:\BuildAgent\Uninstall.exe""
WriteRegStr: "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\JetBrains TeamCity Agent" "Publisher"="JetBrains s.r.o."
WriteRegStr: "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\JetBrains TeamCity Agent" "DisplayVersion"="2019.2 (build 71499)"
WriteRegStr: "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\JetBrains TeamCity Agent" "URLInfoAbout"="http://www.jetbrains.com/teamcity"

After a software update, the version info in the registry keeps unchanged. When you open Control Panel -> Programs and Features, the displayed version of TeamCity server or build agent is wrong and does not correspond to the installed version.

1
2 comments

Hi,

Thanks for reaching out to us!

It's a known limitation of the auto-upgrade. The auto-update procedure downloads a .tar.gz with a new version and replaces the binaries in the existing installation with the ones from the archive. It doesn't require more permissions than the user that runs the server already has. Updating the registry may require elevated permissions, which the user may be missing.

There is an existing feature request about that: TW-67253. Feel free to vote for it and leave comments.

If updating the TeamCity version number in the list of installed applications is vital to you, you can manually update your TeamCity server using a Windows installer. The installer should update the existing entries in the registry. 

Any other questions, just let me know.

0

The error indicates that the PowerShell process did not have enough permission to modify the corresponding HKEY_LOCAL_MACHINE registry entries. Using runas /user:... starts the process under another account but does not necessarily launch it with an elevated Administrator token because of Windows UAC.

Could not change the registry key, error: requested registry access is not allowed.

Please try the following instead:

1. Open Windows PowerShell using Run as administrator.

2. Run the script directly from the elevated PowerShell session:

Set-ExecutionPolicy -Scope Process Bypass
& "C:\TeamCity\bin\update-registry-version.ps1

The exact registry path can depend on whether TeamCity was installed using a 32-bit or 64-bit Windows installer. Therefore, entries may be located under either:

HKEY_LOCAL_MACHINE\SOFTWARE\JetBrains\...
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\…

 

or:

HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\JetBrains\...
HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\…

The script should update the registry view associated with the original TeamCity installation. If the entry is located in a different registry view, this may explain why the expected value remains unchanged.

Manually updating the registry is also possible, but the values should be taken from the currently installed TeamCity version rather than hard-coded. One small clarification: the current registry value is expected to use the TeamCity build number (for example, 222647) rather than the product version (for example, 2026.1.2). So the format you're using is correct.

Stopping the TeamCity service is normally not required only to change these display values, since they do not control the version of the running TeamCity server.

Please note that automatic TeamCity updates replace the application files but do not update the Windows uninstaller itself. As a result, an older version may continue to appear in Programs and Features. This remains a known limitation tracked as TW-67253

Running a newer Windows installer over the existing installation is still the most reliable way to refresh all installer and uninstall registry information.

One thing worth flagging: this fix only covers the TeamCity server. Build agent versions aren't updated by this script or by auto-update. That's tracked separately in TW-86811, which is still open. If you're seeing the same problem on agents, that's the issue to follow.

 

0

Please sign in to leave a comment.