Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Icon replacement in Windows causes exe fail to excutation #4

Open
mayaa6 opened this issue Oct 28, 2015 · 15 comments
Open

Icon replacement in Windows causes exe fail to excutation #4

mayaa6 opened this issue Oct 28, 2015 · 15 comments

Comments

@mayaa6
Copy link

mayaa6 commented Oct 28, 2015

I use this to replace a icon of an nwjs Windows application.

winresourcer --operation=Update --exeFile=path/to/your/file.exe --resourceType=Icongroup --resourceName:IDR_MAINFRAME --resourceFile:path/to/your/resource.ico

The result exe failed to excutation with an error:.
image

I aslo found the exe after icon replacement, exe file size reduce 20M.

@felicienfrancois
Copy link
Owner

There is an error in the doc: the key/value separator of command line arguments is = for all arguments.

So the command should be:

winresourcer --operation=Update --exeFile=path/to/your/file.exe --resourceType=Icongroup --resourceName=IDR_MAINFRAME --resourceFile=path/to/your/resource.ico

Also if your path(s) contains spaces your should enclose it with double quotes.

@felicienfrancois
Copy link
Owner

I will update the documentation

@AndrewMast
Copy link

I have the same error, but when I do:

winresourcer({
    operation: "Update", // one of Add, Update, Extract or Delete 
    exeFile: build + "win64/app.exe",
    resourceType: "Icongroup",
    resourceName: "IDR_MAINFRAME",
    lang: 1033,
    resourceFile: "resources/icon.ico"
}, function(error) {
    // callback 
});```

@felicienfrancois
Copy link
Owner

This error is very generic, so I can do nothing for you. You'll have to investigate on your own.
Here a few things you should do:

  • Check that the paths are good (exeFile & resourceFile)
  • Maybe try with absolute paths to be sure there is not a problem of working directory
  • check that the IDR_MAINFRAME resource name exists in the exe file using the GUI (launch Resourcer.exe in the bin directory of this module)
  • Verify that your icon is OK (maybe try with another icon also)

@AndrewMast
Copy link

When I put my app and my ico in the bin folder I run this command, but it still does that error: Resource.exe -op:upd -src:app.exe -type:Icongroup -name:IDR_MAINFRAME -file:app.ico

FYI, the app did work before.

EDIT: I am trying a different icon now.

@AndrewMast
Copy link

I tried with a different ico, and it still shows that error.

@AndrewMast
Copy link

I also tried by opening the Anoles Resourcer and change the icon with that, but it still does that error. (I used a fresh working copy of the app)

My guess it that my version of Windows (Windows 10) doesn't allow it.

@felicienfrancois
Copy link
Owner

does app.exe is NWJS or another binary ?
Cause IDR_MAINFRAME is the name of the icon resource that was used in NWJS (don't know if it's still used).
That's why I told you to check that the IDR_MAINFRAME resource name exists in the exe file using the GUI (launch Resourcer.exe without any parameter)

Then, this project is only a wrapper around winresourcer, which is a bit old now (2008). It's possible it don't work on recent OS.

@felicienfrancois
Copy link
Owner

You may try with another project (rcedit or resourcehacker)

@AndrewMast
Copy link

Yes, I am using NWJS

@AndrewMast
Copy link

I checked and the package does have "IDR_MAINFRAME". Okay, I will try those other projects

@sadikyalcin
Copy link

The icon does update but the app does not run. Same with Resource Hacker - in which case it throws a different error.

@ogimenezb
Copy link

Are you using 32 or 64?

@AndrewMast
Copy link

I was using 64

@ogimenezb
Copy link

I think there is a problem with 64, 32 did work for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants