Skip to content
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

kinto.sh does not start automatically on Windows 11 #883

Open
jeff9finger-usda opened this issue Oct 10, 2024 · 7 comments
Open

kinto.sh does not start automatically on Windows 11 #883

jeff9finger-usda opened this issue Oct 10, 2024 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@jeff9finger-usda
Copy link

jeff9finger-usda commented Oct 10, 2024

Describe the bug
kinto.sh does not start automatically on Windows 11

Expected behavior
I expect that kinto.sh will be started upon system startup and that it shows up in the system tray and is active.

Install Type: Bare Metal
Distro: Windows 11
DE: n/a
Branch: master, dev
Commit: git rev-parse --short HEAD

Logs and status if relevant
Don't know what to grab on Windows 11

@jeff9finger-usda jeff9finger-usda added the bug Something isn't working label Oct 10, 2024
@jeff9finger-usda
Copy link
Author

More details. The IT people are telling me that kinto should not appear in the taskbar upon reboot. So I opened this as a bug, just in case it isn't supposed to do that, but I can't imagine that it would not start automatically in normal cases. I strongly believe that there is some authorization restriction preventing this.

So, I think what I need to know is what auth/authz is needed to have this start automatically on Windows 11.

@RedBearAK
Copy link
Contributor

@jeff9finger-usda

Hey, it's me, from Toshy. I have used Kinto on Win11 without any issues. It does show up in the system tray, just like it did in Win10.

But it was just a personal system, and the user was an administrator. Could be a permissions issue if your Win11 user is not an admin.

This is totally unrelated to your previous issue with Toshy on RHEL, and I would have no idea how to fix the Windows version of Kinto. But it's definitely supposed to start automatically and show up in the tray, with a "k" icon like its Linux version.

kinto should not appear in the taskbar

Did you mean, "should appear"? Otherwise this sentence is confusing without further context.

@jeff9finger-usda
Copy link
Author

@RedBearAK Thanks for the response and confirmation.

As for your comment about "kinto should not appear in the taskbar", that is what I meant. The full context of that sentence

The IT people are telling me that kinto should not appear in the taskbar upon reboot.
is to say that the IT guys that have authority to make changes to my system, are thinking and telling me that I should not expect kinto to start automatically and to be in the taskbar. So that sentence it correct.

@rbreaves or any other contributor, do you all have any suggestions on what needs to change to allow kinto to start automatically?

@RedBearAK
Copy link
Contributor

@jeff9finger-usda

the IT guys that have authority to make changes to my system, are thinking and telling me that I should not expect kinto to start automatically and to be in the taskbar

That was my other possible interpretation. But I would think that would mean it may be difficult to get Kinto to autostart at login, if you aren't the one that has control over what gets allowed to autostart. They may be applying a policy that blocks things from being added as autostart items or services, or just stops them from running.

I assume that you are able to get Kinto to start manually, even though that hasn't been stated explicitly in this thread.

You may be stuck with that because of your managed IT environment. Kind of the like the permission issues with RHEL.

@jeff9finger-usda
Copy link
Author

@RedBearAK Thanks again for the info.

When I install kinto.sh, it starts and runs ok. I didn't see how to start it manually. Maybe I just missed a simple step?

As for the auto start issue, I think that the IT guys are willing to make the policy changes to allow auto start. They just need to know what to change.

@RedBearAK
Copy link
Contributor

@jeff9finger-usda

Maybe I just missed a simple step?

I doubt you missed anything, it's probably just being blocked by a policy setting. Only the IT people might know what they did to cause that.

When I install kinto.sh, it starts and runs ok.

Maybe you can use the technique I always used when I was working on new customizations of the Kinto AHK config file in Windows. There's a file called kinto-start.vbs that I think is in the same folder as your kinto.ahk file. If you double-click on that it should start Kinto up.

Once upon a time I somehow put a shortcut to that on the Win11 taskbar as if it was an application, but at some point after some Win11 updates the ability to do that seemed to disappear. So I mostly settled on having a shortcut to the file on the desktop, and also since I was using it a lot it would show up in the Start menu as a recent file.

If Kinto works fine after installing, it should mean that you can manually launch it with that script. I'm not aware of a more convenient way to launch it. I don't recall there being a "Start Kinto" item in the application menu in Windows, since it is intended to always auto-start itself.

As for the auto start issue, I think that the IT guys are willing to make the policy changes to allow auto start. They just need to know what to change.

Knowing IT people, it seems unlikely that they will be interested in making a specific exception to the auto-start blocking policy just for Kinto, but maybe you'll get lucky.

This Python function seems to be the entirety of what the setup script does when installing Kinto in Windows:

kinto/setup.py

Lines 17 to 88 in 4a3bfe7

def windows_setup():
keymaps = ["Apple keyboard standard", "Windows keyboard standard","Chromebook","IBM - No Super/Win","Uninstall"]
for index, item in enumerate(keymaps):
print(" %i. %s" % (index+1, item))
default = 0
while not int(default) in range(1,len(keymaps)+1):
default = int(input("\nPlease enter your desired keymap (1 - " + str(len(keymaps)) + ") : "))
print("")
# Short DOS path notation
path= cmdline('echo ''%cd%''')[:-1]
if default > 0 and default < 5:
print("Will now install chocolatey and autohotkey with elevated privileges...")
print("This install will fail if you are not running with elevated privileges")
os.system('powershell -executionpolicy bypass ".\\windows\\autohotkey.ps1"')
print("Copying autohotkey combinations for Terminals & Editors...")
os.system('copy /Y "' + path + '\\windows\\kinto.ahk" "' + homedir + '\\kinto-new.ahk"')
if default < 3:
os.system('C:\\Strawberry\\perl\\bin\\perl.exe -pi -e "s/(; )(.*)(; Default)(?!( - ST2CODE))(.*)/$2$3$5/gm" ' + homedir + '\\kinto-new.ahk')
if default == 1:
kbtype = "mac"
os.system('C:\\Strawberry\\perl\\bin\\perl.exe -pi -e "s/(; )(.*)(; MacModifiers)/$2$3/gm" ' + homedir + '\\kinto-new.ahk')
elif default == 2:
kbtype = "win"
os.system('C:\\Strawberry\\perl\\bin\\perl.exe -pi -e "s/(; )(.*)(; WinModifiers)/$2$3/gm" ' + homedir + '\\kinto-new.ahk')
elif default == 5:
print("Removing any old registry keys from prior versions...")
p = subprocess.Popen(['powershell.exe', "Remove-ItemProperty -Path HKLM:'SYSTEM\CurrentControlSet\Control\Keyboard Layout' -Name 'Scancode Map' -ErrorAction SilentlyContinue"], stdout=sys.stdout)
print("Removing Kinto from Startup folder...")
os.system("(del \"C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\StartUp\\kinto.ahk\") 2> nul")
os.system('(del "%userprofile%\\AppData\\Roaming\\Microsoft\\Windows\\STARTM~1\\Programs\\Startup\\kinto-start.vbs") 2> nul')
print("Ending any running Kinto tasks...")
os.system("(taskkill /IM autohotkey.exe) 2> nul")
print("Removing Kinto from users profile directory...")
os.system('(rd /s /q "%userprofile%\\.kinto") 2> nul')
print("")
print("Uninstall of Kinto is Complete.")
if default == 3:
kbtype = "chrome"
os.system('C:\\Strawberry\\perl\\bin\\perl.exe -pi -e "s/(; )(.*)(; Chromebook)/$2$3/gm" ' + homedir + '\\kinto-new.ahk')
os.system('C:\\Strawberry\\perl\\bin\\perl.exe -pi -e "s/(; )(.*)(; WinModifiers\/CB)/$2$3/gm" ' + homedir + '\\kinto-new.ahk')
if default == 3 or default == 4:
os.system('C:\\Strawberry\\perl\\bin\\perl.exe -pi -e "s/(; )(.*)(; CB\/IBM)/$2$3/gm" ' + homedir + '\\kinto-new.ahk')
os.system('C:\\Strawberry\\perl\\bin\\perl.exe -pi -e "s/(; )(.*)(; WinModifiers\/CB\/IBM)/$2$3/gm" ' + homedir + '\\kinto-new.ahk')
if default == 4:
kbtype = "ibm"
os.system('C:\\Strawberry\\perl\\bin\\perl.exe -pi -e "s/(; )(.*)(; IBM)/$2$3/gm" ' + homedir + '\\kinto-new.ahk')
if default > 0 and default < 5:
stvscode = yn_choice(bcolors.CYELLOW2 + "Would you like to use Sublime Text 3 keymaps in VS Code?\n" + bcolors.ENDC)
print("\nWill now install Ubuntu Terminal Theme as default...")
os.system('regedit "' + path + '\\windows\\theme_ubuntu.reg"')
os.system('robocopy "'+ path + '\\assets" "%userprofile%\\.kinto\\assets" /E')
if (stvscode and (default > 0 or default < 3)):
os.system('C:\\Strawberry\\perl\\bin\\perl.exe -pi -e "s/(; )(.*)(; Default - ST2CODE)/$2$3/gm" ' + homedir + '\\kinto-new.ahk')
elif (stvscode and (default == 3 or default == 4 )):
os.system('C:\\Strawberry\\perl\\bin\\perl.exe -pi -e "s/(; )(.*)(; CB/IBM - ST2CODE)/$2$3/gm" ' + homedir + '\\kinto-new.ahk')
os.system('copy /Y "' + path + '\\windows\\kinto-start.vbs" "%userprofile%\\.kinto\\kinto-start.vbs"')
os.system('C:\\Strawberry\\perl\\bin\\perl.exe -pi -e "s/{kbtype}/' + kbtype + '/gm" "%userprofile%\\.kinto\\kinto-start.vbs"')
os.system('copy /Y "' + path + '\\windows\\usb.vbs" "%userprofile%\\.kinto\\usb.vbs"')
os.system('copy /Y "' + path + '\\windows\\detectUSB.ahk" "%userprofile%\\.kinto\\detectUSB.ahk"')
os.system('mklink "%userprofile%\\AppData\\Roaming\\Microsoft\\Windows\\STARTM~1\\Programs\\Startup\\kinto-start.vbs" "%userprofile%\\.kinto\\kinto-start.vbs"')
os.system('copy /Y "'+ path + '\\windows\\NoShell.vbs" "%userprofile%\\.kinto\\NoShell.vbs"')
os.system('copy /Y "'+ path + '\\windows\\toggle_kb.bat" "%userprofile%\\.kinto\\toggle_kb.bat"')
os.system('copy /Y "'+ homedir + '\\kinto-new.ahk" "%userprofile%\\.kinto\\kinto.ahk"')
os.system("del /f " + homedir + "\\kinto-new.ahk")
os.system("del \"C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\StartUp\\kinto.ahk\" 2> nul")
userpath = cmdline('cmd /c for %A in ("%userprofile%") do @echo %~sA')[:-1]
print('Starting... "' + userpath + '\\AppData\\Roaming\\Microsoft\\Windows\\STARTM~1\\Programs\\Startup\\kinto-start.vbs"')
os.system('"' + userpath + '\\AppData\\Roaming\\Microsoft\\Windows\\STARTM~1\\Programs\\Startup\\kinto-start.vbs"')
# # print("\nPlease log off and back on for changes to take full effect.")
print("If using WSL then please remember to right click on title bar -> Properties -> Edit Options -> Use Ctrl+Shift+C/V as Copy/Paste and enable it.")
else:
os.system("(del \"C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\StartUp\\kinto.ahk\") 2> nul")

The key is probably this line in the last if block, which makes a link from the kinto-start.vbs script into a startup folder location:

os.system('mklink "%userprofile%\\AppData\\Roaming\\Microsoft\\Windows\\STARTM~1\\Programs\\Startup\\kinto-start.vbs" "%userprofile%\\.kinto\\kinto-start.vbs"')

@jeff9finger-usda
Copy link
Author

jeff9finger-usda commented Oct 25, 2024

Thank you for the detailed comment. It does appear to be that I am unable to add things to the location they need to be in to allow auto start. I can probably get this change authorized. Just needed to know what needed to be done.

This issue can be closed now, as I think it is resolved. Hopefully, this will provide documentation for others who might run into the same thing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants