I have some strange behaviour from python applications using wxPython.
For some reason, 16-bit installers do not display correctly when executed.
One of the two installers I need to execute from Python is java's runtime installer.
============ Example 1: ============
···
#
# SimpleExec.py
#
from __future__ import nested_scopes
import os
JAVA_INSTALL_EXE = "j2re1_3_0-win-i.exe"
if __name__ == '__main__':
os.system(JAVA_INSTALL_EXE)
============ Example 1: ============
This example works without any problems at all.
Example 2 - A simple wxPython app (made with boa):
#!/usr/bin/env python
#Boa:App:BoaApp
#
# wxApp1.py
#
from __future__ import nested_scopes
from wxPython.wx import *
import wxFrame1
modules ={'wxFrame1': [1, 'Main frame of Application', 'wxFrame1.py']}
class BoaApp(wxApp):
def OnInit(self):
self.main = wxFrame1.create(None)
self.main.Show(true)
self.SetTopWindow(self.main)
return true
def main():
application = BoaApp(0)
application.MainLoop()
if __name__ == '__main__':
main()
================================================
================================================
#Boa:Frame:wxFrame1
#
# wxFrame1.py
#
from __future__ import nested_scopes
from wxPython.wx import *
import os
JAVA_INSTALL_EXE = "j2re1_3_0-win-i.exe"
def create(parent):
return wxFrame1(parent)
[wxID_WXFRAME1, wxID_WXFRAME1BUTTON1] = map(lambda _init_ctrls: wxNewId(), range(2))
class wxFrame1(wxFrame):
def _init_utils(self):
pass
def _init_ctrls(self, prnt):
wxFrame.__init__(self, id = wxID_WXFRAME1, name = '', parent = prnt, pos = wxPoint(182, 155), size = wxSize(446, 256), style = wxDEFAULT_FRAME_STYLE, title = 'wxFrame1')
self._init_utils()
self.SetClientSize(wxSize(438, 229))
self.button1 = wxButton(id = wxID_WXFRAME1BUTTON1, label = 'Start installer', name = 'button1', parent = self, pos = wxPoint(0, 0), size = wxSize(438, 229), style = 0)
EVT_BUTTON(self.button1, wxID_WXFRAME1BUTTON1, self.OnButton1Button)
def __init__(self, parent):
self._init_ctrls(parent)
def OnButton1Button(self, event):
os.system(JAVA_INSTALL_EXE)
This example invokes the java runtime installer when the button is pressed.
However, only the unpacking stage is displayed. The installer itself (from license agreement screen and further on) is never displayed.
The wxPython app appears hung, since it is waiting for os.system to return, and in task manager there is a process called "j2re1_3_0-win-i.exe" running with no processor utilization.
If i manually kill that process, the installation screen suddenly appears.
I have tried several mechanisms for launching the installer (posix calls, win32process et al) but regardsless of mechanim used (they probably all use win32process in the end..) there is no difference.
The examples has been tested using:
Windows NT 4 SP5, SP6, Windows 2000 Pro SP2
Python 2.1.2
win32all-140
wxPython-2.3.2.1-Py21-hybrid
boa-0.1.0-alpha
regards,
David