Topic: Korean IME Support for Win10PESE  (Read 13018 times)

0 Members and 1 Guest are viewing this topic.

Korean IME Support for Win10PESE
« on: October 05, 2015, 09:29:26 PM »

ied206

  • Chef
  • ***
  • Location: South Korea
  • Date Registered: Dec 2013
  • Posts: 136
Hello, I updated my Korean IME Script to support Win10PESE.

This script enables writing Hangul (Korean characters) in Win7PESE, Win8PESE, Win8.1SE, Win10PESE.
This script is updated version of Korean IME Support for Win8.1SE, http://theoven.org/index.php?topic=825

Due to change of registry hierarchy in Win 10, an option that "display IME toolbar on taskbar" is not supported in Win10PESE.
In addition, this version has a minor registry fix too, and that fix covers all versions of PESE.


« Last Edit: October 05, 2015, 09:29:53 PM by ied206 »

Re: Korean IME Support for Win10PESE
« Reply #1 on: October 06, 2015, 01:26:53 AM »

ChrisR

  • Moderator, Win7PE SE Baker
  • Grand Chef
  • *****
  • Date Registered: Mar 2011
  • Posts: 2911
Great :great:
It is on All SE servers.

 :cheers:

Re: Korean IME Support for Win10PESE
« Reply #2 on: October 06, 2015, 04:48:33 AM »

Lancelot

  • Gena Baker
  • Grand Chef
  • *****
  • Date Registered: Sep 2010
  • Posts: 7386
Thanks ied206

 :xmas-beer:

Korean IME v9
« Reply #3 on: October 11, 2015, 04:28:16 AM »

ied206

  • Chef
  • ***
  • Location: South Korea
  • Date Registered: Dec 2013
  • Posts: 136
New version of Korean IME Scirpt (v9) released.

The major changes in version 9 is...

1. Get proper Windows OS Version
I found script v8 could not detect Windows version correctly in Win10PESE, since WinBuilder reported hal.dll has 6.2.10240 for version number.
As a result, script v8 was writing registry for Win8.1SE in Win10PESE.
So in v9, the script detect os version by using %OS% variable, and succesfully detect Windows 10 Source.
Method using hal.dll is left for fallback, for if %OS% is not available.

2. Provide more detailed option for 'Customize Appearance'
'Show or Hide IME' option is expanded, and v9 provides options similar to Control Panel's.
(For exactly, Control Panel - Clock, Language, and Region - Change Input Methods - Advanced Settings - Option near 'Use the desktop language bar when it's available')
And this option works in Win10PESE correctly.
(In v8, it was guessed this option would not work in Win10PESE, which I was wrong)

3. Fixed IMEReg.cmd's SysWOW64 Part for Win7PESE
Attached IMEReg.cmd in the script was misregistering some dlls, using 64bit regsvr32.exe for some 32bit dll.
However, this bug seems not affected the core of IME, so last version of this script was still functional in Win7PESE x64.
« Last Edit: October 11, 2015, 08:51:49 AM by ied206 »

Re: Korean IME Support for Win10PESE
« Reply #4 on: October 11, 2015, 09:14:04 AM »

ied206

  • Chef
  • ***
  • Location: South Korea
  • Date Registered: Dec 2013
  • Posts: 136
For 'Customize Apperance of IME Toolbar' option to work, the value UserPreferencesMask in HKCU\Control Panel\Desktop must be edited.
The value's type is REG_BINARY.

Example Code
Code: [Select]
RegWrite,HKLM,0x3,"Tmp_Default\Control Panel\Desktop",UserPreferencesMask,9e,3e,03,80,12,01,00,00


This value seems to be combination of bits, and each bit represent different options.
(According to http://blog.unidesk.com/tech/how-to-customize-the-performance-of-visual-effects-in-windows-7, mainly about visual effects)
In case of IME Toolbar, bit 47 determines whether to show or hide IME Toolbar. (It overrides other registry keys related)

When I built Win8PESE / Win10PESE with Korean IME Script unchecked, UserPreferencesMask has value of 9e,3e,03,80,12,00,00,00.
(It does not appear with Utils/RegEdit, which proves that if this value does not exist, it is generated by Windows when booting.)
However, in my laptop, UserPreferencesMask has a value of 9e,1e,07,80,12,00,00,00, which is Windows default.
(Tested with Win 8.1 Pro K, Win 10 Pro K)


This means that UserPreferenecesMask can have variety of values, according to settings.
So hardcoding this value into script is not a good workaround.
It must be done like this : "Get UserPreferencesMask from registry" -> "Mask bit 47 as 1" -> "Write masked UserPreferencesMask to registry"


However, I cannot find bit operation in WB syntax, which means I cannot mask only one bit with Bit AND operation.
I thought about using StrFormat operation, but it also overrides bit 44, 45, 46.
So I had to hardcode this value in Korean IME Script as a temporary measure despite it is not good workaround.

Is there any way to mask a bit in WB syntax?
If the answer is no, what will be alternative way to mask a bit?

« Last Edit: October 11, 2015, 09:15:57 AM by ied206 »

Re: Korean IME Support for Win10PESE
« Reply #5 on: October 11, 2015, 09:53:27 AM »

Lancelot

  • Gena Baker
  • Grand Chef
  • *****
  • Date Registered: Sep 2010
  • Posts: 7386
Hi ied206,

Yes I very well know
 REG_BINARY  \Control Panel\Desktop",UserPreferencesMask

Some years ago I had defined it in detail on xp/2k3
on xp/2k3 4 values, XPsp3x86 default settings: 9E,3E,01,80

I had done it including all settings inside 1 plugin ;) but now it seems not possible anymore  :lol: .

now on w7 and later , more values including 'Customize Apperance of IME Toolbar'

ps: There are some REG_BINARY values on windows working same way ;) .

Give me a week (next weekend) to create a way for REG_BINARY seperated values .  :thumbsup:
I will post to current topic.  :great:

:turtle:

Re: Korean IME Support for Win10PESE
« Reply #6 on: October 16, 2015, 12:22:27 AM »

Lancelot

  • Gena Baker
  • Grand Chef
  • *****
  • Date Registered: Sep 2010
  • Posts: 7386
Hi ied206,

update plugins from servers,
Macro Library v42.r127 (SE\Build\Macro Library)
Ime Korean v11

Ime Korean v11
all written:
History011a=
History011b=
History011=



Some Notes:

*
We already have Call,TargetVersion
Call http://TheOven.org/index.php?topic=45.0
to fix builder bug  :wink:  :thumbsup:

*
IME Toolbar Precise bit is Bit40 (not Bit47) (reverse bit ;), count all from left to right  :thumbsup: )
Check "Call Math Info" topic

*
We now have
Call,RegWriteBinaryBit,.....
to mask bit no on Reg_Binary values  :great:

Call http://TheOven.org/index.php?topic=45.0
Call Math Info http://TheOven.org/index.php?topic=1463.0 --> ps: check RegWriteBinary info ;)


*******
I hope now all nice. :great:

:turtle:
« Last Edit: October 16, 2015, 03:19:25 AM by Lancelot »

Re: Korean IME Support for Win10PESE
« Reply #7 on: October 16, 2015, 05:12:01 AM »

ied206

  • Chef
  • ***
  • Location: South Korea
  • Date Registered: Dec 2013
  • Posts: 136
Thank you for your great work, Lancelot!  :great:
With your help, writing plugin has become mush easier!  :smile:


While Lancelot was refining this pugin, I was also working on new version of this plugin.
Version 11 produces an error with Windows 10 en-US source, because it does not have gulim.ttc.
With some tests I figured out an workaround, using other fonts as alternate.

ko-KR Windows uses two default font : Gulim (gulim.ttc) and Malgun Gothic (malgun.ttf)
Windows 7, 8, 8.1 en-US sources had gulim.ttc, but Microsoft omitted gulim.ttc from Windows 10 en-US source.
(I don't know why, maybe to reduce size of install.wim?)
But Windows 10 en-US source still have malgun.ttf, so applying some registry tweaks makes this plugin to work with Windows 10 en-US source.
This job was done a few days before.

However, ko-KR Windows Console uses fixed-width font GulimChe as default, included in gulim.ttc.
Malgun Gothic is not fixed-width, so without gulim.ttc, en-US Win10PESE is unable to print Korean characters in Console.
What I am working on is this : when it detects nonexistent of gulim.ttc, a font named D2Coding will be automatically downloaded to be used in on Console.


I don't have time for a week, so maybe after a week, these fixes will be merged with Lancelot's enhanced version 11.
Thank you again for your help, Lancelot.

Re: Korean IME Support for Win10PESE
« Reply #8 on: October 16, 2015, 07:11:41 AM »

KYHI

  • Code Baker
  • Sr. Chef
  • ****
  • Location: Kentucky
  • Date Registered: Jan 2015
  • Posts: 909
Quote
What I am working on is this : when it detects nonexistent of gulim.ttc,

Add Font as plugin attachment > then

If,not,existfile,%Source_win%\Fonts\gulim.ttc,ExtractFile,%ScriptFile%,Folder,gulim.ttc,%target_win%\Fonts

and then add font to registry (not sure official font name)

RegWrite,HKLM,0x1,"Tmp_Software\Microsoft\Windows NT\CurrentVersion\Fonts","Gulim (TrueType)",gulim.ttf
RegWrite,HKLM,0x1,"Tmp_Software\wow6432node\Microsoft\Windows NT\CurrentVersion\Fonts","Gulim (TrueType)",gulim.ttf
« Last Edit: October 16, 2015, 07:29:03 AM by KYHI »

Re: Korean IME Support for Win10PESE
« Reply #9 on: October 16, 2015, 07:36:57 AM »

Lancelot

  • Gena Baker
  • Grand Chef
  • *****
  • Date Registered: Sep 2010
  • Posts: 7386

Re: Korean IME Support for Win10PESE
« Reply #10 on: October 16, 2015, 07:40:38 AM »

Lancelot

  • Gena Baker
  • Grand Chef
  • *****
  • Date Registered: Sep 2010
  • Posts: 7386
What I am working on is this : when it detects nonexistent of gulim.ttc, a font named D2Coding will be automatically downloaded to be used in on Console.

Hi ied206,

sound like a nice idea,
 still,
 as KYHI indicated  :thumbsup:,
  maybe you can attach D2Coding font if its license permits,
  else download as you wrote   :great:

:turtle:

Re: Korean IME Support for Win10PESE
« Reply #11 on: October 16, 2015, 09:49:57 AM »

KYHI

  • Code Baker
  • Sr. Chef
  • ****
  • Location: Kentucky
  • Date Registered: Jan 2015
  • Posts: 909
DISM.exe /Online /Add-Capability /CapabilityName:Language.Fonts.Kore~~~und-KORE~0.0.1.0

Adds KO-KR fonts package to windows 10 > including Gulim (gulim.ttc) and Malgun Gothic (malgun.ttf)
« Last Edit: October 16, 2015, 09:51:55 AM by KYHI »

Re: Korean IME Support for Win10PESE
« Reply #12 on: October 16, 2015, 09:59:26 AM »

Lancelot

  • Gena Baker
  • Grand Chef
  • *****
  • Date Registered: Sep 2010
  • Posts: 7386
Hi KYHI,

Also, maybe a dism plugin for "some" languages you like,
"Dism Language"
which downloads once...........  :wink:

Re: Korean IME Support for Win10PESE
« Reply #13 on: October 16, 2015, 10:06:26 AM »

KYHI

  • Code Baker
  • Sr. Chef
  • ****
  • Location: Kentucky
  • Date Registered: Jan 2015
  • Posts: 909
would either have to apply them to an online image or an off-line image (extracted install.wim)

Re: Korean IME Support for Win10PESE
« Reply #14 on: October 16, 2015, 11:21:05 PM »

Lancelot

  • Gena Baker
  • Grand Chef
  • *****
  • Date Registered: Sep 2010
  • Posts: 7386
Maybe,

we can provide Utils\ plugin to apply Dism things on source (extracted install.wim)  :wink:

This way we can add things to source, to be used by build plugins  :smile:

ex:
If,Not,ExistFile,%Source_Win%\Fonts\gulim.tt?,Exit,"%ScriptTitle% -> Add Koren font Pack to your Source -> See Utils\..... "
 :smile:

Such plugin also fix problem of applying packages to target ...  :wink:

:turtle:

Re: Korean IME Support for Win10PESE
« Reply #15 on: October 17, 2015, 04:25:13 AM »

KYHI

  • Code Baker
  • Sr. Chef
  • ****
  • Location: Kentucky
  • Date Registered: Jan 2015
  • Posts: 909
here is a list of Packages / features etc..  Available in Win10
The problem is the amount of test lines to add

limited what can be added to an offline

Also is there a variable for the Extracted Install.wim ??
Also not sure an extracted install.wim - will react the same as a dism mounted install.wim

example;
E:\10PROx64\sources\install_wim\N
E:\10565x64\sources\install_wim\1

* Dism Add- Win10.txt (31.24 kB - downloaded 1238 times.)
« Last Edit: October 17, 2015, 04:35:18 AM by KYHI »

Re: Korean IME Support for Win10PESE
« Reply #16 on: October 17, 2015, 06:32:24 AM »

ied206

  • Chef
  • ***
  • Location: South Korea
  • Date Registered: Dec 2013
  • Posts: 136
Version 12, as a hotfix, is released.
I found  'Customize Apperance of IME Toolbar' option is not working in v11, so I updated this urgently.
However, because of my lack of free time, I could not test this scipt fully.
  (I tested a lot with 'Provide gulim.ttc' and 'Use D2Cdoing', but there still is a posibillity of bug)
So if you can test this version under variety of environments, I would be thankful.


1. UserPreferenceMask
Yesterday I noticed UserPreferenceMask was not masked in v11 as we intended.
As a result, 'Customize Apperance of IME Toolbar' functionality was broken in v11.

It happened because in SE Project, no other scripts did not set this value (as least for now), and Macro Library failed to mask a bit since there is no key named UserPreferenceMask.
It seems that when there is no registry key named UserPreferenceMask, Windows PE generate that value on runtime.

So I dealt with these lines of codes:
from these,
Code: [Select]
//IME Toolbar appears (More Precise, Bit40)
RegHiveLoad,Tmp_Default,%RegDefault%
If,%IME_Position_ScrollBox%,Equal,"Floating On Desktop",Begin
If,%SourceVer%,Bigger,6.1,Call,RegWriteBinaryBit,6,0,1,HKLM,0x3,"Tmp_Default\Control Panel\Desktop",UserPreferencesMask
RegWrite,HKLM,0x4,Tmp_Default\Software\Microsoft\CTF\LangBar,ShowStatus,0
End

to these.
Code: [Select]
[Process-Reg-LangBar]
// If UserPreferencesMask not exists, set it with PESE's default value, then mark bit40.
// If UserPreferencesMask already exists, mark bit40, retaining other bits. (Credit to Lancelot)
RegHiveLoad,Tmp_Default,%RegDefault%
If,%IME_Position_ScrollBox%,Equal,"Floating On Desktop",Begin
  If,%SourceVer%,Bigger,6.1,Begin
    If,Not,ExistRegKey,HKLM,"Tmp_Default\Control Panel\Desktop",UserPreferencesMask,RegWrite,HKLM,0x3,"Tmp_Default\Control Panel\Desktop",UserPreferencesMask,9e,3e,03,80,12,00,00,00
    Call,RegWriteBinaryBit,6,0,1,HKLM,0x3,"Tmp_Default\Control Panel\Desktop",UserPreferencesMask
  End
  RegWrite,HKLM,0x4,Tmp_Default\Software\Microsoft\CTF\LangBar,ShowStatus,0
End

Changed code will look if registry key UserPreferencesMask exists. If not, it will take care.
So it is settled.


2. %FullEnable% - unused code
In case of codes under line in v9 : 'If,CopyFull_ScrollBox,Equal,"Full",Begin'  (or %FullEnable%in v11), I intended to delete them but it seems I forgot.
I originally tried to make an option named 'File Copy Mode' (like 1-files.script) to add some advanced functionality and correct visual problem.

Code: [Select]
//----------------------Full S
Set,%FullEnable%,0
//Set,%FullEnable%,1
If,%FullEnable%,Equal,1,Begin
//IMCCPHR.dll not exists - 10240.16384.150709-1700.TH1_CLIENTENTERPRISEEVAL_OEMRET_X64FRE_KO-KR.iso
// Require_FileQ,msctf.dll - Already Exists
Require_FileQ,msctfp.dll
Require_FileQ,msctfui.dll
Require_FileQ,msctfuimanager.dll
//-
FileCopy,%Source_Win%\IME\%ImeKoreanFolder%\DICTS\mshwkorrIME.dll,%target_win%\IME\%ImeKoreanFolder%\DICTS\mshwkorrIME.dll
FileCopy,%Source_Sys%\IME\%ImeKoreanFolder%\imkrudt.dll,%target_sys%\IME\%ImeKoreanFolder%\imkrudt.dll
...

In my Host Windows 10 K

In Win10PESE
ila_rendered
In Host, a square written as 한 is displayed (한 for Korean IME), but in PE, it is not displayed.
That icon resides in IMEKRTIP.dll, but I could not figure out how to display this in PE.
However, it does not affect the core function of this plugin, so I gave up because of lack of time.
(If someone in this forum knows the cause and cure, it would be welcome to hear it.)
Which means these codes are removed in version 12.


3. Fonts - gulim.ttc, D2Coding
The ultimate way to handle gulim.ttc problem is dism method, but I didn't have time to apply it.
However, version 12 provide other ways to address inexistance of gulim.ttc.

gulim.ttc is a collection of Gulim, Dotum (variable-width), GulimChe, DotumChe (fixed-width).
(There is no gulim.ttf, just gulim.ttc as a collection of number of ttf)
However, I cannot embed this file since its size is too large (~13MB) and as Lancelot pointed, it is MS licensed file.
  (Korean fonts have ~128 (ASCII) + 24 (atomic hangul) + 11172 (combinationed hangul) + Hanja (Chinese characters, more than a ten thousand!) glyphs -> Size is too large!)

So I provide two options as workaround:
 
1) Provide gulim.ttc yourself
    You can extract gulim.ttc from other sources, such as ko-KR sources or en-US source prior to 10 (7, 8, 8.1).

2) Use D2Coding as alternative of GulimChe

    D2Coding is free font made by Naver and licensed under OFL, and as its name indicate, it is fixed-width font -> So it will be used in Console instead of gulim.ttc.
    The plugin is capable of download D2Coding from internet automatically, so all you need to do is to check to 'Use D2Coding for Console'
      (In fact, even if this option is not checked, the plugin will try this method if gulim.ttc not exists in source.)
    License is automatically inlcuded plugin itself, you can take a look.

With these remedies, you can use Korean IME plugin with Windows 10 en-US source without any trouble.


KYHI, Lancelot, thanks for your suggestions.
I am going to look at DISM method a week later.
« Last Edit: October 17, 2015, 06:47:08 AM by ied206, Reason: add some contents »

Re: Korean IME Support for Win10PESE
« Reply #17 on: October 17, 2015, 07:58:33 AM »

KYHI

  • Code Baker
  • Sr. Chef
  • ****
  • Location: Kentucky
  • Date Registered: Jan 2015
  • Posts: 909
you can get from Host on 7 8 8.1

If,not,existfile,%Source_win%\Fonts\gulim.ttc,Begin
  If,ExistFile,C:\Windows\Fonts\gulim.ttc,FileCopy,C:\Windows\Fonts\gulim.ttc,%target_win%\Fonts
  Else,Begin
  Call,Echo,"run Dism cmd to get needed Font",Warn,,MessageError,,Exit
End

with a note for the Dism cmd to get needed Font if win10 host
« Last Edit: October 17, 2015, 08:10:01 AM by KYHI »

Re: Korean IME Support for Win10PESE
« Reply #18 on: October 17, 2015, 01:24:29 PM »

Lancelot

  • Gena Baker
  • Grand Chef
  • *****
  • Date Registered: Sep 2010
  • Posts: 7386
Hi ied206, KYHI,

I found  'Customize Apperance of IME Toolbar' option is not working in v11, so I updated this urgently.
...
It happened because in SE Project, no other

I forgot to mention,
Chris already updated "2 - Shell & Config" plugin 3 days ago with default userpreferences mask....  (Win10PESE "2 - Shell & Config" v68, before I post)
 Still I kept If,Not,ExistReg...  :thumbsup:

*
to add some advanced functionality and correct visual problem.

We hardly understand you are working on something  :thumbsup:
(at first, it looked like you miss scrollbox  ;) )

This is a nice trick to publish plugin with unfinished development.  :wink:

Code: [Select]
Set,%FullEnable%,0
//Set,%FullEnable%,1
If,%FullEnable%,Equal,1,Begin

so others when read codes, easily understand you are working on things  :thumbsup:

or:

you can add a scrollbox and hide from interface before publish  :wink:  :thumbsup: :thumbsup:


+
'D2 Coding' license let us distribute for none commercial,
so I attached to plugin  :thumbsup:
no need download.
(Still it is better to keep codes  :wink: )

+
I also combined KYHI idea of getting gulim.ttc from host  :thumbsup:

++
as usual, I did not delete previous codes, I leave such things to you  :great:

+++++
... not perfect coding, low free time, but it does work nicely  :cool:
See History014....
better compare with your v12  :great:

*
for now I did not work dism download option....
 but as I mentioned earlier, I believe this is better on a seperate plugin at Utils\


Since I do not use 14-1 number  :tongue:
v14 on servers.
« Last Edit: October 17, 2015, 01:24:45 PM by Lancelot »

Re: Korean IME Support for Win10PESE
« Reply #19 on: October 17, 2015, 01:37:20 PM »

Lancelot

  • Gena Baker
  • Grand Chef
  • *****
  • Date Registered: Sep 2010
  • Posts: 7386
here is a list of Packages / features etc..  Available in Win10
The problem is the amount of test lines to add
Thanks KYHI

Also is there a variable for the Extracted Install.wim ??
no but it is on fixed folder path with fixed named plugin with fixed Interface variables on all SE projects...  :wink:

Since fixed plugin, You can read "Images configuration" values with "ChangeInterface,Read,Value," syntax,
 see  Update XXX (Exact and Secure) lines
   (they are not needed anymore at "Update XXX (Exact and Secure)" after we much later added auto detect checkbox to Images Configuration)


or better syntax to you,
Since fixed path, Check lines under Images configuration
Code: [Select]
If,%pCheck_ExtractWimFolder_AutoD%,Equal,True,Begin

Also not sure an extracted install.wim - will react the same as a dism mounted install.wim
Probably:
update install.wim with dism,
 and extract again  :wink:


Idea is not new:
 we had done it for Gena to support XP/2k3 sources which are updated by following ms instructions  :cool:
  so plugins would use updated files (.dll .exe etc....).
    Gena support these sources nicely  :smile: :smile:


It should be easier for SE (since path organisation is straight forward)
Procedure should be like:
 get official source,
 update with dism (via an Utils\ plugin )  :cool:
   and optionally extract wim  :wink:

updating extracted folders with dism is, as you mentioned, another question !

Well on your hands, free time went to bottom here......

:turtle:

 

Powered by EzPortal