B4J Question What's wrong with my icons - Can not code sign exe after changing icon with Resource hacker

Chris2

Active Member
Licensed User
Longtime User
This is not directly a B4J problem but it's related so I'm postng here. My apologies if it should be in Chit Chat.

I've been using Resource Hacker as detailed here for ages to alter the appearance of B4J apps as they appear in Task Manager etc.
One small issue I've always had is that after using Resource Hacker to change the icon in the packaged B4J app (the exe in ...\Objects\temp\build\bin\) to an icon of my own making I can not code sign that exe.
Using kSign generates an 'error: 0x800700C1 %1 is not a valid win32 application':
CodeSignFail.png


I can successfully make other changes to the exe via Resource Hacker and still sign the exe. It's only after changing the icon to one I've made that this issue occurs.

I can also always successfully sign the 'launcher' exe created by B4J Packager (the one in ...\Objects\temp\build\, altough of course that one will already have the correct icon as it's set using #PackagerProperty: ExeName = IconTest).

There's nothing wrong with the packaged, Resource Hacked app. It works fine, I just can't sign the ...\build\bin\ executable after adding one of my own icons.

Furthermore, if I use the attached icon that I found on my machine (clouds.ico - actually the OneDrive icon I think), then the problem does not occur and I can sign the exe successfully. It's only when I use an icon that I've made.
I've tried using Inkscape (with the Icon Export extension), Gimp, and FreeConvert (https://www.freeconvert.com/png-to-ico) to create icons but always have the same issue.

I've attached an example app (just the default B4XPages app), and a zip file containing the test ico files I've made, the png file they're based on, and the clouds.ico with which code signing works.

Can anyone see what's wrong with my icon files, and why they seemingly prevent code signing?
Has any one else come across this or a smilar problem?
What tools do other people use to create ico files?

Many thanks.
 

Attachments

  • IconTest.zip
    17.8 KB · Views: 80
  • Icons.zip
    44.8 KB · Views: 88

Sagenut

Expert
Licensed User
Longtime User
Probably I did not understood the problem.
I was able to make the Package with icon
Immagine.jpg

using
B4X:
#PackagerProperty: IconFile = ..\AppIcon-Gimp.ico
I copied the ico file in the root folder of the project and I even added it to the Files Tab using Add Files from inside the IDE.
 
Upvote 0

aeric

Expert
Licensed User
Longtime User
Resource Hacker is used to change the Java icon and app name in Task Manager.

 
Upvote 0

Chris2

Active Member
Licensed User
Longtime User
lunapic.com is my favourite online tool to create PNG and ICO file.
I've not come across lunapic before. Thanks for the suggestion. I'm getting mixed results at the moment with ico files generated from there, but will investigate further...
 
Upvote 0

Chris2

Active Member
Licensed User
Longtime User
Probably I did not understood the problem.
I was able to make the Package with icon
View attachment 149954
using
B4X:
#PackagerProperty: IconFile = ..\AppIcon-Gimp.ico
I copied the ico file in the root folder of the project and I even added it to the Files Tab using Add Files from inside the IDE.
It's the IconTest.exe in the ...\bin\ folder that is adjusted using Resource Hacker.
 
Upvote 0
Top