diff --git a/setup.py b/setup.py index 118d44a..08f0d56 100644 --- a/setup.py +++ b/setup.py @@ -54,14 +54,13 @@ py2exe_dependencies = [ # Set icons path if PY2EXE: icons_path = 'icons' + + fallback_icons_path = '' else: # On windows you have to copy the icons manually if you dont use py2exe - xdg_data_dirs = os.getenv('XDG_DATA_DIRS') + icons_path = '/usr/local/share/icons/hicolor/' - if xdg_data_dirs is None: - icons_path = '/usr/share/pixmaps/' - else: - icons_path = '/usr/local/share/icons/hicolor/' + fallback_icons_path = '/usr/share/pixmaps/' # Set params if PY2EXE: @@ -78,12 +77,15 @@ if PY2EXE: else: data_files = [] if os.name != 'nt': - if xdg_data_dirs is not None: - for index, size in enumerate(ICONS_SIZE): - data_file = (icons_path + size + '/apps', [ICONS_LIST[index]]) - data_files.append(data_file) - else: - data_files = [(icons_path, ICONS_LIST)] + # Create all the hicolor icons + for index, size in enumerate(ICONS_SIZE): + data_file = (icons_path + size + '/apps', [ICONS_LIST[index]]) + data_files.append(data_file) + + if fallback_icons_path != '': + # Add the 48x48 icon as fallback in /usr/share/pixmaps + data_file = (fallback_icons_path, [ICONS_LIST[2]]) + data_files.append(data_file) params = { 'data_files': data_files