improve update process for macOS and Linux
This commit is contained in:
parent
a95fbbbd78
commit
b7c34b0d42
@ -53,12 +53,14 @@ func (a *App) UpdateApp(url string) (broken bool, err error) {
|
||||
}
|
||||
return false, err
|
||||
}
|
||||
if runtime.GOOS == "windows" {
|
||||
name, err := os.Executable()
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
exec.Command(name, os.Args[1:]...).Start()
|
||||
wruntime.Quit(a.ctx)
|
||||
}
|
||||
return false, nil
|
||||
}
|
||||
|
||||
|
@ -141,5 +141,6 @@
|
||||
"Current Strategy": "当前Strategy",
|
||||
"MacOS is not yet supported for performing this operation, please do it manually.": "MacOS尚未支持此操作, 请手动执行",
|
||||
"Linux is not yet supported for performing this operation, please do it manually.": "Linux尚未支持此操作, 请手动执行",
|
||||
"On Linux system, you must manually install python dependencies.": "在Linux系统下, 你必须手动安装python依赖"
|
||||
"On Linux system, you must manually install python dependencies.": "在Linux系统下, 你必须手动安装python依赖",
|
||||
"Update completed, please restart the program.": "更新完成, 请重启程序"
|
||||
}
|
@ -16,7 +16,6 @@ import { Button } from '@fluentui/react-components';
|
||||
import { Language, Languages, SettingsType } from '../pages/Settings';
|
||||
import { ModelSourceItem } from '../pages/Models';
|
||||
import { ModelConfig, ModelParameters } from '../pages/Configs';
|
||||
import { BrowserOpenURL } from '../../wailsjs/runtime';
|
||||
|
||||
export type Cache = {
|
||||
models: ModelSourceItem[]
|
||||
@ -250,14 +249,20 @@ export async function checkUpdate(notifyEvenLatest: boolean = false) {
|
||||
`https://gitee.com/josc146/RWKV-Runner/releases/download/${versionTag}/${asset.name}`;
|
||||
toastWithButton(t('New Version Available') + ': ' + versionTag, t('Update'), () => {
|
||||
DeleteFile('cache.json');
|
||||
if (commonStore.platform != 'darwin') {
|
||||
toast(t('Downloading update, please wait. If it is not completed, please manually download the program from GitHub and replace the original program.'), {
|
||||
type: 'info',
|
||||
position: 'bottom-left',
|
||||
autoClose: 20000
|
||||
autoClose: 30000
|
||||
});
|
||||
setTimeout(() => {
|
||||
UpdateApp(updateUrl).catch((e) => {
|
||||
UpdateApp(updateUrl).then(() => {
|
||||
toast(t('Update completed, please restart the program.'), {
|
||||
type: 'success',
|
||||
position: 'bottom-left',
|
||||
autoClose: false
|
||||
}
|
||||
);
|
||||
}).catch((e) => {
|
||||
toast(t('Update Error') + ' - ' + e.message || e, {
|
||||
type: 'error',
|
||||
position: 'bottom-left',
|
||||
@ -265,9 +270,6 @@ export async function checkUpdate(notifyEvenLatest: boolean = false) {
|
||||
});
|
||||
});
|
||||
}, 500);
|
||||
} else {
|
||||
BrowserOpenURL(updateUrl);
|
||||
}
|
||||
}, {
|
||||
autoClose: false,
|
||||
position: 'bottom-left'
|
||||
|
Loading…
Reference in New Issue
Block a user