HO-COOH / FastCopy

A GUI wrappers for Windows' built-in robocopy. QQ讨论群:479734355
MIT License
180 stars 24 forks source link
cpp20 explorer system-utility windows windowsappsdk winui3

Frame 8 FastCopy

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

Features

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

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

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:

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
    */
  2. 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
    */