The Problem

Users of the classic PC game collection on Archive.org need a single Windows desktop client to browse, download, install, and launch titles without manually handling archives or configuring shortcuts. The current manual workflow is error‑prone (blocked files, missing executables) and lacks a unified UI for controller navigation.

What This Does

-RohanKar-Launcher is an Electron‑based desktop app that pulls the game catalogue from the Archive.org Advanced Search API, presents it in a searchable grid, and automates download, extraction, and shortcut creation. Core UI lives in src/renderer/renderer.js and src/renderer/index.html; the main process logic is in src/main/main.js and src/main/preload.js. Functions such as loadSettings, saveSettings, createWindow, and doRequest orchestrate configuration, window creation, and network calls, while renderLibraryGrid, getTitle, and showDetailView drive the UI rendering pipeline.

How It Is Wired

Execution begins with Electron’s entry point defined in package.json (the main field points to src/main/main.js).

  1. src/main/main.jsinit (line 368) is the first renderer‑side call; it invokes renderLibraryGrid, which in turn calls getTitle (10 callers) and renderFsCollectionPills (4 callers). The main process also defines saveSettings (line 118) and writeField (line 1160), each reaching a handful of helper functions.
  2. The main process creates the browser window via createWindow, injects the preload script (src/main/preload.js), and sets up IPC channels used by the renderer.
  3. Renderer sidesrc/renderer/renderer.js houses the bulk of UI logic (≈125 functions). The init function reaches 25 other functions, including renderLibraryGrid, gpHandleButton, and gpHandleOSK. The call graph shows dense branching: gpHandleButton calls gpClearMenuHighlight, gpClearDetailHighlight, gpToggleMouseMode, gpOpenOSK, gpUpdateHint, and gpNavigateMenu (each 3–6 times).
  4. Network interaction occurs in doRequest (main) which fetches JSON from Archive.org; the result is passed back to the renderer to populate the library view.
  5. File system actions (download, unzip, unblock) are performed by functions like startSingleDownload, writeByte, and writeVdfShortcuts (main). These have limited call depth (2–3 functions) but are critical for installation.

No circular imports are present; the three internal modules (main, preload, renderer) are isolated, simplifying change impact. The widest blast radius resides in src/renderer/renderer.js (2857 lines, deep nesting depth 6, 350 branch points) and src/main/main.js (983 lines, high branching density).

How To Use It

# Clone the repo
git clone https://github.com/moses-y/-RohanKar-Launcher
cd -RohanKar-Launcher

# Install dependencies
npm ci   # respects package-lock.json

# Start the Electron app (script defined in package.json)
npm start

Configuration files are src/main/main.js (default download/install paths) and src/renderer/style.css for UI tweaks. No environment variables are required out of the box.

Real‑World Use

A PC café could deploy the launcher on each workstation, point it at the same Archive.org collection, and let patrons browse and launch games via a controller. The app automatically unblocks extracted files, writes a Steam shortcut (writeVdfShortcuts), and tracks playtime without manual scripting.

Code Health & Issues

  • HIGH – Cognitive load: src/renderer/renderer.js (2857 lines) and src/main/main.js (983 lines) are monolithic; refactor into domain‑specific modules.
  • MEDIUM – Deep nesting: src/renderer/renderer.js max indentation depth 6; extract inner blocks to reduce complexity.
  • MEDIUM – High branching: src/main/main.js contains ~350 branch points; consider strategy tables or separate handlers.
  • HIGH – Pin GitHub Action versions: .github/workflows/release.yml uses softprops/action-gh-release@v2; replace with a fixed SHA.
  • MEDIUM – Least‑privilege GITHUB_TOKEN: workflow lacks explicit permissions; add contents: read (and finer scopes per job).
  • MEDIUM – Dependabot missing: no .github/dependabot.yml; add to keep dependencies patched.
  • MEDIUM – No dependency‑vulnerability scan: add dependency-review-action or osv-scanner to CI.
  • MEDIUM – Checkout persists credentials: set persist-credentials: false on the checkout step.
  • LOW – No job timeout: specify timeout-minutes in workflow jobs.
  • SDLC observations: No test suite, no LICENSE file, and only a single GitHub Actions workflow; documentation is limited to README.md and PROJECT_BRIEF.md.

The Bottom Line

The launcher delivers a functional, Electron‑based game library with solid Archive.org integration, but its core files are extremely large and complex, making maintenance risky. Engineers should prioritize modularizing renderer.js and main.js, tighten CI security, and add tests before extending functionality. Suitable for internal Windows deployments where rapid UI changes are not required.