Import DIALOG, TEXTFILE and others resource type...

Feb 15, 2010 at 4:23 PM

HI, first I have to say that I'm new to this . How can I import DIALOG, TEXTFILE, AVI .... by using Anolis Packager ? Looklike only BITMAP, ICONGROUP could be imported. 

Coordinator
Feb 15, 2010 at 5:07 PM

In your package's XML file just specify the type:

For example, this is from xpize:

         <patch path="%windir%\system32\sysdm.cpl">
                <res type="bitmap" name="1"   src="Base\Windows\system32\sysdm.cpl\1.bmp" />
                <res type="icon"   name="1"   src="Base\Windows\system32\sysdm.cpl\1.ico" />
                <res type="icon"   name="3"   src="Base\Windows\system32\sysdm.cpl\3.ico" />
                
                <res type="dialog" name="112" lang="1033" src="Base\Windows\system32\sysdm.cpl\112-1033.dialog" />
                <res type="dialog" name="112" lang="1046" src="Base\Windows\system32\sysdm.cpl\112-2070.dialog" />
                <res type="dialog" name="112" lang="2070" src="Base\Windows\system32\sysdm.cpl\112-2070.dialog" />
            </patch>

Here is how the type="" attribute is interpreted:

If it's an integer number, it's assumed to be the numeric representation of a Win32 ResourceType (e.g. Accelerator is 9, Version is 16, and so on). These numbers can start with 0x to unambiguously represent a number in hexadecimal base.

If it's an exact match to the Win32 resource type names then that's used.

If it matches a ResHacker-style name (one of: "ICON", "ICONDIR", "ICONGROUP", "CURSOR", "CURSORDIR", "CURSORGROUP", "BMP") then these map to IconDirectory, CursorDirectory, and Bitmap respectively.

Finally, if it doesn't match anything it's assumed to be a string resource type identifier.

If you start the identifier with the " character (you'll have to encode it using &quot; then it will always interpret it as a string identifier even if it matches a Win32 resource type name.

HTH.

Feb 16, 2010 at 2:49 PM

thanks. I didn't know it matches ResHacker-style name.

Feb 16, 2010 at 3:11 PM

so if I want to import a STRING TABLE, I have to type:

<res type="string" name="1" lang="1033" src="Base\Windows\system32\sysdm.cpl\1-1033.rc" />
Coordinator
Feb 16, 2010 at 4:15 PM

No, that won't work. Reshacker-style names are only supported for the types I explicitly listed above.

 

Also, Anolis doesn't support transplanting resources from one ResourceSource to another (i.e. you cannot extract from an RC and place into an EXE in a single go).

You must extract the raw bytes of the string table resource first and put them into a separate file.

 

<res type="StringTable" name="1" lang="1033" src="Base\Windows\system32\sysdm.cpl\1-1033.strings" />