From 98a277713b63ba7baa58ce7e652472c22afbf1bb Mon Sep 17 00:00:00 2001 From: "Scott E. Graves" Date: Sat, 6 Sep 2025 18:24:49 -0500 Subject: [PATCH] [ui] Add auto-mount on first launch functionality #52 --- repertory/repertory/src/ui/mgmt_app_config.cpp | 9 ++++++--- support/src/utils/windows.cpp | 5 +++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/repertory/repertory/src/ui/mgmt_app_config.cpp b/repertory/repertory/src/ui/mgmt_app_config.cpp index f823ac5a..f45636d2 100644 --- a/repertory/repertory/src/ui/mgmt_app_config.cpp +++ b/repertory/repertory/src/ui/mgmt_app_config.cpp @@ -244,9 +244,12 @@ void mgmt_app_config::set_auto_start(bool auto_start) { #if defined(_WIN32) if (auto_start) { - if (utils::create_shortcut(utils::path::combine(L".", {L"repertory"}), - {L"-ui", L"-lo"}, utils::path::absolute(L"."), - L"repertory", false)) { + shortcut_cfg cfg{}; + cfg.arguments = {L"-ui", L"-lo"}; + cfg.exe_path = utils::path::combine(L".", {L"repertory"}); + cfg.location = utils::path::absolute(L"."); + cfg.shortcut_name = L"repertory"; + if (utils::create_shortcut(cfg, false)) { utils::error::handle_info(function_name, "created auto-start entry|name|repertory"); } else { diff --git a/support/src/utils/windows.cpp b/support/src/utils/windows.cpp index d3c7f73a..5cd2747e 100644 --- a/support/src/utils/windows.cpp +++ b/support/src/utils/windows.cpp @@ -243,8 +243,9 @@ auto create_shortcut(const shortcut_cfg &cfg, bool overwrite_existing) -> bool { } if (not utils::file::file{lnk_path}.remove()) { - utils::error::handle_error( - function_name, "failed to remove existing shortcut|path|" + lnk_path); + utils::error::handle_error(function_name, + "failed to remove existing shortcut|path|" + + utils::string::to_utf8(lnk_path)); return false; }