wxpython app look fine in XP, but look odd in Vista

Hi,

I know there were quite some silimar posts for this, and I read them. but I
still can not fix my problem.

I have a APP that using python 2.6 + wxpython 2.8.10.1. which run fine on
windows XP both as script file and exe file. and it is still fine when I run
it as script on vista(32bit), but when I ran same exe file, it works, but
the looks is quite diffrent, looks more like old windows and some bitmaps I
am using are surrounded by black shadow.
This is my app running as exe:
http://www.nabble.com/file/p23629717/vista.jpg
This is my app running as script
http://www.nabble.com/file/p23629717/script.jpg

and following is my setup.py

···

-----------------------
from distutils.core import setup
import glob
import py2exe
import os,sys

sys.argv.append('py2exe')

setup(windows=[{'script':'litebook.py',"icon_resources": [(1,
"litebook.ico")]}],
data_files=[('icon',
glob.glob('icon/*.*')),"LiteBook_Readme.txt","litebook.exe.manifest","litebook.ico","unrar.dll"],
options = {'py2exe': {'bundle_files': 1,'compressed':2,'optimize':2}},
zipfile = None,

)

--
View this message in context: http://www.nabble.com/wxpython-app-look-fine-in-XP%2C-but-look-odd-in-Vista-tp23629717p23629717.html
Sent from the wxPython-users mailing list archive at Nabble.com.

Hu Jun wrote:

Hi,

I know there were quite some silimar posts for this, and I read them. but I
still can not fix my problem.

I have a APP that using python 2.6 + wxpython 2.8.10.1. which run fine on
windows XP both as script file and exe file. and it is still fine when I run
it as script on vista(32bit), but when I ran same exe file, it works, but
the looks is quite diffrent, looks more like old windows and some bitmaps I
am using are surrounded by black shadow.

options = {'py2exe': {'bundle_files': 1,'compressed':2,'optimize':2}},

Try setting bundle_files to 3.

···

--
Robin Dunn
Software Craftsman

Yes, it works, Thanks a lot!
However,is this the only way? because I really don’t want so many dlls and pyds

···

On Wed, May 20, 2009 at 8:07 PM, Robin Dunn robin@alldunn.com wrote:

Hu Jun wrote:

Hi,

I know there were quite some silimar posts for this, and I read them. but I

still can not fix my problem.

I have a APP that using python 2.6 + wxpython 2.8.10.1. which run fine on

windows XP both as script file and exe file. and it is still fine when I run

it as script on vista(32bit), but when I ran same exe file, it works, but

the looks is quite diffrent, looks more like old windows and some bitmaps I

am using are surrounded by black shadow.

options = {‘py2exe’: {‘bundle_files’: 1,‘compressed’:2,‘optimize’:2}},

Try setting bundle_files to 3.

Robin Dunn

Software Craftsman

http://wxPython.org


wxpython-users mailing list

wxpython-users@lists.wxwidgets.org

http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

Hi,

Yes, it works, Thanks a lot!
However,is this the only way? because I really don't want so many dlls and
pyds

It's probably the only way currently to do it, until wxPython, py2exe
and Python 2.6 will learn to play nice together. In any case, I have
never understood this issue of "too many files, dlls and pyds". You
can package your application using Inno Setup or NSIS and obtain a
single installer executable. Using bundle_files=3 has two or three
obvious advantages:

1) It works;
2) It causes less troubles when you install your app on other
computers (in my experience);
3) Inno Setup can compress the installer far more than when you use
bundle_files=1 or 2, so you end up with a smaller single-file
installer.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

···

On Thu, May 21, 2009 at 4:55 AM, Jun Hu wrote:

Hu Jun,

Robin Dunn wrote:

Hu Jun wrote:

Hi,

I know there were quite some silimar posts for this, and I read them. but I
still can not fix my problem.

I have a APP that using python 2.6 + wxpython 2.8.10.1. which run fine on
windows XP both as script file and exe file. and it is still fine when I run
it as script on vista(32bit), but when I ran same exe file, it works, but
the looks is quite diffrent, looks more like old windows and some bitmaps I
am using are surrounded by black shadow.

options = {'py2exe': {'bundle_files': 1,'compressed':2,'optimize':2}},

Can you share your full setup.py, I could not get this to work, especially interested where you put the MS dll's.

Could you try the scripts I put onto the wiki?
http://wiki.wxpython.org/py2exe
http://wiki.wxpython.org/InnoSetup

Werner

Jun Hu,

Jun Hu wrote:

Yes, it works, Thanks a lot!
However,is this the only way? because I really don't want so many dlls and pyds

Check out the "lib/library.zip" option, see the setup.py on the wiki

Werner

Andrea Gavana wrote:

Hi,

Yes, it works, Thanks a lot!
However,is this the only way? because I really don't want so many dlls and
pyds
    
It's probably the only way currently to do it, until wxPython, py2exe
and Python 2.6 will learn to play nice together. In any case, I have
never understood this issue of "too many files, dlls and pyds". You
can package your application using Inno Setup or NSIS and obtain a
single installer executable. Using bundle_files=3 has two or three
obvious advantages:

1) It works;
2) It causes less troubles when you install your app on other
computers (in my experience);
3) Inno Setup can compress the installer far more than when you use
bundle_files=1 or 2, so you end up with a smaller single-file
installer.
  

Totally agree, what about changing the Gui2Exe tooltip on this.

- change the order of listing the options, i.e. 3 first
- would even go as far as recommending against 1 and 2
- and maybe hint at the lib/zip option which reduces the number of files in the install folder and puts just about all the wxPython and other libs such as SQLA etc into the lib folder.

Werner

···

On Thu, May 21, 2009 at 4:55 AM, Jun Hu wrote:

Thanks Andrea, I will try the Inno and NSIS.

···

On Thu, May 21, 2009 at 12:56 AM, Andrea Gavana andrea.gavana@gmail.com wrote:

Hi,

On Thu, May 21, 2009 at 4:55 AM, Jun Hu wrote:

Yes, it works, Thanks a lot!

However,is this the only way? because I really don’t want so many dlls and

pyds

It’s probably the only way currently to do it, until wxPython, py2exe

and Python 2.6 will learn to play nice together. In any case, I have

never understood this issue of “too many files, dlls and pyds”. You

can package your application using Inno Setup or NSIS and obtain a

single installer executable. Using bundle_files=3 has two or three

obvious advantages:

  1. It works;

  2. It causes less troubles when you install your app on other

computers (in my experience);

  1. Inno Setup can compress the installer far more than when you use

bundle_files=1 or 2, so you end up with a smaller single-file

installer.

Andrea.

“Imagination Is The Only Weapon In The War Against Reality.”

http://xoomer.alice.it/infinity77/

http://thedoomedcity.blogspot.com/


wxpython-users mailing list

wxpython-users@lists.wxwidgets.org

http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

Werner F. Bruhin wrote:

- and maybe hint at the lib/zip option which reduces the number of files in the install folder and puts just about all the wxPython and other libs such as SQLA etc into the lib folder.

absolutely! and you can use /lib without the zip, if you stuff is not zip compatible...

-chris

···

--
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov

Below is my setup.py, it is quite simple:

···

from distutils.core import setup
import glob
import py2exe
import os,sys

sys.argv.append(‘py2exe’)

setup(windows=[{‘script’:‘litebook.py’,“icon_resources”: [(1, “litebook.ico”)]}],
data_files=[(‘icon’, glob.glob(‘icon/.’)),“LiteBook_Readme.txt”,“litebook.exe.manifest”,“litebook.ico”,“unrar.dll”],
options = {‘py2exe’: {‘bundle_files’: 3,‘compressed’:2,‘optimize’:2}},
zipfile = None,
)

and I will assume users already installed vc++ 2008 redistribute. or maybe I will pack that into my installer after I figure out how to use Inno/NSIS

On Thu, May 21, 2009 at 2:11 AM, Werner F. Bruhin werner.bruhin@free.fr wrote:

Hu Jun,

Robin Dunn wrote:

Hu Jun wrote:

Hi,

I know there were quite some silimar posts for this, and I read them. but I

still can not fix my problem.

I have a APP that using python 2.6 + wxpython 2.8.10.1. which run fine on

windows XP both as script file and exe file. and it is still fine when I run

it as script on vista(32bit), but when I ran same exe file, it works, but

the looks is quite diffrent, looks more like old windows and some bitmaps I

am using are surrounded by black shadow.

options = {‘py2exe’: {‘bundle_files’: 1,‘compressed’:2,‘optimize’:2}},

Can you share your full setup.py, I could not get this to work, especially interested where you put the MS dll’s.

Could you try the scripts I put onto the wiki?

http://wiki.wxpython.org/py2exe

http://wiki.wxpython.org/InnoSetup

Werner


wxpython-users mailing list

wxpython-users@lists.wxwidgets.org

http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

I tried the “hello world” script by using following setup.py, work fine both on XP and Vista

···

from distutils.core import setup
import py2exe
import sys

sys.argv.append(‘py2exe’)

setup(windows=[{‘script’:‘1.py’}],
options = {‘py2exe’: {‘bundle_files’: 3,‘compressed’:2,‘optimize’:2}},
zipfile = “lib\library.zip”,

)

Could you try the scripts I put onto the wiki?

http://wiki.wxpython.org/py2exe

http://wiki.wxpython.org/InnoSetup

Werner


wxpython-users mailing list

wxpython-users@lists.wxwidgets.org

http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

Hi Jun Hu,

Jun Hu wrote:

Below is my setup.py, it is quite simple:
-----------------------------------------------------
from distutils.core import setup
import glob
import py2exe
import os,sys

sys.argv.append('py2exe')

setup(windows=[{'script':'litebook.py',"icon_resources": [(1, "litebook.ico")]}],
data_files=[('icon', glob.glob('icon/*.*')),"LiteBook_Readme.txt","litebook.exe.manifest","litebook.ico","unrar.dll"],
options = {'py2exe': {'bundle_files': 3,'compressed':2,'optimize':2}},
zipfile = None,
)
-------------------------------------------------------
and I will assume users already installed vc++ 2008 redistribute. or maybe I will pack that into my installer after I figure out how to use Inno/NSIS

I guess this is the difference, I try it with a vc++ runtime installed locally.

Werner

I studied inno last night a little bit, and I found there is way to check if user has already installed vc runntime, if not the installer will install it, if yes, the installer will just skip it. below is the inno script, basically, it will check system registry to see if there is vc++ runtime installed. I think same method can be used in setup.py

this script is from: [http://wanwan722.blogspot.com/2008/11/inno-setup-visual-c-runtime-library.html](http://wanwan722.blogspot.com/2008/11/inno-setup-visual-c-runtime-library.html)

<details class='elided'>
<summary title='Show trimmed content'>&#183;&#183;&#183;</summary>

-----------------------------------------

[Setup]
Your program setup

[Files]
; Visual C++ redist
Source: vcredist_x86.exe"; DestDir: "{tmp}"; Check: NeedInstallVC9SP1

[Run]
Filename: "{tmp}\vcredist_x86.exe"; Parameters: /q; WorkingDir: {tmp}; Flags: skipifdoesntexist; StatusMsg: "Installing Microsoft Visual C++ Runtime ..."; Check: NeedInstallVC9SP1

[Code]
var vc9SP1Missing: Boolean;

function NeedInstallVC9SP1(): Boolean;
begin
  Result := vc9SP1Missing;
end;

function InitializeSetup(): Boolean;
var version: Cardinal;
begin
  if RegQueryDWordValue(HKLM, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{9A25302D-30C0-39D9-BD6F-21E6EC160475}', 'Version', version) = false then begin

    vc9SP1Missing := true;
  end;
  result := true;
end;

On Fri, May 22, 2009 at 12:26 AM, Werner F. Bruhin werner.bruhin@free.fr wrote:

Hi Jun Hu,

Jun Hu wrote:

Below is my setup.py, it is quite simple:


from distutils.core import setup

import glob

import py2exe

import os,sys

sys.argv.append(‘py2exe’)

setup(windows=[{‘script’:‘litebook.py’,“icon_resources”: [(1, “litebook.ico”)]}],

data_files=[(‘icon’, glob.glob(‘icon/.’)),“LiteBook_Readme.txt”,“litebook.exe.manifest”,“litebook.ico”,“unrar.dll”],

options = {‘py2exe’: {‘bundle_files’: 3,‘compressed’:2,‘optimize’:2}},

zipfile = None,

)


and I will assume users already installed vc++ 2008 redistribute. or maybe I will pack that into my installer after I figure out how to use Inno/NSIS

I guess this is the difference, I try it with a vc++ runtime installed locally.

Werner


wxpython-users mailing list

wxpython-users@lists.wxwidgets.org

http://lists.wxwidgets.org/mailman/listinfo/wxpython-users