It would be nice if the Chrome extension would be automatically installed during the main installation routine.
Shouldn't be that hard to implement: https://developer.chrome.com/extensions/external_extensions
@LyzardKing interested? 馃槃
(For Firefox something like this is sadly not supported: https://blog.mozilla.org/addons/2019/10/31/firefox-to-discontinue-sideloaded-extensions/)
If Firefox is installed: Open JabRef extension page in firefox store.
@LyzardKing Ping? 馃槆
Firefox download page would be something like
https://addons.mozilla.org/de/firefox/addon/jabref/?src=search
I'll have a look at it! I don't have too much time, but I'll see what I can do :)
Ok.. I have the correct file, and it works on Chrome.
We need to set a trigger to copy the file in the correct folder (creating it if it doesn't exist).
This can be done on a non snap browser easily with sudo credentials.
Should this be part of the deb install? I can add to the postinstall trigger there.
The macos part should be the same.. I can test that easily.
The windows implementations requires editing the registry. I have no idea how to do that (my last windows machine was windows 98 a while back) but I'm willing to try if you have any suggestion!
Perfect. Thanks a lot @LyzardKing!
Yes, the idea was to add these steps to the installation routines as post-actions. For Windows, adding a line similar to https://github.com/JabRef/jabref/blob/3bc1f0236cdfef81cb36ebce23f9350b1615928e/buildres/windows/JabRef-post-image.wsf#L24 should work. I can also have a look at the Windows stuff.
I opened a branch to test this out.. I only added the postinst/postrm scripts, but I'll start from there.
@tobiasdiez I'll try the windows integration!
I still have to look at the macos implementation in jpackage
@tobiasdiez
In https://developer.chrome.com/extensions/external_extensions it seems like the current settings should not work in 64bit versions of windows..
Find or create the following key in the registry:
32-bit Windows: HKEY_LOCAL_MACHINE\Software\Google\Chrome\Extensions 64-bit Windows: HKEY_LOCAL_MACHINE\Software\Wow6432Node\Google\Chrome\Extensions
Am I missing something or should the .wsf be changed? At the moment it only seems to access the 32 bit folders..
@LyzardKing May I ask about an update? 馃槆
Yes sorry...
The linux part seems to work (in the deb...)
I need to test it in a clean vm, but I plan to do that later today.
Regarding the windows part I'm waiting for a reply on the previous comment,regarding 32/64bit paths in regex.
The snap is up next, but the issue is that we should ask for more permissions, and in #6353 the issue of whether to ask for classic (unconfined) snap would be better, to enable the different integrations.
I cannot find (and I unfortunately haven't had too much time to look at it) macos instructions for jpackage.
Sorry, I've overlooked your comment. The 32-bit folder HKEY_LOCAL_MACHINE\Software\Google\Chrome\Extensions works fine on my 64bit machine, and so far nobody complained. I would thus leave it as it is right now.
Ok! I just wanted confirmation that it works, since it shouldn't according to the google website.
I uploaded a branch with the deb part for now.
Just to recap...
I looked at this again, and I cannot figure out if a .app mac program can have a postinstall trigger.
The only idea I have is to add something in jabref itself on the first run..
But it's a bit of a bodge...
Regarding windows support, It's not too clear to me how the file should be formed.. since I can add the key in the registry, but then I'd need to set a named property...
Here is some info on this topic:
https://docs.oracle.com/en/java/javase/14/jpackage/override-jpackage-resources.html#GUID-62412365-821D-4736-A20D-70F2D47136D8
There is a postinstall script for pgk and for dmg you might need to integrate such thing in the dmg scpt. That is some AppleScript. Someone who's got a a mac could add some lines to copy the files
Now we just need it for windows as well. Probably inlcude this in the wix installer scripts.
I'm not expert... in fact not at all...but could a change like this in the JabRef-post-image.wsf work?
contents = contents.replace("</Product>", "<RegistryKey Root=\"HKMU\" Key=\"Software\\Google\\Chrome\\Extensions\" Action=\"createAndRemoveOnUninstall\" ForceCreateOnInstall=\"yes\"><RegistryValue Type=\"string\" Value=\"bifehkofibaamoeaopjglfkddgkijdlh"/><Property Id=\"update_url\" Value=\"https://clients2.google.com/service/update2/crx\" /></RegistryKey></Product>");
@tobiasdiez You might know how it works..
That looks promising indeed. Not sure when I find the time to try this.