Skip to content

Commit

Permalink
[Event] Add detection of AME 10/11
Browse files Browse the repository at this point in the history
  • Loading branch information
CodingWonders committed Nov 21, 2024
1 parent 3ace78a commit 711ae4d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
3 changes: 3 additions & 0 deletions MainForm.vb
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,9 @@ Public Class MainForm
If PlaybookDetector.DetectInstalledPlaybook(PlaybookDetector.VerifiedPlaybooks.ReviOS) Then
DynaLog.LogMessage("Revision (ReviOS) has been detected on this system. There may be compatibility issues with DISMTools on your system", False)
End If
If PlaybookDetector.DetectInstalledPlaybook(PlaybookDetector.VerifiedPlaybooks.AME) Then
DynaLog.LogMessage("AME 10/11 has been detected on this system. There may be compatibility issues with DISMTools on your system", False)
End If

If Not Directory.Exists(Application.StartupPath & "\logs") Then Directory.CreateDirectory(Application.StartupPath & "\logs")
If Not Debugger.IsAttached Then SplashScreen.Show()
Expand Down
11 changes: 11 additions & 0 deletions Utilities/PlaybookDetector.vb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Public Class PlaybookDetector
Public Enum VerifiedPlaybooks
AtlasOS
ReviOS
AME
End Enum

Public Shared Function DetectInstalledPlaybook(InstalledPlaybook As VerifiedPlaybooks) As Boolean
Expand Down Expand Up @@ -34,6 +35,16 @@ Public Class PlaybookDetector
DynaLog.LogMessage("Could not detect presence of Revision on this system. Error information:" & CrLf & CrLf & ex.ToString())
OSPackageCount = 0
End Try
Case VerifiedPlaybooks.AME
' Detect content for standard AME Playbooks
DynaLog.LogMessage("Detecting if AME 10/11 is installed...")
Try
OSPackageCount = (Directory.GetFiles((Environment.GetFolderPath(Environment.SpecialFolder.Windows) & "\servicing\packages"), "Z-AME-NoDefender-Package*", SearchOption.TopDirectoryOnly).Count)
DynaLog.LogMessage("Number of AME packages in system servicing folder: " & OSPackageCount)
Catch ex As Exception
DynaLog.LogMessage("Could not detect presence of AME 10/11 on this system. Error information:" & CrLf & CrLf & ex.ToString())
OSPackageCount = 0
End Try
End Select
Return (OSPackageCount > 0)
End Function
Expand Down

0 comments on commit 711ae4d

Please sign in to comment.