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

@@ -116,15 +116,27 @@ int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev,
if (!command_line_arguments.empty() && command_line_arguments.front().compare(0, cmParam.size(), cmParam.c_str()) == 0) {
is_cm_page = true;
}
bool is_install_page = false;
auto installParam = std::string("--install");
if (!command_line_arguments.empty() && command_line_arguments.front().compare(0, installParam.size(), installParam.c_str()) == 0) {
is_install_page = true;
}
command_line_arguments.insert(command_line_arguments.end(), rust_args.begin(), rust_args.end());
project.set_dart_entrypoint_arguments(std::move(command_line_arguments));
FlutterWindow window(project);
Win32Window::Point origin(10, 10);
Win32Window::Size size(800, 600);
if (!window.CreateAndShow(
is_cm_page ? app_name + L" - Connection Manager" : app_name, origin,
size, !is_cm_page)) {
std::wstring window_title;
if (is_cm_page) {
window_title = app_name + L" - Connection Manager";
} else if (is_install_page) {
window_title = app_name + L" - Install";
} else {
window_title = app_name;
}
if (!window.CreateAndShow(window_title, origin, size, !is_cm_page)) {
return EXIT_FAILURE;
}
window.SetQuitOnClose(true);