Installer for Input Method Environment on Windows
Installer for Input Method Environment on Windows | Windows中输入法(IME)的安装
Surf in internet and find one open source project on Windows: The Free PinYin IME. It has a installer writen in C. This is what the example of freepy's (free pingyin) installer did: 在网上闲逛,发现了一个Windows下的开源软件--自由拼音输入法。�自由拼音�的安装程序(一个用C写的程序)作了这些事情:
1. Copy the files:
���� freepy.hlp ---> $(WINNT)\system32
���� freepy.tab ---> $(WINNT)\system32
���� freepysys.dic ---> $(WINNT)\system32� (the dictionay file)
���� freepy.ime ---> $(WINNT)\system32
2. Register the input method
���� Call ImmInstallIME( sImeFile, FREEPYIMENAME) in imm32.dll (prototype defined in imm.h)
3. Create the registry entry
���� [HKEY_LOCAL_MACHINE\Software\freepy]
���� "ConversionSet"=dword:6101
The drawback is, the IME can not be uninstalled be user. So I spend five minutes to build a installer for it. The most difficult part is registering the IME, I have to write a companion DLL to do that. If the registration succed, the fowllowing register entry will be created.
这样做有一个不足,用户无法自己卸载这个输入法。我花了五分钟用做了个安装程序。然后发现一个问题:imm32.dll里面导出的是ImmInstallIMEW和ImmInstallIMEA这两个函数,而用任何一个函数在Wise里都不能正确注册,这个问题一部分也与Wise在处理Action时候的bug以及对路径变量字符串
的处理有关。最后,只好写了个DLL, 用它来作custom action去注册IME. 注册成功会在注册表里生成以下键值:
���� [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layouts\E0220804]
���� "Ime File"="FREEPY.IME"
���� "Layout Text"="Chinese (Simplified) - Free PinYin"
���� "Layout File"="kbdus.dll"
The path name "E0220804" was created by imm.dll, and 0804 refer to "Chinese Simplified". "E022" is a incremental index, however all the East Esia IME on my computer has a index of "EXXX". The final installer can be downloaded here. It's a MSI installer, you may have to install Microsoft's MSI service before you can use it. 主键名E0220804是Windows生成的, 0804表明是简体中文输入法(0404是繁体中文,0411是日文,0412是韩文),E022这个似乎是按安装顺序递增的,但所有的东亚输入法都是E打头,不知道这个在哪里定义的。最后生成的安装程序可以在这里下载。这是一个MSI安装程序,如果你不能安装那么需要先装微软的MSI服务程序。
posted 2004.02.25 Wednesday
分类
Technology

发表评论