-
Notifications
You must be signed in to change notification settings - Fork 350
feat: 差分アップデートを追加 #2701
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
base: main
Are you sure you want to change the base?
feat: 差分アップデートを追加 #2701
Changes from 9 commits
8a10e2e
c316767
b871001
42768ac
d87d436
66dc391
4c54143
655a72f
cafc5ca
4ce246c
6164b65
1b5fddb
7f749ee
e6a412f
58e2451
58c10e6
1c683b0
63c43bd
8369deb
16394e5
b69bb9e
9911ffc
3d2abb5
d30d896
e5ef5fe
2036dc8
1d21dc6
30fec5c
cd95804
b651811
2ff2d3d
fe2ac52
dc8dde5
57571e9
915364a
3f2515f
3474cbb
d9d448e
d52003d
a3dcde1
de599b7
abb37fa
e2b1ddd
3274b2d
8b03f99
7624268
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| VITE_APP_NAME=voicevox | ||
| VITE_APP_NAME=voicevox-test | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (ここに関係ないけど、議論分けたいのでここにコメントしました) ちょっと相談です!! あるいは抜本的な解決策として、先にエンジン分離をやってしまえば、差分アプデがすごく簡単になる(githubのみで完結する)ことを思いつきました。 現状まだ考えきれてないですが、サーバー追加周りは考えることが山ほどあるなと思ってます。 まああとで考えれば良いことが多いですが、であればもうエンジン分離してしまった方が早いんじゃないかと、ふと思ったのでコメントしてみました…。 |
||
| VITE_DEFAULT_ENGINE_INFOS=`[ | ||
| { | ||
| "uuid": "074fc39e-678b-4c13-8916-ffca8d505d1d", | ||
|
|
||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. メモ:消す
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. これも消す感じですかね
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ですね。 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| provider: generic | ||
| url: http://localhost:3000 | ||
| useMultipleRangeRequest: false | ||
| updaterCacheDirName: voicevox-updater |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| { | ||
| "name": "voicevox", | ||
| "version": "999.999.999", | ||
| "name": "voicevox-test", | ||
| "version": "0.24.8", | ||
|
||
| "author": "Hiroshiba Kazuyuki", | ||
| "private": true, | ||
| "main": "./dist/main.js", | ||
|
|
@@ -59,6 +59,7 @@ | |
| "async-lock": "1.4.1", | ||
| "dayjs": "1.11.13", | ||
| "electron-log": "5.4.1", | ||
| "electron-updater": "6.6.2", | ||
| "electron-window-state": "5.0.3", | ||
| "encoding-japanese": "2.2.0", | ||
| "fast-array-diff": "1.1.0", | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| import { autoUpdater as electronUpdater } from "electron-updater"; | ||
| import { DisplayableError } from "@/helpers/errorHelper"; | ||
| import { createLogger } from "@/helpers/log"; | ||
|
|
||
| const log = createLogger("AutoUpdateManager"); | ||
|
|
||
| // ログの設定 | ||
| electronUpdater.logger = createLogger("electron-updater"); | ||
| // 手動でアップデートをダウンロードするために自動ダウンロードを無効化 | ||
| electronUpdater.autoDownload = false; | ||
| // アプリ終了時に自動的にインストールする挙動を無効化 | ||
| electronUpdater.autoInstallOnAppQuit = false; | ||
| // 開発版でもアップデートを有効化する | ||
| electronUpdater.forceDevUpdateConfig = true; | ||
|
|
||
| electronUpdater.on("error", (error) => { | ||
| log.error("AutoUpdater error:", error); | ||
| }); | ||
|
|
||
| electronUpdater.on("update-downloaded", (info) => { | ||
| log.info("Update downloaded:", info); | ||
| }); | ||
|
|
||
| export class UpdateManager { | ||
| constructor() {} | ||
| async updateApp(version: string) { | ||
| const latest = await electronUpdater.checkForUpdates(); | ||
| if (latest == null || latest.updateInfo == null) { | ||
| log.error("Assertion failed: Latest update info is null"); | ||
| throw new DisplayableError( | ||
| `アップデートサーバーからの情報が取得できませんでした。時間をおいてからもう一度やり直してください。`, | ||
| ); | ||
| } | ||
| if (latest.updateInfo.version !== version) { | ||
| log.error( | ||
| `Assertion failed: Server's latest: ${latest?.updateInfo.version}, Current: ${version}`, | ||
| ); | ||
| throw new DisplayableError( | ||
| `アップデートサーバーのバージョンが現在のバージョンと異なります。時間をおいてからもう一度やり直してください。`, | ||
| ); | ||
| } | ||
|
|
||
| await electronUpdater.downloadUpdate(); | ||
| log.info("Quitting and installing update..."); | ||
| electronUpdater.quitAndInstall(); | ||
| } | ||
| } | ||
|
|
||
| let managerInstance: UpdateManager | null = null; | ||
| export function getUpdateManager(): UpdateManager { | ||
| if (managerInstance == null) { | ||
| managerInstance = new UpdateManager(); | ||
| } | ||
| return managerInstance; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
メモ:戻す