wxpython application vista

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

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.

Also how can i configure the wxapp crash log to write into userdata directory.

Has anyone else have any other issues with wxpython app install on vista.

cheers

Thomas

Thomas Thomas wrote:

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

Yep, I've been anticipating this, too.

I had tmp & log directories under that which vista wont let create anymore.

My app used to create temp files there, and py2exe by default outputs error logs there.

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.

I didn't know about GetUserDataDir()... I've been using:

import os
userDataDir = os.environ.get("APPDATA")

(and then join that with your application's name).

Also how can i configure the wxapp crash log to write into userdata directory.
Has anyone else have any other issues with wxpython app install on vista.

I've not tried Vista yet, and AFAIK none of my clients are using it yet, either (they listen to my advice and I recommend heartily against going to Vista yet).

···

--
pkm ~ http://paulmcnett.com

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