slorelee / wimbuilder2

wimbuilder with new UI & new syntax (hta+bat+vbs+js)
470 stars 105 forks source link

WimBuilder2\Projects\Win10XPE\za-Slim\Slim_Safely.batHi Slore, the localized keyboard layout file was not keeped. In line 15, in fonts, tahoma.ttf was written twice. #80

Closed rupelodn closed 2 years ago

rupelodn commented 2 years ago

Hi Slore, the localized keyboard layout file was not keeped. In line 15, in fonts, tahoma.ttf was written twice.

slorelee commented 2 years ago

git fetch origin (my repository)

then you create a new fix branch from the origin/master.

The pull request branch should not contain the "Merge branch 'slorelee:master' into master" commits.

On my site:

C:\Users\Slore>reg query HKLM\SYSTEM\ControlSet001\Control\Nls\Locale /ve

HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Nls\Locale
    (Default)    REG_SZ    00000804

So it be tokens=3 not 4, the "Default" is not right on your OS.

Could you show your result (it is fine in Russian) ?

rupelodn commented 2 years ago

Hi Slore, my reg query works the same as yours:

D:\z-debug>reg query HKLM\SYSTEM\ControlSet001\Control\Nls\Locale /ve HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Nls\Locale (default) REG_SZ 00000419

Next, I slightly changed your code for testing:

@echo off set _LocaleId= for /f "tokens=3" %%l in ('reg query "HKLM\SYSTEM\ControlSet001\Control\Nls\Locale" /ve') do ( set _LocaleId=%%l ) echo Locale ID is %_LocaleId%

set _LayoutFile= for /f "tokens=4" %%l in ('reg query "HKLM\SYSTEM\ControlSet001\Control\Keyboard Layouts\%_LocaleId%" /v "Layout File"') do ( set _LayoutFile=%%l ) echo [INFO] Got LocaleId:%_LocaleId% echo [INFO] Got LayoutFile:%_LayoutFile% set _LocaleId= set _LayoutFile= pause

The result is on the screen:

Locale ID is REG_SZ Error: The specified section or parameter cannot be found in the registry. [INFO] Got LocaleId:REG_SZ [INFO] Got LayoutFile: To continue, press any key . . .

I decided to change "3" to "4" in this code. The output result on the screen has changed:

Locale ID is 00000419 [INFO] Got LocaleId:00000419 [INFO] Got LayoutFile:KBDRU.DLL To continue, press any key . . .

I'm attaching for the test NLS_KBD_Query.bat.txt There I have already changed "3" to "4". NLS_KBD_Query.bat.txt

slorelee commented 2 years ago

tokens=4 failed on Windows in zh-CN language.

How about next one on your Windows?

set _LocaleId=
for /f "tokens=3" %%l in ('reg query "HKLM\SYSTEM\ControlSet001\Control\Nls\Locale" /v "(Default)"') do (
  set _LocaleId=%%l
)
echo Locale ID is %_LocaleId%
slorelee commented 2 years ago
C:\Users\Slore>for /f "tokens=3,4" %i in ("(default) REG_SZ 00000419") do echo 3=%i, 4=%j

C:\Users\Slore>echo 3=00000419, 4=
3=00000419, 4=

C:\Users\Slore>for /f "tokens=3,4" %i in ("  (default) REG_SZ 00000419") do echo 3=%i, 4=%j

C:\Users\Slore>echo 3=00000419, 4=
3=00000419, 4=
rupelodn commented 2 years ago

Hi Slore, yes, it is work:

D:\z-debug>set _LocaleId=

D:\z-debug>for /F "tokens=3" %l in ('reg query "HKLM\SYSTEM\ControlSet001\Control\Nls\Locale" /v "(Default)"') do (set _LocaleId=%l )

D:\z-debug>(set _LocaleId=00000419 )

D:\z-debug>echo Locale ID is 00000419 Locale ID is 00000419

slorelee commented 2 years ago

Hi, @rupelodn

Could you add a commit for pullrequest #81? Use "tokens=3" and /v "(Default)" .

rupelodn commented 2 years ago

Done.