OSDeploy / OSD

OSD Shared Functions
MIT License
130 stars 54 forks source link

DevGui - combobox for Edition is not working properly #130

Closed AyeffkayHennepin closed 3 months ago

AyeffkayHennepin commented 3 months ago

Describe the bug Editions combobox defaults to Windows 11 Education even though JSON defines the default as Enterprise. Furthermore, if you change the OS combobox From Windows 11 xxxx to Windows 10 xxxx, the Edition combobox clears out but the values in it remain Windows 11 xxxx, and the Index box is unpopulated.

To Reproduce 1) Start-OSDCloudGuiDev without specifying any particular settings. 1a) observe that the Editions combobox says Windows 11 Education, when the default defined in OSD.json is Enterprise. 2) change the Operating System combobox from Windows 11 xxxx to Windows 10 xxxx. 2a) observe that the Editions combobox is cleared. 3) click on the Editions combobox and observe that all available editions are Windows 11 xxxx and that Home/Home N are missing. 4) select one of those editions and observe that the Index field is empty.

Expected behavior Editions combobox should default to Enterprise per the OSD.json. Changing the OS from 11 to 10 should allow selection of Windows 10 editions.

Screenshots image image

gwblok commented 3 months ago

Your observations are correct. (and by design) See release notes: https://github.com/OSDeploy/OSD/blob/master/RELEASENOTES.md

TLDR The previous method for picking index was based on assumptions (Professional always equals X for example) which was wrong for several different language ESD files. You can look at the logic: https://github.com/OSDeploy/OSD/blob/master/Public/Start-OSDCloud.ps1 Lines 453 to 553 (ish)

Defaults are being removed for the most part, requiring users to pick what they want, so OSDCloud GUI logic can figure out the needed index.

Currently, in the OSDCloudGUI (non-dev), it's working the way it's been working since the beginning [assumptions of index numbers based on the drop down items in the GUI], which caused issues with several different languages. To try to resolve this, I've made a "database" of indexes for each ESD file, so as you pick different criteria in the drop down. As the user selects options in the drop down, it queries the "database" to map to the correct ESD file and other options available. When you change a core option, like language, it loads information for that ESD file based on Language & Activation (Retail / Volume), so then if you change Activation from Volume to Retail, it must then reload index information from another ESD file, which can reset the Edition drop down. There isn't an easy way to avoid this, and I do like that it draws attention back to the drop down so users know they must reselect an option to ensure the index is being mapped properly.

The changes on the DEV side are in response to issue 117: https://github.com/OSDeploy/OSD/issues/117

While some might find the change inconvenient, it now allows for improved experiences for other languages.

Database file: https://github.com/OSDeploy/OSD/blob/master/Catalogs/CloudOperatingSystemsIndexes.JSON

Examples of two languages that now work properly, that didn't under the old method

image

image image

With the new changes in DEV, when users pick their options, it will now correctly match the Index.

If you have any suggestions on how to improve the experience, let me know and I'll see what I can do.

AyeffkayHennepin commented 3 months ago

If defaults are removed, is it correct that administrators won't be able to populate defaults in the GUI for deployment teams to use?

As in the example, if I use Start-OSDCloudGUIDev without any other options, it exports the default configuration to X:\windows\TEMP\Start-OSDCloudGUI.json. The readout in the PS window includes OSEdition = Enterprise, but when the GUI opens it has selected Windows 11 Education.

In our environment, we launch the GUI by defining those values. Here's a sanitized version of our script Lines 59-88, we define the defaults before launching the gui. It respects all of those defaults except for line 61-62 where we pick Enterprise/6.

~

The potentially larger issue is that when you change the OS selection combobox from any Win11 (the default is Windows 11 23H2 x64) to any Win10 (say, Windows 10 22H2 x64), it does not repopulate the Edition combobox (as in my second screenshot), so you're left trying to select a Win11 edition to apply a Win10 image, and there is no valid index.

gwblok commented 3 months ago

@AyeffkayHennepin, I think I resolved the issue in the next release of the module. OSDCloudGUI, while still dynamically grabbing Editions, should respect your defaults.

image

All the code has been updated on GitHub as today, so next time @OSDeploy updates the module, you can test and confirm all is well again.

AyeffkayHennepin commented 3 months ago

Hi Gary, I checked it out this morning and it's working now for both problem scenarios. Thanks for all your work and help with this project!