Skip to content

Commit 0792a57

Browse files
authored
Merge pull request #7 from AHS12/dev
Feat: Code refactors & update release build
2 parents 5e6142e + caed6e8 commit 0792a57

File tree

20 files changed

+459
-226
lines changed

20 files changed

+459
-226
lines changed
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
name: Build Check(Windows)
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
7+
jobs:
8+
build:
9+
runs-on: windows-latest
10+
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v4
14+
15+
- name: Set up Go
16+
uses: actions/setup-go@v5
17+
with:
18+
go-version: '^1.24'
19+
# Alternatively: go-version: 'stable'
20+
- name: Set up MinGW for CGO (required for Fyne)
21+
uses: msys2/setup-msys2@v2
22+
with:
23+
msystem: MINGW64
24+
update: true
25+
install: >-
26+
mingw-w64-x86_64-gcc
27+
mingw-w64-x86_64-pkg-config
28+
29+
- name: Add MinGW to PATH and set CGO vars
30+
shell: pwsh
31+
run: |
32+
$mingwPath = "C:\msys64\mingw64\bin"
33+
echo $mingwPath >> $env:GITHUB_PATH
34+
echo "CC=gcc" >> $env:GITHUB_ENV
35+
echo "CXX=g++" >> $env:GITHUB_ENV
36+
echo "CGO_ENABLED=1" >> $env:GITHUB_ENV
37+
38+
- name: Verify Go installation and CGO setup
39+
run: |
40+
go version
41+
gcc --version
42+
echo "CGO_ENABLED: $env:CGO_ENABLED"
43+
44+
- name: Check go.mod exists
45+
shell: cmd
46+
run: |
47+
if not exist go.mod (
48+
echo "❌ go.mod not found!"
49+
exit /b 1
50+
)
51+
echo "✅ go.mod found"
52+
53+
- name: Install Go dependencies
54+
shell: cmd
55+
run: |
56+
echo "Downloading dependencies..."
57+
go mod download -x
58+
echo "Dependencies downloaded successfully"
59+
60+
- name: Create dist directory
61+
shell: cmd
62+
run: if not exist "dist" mkdir dist
63+
64+
- name: Clean previous builds
65+
shell: cmd
66+
run: del /Q dist\*.exe 2>nul || echo "No previous builds to clean"
67+
68+
- name: Check Go and CGO environment
69+
run: |
70+
go version
71+
go env GOOS GOARCH CGO_ENABLED CC CXX
72+
73+
- name: List dependencies
74+
run: go list -m all
75+
76+
- name: Build GUI version
77+
shell: cmd
78+
run: |
79+
echo Building GUI version...
80+
go build -v -ldflags "-s -w -H=windowsgui" -o dist\click-guardian-gui.exe .\cmd\click-guardian
81+
if %ERRORLEVEL% EQU 0 (
82+
echo ✅ GUI build successful!
83+
) else (
84+
echo ❌ GUI build failed with error code %ERRORLEVEL%!
85+
)
86+
87+
- name: Build console version
88+
shell: cmd
89+
run: |
90+
echo Building console version...
91+
go build -v -ldflags "-s -w" -o dist\click-guardian.exe .\cmd\click-guardian
92+
if %ERRORLEVEL% EQU 0 (
93+
echo ✅ Console build successful!
94+
) else (
95+
echo ❌ Console build failed with error code %ERRORLEVEL%!
96+
exit /b 1
97+
)
98+
99+
- name: Check if EXE was generated
100+
shell: cmd
101+
run: |
102+
if not exist dist\click-guardian-gui.exe (
103+
echo "❌ GUI EXE not found!"
104+
exit /b 1
105+
)
106+
if not exist dist\click-guardian.exe (
107+
echo "❌ Console EXE not found!"
108+
exit /b 1
109+
)
110+
echo "✅ Both EXE files found."

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ dist/
88
*.deb
99
*.rpm
1010
*.msi
11+
*.syso
1112

1213
# Logs
1314
*.log

README.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616

1717
- 🎯 **Strict Double-Click Blocking**: Ensures no double-clicks are allowed under any circumstances
1818
- ⚙️ **Customizable Delay**: Set delay from 5ms to 500ms (default: 50ms)
19-
- **Adaptive Protection**: Automatically increases delay when faulty mouse hardware is detected (never decreases below user setting)
20-
- 📊 **Real-time Logging**: Detailed logs for allowed and blocked clicks, including reasons and timestamps
19+
- 🛡️ **Adaptive Protection**: Automatically increases delay when faulty mouse hardware is detected (never decreases below user setting)
20+
- 📊 **Real-time Logging**: Detailed logs for allowed and blocked clicks, including reasons and timestamps
2121
- 🖥️ **Modern GUI**: Clean and intuitive Fyne-based interface
2222
- 🚀 **Lightweight**: Minimal resource usage
2323
- 🛡️ **Safe**: Only monitors clicks, doesn't interfere with other mouse operations
@@ -56,12 +56,8 @@ _Tip: Start with the default 50ms delay - it works well for most users._
5656

5757
1. Go to [Releases](../../releases) page
5858
2. Download the latest `click-guardian-v*.zip`
59-
3. Extract and run `click-guardian-gui.exe`
59+
3. Extract and run `click-guardian.exe`
6060

61-
**Alternative downloads:**
62-
63-
- `click-guardian-gui.exe` - Main application (recommended)
64-
- `click-guardian.exe` - Console version (shows debug output)
6561

6662
### Build from Source
6763

build/build.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Build Configuration
2-
VERSION=1.0.0
2+
VERSION=1.0.1
33
COMPANY_NAME=Click Guardian Project
44
PRODUCT_NAME=Click Guardian
55
DESCRIPTION=Prevents accidental double-clicks with configurable delay protection

build/windows/app-manifest.xml

Lines changed: 31 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,34 @@
1-
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
1+
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
22
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
3-
<assemblyIdentity
4-
version="1.0.0.0"
5-
processorArchitecture="*"
6-
name="ClickGuardian"
7-
type="win32" />
8-
9-
<!-- Application information -->
10-
<description>Click Guardian - Double-Click Protection</description>
11-
12-
<!-- UAC settings - run as normal user -->
13-
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
14-
<security>
15-
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
16-
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
17-
</requestedPrivileges>
18-
</security>
19-
</trustInfo>
20-
21-
<!-- DPI awareness -->
22-
<application xmlns="urn:schemas-microsoft-com:asm.v3">
23-
<windowsSettings>
24-
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
25-
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2</dpiAwareness>
26-
</windowsSettings>
3+
<assemblyIdentity version="1.0.1.0" processorArchitecture="*" name="ClickGuardian" type="win32" />
4+
<!-- Application information -->
5+
<description>Click Guardian - Double-Click Protection</description>
6+
<!-- UAC settings - run as normal user -->
7+
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
8+
<security>
9+
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
10+
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
11+
</requestedPrivileges>
12+
</security>
13+
</trustInfo>
14+
<!-- DPI awareness -->
15+
<application xmlns="urn:schemas-microsoft-com:asm.v3">
16+
<windowsSettings>
17+
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
18+
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2</dpiAwareness>
19+
</windowsSettings>
20+
</application>
21+
<!-- Supported Windows versions -->
22+
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
23+
<application>
24+
<!-- Windows 10 and later -->
25+
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />
26+
<!-- Windows 8.1 -->
27+
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />
28+
<!-- Windows 8 -->
29+
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />
30+
<!-- Windows 7 -->
31+
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />
2732
</application>
28-
29-
<!-- Supported Windows versions -->
30-
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
31-
<application>
32-
<!-- Windows 10 and later -->
33-
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />
34-
<!-- Windows 8.1 -->
35-
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />
36-
<!-- Windows 8 -->
37-
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />
38-
<!-- Windows 7 -->
39-
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />
40-
</application>
41-
</compatibility>
33+
</compatibility>
4234
</assembly>

build/windows/app.rc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
ICON_ID ICON "app-icon.ico"
44

55
1 VERSIONINFO
6-
FILEVERSION 1,0,0,0
7-
PRODUCTVERSION 1,0,0,0
6+
FILEVERSION 1,0,1,0
7+
PRODUCTVERSION 1,0,1,0
88
FILEFLAGSMASK 0x3fL
99
#ifdef _DEBUG
1010
FILEFLAGS 0x1L
@@ -21,12 +21,12 @@ BEGIN
2121
BEGIN
2222
VALUE "CompanyName", "Click Guardian Project"
2323
VALUE "FileDescription", "Click Guardian - Double-Click Protection"
24-
VALUE "FileVersion", "1.0.0.0"
24+
VALUE "FileVersion", "1.0.1"
2525
VALUE "InternalName", "click-guardian"
26-
VALUE "LegalCopyright", "© 2025 Click Guardian Project"
26+
VALUE "LegalCopyright", "© 2025 Azizul hakim"
2727
VALUE "OriginalFilename", "click-guardian.exe"
2828
VALUE "ProductName", "Click Guardian"
29-
VALUE "ProductVersion", "1.0.0.0"
29+
VALUE "ProductVersion", "1.0.1"
3030
VALUE "Comments", "Prevents accidental double-clicks with configurable delay protection"
3131
END
3232
END

cmd/click-guardian/app.syso

-192 KB
Binary file not shown.

0 commit comments

Comments
 (0)