diff --git a/aqt/__init__.py b/aqt/__init__.py index d42cad0b3..a7517f510 100644 --- a/aqt/__init__.py +++ b/aqt/__init__.py @@ -1,7 +1,7 @@ # Copyright: Damien Elmes # License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html -import os, sys, optparse, atexit, __builtin__ +import os, sys, optparse, atexit, tempfile, __builtin__ from aqt.qt import * import locale, gettext import anki.lang @@ -191,6 +191,16 @@ def run(): # we've signaled the primary instance, so we should close return + # we must have a usable temp dir + try: + tempfile.gettempdir() + except: + QMessageBox.critical( + None, "Error", """\ +No usable temporary folder found. Make sure C:\\temp exists or TEMP in your \ +environment points to a valid, writable folder.""") + return + # parse args opts, args = parseArgs(sys.argv) opts.base = unicode(opts.base or "", sys.getfilesystemencoding())