Skip to content

Commit 2ad42f5

Browse files
committed
fix: improve startup diagnostics
1 parent 6e38bee commit 2ad42f5

7 files changed

Lines changed: 256 additions & 30 deletions

File tree

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,12 @@ body:
3939
label: Version
4040
description: The version of the application you are using. (e.g. 1.0.0)
4141

42+
- type: textarea
43+
attributes:
44+
label: Logs
45+
description: If LeviLauncher fails to open or closes immediately, please attach `%APPDATA%\\levilauncher.exe\\logs\\startup.log`.
46+
4247
- type: textarea
4348
attributes:
4449
label: Additional context
45-
description: Add any other context about the problem here.
50+
description: Add any other context about the problem here. If startup fails before the UI appears, include `%APPDATA%\\levilauncher.exe\\logs\\startup.log` when possible.

docs/guide/update-troubleshooting.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ Use this page when LeviLauncher installs, updates, or launches do not behave as
1919
- Move your managed content path to a writable location in **Settings**.
2020
- If the launcher requests elevation for install or self-update, allow it when you trust the action.
2121

22+
### LeviLauncher closes immediately or never shows a window
23+
24+
- On Windows, LeviLauncher now starts WebView2 in a safer software-rendered mode to reduce startup crashes on some GPU and driver combinations.
25+
- If the launcher still fails before the UI appears, check `%APPDATA%\levilauncher.exe\logs\startup.log`.
26+
- Retry once after a failed launch. If it still happens, attach `startup.log` when opening a GitHub issue.
27+
2228
### A version fails to launch
2329

2430
- test the same version without mods
@@ -59,4 +65,3 @@ When reporting, include:
5965
- screenshots or logs if available
6066

6167
Open issues here: [GitHub Issues](https://github.com/LiteLDev/LeviLauncher/issues)
62-

docs/zh-CN/guide/update-troubleshooting.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@
1919
-**Settings** 中把托管内容路径改到可写位置。
2020
- 如果启动器在安装或自更新时要求提升权限,只在你确认可信时允许执行。
2121

22+
### LeviLauncher 本体一闪即退或双击没反应
23+
24+
- 在 Windows 上,LeviLauncher 现在会以更保守的 WebView2 软件渲染模式启动,以降低部分显卡和驱动组合下的启动崩溃概率。
25+
- 如果界面还没出现就退出,请先检查 `%APPDATA%\levilauncher.exe\logs\startup.log`
26+
- 失败后可以先重试一次;如果仍然复现,提交 Issue 时请附上 `startup.log`
27+
2228
### 某个版本无法启动
2329

2430
- 先测试该版本在无 Mods 情况下能否启动
@@ -59,4 +65,3 @@ LeviLauncher 可以检查、下载并安装应用更新。若安装目录不可
5965
- 截图或日志(如果有)
6066

6167
问题反馈入口: [GitHub Issues](https://github.com/LiteLDev/LeviLauncher/issues)
62-

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ require (
1010
github.com/google/go-github/v30 v30.1.0
1111
github.com/joho/godotenv v1.5.1
1212
github.com/mouuff/go-rocket-update v1.5.6
13-
github.com/wailsapp/wails/v3 v3.0.0-alpha.74
13+
github.com/wailsapp/wails/v3 v3.0.0-alpha.77
1414
golang.org/x/sys v0.40.0
1515
gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce
1616
)

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@ github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu
122122
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
123123
github.com/wailsapp/go-webview2 v1.0.23 h1:jmv8qhz1lHibCc79bMM/a/FqOnnzOGEisLav+a0b9P0=
124124
github.com/wailsapp/go-webview2 v1.0.23/go.mod h1:qJmWAmAmaniuKGZPWwne+uor3AHMB5PFhqiK0Bbj8kc=
125-
github.com/wailsapp/wails/v3 v3.0.0-alpha.74 h1:wRm1EiDQtxDisXk46NtpiBH90STwfKp36NrTDwOEdxw=
126-
github.com/wailsapp/wails/v3 v3.0.0-alpha.74/go.mod h1:4saK4A4K9970X+X7RkMwP2lyGbLogcUz54wVeq4C/V8=
125+
github.com/wailsapp/wails/v3 v3.0.0-alpha.77 h1:7oM39SMUKP3cG3i1XZ6rLwuOTjkEEGW7m7weFe/GRsQ=
126+
github.com/wailsapp/wails/v3 v3.0.0-alpha.77/go.mod h1:4saK4A4K9970X+X7RkMwP2lyGbLogcUz54wVeq4C/V8=
127127
github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM=
128128
github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw=
129129
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=

internal/apppath/apppath.go

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,20 @@ func SetBaseRootOverride(path string) {
1616
baseRootOverride = path
1717
}
1818

19+
func executableStorageRoot() string {
20+
exeName := "levilauncher.exe"
21+
if exe, err := os.Executable(); err == nil {
22+
base := strings.TrimSpace(filepath.Base(exe))
23+
if base != "" {
24+
exeName = strings.ToLower(base)
25+
}
26+
}
27+
28+
root := filepath.Join(AppData(), exeName)
29+
_ = os.MkdirAll(root, 0o755)
30+
return root
31+
}
32+
1933
func LauncherDir() string {
2034
exe, err := os.Executable()
2135
if err != nil {
@@ -36,22 +50,23 @@ func AppData() string {
3650
}
3751

3852
func ConfigPath() string {
39-
exeName := "levilauncher.exe"
40-
if exe, err := os.Executable(); err == nil {
41-
b := strings.TrimSpace(filepath.Base(exe))
42-
if b != "" {
43-
exeName = strings.ToLower(b)
44-
}
45-
}
46-
base := filepath.Join(AppData(), exeName)
47-
_ = os.MkdirAll(base, 0o755)
48-
return filepath.Join(base, "config.json")
53+
return filepath.Join(executableStorageRoot(), "config.json")
4954
}
5055

5156
func ConfigDir() string {
5257
return filepath.Dir(ConfigPath())
5358
}
5459

60+
func LogsDir() string {
61+
dir := filepath.Join(executableStorageRoot(), "logs")
62+
_ = os.MkdirAll(dir, 0o755)
63+
return dir
64+
}
65+
66+
func StartupLogPath() string {
67+
return filepath.Join(LogsDir(), "startup.log")
68+
}
69+
5570
func BaseRoot() string {
5671
if v := strings.TrimSpace(baseRootOverride); v != "" {
5772
_ = os.MkdirAll(v, 0o755)
@@ -65,17 +80,7 @@ func BaseRoot() string {
6580
}
6681
}
6782

68-
exeName := "levilauncher.exe"
69-
if exe, err := os.Executable(); err == nil {
70-
base := strings.TrimSpace(filepath.Base(exe))
71-
if base != "" {
72-
exeName = strings.ToLower(base)
73-
}
74-
}
75-
76-
root := filepath.Join(AppData(), exeName)
77-
_ = os.MkdirAll(root, 0o755)
78-
return root
83+
return executableStorageRoot()
7984
}
8085

8186
func InstallersDir() (string, error) {

0 commit comments

Comments
 (0)