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).
src/main/main.js–init(line 368) is the first renderer‑side call; it invokesrenderLibraryGrid, which in turn callsgetTitle(10 callers) andrenderFsCollectionPills(4 callers). The main process also definessaveSettings(line 118) andwriteField(line 1160), each reaching a handful of helper functions.- 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. - Renderer side –
src/renderer/renderer.jshouses the bulk of UI logic (≈125 functions). Theinitfunction reaches 25 other functions, includingrenderLibraryGrid,gpHandleButton, andgpHandleOSK. The call graph shows dense branching:gpHandleButtoncallsgpClearMenuHighlight,gpClearDetailHighlight,gpToggleMouseMode,gpOpenOSK,gpUpdateHint, andgpNavigateMenu(each 3–6 times). - 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. - File system actions (download, unzip, unblock) are performed by functions like
startSingleDownload,writeByte, andwriteVdfShortcuts(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) andsrc/main/main.js(983 lines) are monolithic; refactor into domain‑specific modules. - MEDIUM – Deep nesting:
src/renderer/renderer.jsmax indentation depth 6; extract inner blocks to reduce complexity. - MEDIUM – High branching:
src/main/main.jscontains ~350 branch points; consider strategy tables or separate handlers. - HIGH – Pin GitHub Action versions:
.github/workflows/release.ymlusessoftprops/action-gh-release@v2; replace with a fixed SHA. - MEDIUM – Least‑privilege GITHUB_TOKEN: workflow lacks explicit
permissions; addcontents: 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-actionorosv-scannerto CI. - MEDIUM – Checkout persists credentials: set
persist-credentials: falseon the checkout step. - LOW – No job timeout: specify
timeout-minutesin workflow jobs. - SDLC observations: No test suite, no LICENSE file, and only a single GitHub Actions workflow; documentation is limited to
README.mdandPROJECT_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.