DawnFz / Genshin.Launcher.Plus

[原神启动器Plus] lightweight globalized Genshin Impact launcher. Support arbitrarily resolution ratio, account switching, client convertion, FPS unlocking and more!
MIT License
811 stars 56 forks source link

直接使用命令行运行时,无法获取应用程序正确的工作文件夹,导致自动更新失败。 #39

Closed soloopooo closed 2 years ago

soloopooo commented 2 years ago

我运行原神启动器Plus的方式如下:

在pwsh内的Profile里预定义函数:

# User Defined function part
...
function Start-YuanShenLauncherDIY { & "D:\yuanshen-launcher\GenShin-Launcher.exe" }

# Alias part
...
Set-Alias yslaudiy Start-YuanShenLauncherDIY

之后,直接在pwsh里运行 yslaudiy 即可打开原神启动器plus。 image

但这样启动会产生无法正确获取应用程序工作文件夹的问题,具体表现在,自动更新无法完成。 (图中是命令行运行1.3.2升级到1.3.5的错误界面) image

Lightczx commented 2 years ago

@DawnFz 可以参考我的解决方案 https://github.com/DGP-Studio/Snap.Genshin/blob/main/DGP.Genshin/App.xaml.cs#217

soloopooo commented 2 years ago
function Start-YuanShenLauncherDIY { cd D:\yuanshen-launcher\ && D:\yuanshen-launcher\GenShin-Launcher.exe }

原启plus是根据命令行所在的文件夹确定工作文件夹的,明白了。以上是修改后的Profile。