WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Compiler
plus
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Icons and the Compiler (old versions)

Keywords:	      ICONS in NT Compiler replace icon 

For Icons and the 2001P and 2002 and subsequent versions of the Compiler, see:
Icons and Compiler 2001P and 2002

For 2001N and older versions of the compiler...

When using the 32-bit Compiler to add an Icon to an EXE, there are a few rules to follow.
  1. The Compiler cannot replace the original icon with an icon which has a larger file size.

  2. The icon must be the standard 32 by 32 icon type. We can't use the niftier high resolution ones.

  3. The Compiler cannot place a 32-bit Icon on a 16-bit application.

  4. Icon files cannot be any larger than 766 bytes, and must be named with the standard .ICO file extension.

  5. Make sure no anti-virus programs are running. They get upset as WinBatch modifes EXE files...

    What the compiler does is create an exe, then patches your icon into the exe. If your virus software sees this it can go ballistic...some program is modifying an exe file (the virus software is trained not to let such a thing happen). If this is the case, you must either remove the virus software, or tell it that the Compiler is a trusted program that is allowed to modify exe files.

  6. Compile to a target local drive rather than to a network drive. You can sometimes get the 'Error installing specified custom icon while trying to compile WIL file' error message when a security setting on the server prevents changes being made to EXEs. For example, Read/Write/Create permissions but not change or modify permissions set on the server would prevent the Compiler from being able to change the icon in the EXE. Compiling to the local drive will bypass this problem, and then you can copy the EXE back up to the server.

Question:

Every time I compile a WinBatch script with an icon file that I have, I get the following error message:

        Specified is the wrong size: it should be 766 bytes.
I have used this icon file with the 16-bit compiler. What is the difference?

Answer:

Different compiler. Different EXE format. How big is your ico file? It needs to be exactly 766 bytes.

Question (continued):

My ICO file is 326 bytes. I am concerned now that I have to convert all the icons. I realize that it is a new compiler, but why technically handle it differently. Is this a development limitation, or is this a Wilson WindowWare limitation?

I would appreciate your input. I cannot understand why it would work with one Compiler and not the other.

If there is no way around this, how do I convert my icon file to work with the 32-bit compiler?

Answer:

It seems to be a a development limitation in the way we preform a horrific patch to the 32 bit exe to slime the new icon in. Instead of the easy format of 16 bit EXE files where we can do something useful, in the 32 bit world we do not try to decode the resource format of the 32 bit exe file and merely patch the icon in using IntControl 37.

We need a standard simple 32x32 icon in a 766 byte file.

Multiple Icons in Compiled WB Exes

If you make a shortcut to a compiled Winbatch EXE, and then right click on that shortcut and go to properties, you'll see that a standard Winbatch EXE has optional 5 icons.

To replace the icons, use Intcontrol(37... or IconReplace.

The maximum number of icons any Winbatch EXE can have is 5.


Editing Icons with Axialis AX-Icons

We've discovered a handy utility to create 32x32 bit (766 byte) icons for Winbatch compiler.

You can download Axialis AX-Icons from:

http://www.axialis.com/axicons/
AX-Icons is a shareware program, and if you like it, you can purchase it for $14.

To create 766 byte icons, edit your icon in AX-Icons, then go into "Draw|New Image Format" and make sure you select: 32x32 pixels and over on the right, 16 colors (4 bits). Then save it.

When you right click on the properties of the icon in Explorer, you can see it's 766 bytes.


Article ID:   W12793
Filename:   Icons and the Compiler (old versions).txt
File Created: 2017:08:29:11:39:08
Last Updated: 2017:08:29:11:39:08