Jan-22-2018, 01:07 AM
(Jan-19-2018, 12:05 PM)buran Wrote: please, post your full spec file. the icon in the taskbar is the same as the icon of the exe file. you need to specify the icon attribute in the exe part of the spec file. The line that you show will tell pyinstaller that it need to include this png file when building the exe and this png will be used from your application (e.g. as an tray icon). when it is included with the exe you can use it by reference it with _MEIPASS2. If you don't use _MEIPASS2 you need to supply the png as an external file (i.e. you will distribute exe + png file).
sample as below;
# -*- mode: python -*- block_cipher = None a = Analysis(['LT_SC.py'], pathex=['C:\\ProgramData\\Miniconda3\\envs\\LT'], binaries=[], datas=[], hiddenimports=['pandas._libs.tslibs.timedeltas'], hookspath=[], runtime_hooks=[], excludes=[], win_no_prefer_redirects=False, win_private_assemblies=False, cipher=block_cipher) a.datas += [('LOAD.png','C:\\ProgramData\\Miniconda3\\envs\\LT\\LOAD.png','Data')] pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher) exe = EXE(pyz, a.scripts, a.binaries, a.zipfiles, a.datas, name='LT_SC', debug=False, strip=False, upx=True, runtime_tmpdir=None, console=False , icon='C:\\ProgramData\\Miniconda3\\envs\\LT\\dist\LOAD.ico' )