Skip to content

Commit

Permalink
Fixed auto update when superseeding (#90)
Browse files Browse the repository at this point in the history
Fixed #84
  • Loading branch information
svrooij authored Jul 25, 2024
1 parent 3b3e959 commit d281c71
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/Svrooij.WinTuner.CmdLets/Commands/DeployWtWin32App.cs
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,8 @@ await batch.AddBatchRequestStepAsync(graphServiceClient.DeviceAppManagement.Mobi
{
if (assignment.Intent == GraphModels.InstallIntent.Available && assignment.Settings is null)
{
//assignment.Settings = new GraphModels.Win32LobAppAssignmentSettings { AutoUpdateSettings = new GraphModels.Win32LobAppAutoUpdateSettings { AutoUpdateSupersededApps = GraphModels.Win32LobAppAutoUpdateSupersededApps.Enabled } };
assignment.Settings = new GraphModels.Win32LobAppAssignmentSettings { Notifications = GraphModels.Win32LobAppNotification.ShowReboot };
assignment.Settings.AdditionalData.Add("autoUpdateSettings", new Win32LobAppAutoUpdateSettings());
}
}

Expand Down
3 changes: 2 additions & 1 deletion src/WingetIntune/Graph/GraphWorkflows.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ private static List<MobileAppAssignment> GenerateAssignments(string[] groups, In
MobileAppAssignmentSettings? settings = null;
if (intent == InstallIntent.Available && addSetting)
{
//settings = new Win32LobAppAssignmentSettings { AutoUpdateSettings = new Win32LobAppAutoUpdateSettings { AutoUpdateSupersededApps = Win32LobAppAutoUpdateSupersededApps.Enabled } };
settings = new Win32LobAppAssignmentSettings { Notifications = Win32LobAppNotification.ShowReboot };
settings.AdditionalData.Add("autoUpdateSettings", new Win32LobAppAutoUpdateSettings());
}
if (groups is not null && groups.Any())
{
Expand Down
17 changes: 17 additions & 0 deletions src/WingetIntune/Graph/Win32LobAppAutoUpdateSettings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using Microsoft.Graph.Beta.Models;

namespace WingetIntune.Graph;
public class Win32LobAppAutoUpdateSettings : Entity
{
public Win32LobAppAutoUpdateSettings()
{
base.OdataType = "microsoft.graph.win32LobAppAutoUpdateSettings";
AutoUpdateSupersededAppsState = "enabled";
}

public string? AutoUpdateSupersededAppsState
{
get => BackingStore?.Get<string>("autoUpdateSupersededAppsState");
set => BackingStore?.Set("autoUpdateSupersededAppsState", value);
}
}

0 comments on commit d281c71

Please sign in to comment.