View Single Post
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, 569 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