diff --git a/gluon/fileutils.py b/gluon/fileutils.py index 0fa29acf..c1644be7 100644 --- a/gluon/fileutils.py +++ b/gluon/fileutils.py @@ -264,13 +264,20 @@ def w2p_pack(filename, path, compiled=False, filenames=None): def create_welcome_w2p(): - if not os.path.exists('welcome.w2p') or os.path.exists('NEWINSTALL'): + is_newinstall_file = os.path.exists('NEWINSTALL') + if not os.path.exists('welcome.w2p') or is_newinstall_file: try: w2p_pack('welcome.w2p', 'applications/welcome') - os.unlink('NEWINSTALL') logging.info("New installation: created welcome.w2p file") except: logging.error("New installation error: unable to create welcome.w2p file") + return + if is_newinstall_file: + try: + os.unlink('NEWINSTALL') + logging.info("New installation: removed NEWINSTALL file") + except: + logging.error("New installation error: unable to remove NEWINSTALL file") def w2p_unpack(filename, path, delete_tar=True):