Skip to content

Commit

Permalink
chore(cli): bump YASB_CLI_VERSION to 1.0.4 and improve version messag…
Browse files Browse the repository at this point in the history
…e formatting

- Updated the YASB_CLI_VERSION to 1.0.4.
- Enhanced the version message output for better readability.
- Added additional process termination for related executables during updates.
  • Loading branch information
amnweb committed Dec 23, 2024
1 parent ebdf2e5 commit d961915
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/core/utils/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
just_fix_windows_console()

YASB_VERSION = BUILD_VERSION
YASB_CLI_VERSION = "1.0.3"
YASB_CLI_VERSION = "1.0.4"

OS_STARTUP_FOLDER = os.path.join(os.environ['APPDATA'], r'Microsoft\Windows\Start Menu\Programs\Startup')
INSTALLATION_PATH = os.path.abspath(os.path.join(__file__, "../../.."))
Expand Down Expand Up @@ -199,7 +199,7 @@ def parse_arguments():
sys.exit(0)

elif args.version:
version_message = f"\nYASB Reborn " + Format.underline + f"v{YASB_VERSION}" + Format.end + f"\nYASB-CLI " + Format.underline + f"v{YASB_CLI_VERSION}" + Format.end + "\n"
version_message = f"YASB Reborn v{YASB_VERSION}\nYASB-CLI v{YASB_CLI_VERSION}"
print(version_message)
else:
logging.info("Unknown command. Use --help for available options.")
Expand Down Expand Up @@ -347,13 +347,18 @@ def update_yasb(YASB_VERSION):
# Step 4: Run the MSI installer in silent mode and restart the application
if is_process_running("yasb.exe"):
subprocess.run(["taskkill", "/f", "/im", "yasb.exe"], creationflags=subprocess.CREATE_NO_WINDOW)
if is_process_running("yasb_themes.exe"):
subprocess.run(["taskkill", "/f", "/im", "yasb_themes.exe"], creationflags=subprocess.CREATE_NO_WINDOW)
if is_process_running("yasbc.exe"):
subprocess.run(["taskkill", "/f", "/im", "yasbc.exe"], creationflags=subprocess.CREATE_NO_WINDOW)

# Construct the uninstall command as a string
product_code = CLIUpdateHandler.get_installed_product_code()
if product_code is not None:
uninstall_command = f'msiexec /x {product_code} /passive'
else:
uninstall_command = ""

# Construct the install command as a string
install_command = f'msiexec /i "{os.path.abspath(msi_path)}" /passive /norestart'
run_after_command = f'"{EXE_PATH}"'
Expand Down

0 comments on commit d961915

Please sign in to comment.