Skip to content

Commit

Permalink
修改 workflow 用于自动构建打包
Browse files Browse the repository at this point in the history
  • Loading branch information
KrxkGit committed May 8, 2024
1 parent 556c8af commit 65eaa73
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 20 deletions.
32 changes: 29 additions & 3 deletions .github/workflows/msbuild.yml → .github/workflows/build_pack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ name: MSBuild

on:
push:
branches: [ "main", "dev", "fix" ]
branches:
- '*'
pull_request:
branches: [ "main", "dev", "fix" ]
branches:
- '*'

env:
# Path to the solution file relative to the root of the project.
Expand Down Expand Up @@ -41,4 +43,28 @@ jobs:
working-directory: ${{env.GITHUB_WORKSPACE}}
# Add additional options to the MSBuild command line here (like platform or verbosity level).
# See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference
run: msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} ${{env.SOLUTION_FILE_PATH}}
run: |
msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} /p:Platform=x86 ${{env.SOLUTION_FILE_PATH}}
msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} /p:Platform=x64 ${{env.SOLUTION_FILE_PATH}}
- name: Package
run: |
mkdir dist/
mkdir dist/x86/
mkdir dist/x64/
mv x64/Release/HelpUploadFiles.exe dist/x64/
mv x64/Release/WorkDll.dll dist/x64/
mv Release/HelpUploadFiles.exe dist/x86/
mv Release/WorkDll.dll dist/x86/
mv documents/SkinBackup/*.* dist/x86/
mv Release/Startup.exe dist/
- name: Upload a Build Artifact
uses: actions/[email protected]
with:
name: HelpUploadFiles
path: dist/
32 changes: 16 additions & 16 deletions HelpUploadFiles/CMainDlg.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "pch.h"
#include "pch.h"
#include "CMainDlg.h"

CMainDlg* CMainDlg::singleton = new CMainDlg;
Expand Down Expand Up @@ -36,7 +36,7 @@ VOID CMainDlg::OnDlgInit()
this->haveInject = false;

this->hInjectWnd = NULL;
SetDlgItemText(this->hDlg, IDC_CAPTUREWND, _T("长按鼠标开启捕获"));
SetDlgItemText(this->hDlg, IDC_CAPTUREWND, _T("长按鼠标开启捕获"));

this->hListBox = GetDlgItem(this->hDlg, IDC_LIST1);
this->hIcon = LoadIcon(this->hInst, MAKEINTRESOURCE(IDI_HELPUPLOADFILES));
Expand All @@ -51,7 +51,7 @@ VOID CMainDlg::OnDlgInit()

void CMainDlg::OnCommand()
{
// TODO: 在此处添加实现代码.
// TODO: 在此处添加实现代码.
switch (LOWORD(this->wParam))
{
case IDCANCEL:
Expand Down Expand Up @@ -111,7 +111,7 @@ void CMainDlg::OnRemove()
CIgnoreFileManager::getSingleton()->removeIgnoreFile(this->szInput);
ListBox_DeleteString(this->hListBox, curSel);

// 设置下一个选中的位置
// 设置下一个选中的位置
if (curSel > 0) {
curSel--;
}
Expand Down Expand Up @@ -147,30 +147,30 @@ void CMainDlg::OnDropFile()
{
HDROP hDrop = (HDROP)this->wParam;
if (!isHaveInject()) {
DragFinish(hDrop); // 结束此次拖拽
DragFinish(hDrop); // 结束此次拖拽
return;
}

if (IDCANCEL == MessageBox(this->hDlg, _T("检测到拖拽文件,是否添加到忽略列表?"), _T("提示"), MB_ICONQUESTION | MB_OKCANCEL | MB_DEFBUTTON1)) {
DragFinish(hDrop); // 结束此次拖拽
if (IDCANCEL == MessageBox(this->hDlg, _T("检测到拖拽文件,是否添加到忽略列表?"), _T("提示"), MB_ICONQUESTION | MB_OKCANCEL | MB_DEFBUTTON1)) {
DragFinish(hDrop); // 结束此次拖拽
return;
}

UINT numFiles = DragQueryFile(hDrop, 0xFFFFFFFF, NULL, 0);

// 此功能从 C++ 17 开始支持
// 此功能从 C++ 17 开始支持
namespace fs = std::filesystem;

for (UINT i = 0; i < numFiles; i++)
{
//TCHAR szFileName[MAX_PATH];
DragQueryFile(hDrop, i, this->szInput, MAX_PATH);

// 在这里处理拖放的文件,比如显示文件名
// 在这里处理拖放的文件,比如显示文件名
fs::path path = this->szInput;
_tcscpy_s(this->szInput, _countof(this->szInput), path.filename().c_str());

// 拖拽将逃逸正则规则
// 拖拽将逃逸正则规则
std::swprintf(this->szInput, _countof(this->szInput), _T("%s"), CEscapeRegex::escapeRegex(this->szInput).c_str());

DoAdd();
Expand All @@ -190,7 +190,7 @@ void CMainDlg::OnMouseMove()
GetCursorPos(&pt);
HWND hWnd = WindowFromPoint(pt);
if (hWnd == this->hInjectWnd) {
// 窗口未发送变化,不处理
// 窗口未发送变化,不处理
return;
}
this->hInjectWnd = hWnd;
Expand Down Expand Up @@ -223,9 +223,9 @@ void CMainDlg::OnLButtonUp()
SetCursor(this->hOldCur);

TCHAR sz[MAX_PATH];
std::swprintf(sz, _countof(sz), _T("是否为窗口 %s 加载赋能模块"), this->szTitle);
std::swprintf(sz, _countof(sz), _T("是否为窗口 %s 加载赋能模块"), this->szTitle);

if (IDOK == MessageBox(this->hDlg, sz, _T("加载赋能模块"), MB_ICONQUESTION | MB_OKCANCEL)) {
if (IDOK == MessageBox(this->hDlg, sz, _T("加载赋能模块"), MB_ICONQUESTION | MB_OKCANCEL)) {
OnInject();
}
}
Expand All @@ -236,16 +236,16 @@ bool CMainDlg::isHaveInject()
bool b = this->haveInject;
if (!b) {
TCHAR sz[MAX_PATH];
std::swprintf(sz, _countof(sz), _T("尚未注入赋能模块,请先完成注入操作"));
MessageBox(this->hDlg, sz, _T("提示"), MB_ICONWARNING);
std::swprintf(sz, _countof(sz), _T("尚未注入赋能模块,请先完成注入操作"));
MessageBox(this->hDlg, sz, _T("提示"), MB_ICONWARNING);
}
return b;
}


void CMainDlg::OnSetProcessId()
{
// TODO: 在此处添加实现代码.
// TODO: 在此处添加实现代码.
INT_PTR res = DialogBox(hInst, MAKEINTRESOURCE(IDD_SETPROCESSDLG), this->hDlg, CSetProcessDlg::SetProcess);
if (res == IDCANCEL) {
return;
Expand Down
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# 🍕HelpUploadFiles

![GitHub license](https://img.shields.io/github/license/KrxkGit/HelpUploadFiles) ![GitHub last commit](https://img.shields.io/github/last-commit/KrxkGit/HelpUploadFiles/dev) [![GitHub stars](https://img.shields.io/github/stars/KrxkGit/HelpUploadFiles.svg?style=social)](https://github.com/KrxkGit/HelpUploadFiles)

## 🍺简介 - Introduction

***HelpUploadFiles (星空上传助手)*** 是一款 **辅助上传** 工具。我们知道,*git* 提供了 **.gitignore** 文件用于根据规则忽略某些文件的上传,但是这个功能仅限于 *git*,还有很多场景涉及**文件的上传**,比如我们可能需要将某些文件上传到网盘,但是大部分网盘并不具备 ***根据规则忽略指定文件*** 的功能,这十分不方便。另外,还存在着许许多多的上传文件的场景,此时,***HelpUploadFiles*** 油然而生!
Expand All @@ -10,6 +12,16 @@

Since there are no special rules required to ignore uploading for individual files, HelpUploadFiles is primarily aimed at scenarios involving folder uploads.

## 🔥软件包的获取

1. 可前往 *Actions* 区下载最新特性 **HelpUploadFiles** 包。
2. 可前往 *Releases* 区下载稳定版本的 **HelpUploadFiles** 包。

## 🔥Package Acquisition

1. You can go to the *Actions* section to download the latest feature package **HelpUploadFiles**.
2. You can go to the *Releases* section to download the stable version of the **HelpUploadFiles** package.

## 🍺文件上传概念的推广 - Expansion of File Upload Concepts

***HelpUploadFiles*** 涉及的文件上传并不仅仅局限于将本机文件上传到网盘这种场景,在 ***HelpUploadFiles*** 中,凡是需要 **将某个文件夹发送到某一个接口** 的操作均可推广为文件上传。
Expand Down Expand Up @@ -81,7 +93,7 @@ The following scenarios have been verified and are operational:
## 📍使用注意事项

1. ***HelpUploadFiles*** 分为 ***32位******64位*** 两个版本,需要根据不同的上传接口选择不同的版本,如目前百度网盘客户端是32位的,则需要使用32位版本的 ***HelpUploadFiles***;而64位系统的Edge浏览器是64位程序,则需要使用64位版本的 ***HelpUploadFiles***
2. 目前版本(v1.0.2)仅支持同时拦截一个进程的文件上传行为,值得注意的是 ***32位 与 64位版本 加起来一共能同时拦截一个进程***。且 ***添加/移除*** 忽略列表的操作 **仅对当前拦截的进程有效,若切换进程,即使重新注入,也需要重新添加忽略列表(移除后重新添加),否则将无效。** 这是由于目前采用的进程通信方案导致的。
2. 目前版本(v1.0.3)仅支持同时拦截一个进程的文件上传行为,值得注意的是 ***32位 与 64位版本 加起来一共能同时拦截一个进程***。且 ***添加/移除*** 忽略列表的操作 **仅对当前拦截的进程有效,若切换进程,即使重新注入,也需要重新添加忽略列表(移除后重新添加),否则将无效。** 这是由于目前采用的进程通信方案导致的。
3. 对于下方输入框手动输入的忽略规则,将采用 **C++ 正则表达式规则**
4. 对于拖拽上传的文件,将自动进行转义使其符合 **C++正则表达式规则**

Expand Down
Binary file added documents/SkinBackup/Gloss.ssk
Binary file not shown.
Binary file added documents/SkinBackup/SkinPPWTL.dll
Binary file not shown.

0 comments on commit 65eaa73

Please sign in to comment.