Skip to content

Commit

Permalink
added(meta data): Added exe icon, exe meta data
Browse files Browse the repository at this point in the history
  • Loading branch information
middaysan committed May 26, 2024
1 parent a4acbda commit e211f7a
Show file tree
Hide file tree
Showing 7 changed files with 67 additions and 11 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,13 @@ jobs:
go-version: '1.22.3'

- name: Install dependencies
run: go get -u golang.org/x/sys/windows github.com/getlantern/systray
run: go get -u golang.org/x/sys/windows github.com/getlantern/systray github.com/josephspurrier/goversioninfo

- name: Generate .syso
run: go generate .\cmd\

- name: Build application
run: go build -ldflags="-H windowsgui -extldflags=-Wl,app.manifest" -o memory-cleaner-tray.exe ./cmd/main.go
run: go build -ldflags="-H windowsgui -extldflags=-Wl,app.manifest" -o memory-cleaner-tray.exe .\cmd\

- name: Archive build
uses: actions/upload-artifact@v2
Expand Down
16 changes: 8 additions & 8 deletions app.manifest → cmd/app.manifest
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<application>
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true/pm</dpiAware>
</windowsSettings>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="requireAdministrator" uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
</application>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="requireAdministrator" uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>
Binary file added cmd/exe_icon.ico
Binary file not shown.
3 changes: 3 additions & 0 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import (
"runtime"
"time"

_ "github.com/josephspurrier/goversioninfo"

"github.com/getlantern/systray"
)

Expand All @@ -17,6 +19,7 @@ const (
percentThreshold = 65
)

//go:generate goversioninfo -icon=exe_icon.ico -manifest=app.manifest
func main() {
// Request admin rights if not already granted
if !windowsapi.IsRunAsAdmin() {
Expand Down
41 changes: 41 additions & 0 deletions cmd/versioninfo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"FixedFileInfo": {
"FileVersion": {
"Major": 1,
"Minor": 2,
"Patch": 5,
"Build": 0
},
"ProductVersion": {
"Major": 1,
"Minor": 2,
"Patch": 5,
"Build": 0
},
"FileFlagsMask": "3f",
"FileFlags": "00",
"FileOS": "040004",
"FileType": "01",
"FileSubtype": "00"
},
"StringFileInfo": {
"Comments": "Standby List Memory Cleaner - Tray Application",
"CompanyName": "Middaysan",
"FileDescription": "This is a simple Windows application that runs in the system tray and allows you to clean the standby memory list.",
"FileVersion": "1.2.5.0",
"InternalName": "memory-cleaner-tray.exe",
"LegalCopyright": "Copyright © 2024 Middaysan",
"LegalTrademarks": "",
"OriginalFilename": "memory-cleaner-tray.exe",
"ProductName": "Clean Standby List",
"ProductVersion": "1.2.5.0"
},
"VarFileInfo": {
"Translation": {
"LangID": "0409",
"CharsetID": "04b0"
}
},
"IconPath": "exe_icon.ico",
"ManifestPath": "app.manifest"
}
6 changes: 5 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ require (
golang.org/x/sys v0.20.0
)

require github.com/go-ole/go-ole v1.2.5 // indirect
require (
github.com/akavel/rsrc v0.10.2 // indirect
github.com/go-ole/go-ole v1.2.5 // indirect
github.com/josephspurrier/goversioninfo v1.4.0
)

require (
github.com/StackExchange/wmi v1.2.1
Expand Down
5 changes: 5 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
github.com/StackExchange/wmi v1.2.1 h1:VIkavFPXSjcnS+O8yTq7NI32k0R5Aj+v39y29VYDOSA=
github.com/StackExchange/wmi v1.2.1/go.mod h1:rcmrprowKIVzvc+NUiLncP2uuArMWLCbu9SBzvHz7e8=
github.com/akavel/rsrc v0.10.2 h1:Zxm8V5eI1hW4gGaYsJQUhxpjkENuG91ki8B4zCrvEsw=
github.com/akavel/rsrc v0.10.2/go.mod h1:uLoCtb9J+EyAqh+26kdrTgmzRBFPGOolLWKpdxkKq+c=
github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
Expand Down Expand Up @@ -40,6 +42,8 @@ github.com/go-stack/stack v1.8.1/go.mod h1:dcoOX6HbPZSZptuspn9bctJ+N/CnF5gGygcUP
github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/josephspurrier/goversioninfo v1.4.0 h1:Puhl12NSHUSALHSuzYwPYQkqa2E1+7SrtAPJorKK0C8=
github.com/josephspurrier/goversioninfo v1.4.0/go.mod h1:JWzv5rKQr+MmW+LvM412ToT/IkYDZjaclF2pKDss8IY=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
Expand All @@ -54,6 +58,7 @@ github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966/go.mod h1:s
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
Expand Down

0 comments on commit e211f7a

Please # to comment.