[ui] Add auto-mount on first launch functionality #52
This commit is contained in:
@@ -244,9 +244,12 @@ void mgmt_app_config::set_auto_start(bool auto_start) {
|
|||||||
|
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
if (auto_start) {
|
if (auto_start) {
|
||||||
if (utils::create_shortcut(utils::path::combine(L".", {L"repertory"}),
|
shortcut_cfg cfg{};
|
||||||
{L"-ui", L"-lo"}, utils::path::absolute(L"."),
|
cfg.arguments = {L"-ui", L"-lo"};
|
||||||
L"repertory", false)) {
|
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,
|
utils::error::handle_info(function_name,
|
||||||
"created auto-start entry|name|repertory");
|
"created auto-start entry|name|repertory");
|
||||||
} else {
|
} else {
|
||||||
|
@@ -243,8 +243,9 @@ auto create_shortcut(const shortcut_cfg &cfg, bool overwrite_existing) -> bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (not utils::file::file{lnk_path}.remove()) {
|
if (not utils::file::file{lnk_path}.remove()) {
|
||||||
utils::error::handle_error(
|
utils::error::handle_error(function_name,
|
||||||
function_name, "failed to remove existing shortcut|path|" + lnk_path);
|
"failed to remove existing shortcut|path|" +
|
||||||
|
utils::string::to_utf8(lnk_path));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user