View Single Post
Old Yesterday, 12:13 PM   #50
thiago.eec
Wizard
thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.
 
Posts: 1,323
Karma: 1436993
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite, Kindle Oasis
Quote:
Originally Posted by dunhill View Post
Thank you so much for the tips, Kovid! I really appreciate you taking the time to point me in the right direction.
Automating the installation via msiexec and hdiutil sounds like the perfect path to make the experience seamless. I will definitely look into the update-on-osx script for inspiration.
For now, I'll focus on making sure the download process is 100% stable across all platforms with the current manual steps, and then I'll start working on full automation for the next major release. Thanks again!
A long time ago I got a bat script posted by @eschwartz that automated calibre updates using Windows Task Scheduler. Like @Kovid said, it uses msiexec. The task was set to run this script everyday, and install it silently if a new version is found.

Code:
@echo off

calibre-debug.exe -c "import urllib.request as u; from calibre.constants import numeric_version; raise SystemExit(int(numeric_version  < (tuple(map(int, u.urlopen('http://code.calibre-ebook.com/latest').read().decode('utf-8').split('.'))))))"

if %ERRORLEVEL%==0 (
echo calibre is up to date.
)	else (
calibre.exe --shutdown-running-calibre
msiexec /passive /i http://status.calibre-ebook.com/dist/win64
)
P.S.: If Windows determines a restart is needed, it will do that automatically, so I set it up to run at night.

Last edited by thiago.eec; Yesterday at 12:27 PM.
thiago.eec is offline   Reply With Quote