├── .gitattributes ├── .gitignore ├── LICENSE ├── README.md ├── build.ps1 ├── logo.ico └── main.ps1 /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.exe 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 神代綺凜 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # genshin-borderless-launcher 2 | 3 | 这个启动器已经没有存在的必要了,你只需要使用两个参数就可以让原神窗口全屏启动 4 | 5 | ## 教程 6 | 7 | 0. 将原神调整至独占全屏,退出游戏 8 | 1. 打开 `YuanShen.exe` 所在目录,例如 `C:\Program Files\Genshin Impact\Genshin Impact Game` 9 | 2. 右击 `YuanShen.exe`,发送到 > 桌面快捷方式 10 | 3. 右击桌面上刚创建的快捷方式,属性 11 | 4. 在“目标”的最末尾加上 `-popupwindow -screen-fullscreen 0`(前面要加个空格),使其变为例如 `"C:\Program Files\Genshin Impact\Genshin Impact Game\YuanShen.exe" -popupwindow -screen-fullscreen 0`,确定保存 12 | 5. 使用这个快捷方式启动游戏 13 | 14 | ## 如何恢复独占全屏 15 | 16 | 两种方法任选其一 17 | 18 | 1. 进入游戏,设置成窗口模式,再设置成独占全屏 19 | 2. 将 `-screen-fullscreen 0` 改为 `-screen-fullscreen 1`,使用快捷方式启动游戏一次 20 | 21 | ## 原理 22 | 23 | 24 | 25 | 见“Unity 独立平台播放器命令行参数”的 `-popupwindow` 和 `-screen-fullscreen` 26 | 27 | ## 版权 28 | 29 | `logo.ico` 是从原神官方启动器 `launcher.exe` 中提取的,版权归 miHoYo 所有 30 | -------------------------------------------------------------------------------- /build.ps1: -------------------------------------------------------------------------------- 1 | $version = (git rev-list --tags --max-count=1 | git describe --tags) -replace 'v', '' -replace '-.*', '' 2 | Remove-Item genshin-launcher.exe -Force -ErrorAction SilentlyContinue 3 | ps2exe main.ps1 genshin-launcher.exe -noConsole -iconFile logo.ico -title "Genshin Impact Launcher" -product "Genshin Impact Launcher" -copyright "Tsuk1ko/genshin-launcher" -noOutput -version $version 4 | -------------------------------------------------------------------------------- /logo.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tsuk1ko/genshin-borderless-launcher/8853cf7275d4a16db15b09e08e847f5780e19492/logo.ico -------------------------------------------------------------------------------- /main.ps1: -------------------------------------------------------------------------------- 1 | Param( 2 | [string] $Path 3 | ) 4 | 5 | Function Get-GenshinWorkDir { 6 | $CurDir = (Resolve-Path '.').Path; 7 | if ($Path) { $CurDir = $Path } 8 | Write-Host "Current directory:`t$CurDir" 9 | if (Test-Path "$CurDir\YuanShen.exe") { 10 | Write-Host "Test-Path 1 ok" 11 | return $CurDir 12 | } 13 | if (Test-Path "$CurDir\Genshin Impact Game\YuanShen.exe") { 14 | Write-Host "Test-Path 2 ok" 15 | return "$CurDir\Genshin Impact Game" 16 | } 17 | try { 18 | $RootDir = Get-ItemPropertyValue "HKLM:\SOFTWARE\launcher" "InstPath" -ErrorAction Stop 19 | Write-Host "From registry:`t`t$RootDir" 20 | return "$RootDir\Genshin Impact Game" 21 | } 22 | catch { 23 | Write-Error "Genshin Impact executable file not found." 24 | Exit 25 | } 26 | } 27 | 28 | $GenshinWorkDir = Get-GenshinWorkDir 29 | $GenshinExePath = "$GenshinWorkDir\YuanShen.exe" 30 | 31 | if (Test-Path $GenshinExePath) { 32 | Start-Process -FilePath $GenshinExePath -ArgumentList "-popupwindow","-screen-fullscreen 0" -WorkingDirectory $GenshinWorkDir 33 | } 34 | else { 35 | Write-Error "Genshin Impact executable file `"$GenshinExePath`" not found." 36 | } 37 | --------------------------------------------------------------------------------