[ui] Add auto-mount on first launch functionality #52

This commit is contained in:
2025-09-06 08:08:26 -05:00
parent 78abe1ed8f
commit 13fbcbab9a
7 changed files with 238 additions and 188 deletions

View File

@@ -24,6 +24,8 @@
#include "utils/windows.hpp"
#include "utils/error.hpp"
#include "utils/file.hpp"
#include "utils/path.hpp"
#include "utils/string.hpp"
namespace repertory::utils {
@@ -273,6 +275,19 @@ auto create_shortcut(const std::wstring &exe_path,
return true;
}
auto remove_shortcut(std::wstring shortcut_name, const std::wstring &location)
-> bool {
if (not shortcut_name.ends_with(L".lnk")) {
shortcut_name += L".lnk";
}
auto file = utils::path::combine(location, {shortcut_name});
if (not utils::file::file{file}.exists()) {
return true;
}
return utils::file::file{file}.remove();
}
} // namespace repertory::utils
#endif // defined(_WIN32)