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
|
return false, err
|
||||||
}
|
}
|
||||||
|
if runtime.GOOS == "windows" {
|
||||||
name, err := os.Executable()
|
name, err := os.Executable()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, err
|
return false, err
|
||||||
}
|
}
|
||||||
exec.Command(name, os.Args[1:]...).Start()
|
exec.Command(name, os.Args[1:]...).Start()
|
||||||
wruntime.Quit(a.ctx)
|
wruntime.Quit(a.ctx)
|
||||||
|
}
|
||||||
return false, nil
|
return false, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -141,5 +141,6 @@
|
|||||||
"Current Strategy": "当前Strategy",
|
"Current Strategy": "当前Strategy",
|
||||||
"MacOS is not yet supported for performing this operation, please do it manually.": "MacOS尚未支持此操作, 请手动执行",
|
"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尚未支持此操作, 请手动执行",
|
"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 { Language, Languages, SettingsType } from '../pages/Settings';
|
||||||
import { ModelSourceItem } from '../pages/Models';
|
import { ModelSourceItem } from '../pages/Models';
|
||||||
import { ModelConfig, ModelParameters } from '../pages/Configs';
|
import { ModelConfig, ModelParameters } from '../pages/Configs';
|
||||||
import { BrowserOpenURL } from '../../wailsjs/runtime';
|
|
||||||
|
|
||||||
export type Cache = {
|
export type Cache = {
|
||||||
models: ModelSourceItem[]
|
models: ModelSourceItem[]
|
||||||
@ -250,14 +249,20 @@ export async function checkUpdate(notifyEvenLatest: boolean = false) {
|
|||||||
`https://gitee.com/josc146/RWKV-Runner/releases/download/${versionTag}/${asset.name}`;
|
`https://gitee.com/josc146/RWKV-Runner/releases/download/${versionTag}/${asset.name}`;
|
||||||
toastWithButton(t('New Version Available') + ': ' + versionTag, t('Update'), () => {
|
toastWithButton(t('New Version Available') + ': ' + versionTag, t('Update'), () => {
|
||||||
DeleteFile('cache.json');
|
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.'), {
|
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',
|
type: 'info',
|
||||||
position: 'bottom-left',
|
position: 'bottom-left',
|
||||||
autoClose: 20000
|
autoClose: 30000
|
||||||
});
|
});
|
||||||
setTimeout(() => {
|
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, {
|
toast(t('Update Error') + ' - ' + e.message || e, {
|
||||||
type: 'error',
|
type: 'error',
|
||||||
position: 'bottom-left',
|
position: 'bottom-left',
|
||||||
@ -265,9 +270,6 @@ export async function checkUpdate(notifyEvenLatest: boolean = false) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
}, 500);
|
}, 500);
|
||||||
} else {
|
|
||||||
BrowserOpenURL(updateUrl);
|
|
||||||
}
|
|
||||||
}, {
|
}, {
|
||||||
autoClose: false,
|
autoClose: false,
|
||||||
position: 'bottom-left'
|
position: 'bottom-left'
|
||||||
|
Loading…
Reference in New Issue
Block a user