def run(last_run_version):
if config.get(["modules", "launcher", "auto_start"], 0):
import autorun
autorun.enable()
if os.path.isdir(os.path.join(top_path, 'launcher')):
shutil.rmtree(os.path.join(top_path, 'launcher')) # launcher is for auto-update from 2.X
if older_or_equal(last_run_version, '3.0.4'):
xlog.info("migrating to 3.x.x")
for filename in os.listdir(top_path):
filepath = os.path.join(top_path, filename)
if os.path.isfile(filepath):
if sys.platform != 'win32' and filename == 'start':
st = os.stat(filepath)
os.chmod(filepath, st.st_mode | stat.S_IEXEC)
if filename in ['start.sh', 'start.command', 'start.lnk', 'LICENSE.txt', 'download.md', 'version.txt', 'xxnet', 'xxnet.bat', 'xxnet.vbs', 'xx_net.sh']:
os.remove(filepath)
else:
if filename in ['goagent', 'python27', 'gae_proxy', 'php_proxy', 'x_tunnel', 'python3', 'Python3', 'lib', 'SwitchySharp']:
shutil.rmtree(filepath)
评论列表
文章目录