-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Self-update isn't working properly #25
Comments
If the launcher isn't working after self-updating, please download the latest version from GitHub release and replace the old executable file. 如果遇到自动更新后打不开的情况,请先暂时从 GitHub release 下载最新版启动器替换原文件。 |
It turns out that in .NET Core, the single-file executable (GBCL.exe) is actually extracted to %TEMP%/.net/GBCL/ and the GBCL.dll in the temp folder is what really runs by the .NET Core runtime. See Extracting Bundled Files to Disk This is why during the self-update, the current path returned by Application.ResourceAssembly.Location is the path to the dll instead of that to the executable, so the old GBCL.exe is not properly replaced. 😪 Possible solution is to use Process.GetCurrentProcess().MainModule.FileName to get current executable path。 在 .NET Core 中,单文件打包的 GBCL.exe 会在执行时被解压到临时文件夹 %TEMP%/.net/GBCL/ 而其中的 GBCL.dll 才是 .NET Core 运行时真正执行的文件。见 Extracting Bundled Files to Disk 这就是为什么在进行自升级时,由 Application.ResourceAssembly.Location 返回的当前路径是到 dll 的路径而不是到 exe 的路径,因此旧的 exe 没有被正确替换。😪 可能的解决方法是使用 Process.GetCurrentProcess().MainModule.FileName 来得到当前可执行文件的路径。 |
It may be the bug about acquiring the file path and I agree.
Seems it didn't check the files when 大概是更新操作的路径获取上引发的 bug ,同意。
似乎和启动时没有校验文件有关,只要 |
Self update won't replace the old launcher exe file, and the launcher won't start successfully the second time. Investigating...Perhaps need a new self-update scheme
自动更新不能替换旧启动器可执行文件,并且第二次不能正常打开。正在查找原因,也许要找一种新的自动更新方法。
The text was updated successfully, but these errors were encountered: