File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed
Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change 2020#
2121
2222from inspect import trace
23- from os import path
23+ import os
2424import sys
2525import time
2626import traceback
@@ -249,7 +249,7 @@ def joystick_run():
249249 arch = 'x64'
250250 else :
251251 arch = 'x86'
252- dll_path = path .join (installpath , arch , 'vJoyInterface.dll' )
252+ dll_path = os . path .join (installpath , arch , 'vJoyInterface.dll' )
253253 vjoy = ctypes .WinDLL (dll_path )
254254 verbose ("VJoy version" , vjoy .GetvJoyVersion ())
255255
@@ -411,16 +411,22 @@ def main():
411411
412412 pygame .midi .init ()
413413
414+ if getattr (sys , 'frozen' , False ):
415+ application_path = os .path .dirname (sys .executable )
416+ elif __file__ :
417+ application_path = os .path .dirname (__file__ )
418+ verbose ("Application path:" , application_path )
419+
414420 if options .help :
415421 help_page ()
416422 elif options .config_help :
417423 help_config ()
418424 elif options .test :
419425 midi_test ()
420- elif options .conf and path .exists (options .conf ):
426+ elif options .conf and os . path .exists (options .conf ):
421427 joystick_run ()
422- elif path .exists (path .join (sys . path [ 0 ] , "mapping.conf" )):
423- options .conf = path .join (sys . path [ 0 ] , "mapping.conf" )
428+ elif os . path .exists (os . path .join (application_path , "mapping.conf" )):
429+ options .conf = os . path .join (application_path , "mapping.conf" )
424430 joystick_run ()
425431 else :
426432 help_page ()
You can’t perform that action at this time.
0 commit comments