-
Notifications
You must be signed in to change notification settings - Fork 90
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
Add file association with .jar #112
Comments
I couldn't get this to work in Windows 11, sadly. Here's how I got it to work instead: I found a program that can set file associations here (I found a scoop manifest for it here). But it needs a ProgId to be passed as the file type association, so I modified your batch file to a registry file like so: Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Classes\.jar]
@="scoop-javaw"
[HKEY_CURRENT_USER\Software\Classes\scoop-javaw]
@="Java Archive"
[HKEY_CURRENT_USER\Software\Classes\scoop-javaw\DefaultIcon]
@="C:\\Users\\<username-goes-here>\\scoop\\apps\\openjdk\\current\\bin\\javaw.exe,1"
[HKEY_CURRENT_USER\Software\Classes\scoop-javaw\shell]
[HKEY_CURRENT_USER\Software\Classes\scoop-javaw\shell\open]
[HKEY_CURRENT_USER\Software\Classes\scoop-javaw\shell\open\command]
@="\"C:\\Users\\<username-goes-here>\\scoop\\apps\\openjdk\\current\\bin\\javaw.exe\" -jar \"%1\"" Unfortunately, I couldn't get Once you've saved this as a > SetUserFTA .jar scoop-javaw The file association should work immediately. But for the DefaultIcon to show up you might need to restart File Explorer. Hope this helps someone. Edited 05/09/2022 to fix reg file not adding paths to registry (needed to escape each |
@tech189 Hi. I've customised your reg script and the icon didn't work for me. In my case, just remove Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Classes\.jar]
@="scoop-javaw"
[HKEY_CURRENT_USER\Software\Classes\scoop-javaw]
@="Java Archive"
[HKEY_CURRENT_USER\Software\Classes\scoop-javaw\DefaultIcon]
- @="C:\\Users\\<username-goes-here>\\scoop\\apps\\openjdk\\current\\bin\\javaw.exe,1"
+ @="C:\\Users\\<username-goes-here>\\scoop\\apps\\openjdk\\current\\bin\\javaw.exe"
[HKEY_CURRENT_USER\Software\Classes\scoop-javaw\shell]
[HKEY_CURRENT_USER\Software\Classes\scoop-javaw\shell\open]
[HKEY_CURRENT_USER\Software\Classes\scoop-javaw\shell\open\command]
@="\"C:\\Users\\<username-goes-here>\\scoop\\apps\\openjdk\\current\\bin\\javaw.exe\" -jar \"%1\"" Thank you very much. |
Scoop uses Powershell internally. For consistency, should a user-invoked post-install script be made for Powershell? Also, note I'm looking into the feasibility of https://github.com/DanysysTeam/PS-SFTA atm |
Running executable JARs requires calling
java.exe -jar "%1"
, but when selecting the java.exe in explorer, it usesjava.exe "%1"
, which fails.i suggest adding something like:
manifests:
/scripts/associate-javaw.bat:
The text was updated successfully, but these errors were encountered: