
-----------------------------------
fiercedeity
Sun Oct 14, 2018 9:05 pm

Change .exe icon; &quot;Bad object file header in...&quot;, &quot;Unable to read object file...&quot;
-----------------------------------
What is it you are trying to achieve?
To change the icon on my Turing standalone program (.exe).

What is the problem you are having?
All the third party programs I found (two courtesy of these forums) result in the .exe becoming non-functional after I, in any way, adjust the icon. While my program runs just the way I want it before I do any "fiddling," after I save my changes, it won't start and a window pops up saying either "Unable to read object file Describe what you have tried to solve this problem
I used "ResourceHacker" and "IconChanger" (these two resulted in the "Bad object file header in..." message), and "XNResourceEditor" (this one, the "Unable to read object file..."). I tried generating the standalone .exe using both the Turing 4.1 program and a version of OpenTuring I found on here, but both seemed to lead to the same problem from these third parties.


Am I doing something wrong? Is it a problem with these third party applications? Is it the Turing program I am using that's preventing me from doing this/would a different version of Turing work?

Thanks in advance for any help.

-----------------------------------
Srlancelot39
Mon Oct 15, 2018 3:14 pm

RE:Change .exe icon; &quot;Bad object file header in...&quot;, &quot;Unable to read object file...&quot;
-----------------------------------
You should be able to do it through the operating system by right-clicking the .exe, clicking Properties, and selecting an icon via the Change Icon button.

No need to install any 3rd party software.

-----------------------------------
fiercedeity
Mon Oct 15, 2018 4:55 pm

Re: Change .exe icon; &quot;Bad object file header in...&quot;, &quot;Unable to read object file...&quot;
-----------------------------------
Thanks, but unfortunately no. The "Change Icon..." button doesn't exist in "Properties" for .exes like it does for shortcuts, and folders (and maybe other kinds of files). From Googling it seems the only way to change the icon for an .exe is by changing the resource embedded in the file using one of these third party apps. And I've done such a thing successfully on other .exes, just not ones generated using Turing.

If anyone HAS changed the icon on their Turing-generated program or has come across the problem I did and managed to figure it out, please let me know how!

-----------------------------------
Srlancelot39
Mon Oct 15, 2018 6:42 pm

RE:Change .exe icon; &quot;Bad object file header in...&quot;, &quot;Unable to read object file...&quot;
-----------------------------------
Damn.  I might have been thinking of shortcuts then.  I tested on a shortcut before posting that, but thought I had done it to an executable for my own Turing game years ago.  I probably did it to the shortcut though, it seems.

-----------------------------------
fiercedeity
Wed Oct 17, 2018 9:04 am

Re: Change .exe icon; &quot;Bad object file header in...&quot;, &quot;Unable to read object file...&quot;
-----------------------------------
So after fiddling a great deal longer, I'm pretty sure it's Turing that's the problem (in case I needed another reason to switch from Turing after finishing my current project). I'm able to change the icons associated with other .exes using the software I downloaded, just not the .exes created using Turing. I'm thinking there must be something embedded in the files that is preventing me from doing so, or at least something that does not easily agree with my attempts to do so.

BUT...

There is a different icon associated with .exes created using Turing (by Holtsoft) and OpenTuring. Since OpenTuring is open source I was wondering if it was possible to determine if/why this problem existed, and if there was a way to fix it.

Thanks if anyone has any suggestions!

-----------------------------------
fiercedeity
Wed Oct 17, 2018 3:16 pm

Re: Change .exe icon; &quot;Bad object file header in...&quot;, &quot;Unable to read object file...&quot;
-----------------------------------
ALRIGHT! SOOOO...

After many hours I did finally find a way to change the icon on my .exe, but, boy, was it complicated. Below is a walkthrough of what I did, in case anyone else wants to change the icon on their Turing-generated program.


So first of all, I had to generate my program using a version of OpenTuring I found here: in a specific order. The problem I was having was that the sizes and order of images in my .ico file didn't match that of the default .ico file applied to all programs made by OpenTuring.
And making an .ico file that matches the default OpenTuring .ico file was actually harder than you might think. Here's what I had to do:

I made an .ico file using this website here: The only sizes you need are 16x16, 32x32, 48x48, 128x128, and 256x256. Delete all the sizes that are not one of these five. You will also have to change the 256x256 image from PNG to BMP (32 bits) via the "Change format" option accessed by right-clicking said image on the left.
Now you can download the .ico file.

Next you have to download an app that will let you change the order in which the images (that you just created) are stored within the .ico file. I tried many, but I actually couldn't find ANY that let me do exactly this; some apps want to change the 256x256 image into a .png stored in the .ico file (which will not work with the next step), while other apps just won't let a 256x256 image be part of the .ico file altogether.
I did, however, find an app that suffices for this specific need. While I don't know that it has a feature that lets you put the images stored in the .ico file in whatever order you want, it DOES conveniently re-organize them into the order we NEED. Unfortunately this is a 30-day-trial app, so if you plan on changing the icons for Turing-generated programs in the future, then... I guess at that stage you'll have to buy it (though I recommend joining me and just using a different language/IDE in the future). It's Axialis IconWorkshop and can be found here: https://www.axialis.com/iconworkshop/.

Once you've downloaded and opened the app, open the .ico file and you'll see the images stored within have been put into a biggest-to-smallest order (this is what we need!). You'll have to right-click the 256x256 image on the left and de-select the "PNG Compressed Image Format (Windows Vista)" option. Then you can save your .ico file.


Next you'll have to download ResourceHacker, from here: however, I could not find a way to edit the specific tags that are seen when your program's properties are checked (such as "FileDescription," "LegalCopyright," and "Comments"; the words that come after each instance of "VALUE"). But you can change the values after these tags to whatever you want, so that they're more relevant to your program.


And that's that!

I've spent many months searching this forum and others for ways of changing Turing-generated programs' icons, and spent the last few days getting really into the nitty gritty of it (I'm just about done the project I've been working on after all). Since I REALLY couldn't find an answer from Googling, I thought I should provide a walkthrough of what I did, in case anyone in the future wants to do the same.

If there's a simpler way to do ALL OF THIS though, I'd love to hear it! Otherwise, yeah, here it is ^

-----------------------------------
Srlancelot39
Thu Oct 25, 2018 7:37 am

RE:Change .exe icon; &quot;Bad object file header in...&quot;, &quot;Unable to read object file...&quot;
-----------------------------------
Nice. lol

As for the Holtsoft logo, I believe it is a sun on a horizon.

In the past, I think I've made icon files simply by changing the file ending to .ico, though I'm not sure if that still works.  Also, I believe most image editors let you save as .ico.
