Hi, @Mustang
Use the source code: https://github.com/dotnet/deployment-tools/blob/main/Documentation/dotnet-mage/ApplicationDeployment.cs And Check version sample:
public Boolean IsNewVersionAvailable()
{
Boolean isRestartRequired = false;
if (ApplicationDeployment.IsNetworkDeployed)
{
ApplicationDeployment ad = ApplicationDeployment.CurrentDeployment;
if (ad.UpdatedVersion > ad.CurrentVersion)
{
isRestartRequired = true;
}
}
return (isRestartRequired);
}
Note:
UpdatedVersion differs from CurrentVersion if a new update has been installed but you have not yet called Restart on the Application. If the application's deployment manifest is configured to perform automatic updates, you can compare these two values to determine whether you should restart the application.
If the application has not been updated, UpdatedVersion returns the same value as CurrentVersion.
There is no CheckForUpdate()
function provided, so you cannot check for undeployed updates in .NET app.
You could follow up the GitHub related page: https://github.com/dotnet/deployment-tools/issues/27
Best regards,
Minxin Yu
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.