windows replace uni with cmd to start up main window after installation (#8235)

This is to avoid uni link not working

Other change: The install window now has the title "appname - Install" to distinguish it from the main application window.

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages
2024-06-01 20:28:21 +08:00
committed by GitHub
parent ed5487a1fc
commit 18464ec570
3 changed files with 16 additions and 7 deletions

View File

@@ -2185,12 +2185,10 @@ sc start {app_name}
fn run_after_run_cmds(silent: bool) {
let (_, _, _, exe) = get_install_info();
let app = crate::get_app_name().to_lowercase();
if !silent {
log::debug!("Spawn new window");
allow_err!(std::process::Command::new("cmd")
.arg("/c")
.arg(format!("timeout /t 2 & start {app}://"))
.args(&["/c", "timeout", "/t", "2", "&", &format!("{exe}")])
.creation_flags(winapi::um::winbase::CREATE_NO_WINDOW)
.spawn());
}