Scighost / Starward

Game Launcher for miHoYo - 米家游戏启动器
https://starward.scighost.com
MIT License
3.57k stars 164 forks source link

[Question] 备份的数据库在恢复时被识别为只读文件 #955

Closed Brian-Du closed 3 months ago

Brian-Du commented 4 months ago

Checklist

Description

备份的数据库在恢复后,祈愿数据更新时显示为只读数据库无法写入,游戏时长同样无法更新,只有在以管理员模式运行才可以正常写入数据 image

Starward Version

0.12.0

Windows Version

26120.961

Log

[20:21:03.560] [INFO] 
Welcome to Starward v0.12.0
System: Microsoft Windows NT 10.0.26120.0
Command Line: "C:\Program Files\Starward\app-0.12.0\Starward.dll"

[20:21:03.609] [INFO] Starward.Services.DatabaseService
Database path is 'C:\Program Files\Starward'

[20:21:03.650] [INFO] Starward.Services.DatabaseService
Database version is 9, target version is 9.

[20:21:03.751] [INFO] Starward.Pages.MainPage
Last game region is hk4e_cn

[20:21:03.770] [INFO] Starward.Pages.MainPage
Navigate to "GameLauncherPage" with param hk4e_cn

[20:21:04.458] [INFO] Starward.Pages.GameLauncherPage
Game install path of hk4e_cn: "C:\Program Files\Genshin Impact"

[20:21:04.486] [INFO] Starward.Pages.GameLauncherPage
Acutal version and gamebiz of hk4e_cn is "4.7.0".

[20:21:05.368] [INFO] Starward.Services.UpdateService
Start to check update (Preview: True, Arch: X64)

[20:21:05.538] [INFO] Starward.Services.UpdateService
Current version: "0.12.0", latest version: "0.12.0", ignore version: null

[20:21:18.471] [INFO] Starward.Services.Launcher.GameLauncherService
Start game (hk4e_cn)
path: "C:\Program Files\Genshin Impact\YuanShen.exe"
arg: null

[20:21:21.429] [INFO] Starward.Pages.GameLauncherPage
Game started ("YuanShen", 20816)

[20:21:23.438] [INFO] Starward.Services.PlayTimeService
Start to log playtime (hk4e_cn, 20816)

[20:22:44.292] [INFO] Starward.Pages.MainPage
Navigate to "GameSettingPage" with param hk4e_cn

[20:22:45.846] [INFO] Starward.Pages.MainPage
Navigate to "ScreenshotPage" with param hk4e_cn

[20:22:45.957] [WARN] Starward.Pages.ScreenshotPage
Cannot find screenshot folder

[20:22:46.783] [INFO] Starward.Pages.MainPage
Navigate to "GachaLogPage" with param hk4e_cn

[20:22:47.470] [EROR] Starward.Pages.GachaLogPage
Update wiki data hk4e_cn
Microsoft.Data.Sqlite.SqliteException (0x80004005): SQLite Error 8: 'attempt to write a readonly database'.
   at Microsoft.Data.Sqlite.SqliteException.ThrowExceptionForRC(Int32, sqlite3)
   at Microsoft.Data.Sqlite.SqliteDataReader.NextResult()
   at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader(CommandBehavior)
   at Microsoft.Data.Sqlite.SqliteCommand.ExecuteNonQuery()
   at Dapper.SqlMapper.ExecuteImpl(IDbConnection cnn, CommandDefinition& command) in /_/Dapper/SqlMapper.cs:line 638
   at Dapper.SqlMapper.Execute(IDbConnection cnn, String sql, Object param, IDbTransaction transaction, Nullable`1 commandTimeout, Nullable`1 commandType) in /_/Dapper/SqlMapper.cs:line 527
   at Starward.Services.Gacha.GenshinGachaService.UpdateGachaInfoAsync(GameBiz gameBiz, String lang, CancellationToken cancellationToken) in D:\a\Starward\Starward\src\Starward\Services\Gacha\GenshinGachaService.cs:line 165
   at Starward.Pages.GachaLogPage.UpdateWikiDataAsync() in D:\a\Starward\Starward\src\Starward\Pages\GachaLogPage.xaml.cs:line 285

[20:22:49.618] [EROR] Starward.Pages.GachaLogPage
Update gacha log
Microsoft.Data.Sqlite.SqliteException (0x80004005): SQLite Error 8: 'attempt to write a readonly database'.
   at Microsoft.Data.Sqlite.SqliteException.ThrowExceptionForRC(Int32, sqlite3)
   at Microsoft.Data.Sqlite.SqliteDataReader.NextResult()
   at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader(CommandBehavior)
   at Microsoft.Data.Sqlite.SqliteCommand.ExecuteNonQuery()
   at Dapper.SqlMapper.ExecuteCommand(IDbConnection cnn, CommandDefinition& command, Action`2 paramReader) in /_/Dapper/SqlMapper.cs:line 2965
   at Dapper.SqlMapper.ExecuteImpl(IDbConnection cnn, CommandDefinition& command) in /_/Dapper/SqlMapper.cs:line 656
   at Dapper.SqlMapper.Execute(IDbConnection cnn, String sql, Object param, IDbTransaction transaction, Nullable`1 commandTimeout, Nullable`1 commandType) in /_/Dapper/SqlMapper.cs:line 527
   at Starward.Services.Gacha.GachaLogService.GetUidFromGachaLogUrl(String url) in D:\a\Starward\Starward\src\Starward\Services\Gacha\GachaLogService.cs:line 107
   at Starward.Pages.GachaLogPage.UpdateGachaLogInternalAsync(String url, Boolean all) in D:\a\Starward\Starward\src\Starward\Pages\GachaLogPage.xaml.cs:line 375
   at Starward.Pages.GachaLogPage.UpdateGachaLogAsync(String param) in D:\a\Starward\Starward\src\Starward\Pages\GachaLogPage.xaml.cs:line 359

[20:25:54.746] [EROR] Starward.Pages.GachaLogPage
Update gacha log
Microsoft.Data.Sqlite.SqliteException (0x80004005): SQLite Error 8: 'attempt to write a readonly database'.
   at Microsoft.Data.Sqlite.SqliteException.ThrowExceptionForRC(Int32, sqlite3)
   at Microsoft.Data.Sqlite.SqliteDataReader.NextResult()
   at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader(CommandBehavior)
   at Microsoft.Data.Sqlite.SqliteCommand.ExecuteNonQuery()
   at Dapper.SqlMapper.ExecuteCommand(IDbConnection cnn, CommandDefinition& command, Action`2 paramReader) in /_/Dapper/SqlMapper.cs:line 2965
   at Dapper.SqlMapper.ExecuteImpl(IDbConnection cnn, CommandDefinition& command) in /_/Dapper/SqlMapper.cs:line 656
   at Dapper.SqlMapper.Execute(IDbConnection cnn, String sql, Object param, IDbTransaction transaction, Nullable`1 commandTimeout, Nullable`1 commandType) in /_/Dapper/SqlMapper.cs:line 527
   at Starward.Services.Gacha.GachaLogService.GetUidFromGachaLogUrl(String url) in D:\a\Starward\Starward\src\Starward\Services\Gacha\GachaLogService.cs:line 107
   at Starward.Pages.GachaLogPage.UpdateGachaLogInternalAsync(String url, Boolean all) in D:\a\Starward\Starward\src\Starward\Pages\GachaLogPage.xaml.cs:line 375
   at Starward.Pages.GachaLogPage.UpdateGachaLogAsync(String param) in D:\a\Starward\Starward\src\Starward\Pages\GachaLogPage.xaml.cs:line 359

[20:25:56.808] [INFO] Starward.Pages.MainPage
Navigate to "SelfQueryPage" with param hk4e_cn

Additional Context

No response

Scighost commented 3 months ago

如果数据文件夹设置在 C:\Program Files\ 内,每次启动时需要管理员权限才能写入数据。

starward-bot[bot] commented 3 months ago

@Brian-Du deleted the following comment published at 2024-08-13 15:58:17 +00:00 updated at 2024-08-13 15:58:17 +00:00

我把文件夹移动到C盘根目录下仍然提示只读数据库> 如果数据文件夹设置在 C:\Program Files\ 内,每次启动时需要管理员权限才能写入数据。

starward-bot[bot] commented 3 months ago

This issue will be closed due to no reply for more than 14 days.