GithubHelp home page GithubHelp logo

tc-hib / go-winres Goto Github PK

View Code? Open in Web Editor NEW
294.0 294.0 15.0 242 KB

Command line tool for adding Windows resources to executable files

License: BSD Zero Clause License

Go 100.00%
golang icon manifest rsrc windows

go-winres's People

Contributors

ginglis13 avatar jeremyletang avatar kmahyyg avatar lostdusty avatar tc-hib avatar whereswaldon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

go-winres's Issues

Large icon view not using 256px png

Hi,

Love this project and how easy it makes embedding Windows resources.

I might be hitting some really obscure Windows bug, but for some reason my 256px icon embedded with go-winres is not being displayed at full resolution (ie. when using (Extra) Large icons in Explorer).

You can see the comparisons with go-winres here in Explorer using Extra Large icons:
Capture

My winres/ folder here: https://github.com/optix2000/totsugeki/tree/v0.2.0/winres
Running Windows 10.0.19043.1110

I've even tried adding all the "required" sizes (16px, 32px, 48px, 256px) to no avail. https://github.com/optix2000/totsugeki/tree/16xicon/winres

Is there some limitation or option that needs to be set for the 256px icon to be used at full resolution?

Copy a resource file from one exe or DLL to another exe or DLL

Will this feature be supported in the future?
I tried using go winres extract, but some files encountered errors:
[RT_VERSION] [# 1] [0804] Unhandled code page

Some files will succeed, but the following error will occur when patching to a new PE file:
Not enough room to add. rsrc section header

Does this work with cross compilation?

Hello,

I am cross-building a windows binary from linux. I used go-winres to generate rsrc files, but I didn't find a way to get it included in the executable.

I tried to put the files both in the project root as well as in the same directory than the main, but it didn't work.

Am I missing something?

The documentation mentions that go build automatically embeds in the executable, but I didn't find any reference or documentation about this behavior or how it's supposed to work. Could you please give some additional references?

This is how I compile the binary for windows:
GOOS=windows GOARCH=amd64 CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc go build -o ./bin/main.exe ./cmd/main.go

And my json file (it's a bit messy because I tried many things, but still nothing works):

{
  "RT_GROUP_ICON": {
    "APP": {
      "0000": "../assets/icon.png"
    },
    "IDI_ICON1": {
      "0409": "../assets/icon.png"
    }
  },
  "RT_MANIFEST": {
    "#1": {
      "0409": {
        "description": "Project name"
      }
    }
  },
  "RT_VERSION": {
    "#1": {
      "0000": {
        "info": {
          "0409": {
            "ProductName": "Project name"
          }
        }
      }
    }
  }
}

How to add an icon for task bar?

Hi, I use go-winres in own Go Qt UI project. I added an icon for the app, and the icon display anywhere but task bar. How to fix that?
If create lnk file for binary file, the icon will be display. But if run binary directly the icon will not be display.
My res config for icon:

"RT_GROUP_ICON": {
    "APP": {
      "0000": [
        "icon.png",
        "icon.png",
        "icon.png",
        "icon.png"
      ]
    },
    "#42": {
      "0409": "icon.ico",
      "040C": "icon.ico"
    },
    "MAINICON": {
      "0409": "icon.ico"
    },
    "OTHER": {
      "0000": "icon.ico"
    }
  }

Result:

Безымянный111

Implement git tag filter

I have a git repository which contains 2 applications and git tag produces this:

helm-chart/0.1.0
helm-chart/0.1.1
syntax/v0.1.0
v1.0.0

and git describe --tags outputs this: helm-chart/0.1.1-28-gdeef00fd5 which is not indented.

However, if go-winres would implement a git-tag filter, like git describe --tags --match 'v*', the correct tag would be returned: v1.0.0-40-gdeef00fd5

git-tag not working with simply

Hi,
I've just installed your tool with "go get github.com/tc-hib/go-winres@latest".
I'm trying to generate resources with "simply" command this way:

go-winres simply --product-version=git-tag --file-version=git-tag --file-description="MKey process" --icon=winres/#1_0409.ico

But when I compile de .exe file, It takes correctly the file description and ico but it shows "git-tag" texts as Product Version and "0.0.0.0" as File-Version.

If I generate the res file with go-winres make --product-version=git-tag --file-version=git-tag it works fine. What could I be doing wrong with the Simply command?

feature request: `--in-dir` and `--out-dir`

allow to pass a root directory where the application starts looking for all of its files.

default value would be . (current directory)

go run github.com/tc-hib/go-winres@latest make --product-version=git-tag --in-dir "./cmd/my-application"
would then start tro look for winres/winres.json in ./cmd/my-application (= ./cmd/my-application/winres/winres.json )

--out-dir would allow to put the resulting files in the specified directory and not in the current working directory.
By default it might be set to . as well.

go run github.com/tc-hib/go-winres@latest make --product-version=git-tag --in-dir "./cmd/my-application" --out-dir "./cmd/my-application" would put the resulting files into --out-dir

Helper for winres

cd /d %~dp0
attrib VERSION|find "A            "&&call :newVer
attrib winres\*|find "A            "&&call :newWinres
goto :EOF

:newVer
attrib -a VERSION
set /p VERSION=<VERSION
git tag v%VERSION%-lw
git push origin --tags

:newWinres
attrib -a winres\*
go-winres make --product-version=git-tag --file-version=git-tag

How to load embedded Icon via LoadIcon / LoadImage?

I have tried:

hModule, err := GetModuleHandle(nil)
hIcon, hModule = _LoadImage(mh, syscall.UTF16PtrFromString("APP"), 0, 0, 0)
hIcon, hModule = _LoadImage(mh, MakeIntResource(42), 0, 0, 0)

But both fail with The specified resource type cannot be found in the image file.

The winres.json file contains:

  "RT_GROUP_ICON": {
    "APP": {
      "0000": "icon_256.png",
      ]
    },
    "#42": {
      "0000": "icon_256.png"
    }
  },

not enough room to add .rsrc section header

Hello,

I'm trying to compile a program for Windows/amd64 using this module and it works fine to add an icon and manifest with the go-winres patch command on a small test version of my app.
I get not enough room to add .rsrc section header when doing the same compilation on the definitive version of the same app that is much larger. I dont understand why the header size would be different and i can't find a relatable solution on internet.
I tried adding the --delete option but it didn't change anything.

Any idea of the reason I could have this strange behaviour?

Thx

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.