Add desktop shortcut and Windows exe packaging

Operators can double-click XlsxClean without using the terminal: Windows
VBS/BAT launchers plus Install-DesktopShortcut, Linux .desktop installer,
and a PyInstaller spec/build script for a standalone Windows exe.

Co-authored-by: Diaco Soltanpour <s-diaco@users.noreply.github.com>
This commit is contained in:
Cursor Agent
2026-07-22 08:12:44 +00:00
parent 1be0c3ca0f
commit afec00b50f
13 changed files with 352 additions and 5 deletions

View File

@@ -6,7 +6,18 @@ import os
import sys
from pathlib import Path
PACKAGE_DIR = Path(__file__).resolve().parent
def _package_dir() -> Path:
"""Directory containing package data (CSV/txt), including PyInstaller bundles."""
if getattr(sys, "frozen", False) and hasattr(sys, "_MEIPASS"):
bundled = Path(sys._MEIPASS) / "xlsx_clean"
if bundled.is_dir():
return bundled
return Path(sys._MEIPASS)
return Path(__file__).resolve().parent
PACKAGE_DIR = _package_dir()
# Historical Windows root used in file_data.csv
DEFAULT_OPENCLOUD_ROOT = Path(r"D:\OpenCloud")

View File

@@ -121,18 +121,25 @@ def parse_args(argv: list[str] | None = None) -> argparse.Namespace:
action="store_true",
help="Enable NiceGUI auto-reload (dev only).",
)
parser.add_argument(
"--no-browser",
action="store_true",
help="Do not open a browser window automatically.",
)
return parser.parse_args(argv)
def main(argv: list[str] | None = None) -> None:
# When frozen by PyInstaller, drop argv[0] quirks handled by argparse normally.
args = parse_args(argv)
_build_page()
ui.run(
host=args.host,
port=args.port,
reload=args.reload,
reload=False if getattr(sys, "frozen", False) else args.reload,
title="xlsx-clean",
show=True,
show=not args.no_browser,
native=False,
)