Hello,
this patch fixes a long-standing problem (I first saw an istance of this bug
in 2001 or so) with icons disappearing from executables compressed with UPX,
on Windows platforms.
The problem is actually a bug in UPX, but let me explain. The bootloader was
being linked with a resource file indicating that the default "blue
butterfly" icon was a resource for language "LANG_ENGLISH_US" (codepage
1033). This is partially incorrect as the icons are normally valid for all
codepages, so they better belong to the LANG_NEUTRAL codepage. Anyway, later
Build.py was coming along and adding the user's icon to the executable, but
this time in LANG_NEUTRAL. So the final executable was having both icons in
it. UPX was then getting confused by icons with same ID but different
language, and was compressing it incorrectly, making them "disappear". They
were not "stripped" though: it was possible to get the icons back by
unpacking the bootloader.
Anyway, this simple patch just isntructs the resource compiler to put the
default icon in the LANG_NEUTRAL codepage. This fixes the problem. Committed
as r278.
--
Giovanni Bajo
Index: source/windows/run.rc
===================================================================
--- source/windows/run.rc (revision 276)
+++ source/windows/run.rc (working copy)
@@ -17,7 +17,7 @@
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
-LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
#pragma code_page(1252)
#endif //_WIN32
@@ -36,18 +36,18 @@
// TEXTINCLUDE
//
-1 TEXTINCLUDE DISCARDABLE
+1 TEXTINCLUDE DISCARDABLE
BEGIN
"resource.h\0"
END
-2 TEXTINCLUDE DISCARDABLE
+2 TEXTINCLUDE DISCARDABLE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
-3 TEXTINCLUDE DISCARDABLE
+3 TEXTINCLUDE DISCARDABLE
BEGIN
"\r\n"
"\0"
Property changes on: source\windows\run.rc
___________________________________________________________________
Name: svn:eol-style
+ CRLF
Index: source/windows/runw.rc
===================================================================
--- source/windows/runw.rc (revision 276)
+++ source/windows/runw.rc (working copy)
@@ -17,7 +17,7 @@
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
-LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
#pragma code_page(1252)
#endif //_WIN32
@@ -36,18 +36,18 @@
// TEXTINCLUDE
//
-1 TEXTINCLUDE DISCARDABLE
+1 TEXTINCLUDE DISCARDABLE
BEGIN
"resource.h\0"
END
-2 TEXTINCLUDE DISCARDABLE
+2 TEXTINCLUDE DISCARDABLE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
-3 TEXTINCLUDE DISCARDABLE
+3 TEXTINCLUDE DISCARDABLE
BEGIN
"\r\n"
"\0"
Property changes on: source\windows\runw.rc
___________________________________________________________________
Name: svn:eol-style
+ CRLF
_______________________________________________
PyInstaller mailing list
[email protected]
http://lists.hpcf.upr.edu/mailman/listinfo/pyinstaller