|
|
@@ -685,7 +685,7 @@ def update(conn, ver_num, set_data):
|
|
|
|
|
|
print('Update completed')
|
|
|
|
|
|
-def set_init_always(conn, ver_num):
|
|
|
+def set_init_always(conn, ver_num, run_mode):
|
|
|
with class_temp_db() as m_conn:
|
|
|
m_curs = m_conn.cursor()
|
|
|
curs = conn.cursor()
|
|
|
@@ -719,23 +719,24 @@ def set_init_always(conn, ver_num):
|
|
|
if db_data:
|
|
|
m_curs.execute('insert into temp (name, data) values ("wiki_access_password", ?)', [db_data[0][0]])
|
|
|
|
|
|
- exe_type = ''
|
|
|
- if platform.system() == 'Linux':
|
|
|
- if platform.machine() in ["AMD64", "x86_64"]:
|
|
|
- exe_type = 'main.amd64.bin'
|
|
|
- else:
|
|
|
- exe_type = 'main.arm64.bin'
|
|
|
- else:
|
|
|
- if platform.machine() in ["AMD64", "x86_64"]:
|
|
|
- exe_type = 'main.amd64.exe'
|
|
|
+ if run_mode == '':
|
|
|
+ exe_type = ''
|
|
|
+ if platform.system() == 'Linux':
|
|
|
+ if platform.machine() in ["AMD64", "x86_64"]:
|
|
|
+ exe_type = 'main.amd64.bin'
|
|
|
+ else:
|
|
|
+ exe_type = 'main.arm64.bin'
|
|
|
else:
|
|
|
- exe_type = 'main.arm64.exe'
|
|
|
+ if platform.machine() in ["AMD64", "x86_64"]:
|
|
|
+ exe_type = 'main.amd64.exe'
|
|
|
+ else:
|
|
|
+ exe_type = 'main.arm64.exe'
|
|
|
|
|
|
- exe_path = os.path.join('.', 'route_go', 'bin')
|
|
|
+ exe_path = os.path.join('.', 'route_go', 'bin')
|
|
|
|
|
|
- for for_a in os.listdir(exe_path):
|
|
|
- if for_a != exe_type:
|
|
|
- os.remove(os.path.join(exe_path, for_a))
|
|
|
+ for for_a in os.listdir(exe_path):
|
|
|
+ if for_a != exe_type:
|
|
|
+ os.remove(os.path.join(exe_path, for_a))
|
|
|
|
|
|
if platform.system() == 'Linux':
|
|
|
os.system('chmod +x ./route_go/bin/' + exe_type)
|