/FastCopy

A GUI wrappers for Windows' built-in robocopy. QQ讨论群:479734355

Primary LanguageC++MIT LicenseMIT

Frame 8 FastCopy

A GUI wrapper for Windows' built-in robocopy and xcopy.

Features

  • Easy to use copy/paste/move/delete dialog, just like your good old explorer, but much faster🚀

  • Support the new Windows 11 context menu, and the old windows context menu, with the fluent design icon adapted to Light/Dark theme

  • Integration with Windows Notification Center: a notification toast will pop up when the copy is finished

  • Speed graph

  • Confirmation Dialog

  • Integration with taskbar: a progress bar sync with the one inside the window

  • Settings

  • Multi-language support
    • English
    • 中文

Installation (before publish to Microsoft Store)

  1. Go to the Release Page, download the zip file in the Asset section of the latest version
  2. Unzip, double-click to open the certificate file ended in .cert, click Install Certificate. Choose Local Machine in the dialog, click Next
  3. Choose Place all certificates in the following store, click Browser, and in the dialog choose Trusted root certification authorities
  4. Then click Next and finally Finish to install the certificate.
  5. Now you can double-click the msix to install the app. 6*. In rare situations, you might need to restart explorer.exe to see FastCopy in the right-click context menu

Usage

  1. Using file explorer, select some files/folders, as many as you want >> right click >> move to FastCopy >> select Copy or Move
  2. Go to destination folder, right click at empty space >> move to FastCopy >> select Paste

Development

Project structure

FastCopy
    FastCopy\               --- Main project
    FastCopyShellExtension\ --- A dll project for registering the new Windows context menu
    SpeedTest\              --- A speed test project for measuring various copying method under Windows
    UnitTest\               --- Unit test for above projects
    FastCopy.sln            --- The solution file for all the projects

Build pre-requisites

  • Visual Studio 2019+, with C++20 support & Universal Windows development workload
  • Windows App Sdk, with C++ template
  • Additional dependencies per project:
    • FastCopy:
      • spdlog
      • boost-algorithm
    • SpeedTest:
      • abseil
      • ftxui
      • cereal

vcpkg is the recommended package manager to handle these dependencies. You can install them with one command, and do no more.

vcpkg install boost-algorithm:x64-windows
vcpkg install spdlog:x64-windows
vcpkg install abseil:x64-windows
vcpkg install ftxui:x64-windows
vcpkg install cereal:x64-windows

Other component comes from my very own WinUIEssentials, which will be installed automatically by Visual Studio nuget.

Known issue

  • App crash after the window closed (does not affect users, low priority)

Recommendation

Please install the Child Process Debugger, so that the debugger would break at the copying process (after you launch the settings process). That is, you run the program first (so it goes into settings), then copy-paste a file, then the debugger will break automatically. Strongly recommended!

Translation

For contribution to translation, there are 2 places to be translated:

  • The main project, in FastCopy/Strings/<language>/Resources.resw
  • The shell extension project, in FastCopyShellExtension/CopyOperationNames.cpp CopyOperationNames::GetInstance()

Prototype

Figma link, you may need to ask for permission.

image

image

Behind the scene

Parsing robocopy output

  1. New file line has the form of this
New File  		     485	CMakeLists.txt	20:58 -> 20:58

This can be matched with staring with New File and containing 4 segments after split with \t

std::string_view{line}.starts_with("New File");
std::vector<absl::string_view> v = absl::StrSplit(s.data(), "\t", absl::SkipEmpty()); 
/*
    New File
    485
    CMakeLists.txt
    xx:xx -> xx:xx
*/
  1. New folder line has the form of this
New Dir       2000	D:\computecpp-sdk\.git\refs\

This can be matched with starting with New Dir and containing 2 segments after split with \t (the spacing between New Dir and number are spaces, not \t)

std::string_view{line}.starts_with("New Dir");
std::vector<std::string> splitted = absl::StrSplit(absl::string_view{ line.data(), line.length() }, "\t", absl::SkipEmpty());
/*
    New Dir       2000
    D:\computecpp-sdk\.git\refs\
*/
std::pair<std::string, std::string> count = absl::StrSplit(splitted[0], "  ", absl::SkipEmpty());
/*
    New Dir
    2000
*/