Hi Thomas,
Thomas Thomas wrote:
Hi All,
I am having issues with clients installing wxpython application on vista.
The major issue is with not having write permission on the install directory which was defaulted to C:/Program Files/AppName
Yeap, you need to move everything which needs write access (database, log files etc) to another folder.
I had tmp & log directories under that which vista wont let create anymore.
is it logical to create them under GetUserDataDir now .. I am using wxpython '2.6.1.0' and i see that function is not there.
You will also need to upgrade to wxPython 2.8.x, at least I had some problems with 2.6.x (had something to do with listctrl throwing errors).
GetUserDataDir returns on Vista the following when I run it from within Boa:
>>> os.path.split(sp.GetUserDataDir())
('C:\\Users\\myuserid\\AppData\\Roaming', 'pythonw')
AppData is by default a hidden folder on Vista.
That is way I used:
>>> os.path.split(sp.GetDocumentsDir())
('C:\\Users\\myuserid', 'Documents')
But I don't put it into Documents as that is not recommended, but create an myappfolder under "users\\myuserid".
At the beginning of my OnInit method I do:
self.RedirectLogFiles()
sys.excepthook = self.MyExceptionHandler
def RedirectLogFiles(self):
sp = wx.StandardPaths.Get()
userdir, userdoc = os.path.split(sp.GetDocumentsDir())
logFolder = os.path.join(userdir, 'TheWineCellarBook')
if not os.path.exists(logFolder):
os.mkdir(logFolder)
sqllogFile = os.path.join(logFolder, 'sqllog.txt')
stdoutFile = os.path.join(logFolder, 'stdoutlog.txt')
stderrFile = os.path.join(logFolder, 'stderrlog.txt')
self.sqllog = file(sqllogFile, 'a+')
self.stdoutlog = file(stdoutFile, 'a+')
self.stderrlog = file(stderrFile, 'a+')
sys.stdout = self.stdoutlog
sys.stderr = self.stderrlog
Also how can i configure the wxapp crash log to write into userdata directory.
As stdout and stderr are redirected the above should do it.
Has anyone else have any other issues with wxpython app install on vista.
Check the thread "[wxPython-users] [Absolutely-OT] Vista Users" about 10 days ago.
Werner
···
cheers
Thomas