View Single Post
Old 02-24-2019, 07:15 AM   #5
latepaul
Wizard
latepaul ought to be getting tired of karma fortunes by now.latepaul ought to be getting tired of karma fortunes by now.latepaul ought to be getting tired of karma fortunes by now.latepaul ought to be getting tired of karma fortunes by now.latepaul ought to be getting tired of karma fortunes by now.latepaul ought to be getting tired of karma fortunes by now.latepaul ought to be getting tired of karma fortunes by now.latepaul ought to be getting tired of karma fortunes by now.latepaul ought to be getting tired of karma fortunes by now.latepaul ought to be getting tired of karma fortunes by now.latepaul ought to be getting tired of karma fortunes by now.
 
latepaul's Avatar
 
Posts: 1,270
Karma: 10468300
Join Date: Dec 2011
Device: a variety (mostly kindles and kobos)
Hi stisev,

I got the bat file working. There are a couple of issues with it, which to be fair to itimpi is probably because things have changed since 2012.

Firstly

Code:
START /belownormal Calibre --with-library --start in tray "%CALIBRE_LIBRARY_DIRECTORY%"
should be
Code:
START /belownormal calibreportable --start-in-tray --with-library "%CALIBRE_LIBRARY_DIRECTORY%"
Note that we run calibreportable not Calibre - because it's looking for a calibre.exe in a Calibre2 directory, or failing that the system path somewhere, but the portable exe is called calibreportable.exe.

Also the added "-"s between "start" "in" and "tray", as it's all one command line flag.

And the --with-library takes an argument so the "%CALIBRE_LIBRARY_DIRECTORY%" needs to follow it. As it was, calibre kept creating an empty library in a directory called "--start"!


Secondly, this part

Code:
IF EXIST U:\eBooks\CalibreLibrary (
	SET CALIBRE_LIBRARY_DIRECTORY=U:\eBOOKS\CalibreLibrary
	ECHO LIBRARY FILES:      U:\eBOOKS\CalibreLibrary
)
IF EXIST CalibreLibrary (
	SET CALIBRE_LIBRARY_DIRECTORY=%cd%\CalibreLibrary
	ECHO LIBRARY FILES:      %cd%\CalibreLibrary
)
is looking for a library at U:\eBooks\CalibreLibrary, if that's not found it looks for a CalibreLibrary subdirectory of the current directory. Since neither exist on my PC CALIBRE_LIBRARY_DIRECTORY never got set.

I changed it to:

Code:
IF EXIST data\library (
	SET CALIBRE_LIBRARY_DIRECTORY=%cd%\data\library
	ECHO LIBRARY FILES:      %CALIBRE_LIBRARY_DIRECTORY%
)
which is where the current portable apps calibreportable puts its library (i.e. \PortableApps\calibrePortable\data\library). If I were using this for real I might ditch the "IF EXIST" part or at least have a valid fallback value for CALIBRE_LIBRARY_DIRECTORY.

I didn't take it further - this works - but neither CALIBRE_CONFIG_DIRECTORY nor CALIBRE_OVERRIDE_DATABASE_PATH get set for similar reasons. I think the layout of portable apps has changed since 2012.

HTH

Last edited by latepaul; 02-24-2019 at 07:17 AM. Reason: clarity
latepaul is offline   Reply With Quote