Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 07-29-2013, 03:39 PM   #1
megamaniac
Junior Member
megamaniac began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Jul 2013
Device: Galaxy Nexus
Lightbulb Solution: Calibre AutoUpdater [Auto-Updater]

Dear community

I really like the agile development and short release cycles with user driven updates. This makes Calibre the tool I like. Although there is a pain because of the lacking auto update mechanism.

In the last minutes I wrote my own solution wrapped around the calibre portable installer. See commented version below. Probably someone could embed button/link into the update notification which executs a configurable command line command (in this case the .bat path).

Kind regards!

===
REM Auto-Updater for Calibre Portable
REM tested on Windows but easily adaptable for other OS, please use proper paths and process kill command
REM Preparation
REM Download (compile) curl from http://curl.haxx.se/

REM set curlBin to binary path, e.g.:
set curlBin=c:/_Portable/Internet/curl-7.22.0-w32/curl.exe

REM set tempFile to a unique file with existing parent directory, readable and writable
set tempFile=C:/Temp/calibreTemp.exe

REM use the entry url of calibre download page (probably test it with your web browser)
set staticUrl=http://status.calibre-ebook.com/dist/portable

REM choose your installation directory for Calibre, prompts wether existing installation shell be updated or not, avoid the ending slash
set targetDir="c:/_Portable/Office/Calibre Portable"

REM shuts down calibre instance immediatly if running (you may also use pskill or ps for linux)
taskkill -IM calibre.exe /T
%curlBin% --url %staticUrl% -L --output %tempFile%
%tempFile% %targetDir%
del %tempFile%
exit
Attached Files
File Type: bat UpdateCalibre.bat (973 Bytes, 329 views)

Last edited by megamaniac; 07-31-2013 at 03:34 PM. Reason: added the option "/T" to taskkill to kill the hole process subtree (like epub reader instances etc.)
megamaniac is offline   Reply With Quote
Old 07-31-2013, 02:21 PM   #2
jemkeith
Enthusiast
jemkeith began at the beginning.
 
Posts: 25
Karma: 10
Join Date: Jan 2011
Device: Nook
Thanks for this! I'm going to use task scheduler to set it to run every Friday night! i don't have to ever worry about downloading it and installing it anymore. Thank you!
jemkeith is offline   Reply With Quote
Advert
Old 07-31-2013, 02:32 PM   #3
PeterT
Grand Sorcerer
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
PeterT's Avatar
 
Posts: 12,160
Karma: 73448616
Join Date: Nov 2007
Location: Toronto
Device: Nexus 7, Clara, Touch, Tolino EPOS
Why not use the documented --shutdown-running-calibre switch to caliobre to shut it down, as opposed to using the brute force approach of killing it?

See http://manual.calibre-ebook.com/cli/calibre.html
PeterT is offline   Reply With Quote
Old 07-31-2013, 03:50 PM   #4
megamaniac
Junior Member
megamaniac began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Jul 2013
Device: Galaxy Nexus
update

I added the "/T" option to taskkill. Otherwise if e.g. an epub reader instance is in use the calibre-parallel.exe process blocks the update.

@PeterT
Did you try these options. In my case none of the CLI options had any effect.

@jemkeith
Yes I have done it the same way, here some (hopefully useful) hints for scheduling configs:

trigger: weekly at night before boot or login
action: start program: cmd
arguments: /c start /min "" <path-to-bat>/UpdateCalibre.bat
condition: connection available
config: start if missed

You could also add "--no-update-check" to your calibre link but I am not shure if it really works.

Last edited by megamaniac; 07-31-2013 at 03:52 PM.
megamaniac is offline   Reply With Quote
Old 08-02-2013, 08:50 AM   #5
jemkeith
Enthusiast
jemkeith began at the beginning.
 
Posts: 25
Karma: 10
Join Date: Jan 2011
Device: Nook
bat for 64 bit

I modified it a little to use the 64 bit calibre and 64 bit curl and to install using the MSI file. You need to change the paths for your computer.
It seemed to work for me.

I made a few more changes. Mine works now...
It doesn't delete the download but moves it to another directory.
Attached Files
File Type: bat UpdateCalibre64.bat (1.1 KB, 316 views)

Last edited by jemkeith; 08-03-2013 at 11:49 AM.
jemkeith is offline   Reply With Quote
Advert
Old 08-02-2013, 08:55 AM   #6
jemkeith
Enthusiast
jemkeith began at the beginning.
 
Posts: 25
Karma: 10
Join Date: Jan 2011
Device: Nook
Quote:
Originally Posted by PeterT View Post
Why not use the documented --shutdown-running-calibre switch to caliobre to shut it down, as opposed to using the brute force approach of killing it?

See http://manual.calibre-ebook.com/cli/calibre.html
I will add this to my bat file. The worst that can happen is if I leave a book open, it won't update to the next week.
jemkeith is offline   Reply With Quote
Old 08-02-2013, 09:47 PM   #7
Halo
Connoisseur
Halo did not drink the Kool Aid.Halo did not drink the Kool Aid.Halo did not drink the Kool Aid.Halo did not drink the Kool Aid.Halo did not drink the Kool Aid.Halo did not drink the Kool Aid.Halo did not drink the Kool Aid.Halo did not drink the Kool Aid.Halo did not drink the Kool Aid.Halo did not drink the Kool Aid.Halo did not drink the Kool Aid.
 
Halo's Avatar
 
Posts: 96
Karma: 72130
Join Date: Nov 2008
Location: San Francisco Bay Area, CA, USA
Device: Sony PRS-505, Kindle DX 1st Gen, Kindle Fire 1st Gen
Windows already provides a temp folder to each user and sets an environment variable to it called %TEMP%. You should be using that, not creating a folder in your drive's root.
Halo is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Solution to Calibre in Google Drive Mattes Related Tools 10 06-02-2014 05:13 PM
I need a solution to set default calibre viewer's window ClientAlive Calibre 2 02-15-2013 09:21 AM
iPhone 101: iPhone+Stanza+Calibre (the almost-perfect solution) ChrisZA Apple Devices 236 04-25-2011 04:19 AM
A solution for wirelessly syncing Calibre & NookColor Quistopher Devices 0 01-23-2011 05:21 PM
Calibre not auto-updating Phonella Calibre 4 10-22-2009 07:37 AM


All times are GMT -4. The time now is 06:34 PM.


MobileRead.com is a privately owned, operated and funded community.