diff --git a/pysollib/init.py b/pysollib/init.py index a4904afc..6a1e9336 100644 --- a/pysollib/init.py +++ b/pysollib/init.py @@ -149,10 +149,10 @@ def init(): if sys.path[0] and not os.path.isdir(sys.path[0]): # i.e. library.zip d = os.path.dirname(sys.path[0]) os.chdir(d) # for read presets - fcs_command = os.path.join('freecell-solver', 'fc-solve.exe') + fcs_command = os.path.join('freecell-solver', 'bin', 'fc-solve.exe') settings.FCS_COMMAND = fcs_command - ##f = os.path.join(d, 'freecell-solver', 'presetrc') - ##os.environ['FREECELL_SOLVER_PRESETRC'] = f # defined in prefix.h + f = os.path.join('freecell-solver', 'presetrc') + os.environ['FREECELL_SOLVER_PRESETRC'] = f if os.name in ('posix', 'nt'): try: kw = {'shell': True, diff --git a/pysollib/mfxutil.py b/pysollib/mfxutil.py index 13d3a006..b9774a6a 100644 --- a/pysollib/mfxutil.py +++ b/pysollib/mfxutil.py @@ -134,9 +134,16 @@ if os.name == "posix": def win32_getusername(): user = os.environ.get('USERNAME','').strip() + try: + user = unicode(user, locale.getpreferredencoding()) + except: + user = '' return user def win32_getprefdir(package): + portprefdir = 'config' # portable varsion + if os.path.isdir(portprefdir): + return portprefdir # %USERPROFILE%, %APPDATA% hd = os.environ.get('APPDATA') if not hd: