This commit is contained in:
2026-04-03 16:24:05 -04:00
parent 413426d597
commit 655f295916
4 changed files with 21 additions and 4 deletions

3
.vscode/settings.json vendored Normal file
View File

@@ -0,0 +1,3 @@
{
"python-envs.defaultEnvManager": "ms-python.python:system"
}

View File

@@ -7,4 +7,5 @@ if %errorlevel% neq 0 (
schtasks /create /tn "FoxPro 2.6 Connectivity Kit ODBC Setup Disk Game Launcher Because It Fell Under My Desk" /tr "pythonw.exe \"%~dp0main.py\"" /sc onlogon /rl highest /f schtasks /create /tn "FoxPro 2.6 Connectivity Kit ODBC Setup Disk Game Launcher Because It Fell Under My Desk" /tr "pythonw.exe \"%~dp0main.py\"" /sc onlogon /rl highest /f
echo If there's no errors above, the install probably worked echo If there's no errors above, the install probably worked
echo You will need to re-login or start the process from process monitor to start the app
pause pause

View File

@@ -3,7 +3,7 @@ import os
import tomllib import tomllib
import psutil import psutil
import win32api import win32api
import tomli_w
CONFIG_PATH = os.path.join(os.environ["APPDATA"], "FP26CKOSDGLBIFUMD", "library.toml") CONFIG_PATH = os.path.join(os.environ["APPDATA"], "FP26CKOSDGLBIFUMD", "library.toml")
PAUSE_FILE = os.path.join(os.environ["APPDATA"], "FP26CKOSDGLBIFUMD", "pause") PAUSE_FILE = os.path.join(os.environ["APPDATA"], "FP26CKOSDGLBIFUMD", "pause")
@@ -28,6 +28,11 @@ def stop_game(game_process):
proc.terminate() proc.terminate()
if not os.path.exists(CONFIG_PATH):
os.makedirs(os.path.dirname(CONFIG_PATH), exist_ok=True)
with open(CONFIG_PATH, "wb") as f:
tomli_w.dump({"disks": {}}, f)
while True: while True:
if os.path.exists("A:\\"): if os.path.exists("A:\\"):
disk_in = True disk_in = True

View File

@@ -143,7 +143,6 @@ def setup_disk():
print("Setup complete!") # that was painful print("Setup complete!") # that was painful
print("Now, eject the disk and press any key to continue") print("Now, eject the disk and press any key to continue")
questionary.press_any_key_to_continue().ask() questionary.press_any_key_to_continue().ask()
os.remove(PAUSE_FILE)
CONFIG_PATH = os.path.join(os.environ["APPDATA"], "FP26CKOSDGLBIFUMD", "library.toml") CONFIG_PATH = os.path.join(os.environ["APPDATA"], "FP26CKOSDGLBIFUMD", "library.toml")
@@ -152,11 +151,20 @@ PAUSE_FILE = os.path.join(os.environ["APPDATA"], "FP26CKOSDGLBIFUMD", "pause")
print("Welcome to the floppy disk setup app!") print("Welcome to the floppy disk setup app!")
while True: while True:
match questionary.select( match questionary.select(
"Please choose an option:", ["Setup individual disk", "Bulk Setup", "Exit"] "Please choose an option:",
[
"Setup disk",
"Open config file (required to delete something)",
"Exit",
],
).ask(): ).ask():
case "Exit": case "Exit":
print("Goodbye!") print("Goodbye!")
break break
case "Setup individual disk": case "Setup disk":
open(PAUSE_FILE, "w").close() open(PAUSE_FILE, "w").close()
setup_disk() setup_disk()
os.remove(PAUSE_FILE)
case "Open config file (required to delete something)":
print("Opening...")
os.startfile(CONFIG_PATH)