User Tools

Site Tools


python:systray

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
python:systray [2023/01/30 12:58] Wulf Rajekpython:systray [2023/05/29 11:55] (current) – external edit 127.0.0.1
Line 41: Line 41:
         pass         pass
  
 +    icon.visible = False
     python = sys.executable     python = sys.executable
     os.execl(python, python, *sys.argv)     os.execl(python, python, *sys.argv)
Line 46: Line 47:
  
 def action_quit(): def action_quit():
 +    icon.visible = False
     print("Exiting application")     print("Exiting application")
     os._exit(0)     os._exit(0)
Line 75: Line 77:
  
 icon.run(run_call) icon.run(run_call)
 +</code>
 +
 +Create version file using:
 +<code>
 +pip install pyinstaller_versionfile
 +</code>
 +
 +<code>
 +import pyinstaller_versionfile
 +
 +pyinstaller_versionfile.create_versionfile(
 +    output_file="version.txt",
 +    version="1.2.3.4",
 +    company_name="My Imaginary Company",
 +    file_description="Simple App",
 +    internal_name="Simple App",
 +    legal_copyright="© My Imaginary Company. All rights reserved.",
 +    original_filename="SimpleApp.exe",
 +    product_name="Simple App"
 +)
 </code> </code>
  
Line 80: Line 102:
 <code> <code>
 wine pyinstaller.exe --onefile --icon=systrayicon.ico --add-data "systrayicon.png;." --version-file=version.txt systraytest.py wine pyinstaller.exe --onefile --icon=systrayicon.ico --add-data "systrayicon.png;." --version-file=version.txt systraytest.py
 +</code>
 +
 +Pyinstaller options:
 +<code>
 +--onefile: Creates a single file. Synonyms: -F
 +--windowed: Ensures that no console is opened during execution. Synonyms: -w and --noconsole
 +--add-data: adds data to the file using "source:target" or "source;target"
 +--version: adds exe file version information
 +--icon: adds windows application icon file
 </code> </code>
python/systray.1675083530.txt.gz · Last modified: 2023/05/29 11:53 (external edit)