The Sysprep preparation tool prepares computers for Sysprep generalization and for image capture.
Note
This is currently in a separate repository so it can be worked on more easily. In the future, it will be merged into the DISMTools repository.
This tool is designed to be as modular as possible. Checks are performed by Compatibility Checker Providers (CCPs). Tasks are performed by Preparation Tasks (PTs).
Special Thanks to Real-MullaC for helping with initial testing and expansion of this tool.
No releases are available yet because this is still under construction. So you'll have to build it.
Requirements: Visual Studio 2012 and later, .NET Framework 4.8 Developer Pack
Note
JetBrains Rider is supported, but you will not be able to design forms
- Clone the repository
- Open the solution and restore the NuGet packages (ManagedDism)
- Press Ctrl + F5 to launch the tool without a debugger
To do this:
- Fork the repo
- Do everything listed in the previous section, but clone your fork instead
- Make your changes and test them
- Create a pull request
Note
Bonus points will be awarded to those who DON'T VIBE CODE
Additional documentation for registering Compatibility Checker Providers and Preparation Tasks will be mentioned now.
The process of adding CCPs and PTs is quite simple:
- Create a new class in the
SysprepPreparator.Helpers.CompatChecksorSysprepPreparator.Helpers.PreparationTasksnamespaces. In Visual Studio, these are located in theHelpersfolder. - Make the class inherit from
CompatibilityCheckProviderorPreparationTask, based on what you're creating. - Implement the abstract members of the base class.
Example of a CCP:
Namespace Helpers.CompatChecks
Public Class ExampleCCP
Inherits CompatibilityCheckProvider
Public Overrides Function PerformCompatibilityCheck() As Classes.CompatibilityCheckerProviderStatus
' Your code here
Return Status
End Function
End Class
End NamespaceIn the case of a CCP, to report a status, you have to call the Status property in the base class. You can do this by simply referencing Status in your code.
Example of a PT:
Namespace Helpers.PreparationTasks
Public Class ExamplePT
Inherits PreparationTask
Public Overrides Function RunPreparationTask() As Boolean
' Your code here
Return ... ' whatever, based on what the PT is for
End Function
End Class
End NamespaceThen, to register your CCP or PT, add it to one of these properties like this:
- For CCPs you'll have to add it to the
CompatibilityCheckerHelpermodule:
Private CompabilityCheckerModules As New List(Of CompatibilityCheckProvider) From {
New SetupStateCCP(),
New ...,
New ExampleCCP(), ' your CCP
' Other CCPs...
}- For PTs you'll have to add it to the
PreparationTaskHelpermodule:
Private PreparationTaskModules As New Dictionary(Of String, PreparationTask) From {
{"Stop Windows Explorer", New ExplorerStopperPT()},
{"Delete Shadow Volumes", New VssAdminShadowVolumeDeletePT()},
{"ExampleTask", New ExamplePT()}, ' your PT
' Other PTs...
}In this dictionary, the key is the name of the task as it will appear in the UI.
For more information, please refer to the XML comments in the classes. Also make sure that your CCPs and PTs have XML comments for easier documentation.