[5.0] Portable Zotero
This discussion was created from comments split from: Zotero 5.0 Beta.
This is an old discussion that has not been active in a long time. Before commenting here, you should strongly consider starting a new discussion instead. If you think the content of this discussion is still relevant, you can link to it from your new discussion.
But for real work, they really would want to use the connector with the Zotero client, since the website is still much more limited and less efficient. You also need the desktop version for word processor integration (though that depends whether the students can install the Word/LibreOffice plugin on a lab computer). I don't know off-hand what's involved in producing a portable version, but if people want to work on that I'm happy to offer guidance.
https://portableapps.com/node/36565
You have to have PortableApps installed on the USB drive. You then use the PortableApps interface to "Install a new app" ("Get more apps" won't come up with Zotero on the menu). This installs version 4.0.19 on the USB. You can then update from the Zotero menu. Just did this and it updated to 4.0.29.17.
This gives you the full Zotero client, on the USB, with the library storage also on the USB. I run this on a 256 GB portable SSD. Works great.
Is there any way of telling Z5 you really want to use the profile directory in the PortableZotero directory? I could set a custom location for the data directory - but then I'd have an absolute address, and if the USB stick gets given a different drive letter next time I plug it in, Zotero won't be able to find its data directory.
BTW, you don't actually need the PortableApps environment to run portable apps - you can just download the PAF file from the link above and when you double-click on it, it will install to any folder you tell it to. You can then run it manually from the folder where you put it by finding the Zotero exe file and double-clicking on it. Having the PortableApps environment installed on the USB drive adds a few nice features, like being able to manage your apps and use your own fonts, but it isn't required.
How do you specify the profile directory here? I assume this uses the -profile flag, dynamically setting the path based on the directory it's running from?
It seems like we could support this with one of two ways — a flag to tell Zotero to use 'zotero' within the profile directory like it used to or a flag to specify a data directory explicitly, overriding any data directory specified in the prefs in the profile directory.
@dstillman : for Z4, I used to have a folder with Zotero installed in it and the database in a subfolder. I was using a shortcut to launch Zotero with arguments [-profile "profile\Profiles\XXXX"]
Would be wonderful if we could have a way to make this work with Zotero 5...
Edit: nevermind.
1) Extract Zotero using Universal Extractor
2) In the Zotero.exe folder, create a new file, zotero-portable.cmd and paste the following to redirect several system folders to a subfolder named 'data' contained in the zotero.exe directory.
@echo off
set APPDATA=%~dp0data\AppData\Roaming
set LOCALAPPDATA=%~dp0data\AppData\Local
set HOMEDRIVE=%~d0
set HOMEPATH=%~p0data
set USERPROFILE=%~dp0data
%~dp0zotero.exe
3) run zotero-portable.cmd. Some files will be created in the data folder (located in the same folder as zotero-portable.cmd). Also, some files will be created in the real %appdata%\Roaming, %appdata%\Local, and %homepath%\Zotero
4) close Zotero and run zotero-portable.cmd again. This time, a proper profile will be created in the redirected AppData folders.
For Zotero 4, this was enough. The problem in Zotero 5 that the database remains in the real %homepath% directory. There are now two options: use junctions, symlinks to redirect %homepath%\Zotero to a location of your choosing. This is seamless but requires admin permissions and is not very portable across OS's or edit the preferences to point to a location of our choosing. I'll go with the second option.
5) copy %homepath%\Zotero to the 'data' subdirectory created in step 2.
6) edit the file data\AppData\Roaming\Zotero\Zotero\Profiles\\prefs.js and change the 'extensions.zotero.dataDir' entry to ABSOLUTE path to the Zotero folder copied in step 5. (Note this can also be done from Zotero)
Right now, step 6 is not very portable since it has to be manually done but changing this automatically is scriptable as part of zotero-portable.cmd
Just to be sure to understand. Database will be impossible to migrate out of profile folder? In my case, even if you find a way to link/copy/junction, if it required admin permission, it will be unusable. I have a limit of space to my profile, and my current database exceed that.
I will follow carefully this post, hoping someone come with a great idea to solve this. Thanks
Thanks
-datadir profile
to the Zotero executable to have it use a 'zotero' directory within the Zotero profile directory, the same as Zotero 4.0 did. (It also takes an absolute path.)This is available in the latest 5.0 Beta, and it'll be included in 5.0.18, which should be out in a day or two.
I then open Zotero with that shortcut and under preferences it lists my Data Directory Location as "C:\Users\Home\AppData\Roaming\Zotero\Zotero\Profiles\d7222u6c.default\zotero"
It also says "(specified via command line)" and I can't change the directory location.
I also tried opening Zotero with the regular .exe and changed the Data Directory to the Zoter folder within my portableFirefox data. It reads all my old data in, but I'm wondering if this is going to work.
How can I properly change the directory to a location on my Flash drive? Do I need to do all (or some) of the things @ferrio suggests? And is there a way to use relative paths to ensure that I can use Portable Zotero while different PC's recognize the flash drive as E:\, F:\, or I:\ etc.
Thank you all.
- Is it OK with the zotero's developers if I publish it on the internet? (PortableApps forums or GitHub)
- Are people here interested in using it?
I can't speak for the developers, but AFAIK they never objected to previous portability efforts.
I'm looking forward to this.
Thanks,
Claudio
Here's the installer:
- edit - ref. GitHub below to download last version.
It's not finished yet. You'll find some trace of the template I used if you look into the files and folders after installation. But it seems to me that it is working...
I'm gonna create a thread on portableapps forums so you'll be able to tell me if there's things not working. I'll post a link here, just maybe not today :(
I modified the splash screen when you launch the program to reflect @adamsmith 's comment: https://www.dropbox.com/s/zk96g07da4duhks/Splash.jpg
I made a modification: pdftotext and pdfinfo are already installed.
I'm ready to receive any comments, but I'm just a french librarian doing this on his free time, I may not be able to answer to everything :P
I don't really understand why... Could someone explain? (poke @danstillman )
However, will try to use on regular basis to see how it goes.
MERCI!!
Mélanie
Thoses %Appdata% leftovers are pissing me off. I cannot figure out a way to make Zotero fully portable. I think it's related to the prefs.js file that Zotero re-locate everytime in %appdata%.
I created a thread on portableapps as planned :
https://portableapps.com/node/56957
But nobody is answering me on those forums.
I've found a solution.
You can download new version here:
- edit - ref. GitHub below to download last version.
Link to Portable apps topic:
https://portableapps.com/node/56957
Source is now on GitHub:
https://github.com/pedrom34/ZoteroPortable
In the ZoteroPortable.ini file you added SupportsUNC=yes
Is it really save starting a zotero portable client on a network share?
https://portableapps.com/manuals/PortableApps.comLauncher/ref/launcher.ini/launch.html#supportsunc
Thanks for your feedback :)