Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
(Click for Image of Window's Optional Features GUI)[^]

I am trying to build a GUI, utilizing Windows Forms and C#, that looks and feels identically the same as the GUI that comes up when you execute
%windir%\System32\OptionalFeatures.exe
on a Windows-7-or-higher system. I am using the variable %windir% is the DOS environment variable that points to the folder on your computer where Windows itself is installed, typically C:\WINDOWS, here, since I am aware that not all systems install Windows system files into the same directory..

A picture of the specific GUI I am referring to is shown above. It must work the same. I assume it really is just a shell for DISM and issues calls to DISM and then formats the output of DISM somehow, and that is not my issue (I know how to populate a tree view).

However, it has been my experience that DISM does not return "prettified" feature names but "code names," and also, I am having trouble figuring out :

(a) how to resolve the dependencies between "windows features" i.e., the tree view is to reveal that some features depend on others being enabled
(b) when you click to place a check mark in a given feature's check box, the GUI will automatically check/uncheck other features' check box, presumably according to certain rules
(c) How to actually perform the changes to windows features/settings once the user has clicked OK?

This is my effort to develop an interactive "setup this new computer from scratch" program and part of the program lets you take this tree and script it so you can then apply the same "turn windows features on or off settings" to a bunch of other computers as part of a IT operations/configuration management tasks.

Thanks in advance...

Brian

What I have tried:

I tried decompiling OptionalFeatures.exe with Telerik JustDecompile but to no avail, as it appears to not be a valid CLR assembly, and apparently, JustDecompile only works with such assemblies.

I am aware of the so-called "Harding problem", in which you cannot get back the exact source code from the compiled binary...so I am coming to the community and seeing if anyone else out there has approached this problem from the standpoint of obtaining the information from the operating system directly, via some heretofore-unknown-to-me WinAPI call.

I have also tried writing, basically, a .bat file routine such as the one listed below, that calls DISM to output the list of all features and parses said list, and then calls dism /Online /NoRestart /Enable-Feature '<name>' /All on each, and I am not able to get all the features to the "turned on" state. This is what I want in the current application, but the GUI is to allow a sysadmin to pick and choose features to be enabled/disabled and then we save the choices to some sort of script file that can then be run on other machines to configure their "Windows Features" to be the same.

Thanks again in advance.
Posted
Updated 15-Aug-18 5:44am
Comments
BillWoodruff 15-Aug-18 21:52pm    
check out Sergey's (free) "Tweaker:" https://winaero.com/ for more ideas.

it's not open source.

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900