R2NorthstarTools / FlightCore

Installer/Updater/Launcher for Northstar
MIT License
59 stars 14 forks source link

Figure out optimal control flow for launching Northstar #179

Open GeckoEidechse opened 1 year ago

GeckoEidechse commented 1 year ago

We got a few checks we need to perform before we can launch Northstar.

What is the best order to do them in to reduce number of branches in control flow? First OS then Steam/non-Steam? First Steam/non-Steam, then OS? Other things we need to check?

GeckoEidechse commented 1 year ago

Given that we can use a similar/same method of launching Northstar for both Windows and Linux when using Steam, I'd say we make that our first branch, from there we go:

graph TD
    start[Launch Northstar] --> steam{Steam version?}
    steam   -->|Yes| linux{Is Linux?}
    linux   -->|Yes| proton{NorthstarProton installed?}
    linux   -->|No | txt[Add run_northstar.txt]

    proton  -->|Yes| txt
    proton  -->|No | F[return with warning]

    txt     --> uri[open steam:// URI]
    uri     --> H[Cleanup]

    steam   -->|No | windows{Is Windows?}
    windows -->|No | F[return with warning]
    windows -->|Yes| ea{Origin/EA running}
    ea      -->|No | F[return with warning]
    ea      -->|Yes| exe[run NorthstarLauncher.exe]
Jan200101 commented 1 year ago

Since libthermite provides the capabilities to deal with NSProton, I think this would be better.

graph TD
    start[Launch Northstar] --> steam{Steam version?}
    steam   -->|Yes| linux{Is Linux?}
    linux   -->|Yes| proton{NorthstarProton installed?}
    linux   -->|No | txt[Add run_northstar.txt]

    proton  -->|Yes| check_proton[NorthstarProton configured?]
    proton  -->|No | install_proton[Install NorthstarProton]
    install_proton --> check_proton
    check_proton --> |Yes | txt
    check_proton --> |No  | F

    txt     --> uri[open steam:// URI]
    uri     --> H[Cleanup]

    steam   -->|No | windows{Is Windows?}
    windows -->|No | F[return with warning]
    windows -->|Yes| ea{Origin/EA running}
    ea      -->|No | F[return with warning]
    ea      -->|Yes| exe[run NorthstarLauncher.exe]
GeckoEidechse commented 1 year ago

Hmm, I think we should already install NorthstarProton when installing Northstar and on clicking "Launch Northstar" only check if it's properly configured ^^

Jan200101 commented 1 year ago

Eh, maybe.

Without #154 it would be a pain for existing users.

Jan200101 commented 1 year ago

I've been thinking about this again and I think this flow might be better

flowchart TD
    launch[Launch Northstar] --> windows{Is Windows?}

    windows -->|No | steam
    windows -->|Yes| ea{Origin/EA running?}
    ea      -->|Yes| exe[run NorthstarLauncher.exe]
    ea      -->|No | steam{Steam version?}

    linux -->|Yes| check_proton{NorthstarProton setup?}
    linux -->|No | run

    steam -->|No | F[return with warning]
    steam -->|Yes| linux{Is Linux?}
    check_proton --> |Yes | run[run through Steam]
    check_proton --> |No  | F

There is also the thought about relaxing the NorthstarProton checks and making them them a pop-up the user has to acknowledge