From 4f6d1c6baf4abc7ea6e36b8d75eed937d4b06e4e Mon Sep 17 00:00:00 2001 From: Elijah Lopez Date: Mon, 20 Nov 2023 16:43:53 -0500 Subject: [PATCH] Fix removing old startup shortcuts --- CHANGELOG.txt | 5 ++++- build_files/mc_version_info.txt | 8 ++++---- build_files/setup_script.iss | 7 ++++++- src/meta.py | 2 +- src/music_caster.py | 4 ++++ src/utils.py | 13 +++++++------ 6 files changed, 26 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 6f0bdf33..dec56b96 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,7 +1,10 @@ Music Caster by Elijah Lopez Changelog +5.16.1 +- [Fix] Remove old startup shortcuts + background thread + 5.16.0 -- [Fix] Linux? +- [Feature] Linux support - [Fix] Remove old startup shortcuts 5.15.0 diff --git a/build_files/mc_version_info.txt b/build_files/mc_version_info.txt index bb094062..843d10fb 100644 --- a/build_files/mc_version_info.txt +++ b/build_files/mc_version_info.txt @@ -3,8 +3,8 @@ # noinspection PyUnresolvedReferences VSVersionInfo( ffi=FixedFileInfo( - prodvers=(5, 16, 0, 0), - filevers=(5, 16, 0, 0), + prodvers=(5, 16, 1, 0), + filevers=(5, 16, 1, 0), # Contains a bitmask that specifies the valid bits 'flags'r mask=0x17, # Contains a bitmask that specifies the Boolean attributes of the file. @@ -28,12 +28,12 @@ VSVersionInfo( '000004b0', [StringStruct('CompanyName', 'Elijah Lopez'), StringStruct('FileDescription', 'Music Caster'), - StringStruct('FileVersion', '5.16.0.0'), + StringStruct('FileVersion', '5.16.1.0'), StringStruct('InternalName', 'Music Caster'), StringStruct('LegalCopyright', 'Copyright (c) 2019 - 2023, Elijah Lopez'), StringStruct('OriginalFilename', 'Music Caster.exe'), StringStruct('ProductName', 'Music Caster'), - StringStruct('ProductVersion', '5.16.0.0')]) + StringStruct('ProductVersion', '5.16.1.0')]) ]), VarFileInfo([VarStruct('Translation', [0, 1200])]) ] diff --git a/build_files/setup_script.iss b/build_files/setup_script.iss index ad74acf0..e816bec2 100644 --- a/build_files/setup_script.iss +++ b/build_files/setup_script.iss @@ -1,5 +1,5 @@ #define MyAppName "Music Caster" -#define MyAppVersion "5.16.0" +#define MyAppVersion "5.16.1" #define MyAppPublisher "Elijah Lopez" #define MyAppURL "https://elijahlopez.ca/software#music-caster" #define MyAppExeName "Music Caster.exe" @@ -63,6 +63,11 @@ Type: filesandordirs; Name: {app}\PyQt5 Type: filesandordirs; Name: {app}\wx Type: filesandordirs; Name: {app}\vlc Type: filesandordirs; Name: {app}\vlc_lib +Type: filesandordirs; Name: {app}\importlib_metadata* +Type: filesandordirs; Name: {app}\keyring* +Type: filesandordirs; Name: {app}\lz4* +Type: filesandordirs; Name: {app}\websockets* +Type: filesandordirs; Name: {app}\wheel* [Icons] Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}" diff --git a/src/meta.py b/src/meta.py index e90096f5..4a71c039 100644 --- a/src/meta.py +++ b/src/meta.py @@ -1,4 +1,4 @@ -VERSION = latest_version = '5.16.0' +VERSION = latest_version = '5.16.1' UPDATE_MESSAGE = """ [NEW] Bienvenue Français [MSG] Language translators wanted diff --git a/src/music_caster.py b/src/music_caster.py index ac163ee2..708fba5b 100644 --- a/src/music_caster.py +++ b/src/music_caster.py @@ -3548,8 +3548,12 @@ def read_main_window(): def start_on_login_modifications(): """ Run platform specific implementation of startup modification """ if platform.system() == 'Windows': + app_log.info('removing old startup shortcuts') rm_old_startup_shortcuts() + app_log.info('removed old startup shortcuts') + app_log.info('creating/removing startup registry entry') start_on_login_win32(working_dir, settings['run_on_startup']) + app_log.info('created/removed startup registry entry') else: print('TODO: start_on_login_modifications not implemented for', platform.system()) diff --git a/src/utils.py b/src/utils.py index 9d6dadb3..cc299940 100644 --- a/src/utils.py +++ b/src/utils.py @@ -1382,12 +1382,13 @@ def start_on_login_win32(working_dir, create_key=True, is_debug=True): def rm_old_startup_shortcuts(): - from win32comext.shell import shell, shellcon - startup_dir = shell.SHGetFolderPath(0, (shellcon.CSIDL_STARTUP, shellcon.CSIDL_COMMON_STARTUP)[0], None, 0) - shortcut_paths = (f"{startup_dir}\\{item}.lnk" for item in ('Music Caster', 'Music Caster (Python)', 'Music Caster [DEBUG]')) - for shortcut_path in shortcut_paths: - with suppress(FileNotFoundError): - os.remove(shortcut_path) + if platform.system() == 'Windows': + from knownpaths import sh_get_known_folder_path, FOLDERID + startup_dir = sh_get_known_folder_path(FOLDERID.Startup) + shortcut_paths = (f"{startup_dir}\\{item}.lnk" for item in ('Music Caster', 'Music Caster (Python)', 'Music Caster [DEBUG]')) + for shortcut_path in shortcut_paths: + with suppress(FileNotFoundError): + os.remove(shortcut_path) def startfile(file):