Preface¶
DeepSeek Harness (DSH) is an agent development platform where developers often need to conduct testing or demonstrations using game scenarios. Manually searching for the game binary path or launcher installer disrupts the workflow. The dsh-plugin-genshin-launch plugin employs a zero-configuration detection mechanism to solve the problem of “detecting local Genshin Impact installation status when opening DSH.”
Core Features¶
The plugin primarily provides two automation schemes:
-
Scheme 2: Launch Genshin upon opening DSH
- Zero-config Detection: The detection order is
config→registry→paths→scan. The fastest tier takes about 400ms, and the entire fast track takes approximately 0.5 seconds. - Trigger Timing: When the browser interface is rendered (based on
patchReload: live), rather than when the host process starts. - Launch Strategy: Detection results are classified into three states:
ready(binary exists),incomplete(installing/updating), and Not Found. Ifready, launch the binary directly; ifincomplete, launch the HoYoVerse Launcher; if Not Found, proceed to Scheme 1. - Process Control: Launches occur only once per DSH process; refreshing the page or hot reloading will not trigger repeated launches.
- Zero-config Detection: The detection order is
-
Scheme 1: Download installer to Desktop if not installed
- Auto Download: If the game is not detected, download the HoYoVerse Launcher installer to the Desktop.
- Size Safety Gate: The installer is approximately 224 MiB. The download validates the file size; if the deviation exceeds 15 MiB (default value), the download is rejected to prevent downloading incorrect files by mistake.
- Resumable Download: Supports breakpoint continuation.
Detection Mechanism¶
The detection process is entirely local and read-only, requiring no network connection. It employs a five-tier ladder strategy, stopping upon a match:
- config: Reads
gameExeorgamePathfrom the configuration file (highest priority). - registry: Reads the HoYoPlay
HYPtree (e.g.,HYP\1_1\hk4e_cn), calibrating encoding before searching for the path. - paths: Iterates through common top-level directories (e.g., drive root directories).
- scan: Executes only if all previous tiers are empty. Performs a full scan of uninstall records (3 roots × 4 key names) and a bounded directory scan (default depth ≤ 4).
State Determination:
* ready: YuanShen.exe or GenshinImpact.exe exists.
* incomplete: Structural fingerprints such as YuanShen_Data, pkg_version, or mhypbase.dll exist.
* Not Found: None of the above conditions are met.
Installation & Configuration¶
Installing the plugin requires a pnpm environment and network access to GitHub.
Installation Command:
dsh plugin --profile web add github:Link258QAQ/dsh-plugin-genshin-launch
Configuration Example:
Add configuration to $DSH_HOME/profiles/web/cordis.patch.yml:
- id: genshin-launch
name: dsh-plugin-genshin-launch
config:
launchGame: true
launchTrigger: gui
launchMethod: spawn
retryShellOnElevation: true
launchWatchMs: 3000
fallbackToLauncher: true
launchOncePerSession: true
detectSources: ['config', 'registry', 'paths', 'scan']
download: true
downloadDir: 'C:\Users\You\Desktop'
expectedInstallerBytes: 234881024
sizeToleranceBytes: 52428800
Notes:
* Windows Only: Detection relies on the registry, DPAPI encryption, and UAC elevation mechanisms.
* Permission Prompts: The plugin does not silently elevate privileges. If the game or launcher manifest requires admin rights, spawn mode will fail with EACCES. In this case, the plugin automatically falls back to shell mode (double-click semantics), triggering a system UAC request.
* Privacy Protection: When launching the game, environment variables containing keywords like *KEY* or *PASSWORD* are stripped; paths are masked or stored via DPAPI encryption in logs and configuration.
Self-check & Debugging¶
The plugin includes a self-check tool that does not depend on DSH, used to verify the detection and launch chain:
# Detection-only mode
node tools/selfcheck.mjs
# Verify launch chain (specify program, auto cleanup)
node tools/selfcheck.mjs --exe "D:\path\to\YuanShen.exe" --launch --kill
Ecosystem Links¶
- Plugin Directory: dsh-plugin-genshin-launch - SkillHub
- Source Repository: Link258QAQ/dsh-plugin-genshin-launch