def run(self): ''' ExtraInstaller thread body ''' try: if self.geturl is None: raise InvalidGetURL("GetURL failed to initialize for %r" % self.url) if not os.path.exists(self.modulepath): os.makedirs(self.modulepath) self.progress_updater.start() self.geturl.save(self.path) if self.geturl.failed: raise GetURLFailed("GetURL failed to save %r to %r" % (self.url, self.path)) # If installer, we need to call it and wait until completion if self.installer: cmd = [self.path] cmd.extend(my_env.resolve_app_params(self.params)) my_env.call(cmd) try: wx.CallAfter(self.manager._download_finished, self) except BaseException as e: logger.exception(e) except GetURLException as e: logger.debug(e) wx.CallAfter(self.manager._download_failed, self) except BaseException as e: logger.exception(e) wx.CallAfter(self.manager._download_failed, self) finally: self.clean()
def _apply(self): version = self._appversion.replace(" ", "_") for filename, downloaded in self.downloaded_files.iteritems(): if downloaded: setup_path = os.path.join(self.download_path, filename) my_env.call([ setup_path, "/SILENT", "/NORESTART", "/RESTARTAPPLICATIONS", "/LAUNCH", "/VERSION=%s" % version], shellexec=True)
def _apply(self): version = self._appversion.replace(" ", "_") for filename, downloaded in self.downloaded_files.iteritems(): if downloaded: setup_path = os.path.join(self.download_path, filename) my_env.call([ setup_path, "/SILENT", "/NORESTART", "/RESTARTAPPLICATIONS", "/LAUNCH", "/VERSION=%s" % version ], shellexec=True)
def run(self): my_env.kill_process_pidfile(self.pidfile) # Python developers do not want to fix a huge bug with # subprocess.Popen and encodings on windows # ( http://bugs.python.org/issue1759845 ), so we need to # workaround this issue. self._pid = my_env.call(self.cmd, shell=True, show=False) if self._pid: with open(self.pidfile, "w") as f: f.write(str(self._pid))
def _newapply(self): for command in self.update_commands: my_env.call(my_env.resolve_app_params(command), shellexec=True)
def launch(self): if self._dest: cmd = [self._dest] + self.argv self._ok = my_env.call(cmd, shellexec=True) if self.close: WxAppProxy.get().close_app()