Topic: Project tree ordering issue  (Read 1237 times)

Project tree ordering issue
« on: August 05, 2018, 04:50:05 PM »

ied206

  • Moderator,
  • Chef
  • *****
  • Location: South Korea
  • Date Registered: Jan 2014
  • Posts: 257
I am stuck with how WinBuilder orders .script files in the project tree.
Do anyone knows exact ordering algorithm of WinBuilder?

At first glance, I thought WinBuilder is using ascii ordering while ignoring case.
In contrast, Windows Explorer uses natural ordering which is more human-friendly.
cmd (ASCII)explorer (Natural)
0 - X.script00 - X.script
00 - X.script0 - X.script
1 - X.script1 - X.script
10 - X.script2 - X.script
2 - X.script10 - X.script

But the problem rises from here. Sometimes WB uses ascii ordering, and sometimes not.

- Case 1 : WB uses natural ordering
See the reversed order of Retrieve Tools and 0 - Preconfig (from Win10PESE).
ila_rendered

These two scripts are ordered differently in the world of ascii/natural order.
cmd (ASCII)explorer (Natural)
0 - preconfig.script00 - retrieve.script
00 - retrieve.script0 - preconfig.script

- Case 2 : WB uses ascii ordering
When I tested with numbers, WB sticks to ascii order.

Explorer
ila_rendered
WinBuilder
ila_rendered
PEBakery
ila_rendered


Now I am guessing that WinBuilder uses natural ordering only if some conditions are met, which I am unable to figure out.
Is this a bug of WB? Or caused by locale difference?
This issue is affecting build of the Win10PESE, so any help is appreciated.
« Last Edit: August 05, 2018, 04:50:53 PM by ied206, Reason: Wrong script order »

Re: Project tree ordering issue
« Reply #1 on: August 06, 2018, 03:09:30 PM »

0scar

  • Code Baker
  • Chef
  • ***
  • Date Registered: Jan 2013
  • Posts: 309
Dir in a DOSbox
> dir    (without any switch)

627,135 0-preconfig.script
49,277 00-retrieve.script
264,981 1-5 PluginCache_Basic.Script
167,516 1-files.Script
4,144,205 2-Config.script

> dir /O    (List by files in sorted order switch)

49,277 00-retrieve.script
627,135 0-preconfig.script
264,981 1-5 PluginCache_Basic.Script
167,516 1-files.Script
4,144,205 2-Config.script

It seems that Winbuilder uses the /O sort switch.
« Last Edit: August 06, 2018, 03:11:03 PM by 0scar »

Re: Project tree ordering issue
« Reply #2 on: August 26, 2018, 12:17:19 PM »

ied206

  • Moderator,
  • Chef
  • *****
  • Location: South Korea
  • Date Registered: Jan 2014
  • Posts: 257
As you pointed out, dir /O shows the most similar order.

Code: [Select]
0.script
00.script
1.script
10.script
2.script

In the meantime, I applied StringComparison.InvariantCultureIgnoreCase ordering of C# to simulate this.

 

Powered by EzPortal