-
Notifications
You must be signed in to change notification settings - Fork 16
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 userinit instead of, or in addition to, shell replacement. #109
Comments
If I understand everything you wrote correctly, UserInit would be more like the older method that uses the registry key HKLM/Software\Microsoft\Windows\CurrentVersion\Run to launch the client, but sooner in the startup chain. I'm reading This definitely sounds like a great option in addition to the existing two options. I think at least for most use cases it's probably the best option available. I'll do some testing and see if I can add this as an option to the installer! |
@kylemhall I tested this a bit more, specifically the (non) blocking behavior and the networking behavior. I was wrong about the blocking. The first entry in Based on that, I'm confident everything in For the network behavior, I'm not sure if that linked doc is correct based on what I observed, at least for Win10. I tested two different Win10 machines. One was a VM with a wired connection and one was a laptop with a WiFi connection. I tested by replacing the I was also able to manually run
Those are very similar. Either would be great IMO. Let me know if there's anything else that would be helpful for me to test. |
I think overriding There could be other alternatives to solve the problem without resorting to the use of For that to work, the installer would have to know in advance the name of the OS user running Libki. Currently, the installer is replacing |
I have performed additional tests on a Windows 10 21H2 machine:
From that test, it seems |
Overview
It can be tough to get the Libki client configured so it loads after user (auto) login, but before the user shell starts. It would be nice if there were a cleaner way to start the Libki client between those two events. I think
userinit
may be a decent solution to consider and, based on my testing, it seems to work well as-is.Problem
The shell replacement option in the installer doesn't work well in some cases. It looks like Libki client is running
explorer.exe
to launch the shell. This StackOverflow question describes some of the conditions that need to be met to get that to work. Specifically:One of the other answers in that StackOverflow question claims that
C:\Windows\explorer.exe
will always launch the shell, but that's incorrect based on my testing. It doesn't change anything.The above is saying that
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon
must haveShell=explorer.exe
for the normal shell to launch when runningexplorer.exe
. Based on my testing, that's correct. With that value set toC:\Program Files (x86)\Libki\libkiclient.exe
the normal shell won't launch whenexplorer.exe
is run. Based on my testing all that happens is the file manager launches.I tried updating the
run_on_login
option in the Libki client.ini
config with a script that would modify the above registry value prior to launchingexplorer.exe
, but I ran into two issues.libkiclient.exe
. This isn't impossible and would probably be tolerable if it were the only drawback.HKEY_LOCAL_MACHINE
and guest accounts don't.Solution
Based on my testing, the
Userinit
value in that same registry key may be a better solution. I've only tested the use case that fits my needs, but it seems to work really well as-is. This is what I did.Prep PC
Create two user accounts; an administrator named
Tech
and a guest (aka limited) account.Install Libki Client
Install the client. When prompted for
Client Information
:Tech
(or the name of the admin account).When prompted for
Startup Mode
:Post Install Config
As the administrator, open a PowerShell prompt and run the following command to modify the
Userinit
registry value.Explanation
I couldn't find much documentation for Userinit, so this is based on what I've observed. I think the programs run sequentially and the first one (
libkiclient.exe
) will block the second one (userinit.exe
) from running. I'm basing that on the way it behaves when I login. The guest account blocks with the Libki client UI until a successful authentication occurs. The administrator account continues right away. I assume that's exiting here because of theRun for all users but this one
option.I don't know enough about C++ and QT to step my way through the rest of the client to see how / where it exits. I assume the main process needs to exit before
userinit.exe
will run, but I don't know for sure. It's worth paying attention to because the current startup behavior seems to be good as-is and, sincelibkiclient.exe
is running beforeuserinit.exe
, care would need to be taken to ensure nothing is ever changed in a way that blocksuserinit.exe
from loading.The text was updated successfully, but these errors were encountered: