DSC icon indicating copy to clipboard operation
DSC copied to clipboard

Automatic detection of newer version and updating

Open SteveL-MSFT opened this issue 5 months ago • 1 comments

Summary of the new feature / enhancement

On startup dsc should check if there is a newer version available (probably a simple REST GET request to a well-known URL) and inform the user they can use dsc update to auto-update itself.

Proposed technical implementation details (optional)

As part of the request, will need to send the OS and DSC version, and the packaging as part of the agent string. Have an env var DSC_DISABLE_UPDATE_CHECK to opt-out of this behavior.

dsc update on Linux/macOS can update in-place. However, on Windows, you can't update an open file. Instead, it may make sense to have a dsc-update.exe who's sole purpose is to download the package (zip/tar), unpack to temp location, and overwrite the existing installation. On Windows, it would also have to check that none of the files in the folder are in use. To allow the update to update dsc-update.exe, dsc would copy dsc-update.exe to the temp folder and spawn it from there giving it the home directory of the current dsc being run (this way if you have multiple versions, it would only update the one you ran).

SteveL-MSFT avatar Jul 23 '25 02:07 SteveL-MSFT

I think as a enchantment to this is good to add flag to packed repository that this is available for auto update, similar as AD connect, as a new release can have some bug and it will impact to some process

Example

2.3.6.0 Release status 21 Feb 2024: Released for download and autoupgrade.

Bug Fixes: Improvements to auto-upgrade detection. Auto-upgrade no longer retries if it detects the machine doesn't meet the OS or .NET runtime requirements.

Link to doc: https://learn.microsoft.com/en-us/entra/identity/hybrid/connect/reference-connect-version-history#2320

mimachniak avatar Aug 20 '25 05:08 mimachniak