Fix Shortcuts icons

This commit is contained in:
David Amrhein 2016-09-03 14:39:39 -04:00
parent 756427560c
commit 514575d0f1
2 changed files with 70 additions and 35 deletions

105
setup.py
View file

@ -124,7 +124,9 @@ elif platform == WINDOWS:
from cx_Freeze import setup, Executable from cx_Freeze import setup, Executable
import requests.certs import requests.certs
win_icon = os.path.join('packaging', 'windows', 'lbry-win32-app', 'icons', 'lbry256.ico') app_dir = os.path.join('packaging', 'windows', 'lbry-win32-app')
daemon_dir = os.path.join('lbrynet', 'lbrynet_daemon')
win_icon = os.path.join(app_dir, 'icons', 'lbry256.ico')
wordlist_path = pkg_resources.resource_filename('lbryum', 'wordlist') wordlist_path = pkg_resources.resource_filename('lbryum', 'wordlist')
# Allow virtualenv to find distutils of base python installation # Allow virtualenv to find distutils of base python installation
@ -140,26 +142,8 @@ elif platform == WINDOWS:
data_dir = os.path.dirname(__file__) data_dir = os.path.dirname(__file__)
return os.path.join(data_dir, filename) return os.path.join(data_dir, filename)
if os.path.isdir("C:\Program Files (x86)"):
shortcut_icon = 'C:\Program Files (x86)\lbrynet\icons\lbry256.ico'
else:
shortcut_icon = 'C:\Program Files\lbrynet\icons\lbry256.ico'
shortcut_table = [ shortcut_table = [
('DesktopShortcut', # Shortcut ('LBRYShortcut', # Shortcut
'DesktopFolder', # Directory
'lbrynet-daemon', # Name
'TARGETDIR', # Component
'[TARGETDIR]\lbrynet-daemon.exe', # Target
'--log-to-console', # Arguments
description, # Description
None, # Hotkey
shortcut_icon, # Icon
None, # IconIndex
None, # ShowCmd
'TARGETDIR', # WkDir
),
('DaemonShortcut', # Shortcut
'DesktopFolder', # Directory 'DesktopFolder', # Directory
'LBRY', # Name 'LBRY', # Name
'TARGETDIR', # Component 'TARGETDIR', # Component
@ -167,7 +151,20 @@ elif platform == WINDOWS:
None, # Arguments None, # Arguments
description, # Description description, # Description
None, # Hotkey None, # Hotkey
shortcut_icon, # Icon None, # Icon
None, # IconIndex
None, # ShowCmd
'TARGETDIR', # WkDir
),
('DaemonShortcut', # Shortcut
'DesktopFolder', # Directory
'lbrynet-daemon', # Name
'TARGETDIR', # Component
'[TARGETDIR]\lbrynet-daemon.exe', # Target
'--log-to-console', # Arguments
description, # Description
None, # Hotkey
None, # Icon
None, # IconIndex None, # IconIndex
None, # ShowCmd None, # ShowCmd
'TARGETDIR', # WkDir 'TARGETDIR', # WkDir
@ -180,7 +177,49 @@ elif platform == WINDOWS:
None, # Arguments None, # Arguments
description, # Description description, # Description
None, # Hotkey None, # Hotkey
shortcut_icon, # Icon None, # Icon
None, # IconIndex
None, # ShowCmd
'TARGETDIR', # WkDir
),
('ProgramMenuLBRYShortcut', # Shortcut
'ProgramMenuFolder', # Directory
# r'[ProgramMenuFolder]\lbrynet', # Directory
'LBRY', # Name
'TARGETDIR', # Component
'[TARGETDIR]\{0}.exe'.format(dist_name), # Target
None, # Arguments
description, # Description
None, # Hotkey
None, # Icon
None, # IconIndex
None, # ShowCmd
'TARGETDIR', # WkDir
),
('ProgramMenuDaemonShortcut', # Shortcut
'ProgramMenuFolder', # Directory
# r'[ProgramMenuFolder]\lbrynet', # Directory
'lbrynet-daemon', # Name
'TARGETDIR', # Component
'[TARGETDIR]\lbrynet-daemon.exe', # Target
'--log-to-console', # Arguments
description, # Description
None, # Hotkey
None, # Icon
None, # IconIndex
None, # ShowCmd
'TARGETDIR', # WkDir
),
('ProgramMenuDaemonCLIShortcut', # Shortcut
'ProgramMenuFolder', # Directory
# r'[ProgramMenuFolder]\lbrynet', # Directory
'lbrynet-cli', # Name
'TARGETDIR', # Component
'[TARGETDIR]\lbrynet-cli.exe', # Target
None, # Arguments
description, # Description
None, # Hotkey
None, # Icon
None, # IconIndex None, # IconIndex
None, # ShowCmd None, # ShowCmd
'TARGETDIR', # WkDir 'TARGETDIR', # WkDir
@ -240,10 +279,8 @@ elif platform == WINDOWS:
'Tkinter', 'tk', 'tcl', 'PyQt4', 'nose', 'mock' 'Tkinter', 'tk', 'tcl', 'PyQt4', 'nose', 'mock'
'zope.interface._zope_interface_coptimizations', 'leveldb'], 'zope.interface._zope_interface_coptimizations', 'leveldb'],
'include_files': [(distutils_path, 'distutils'), (requests.certs.where(), 'cacert.pem'), 'include_files': [(distutils_path, 'distutils'), (requests.certs.where(), 'cacert.pem'),
(os.path.join('packaging', 'windows', 'lbry-win32-app', 'icons', 'lbry16.ico'), (os.path.join(app_dir, 'icons', 'lbry16.ico'), os.path.join('icons', 'lbry16.ico')),
os.path.join('icons', 'lbry16.ico')), (os.path.join(app_dir, 'icons', 'lbry256.ico'), os.path.join('icons', 'lbry256.ico')),
(os.path.join('packaging', 'windows', 'lbry-win32-app', 'icons', 'lbry256.ico'),
os.path.join('icons', 'lbry256.ico')),
(os.path.join(wordlist_path, 'chinese_simplified.txt'), (os.path.join(wordlist_path, 'chinese_simplified.txt'),
os.path.join('wordlist', 'chinese_simplified.txt')), os.path.join('wordlist', 'chinese_simplified.txt')),
(os.path.join(wordlist_path, 'english.txt'), os.path.join('wordlist', 'english.txt')), (os.path.join(wordlist_path, 'english.txt'), os.path.join('wordlist', 'english.txt')),
@ -254,30 +291,28 @@ elif platform == WINDOWS:
'namespace_packages': ['zope', 'google']} 'namespace_packages': ['zope', 'google']}
tray_app = Executable( tray_app = Executable(
script=os.path.join('packaging', 'windows', 'lbry-win32-app', 'LBRYWin32App.py'), script=os.path.join(app_dir, 'LBRYWin32App.py'),
base='Win32GUI', base='Win32GUI',
icon=win_icon, icon=win_icon,
compress=True, compress=True,
shortcutName=dist_name, # shortcutName=dist_name,
shortcutDir='DesktopFolder', # shortcutDir='DesktopFolder',
targetName='{0}.exe'.format(dist_name) targetName='{0}.exe'.format(dist_name)
# targetDir="LocalAppDataFolder"
) )
daemon_dir = os.path.join('lbrynet', 'lbrynet_daemon')
daemon_exe = Executable( daemon_exe = Executable(
script=os.path.join(daemon_dir, 'LBRYDaemonControl.py'), script=os.path.join(daemon_dir, 'LBRYDaemonControl.py'),
icon=win_icon, icon=win_icon,
shortcutName="lbrynet-daemon", # shortcutName="lbrynet-daemon",
shortcutDir='DesktopFolder', # shortcutDir='DesktopFolder',
targetName='lbrynet-daemon.exe' targetName='lbrynet-daemon.exe'
) )
cli_exe = Executable( cli_exe = Executable(
script=os.path.join(daemon_dir, 'LBRYDaemonCLI.py'), script=os.path.join(daemon_dir, 'LBRYDaemonCLI.py'),
icon=win_icon, icon=win_icon,
shortcutName="lbrynet-cli", # shortcutName="lbrynet-cli",
shortcutDir='DesktopFolder', # shortcutDir='DesktopFolder',
targetName='lbrynet-cli.exe' targetName='lbrynet-cli.exe'
) )