0

I made a PyQt5 QWebengine app i wanna make portable. I found out that flash weren't working in the app. After a lot of reading i found out that having pepflashplayer64_*.dll & manifest.json in folder

C:\Windows\System32\Macromed\Flash\ is working.

However i wanna ship the pepflashplayer with app, and adding custom flash folder to PATH env var, do not have effect , or sys.path.insert()

the command

myapp.py --ppapi-flash-path=C:\Flash\pepflashplayer64_27_0_0_187.dll

works , but how to pass extra augments internally when script is launched ?

i tried dirty hack to run sys.arg[0] script with extra command but no success.

if __name__ == "__main__":
    # print sys.argv
    flash = (' --ppapi-flash-path=C:\Flash\pepflashplayer64_27_0_0_187.dll').split()
    # print flash
    noooo =  (sys.argv[0] + flash[0]).split()  
    import sys
    app = QtWidgets.QApplication(noooo)
    # ... the rest of your handling: `sys.exit(app.exec_())`, etc.
Storm Shadow
  • 442
  • 5
  • 12
  • What kind of argument does `QtWidgets.QApplication` take? Can you summarize its documentation? – hpaulj Dec 08 '17 at 00:41
  • among others "Enters the main event loop and waits until exit() is called, then returns the value that was set to exit() (which is 0 if exit() is called via quit()). It is necessary to call this function to start event handling. The main event loop receives events from the window system and dispatches these to the application widgets." – Storm Shadow Dec 08 '17 at 12:56
  • I basiclly wanna set an internal sys.argv[1], with out the need to type the last argument via command line. – Storm Shadow Dec 08 '17 at 17:01

1 Answers1

0

okay i got it to work so i can make app the app with browser portable , and solution was simpler than i thought. Parsing second internal argument like this.

if __name__ == "__main__":
    programname = os.path.dirname(sys.argv[0]) #get current script full folder path
    pepperpflash = ' --ppapi-flash-path=' + programname + '/Flash/pepflashplayer64_27_0_0_187.dll' 
    try:
        app = QtWidgets.QApplication(sys.argv + [pepperpflash])
    except:
        app = QtWidgets.QApplication(sys.argv)
    # ... the rest of your handling: `sys.exit(app.exec_())`, etc.
Storm Shadow
  • 442
  • 5
  • 12