Is there a way to add a custom icon to an .exe file generated from IronPython using pyc.py or programmaticly?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There appears to be several ways to accomplish this, however none are as easy as having a commandline switch like for C# code.
Generate the exe using pyc.py. Modify the generated exe with an
icon editor
Modify pyc.py to add a call to
DefineUnmanagedResource (insert at
line 83, just before ab.save)
Now you have to convert your .ico file into a .res file using RC. From [The SharpDevelop Forums][1]
Create a Resource file (.rc) containing the icons you want to embed as resources, for example:
Compile the .rc file into a .res file using Microsoft’s Resource Compiler Rc.exe, which is part of Microsoft’s Platform SDK. Note that the lowest icon ID number in the .rc file (e.g. 128 above) will automatically become the application’s icon.
[C# question][2] which makes use of BeginUpdateResource(), UpdateResource() and EndUpdateResource() calls in kernel32.dll.