Skip to content

Commit

Permalink
fix: launcher use subprocess to redirect log to logfile
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahkittyy committed Mar 15, 2023
1 parent b9a66d5 commit 83e022e
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 1 deletion.
37 changes: 37 additions & 0 deletions CMakeSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"configurations": [
{
"name": "x64-Debug",
"generator": "Ninja",
"configurationType": "Debug",
"inheritEnvironments": [ "msvc_x64_x64" ],
"buildRoot": "${projectDir}\\build",
"installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "",
"ctestCommandArgs": ""
},
{
"name": "x64-Release",
"generator": "Ninja",
"configurationType": "Release",
"buildRoot": "${projectDir}\\build",
"installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeCommandArgs": "-DAPP_VERSION=v3.0.6",
"buildCommandArgs": "",
"ctestCommandArgs": "",
"inheritEnvironments": [ "msvc_x64_x64" ]
},
{
"name": "x64-Release-Debug",
"generator": "Ninja",
"configurationType": "RelWithDebInfo",
"buildRoot": "${projectDir}\\build",
"installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeCommandArgs": "-DAPP_VERSION=v3.0.6",
"buildCommandArgs": "",
"ctestCommandArgs": "",
"inheritEnvironments": [ "msvc_x64_x64" ]
}
]
}
Binary file added appicon.aps
Binary file not shown.
4 changes: 3 additions & 1 deletion launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import shutil
import distutils.dir_util
import time
import subprocess

def stage1():
version_path = getattr(sys, '_MEIPASS', os.getcwd())
Expand Down Expand Up @@ -91,7 +92,8 @@ def stage3():

def launch():
if os.name == 'nt':
os.system('.\blockquest-remake.exe 1> latest.log 2>&1')
with open('latest.log', 'w') as logfile:
subprocess.run('blockquest-remake.exe', stdout=logfile, stderr=logfile)
else:
fdout = os.open('latest.log', os.O_WRONLY | os.O_CREAT | os.O_TRUNC)
os.dup2(fdout, 1)
Expand Down

0 comments on commit 83e022e

Please sign in to comment.