Skip to content

Commit

Permalink
Fix Python2 compat and allow bypass startup check
Browse files Browse the repository at this point in the history
- Fix compatibility with Python 2,
- allow starting installation even if startup checks fail, in case of false positive
  • Loading branch information
drojf committed Sep 13, 2020
1 parent 7a89d81 commit 6eae526
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def installerCommonStartupTasks():
# Write some dummy data to a temp file
test_data = "test"
temp_file_handle, temp_file_path = tempfile.mkstemp(dir='.')
with open(temp_file_handle, 'w') as temp_file:
with os.fdopen(temp_file_handle, 'w') as temp_file:
temp_file.write(test_data)

# Wait for the file to appear on the filesystem (in most cases this happens immediately)
Expand All @@ -167,9 +167,14 @@ def installerCommonStartupTasks():
errors.append("ERROR: Installer folder is not writeable [{}]. Please run the installer from a user writeable folder instead. Full error:\n{}".format(os.getcwd(), e))

if errors:
print('- ')
print('\n--------------------------------------------------------------')
print('The following problems were found during startup:')
print('- ', end='')
print('\n- '.join(errors))
raise SystemExit(-1)
print('--------------------------------------------------------------')
print('Please try to fix these errors before continuing, then restart the installer.')
input('If you think the error was a false positive, press ENTER to continue anyway')
input("If you're absolutely sure you want to continue, press ENTER again")

if __name__ == "__main__":
installerCommonStartupTasks()
Expand Down

0 comments on commit 6eae526

Please sign in to comment.