-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider building layout library with CMake and using K(eyboard)L(ayout)I(nstaller) #1
Comments
@davidebeatrici somehow I never noticed your comment until I did just now by accident. Ugh, that's a difficult question to answer. On one hand, I'm totally for switching build infrastructure of these layouts to something "more open". On the other hand though, I have no plans to change them further, and I don't think Windows on ARM is prominent enough already for me to worry about it. I would only be able test amd64 and wow64, and would have to just blindly trust that the other builds work. By the way, the driver archive you have in davidebeatrici/kli#1 doesn't even have a wow64 build. I wonder if that was intentional. Probably not? Also, note that different platforms require different compile flags for layouts to work, so I'm not sure you can have a single CMake config file work for all platforms. Also some more questions/thoughts about KLI:
The rest of this comment is kinda offtopic. The abandonware status of MSKLC made me think that it would be super awesome to have an open-source replacement for both MLKLC and KbdEdit. KLI could be its nice "behind the hood" tool for generating the installers. However I never even attempted to do anything in that direction because:
There is one thing that bothers me significantly enough and would certainly cause me to rebuild my layouts: it's the "new" layout features from Win8+. I do check from time to time whether anyone has figured out how to make custom keyboard layouts support them, but that doesn't seem to be the case so far. :( |
No worries, thanks for the detailed reply!
WOW64 is the 32 bit compatibility layer used on 64 bit Windows, am I missing something?
Even if a particular architecture required specific flags it would not be a problem, as CMake supports
It would be a nice addition, right now you can run KLI (with the same configuration) in order to uninstall the layout.
Agreed.
I confirm layouts can be installed by running the MSI file, Achieving a single independent MSI file for each architecture would indeed be ideal and something worth pursuing.
I mainly use Linux, but I write code for other platforms as well. Windows on ARM is indeed kinda "experimental", to the point that not even Visual Studio is built natively for it yet: https://developercommunity.visualstudio.com/t/native-arm-support-for-visual-studio/1161018
Which features are you referring to, in particular? |
Yes, and it requires a separate keyboard layout DLL. The two links below discuss that. I suppose this might also be the case when running x86 apps on arm64, as I read that that emulation also uses a similar WoW64 emulation mechanism.
Okay, that's cool!
And apparently it is possible, as I just stumbled upon this link. It requires having WiX Toolset installed, but it's not a big price to pay, if everything else works. I might try it out next weekend or some other time.
Oh, same here, except I'm a web developer. These keyboard layouts are pretty much my only pet projects on Windows/Mac, and even those are rather dormant.
I've listed them in the README. Stock Windows 8 and 10 keyboard layouts are shipped with several new features, namely:
However, the keyboard layout dll file format seems to have remained unchanged, and this new functionality was instead placed elsewhere. I was unable to find ways to add these features to my layouts when I looked, and it doesn't seem like anyone else would've had any success there either. |
@davidebeatrici so I booted to Windows and used burn.exe from WiX toolset to decompile the MSI file.
So the only thing that currently prevents us from having a completely open-source MSI version of that MSKLC-generated installer is this DLL. With this extension at hand, proper per-platform (and maybe even cross-platform, if MSI allows that) MSI files could be generated. Would you be interested in transforming KLI into such WiX extension? A setup.exe could then also be created as a thin wrapper, although I guess it would only be useful if/when platform-specific MSIs were used. On the other hand, if a single MSI file would be be generated, it would be more practical to just package that MSI in a self-extracting archive instead and launch msiexec automatically after extracting. What do you think? |
Further findings: I md5sum'ed all three of these dll's extracted by burn.exe (one from each platform msi), and they are all identical, so it's indeed the same file in all cases (BTW, apparently, this is how WiX 3 works, and it's also mentioned here, although in this case even ia64 didn't get a separate build). Apparently, this might be an issue when installing on a machine without WoW64 (apparently, some server editions now ship without this layer), so here's one more reason (in addition to licensing) to rewrite it instead of just copying it. |
Please note that I documented the relevant WinAPI functions: https://github.com/davidebeatrici/kli/wiki/WinAPI-reference Transforming KLI into a WiX extension is an excellent idea, I will attempt that. As for the single MSI file in a self-extracting package: it would be ideal. |
@davidebeatrici It's really great that you have these functions documented already! I'm currently trying to recompile the KLC installer using wix, just to see that the resulting file works. |
Less good news: you cannot have multiplatform MSI files. However, a single wix source file could be used to generate msi packages for all platforms. I've diffed all three decompiled wxs files, and their differences are neglible (randomly-generated identifiers differ, and the 32-bit version has two extra conditions specified which prevent it from being installed on 64-bit systems), so I guess a single wxs with multiple msi's is the way to go... |
@davidebeatrici I've committed my current progress to the new-installer branch. Things are looking good. :) I've cleaned up the wxs file and wrote a batch file to build all three of the current installers. Interestingly, the resulting MSI files are even smaller than the ones produced by MSKLC, even though they already embed the DLLs they are installing (although I admit, dark did warn me during decompilation that some functionality would be left out). I've tested, and all three MSIs work as expected on my platform (amd64): the ia64 one is refused by MSI, the i386 one rejects installation with a custom message, and the amd64 one gets installed and enables the layout. |
To avoid spamming this "issue" page further, I created a wiki page too, to collect whatever info I might find relevant to any effort of rewriting/replacing (parts of) MSKLC and/or working around its issues. |
@davidebeatrici, do you have an idea when you'd be willing to attempt it? |
Sorry for the delay, I've been busy with other projects. The wiki page you created is awesome! I unfortunately don't have an ETA for when I'll attempt to write the WiX extension, feel free to step in if you want to work on it instead. |
Visual Studio 2022 17.3 Preview 2 is now available and is the first version of Visual Studio to run natively on ARM devices running Windows 11. |
Awesome! https://developercommunity.visualstudio.com/t/native-arm-support-for-visual-studio/1161018 It was actually already possible to build keyboard layouts for ARM64, with a cross compiler. |
A little status update.
|
Thanks for the update! I'm surprised you couldn't get the layout to compile for ARM using NMake, since it's what CMake uses (unless Ninja is set). Building for different platforms without explicitly calling CMake multiple times is possible, but it's far more complex than it should be with Visual Studio: On Linux it would just be a matter of selecting the corresponding cross-compiler, ideally through the use of a specific toolchain. As for the commands executed by |
I mean I couldn't do that from a single VS "Tools Command Prompt" the way I wanted (although yes, I wasn't able to do that at at all, in the end). Maybe I just started the wrong one? Either way, if I was thinking, perhaps I should go dump environment variables that these build commands are started with, in addition to just the command line... |
Yes, the environment variables are mandatory. |
I've updated the wiki page with environment vars. Not much to see there, as it doesn't seem like |
I originally found this repository while looking up whether Microsoft Keyboard Layout Creator supports ARM64.
Upon discovering that it doesn't, I decided to:
For reference: thomasfaingnaert/win-us-intl-altgr#6
Would you be interested in setting up something similar?
The text was updated successfully, but these errors were encountered: