diff --git a/doc/images/dfetch_logo_only.png b/doc/images/dfetch_logo_only.png new file mode 100644 index 00000000..62dba7c9 Binary files /dev/null and b/doc/images/dfetch_logo_only.png differ diff --git a/doc/images/dfetch_logo_only.svg b/doc/images/dfetch_logo_only.svg new file mode 100644 index 00000000..560699e2 --- /dev/null +++ b/doc/images/dfetch_logo_only.svg @@ -0,0 +1,119 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + diff --git a/pyproject.toml b/pyproject.toml index 0d442dbb..56aa9f4e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -199,9 +199,11 @@ mode = "standalone" # show-progress = true assume-yes-for-downloads = true +lto = "auto" # Use link time optimizations if available and usable + include-data-dir="dfetch/resources=resources" include-package-data="infer_license" -include-module="infer_license.licenses" +include-module="infer_license.licenses" # Explicitly add module to let nuitka discover the data # python-flag = ["-OO"] # Cannot optimize (yet) commands rely on __doc__ being present @@ -210,5 +212,11 @@ output-filename-win = "dfetch.exe" output-filename-linux = "dfetch" output-filename-macos = "dfetch" -# windows-icon-from-ico = "static/favicon.ico" -# windows-company-name = "dfetch-org" +windows-icon-from-ico = "doc/images/favicon.ico" +linux-icon = "doc/images/dfetch_logo_only.png" + +company-name = "dfetch-org" +product-version = "{VERSION}" +file-version = "{VERSION}" +product-name = "dfetch" +file-description = "A vendoring tool for fetching and managing external dependencies." diff --git a/script/package.py b/script/package.py index 1ca2aa51..79d207c1 100644 --- a/script/package.py +++ b/script/package.py @@ -19,6 +19,9 @@ MAINTAINER = project_info.get("authors", [{}])[0].get("name", "") DESCRIPTION = project_info.get("description", "") URL = project_info.get("urls", {}).get("Homepage", "") +DOCS_URL = project_info.get("urls", {}).get("Documentation", "") +ISSUES_URL = project_info.get("urls", {}).get("Issues", "") +CHANGELOG_URL = project_info.get("urls", {}).get("Changelog", "") LICENSE = project_info.get("license", "") INSTALL_PREFIX = ( @@ -28,6 +31,12 @@ OUTPUT_DIR = Path("build", f"{PACKAGE_NAME}-package") UPGRADE_CODE = "BDC7DA0D-70C1-4189-BE88-F1BD2DEE3E33" #: Fixed UUID for WiX installer, must be unique and stable +tools = pyproject.get("tool", {}) +nuitka_info = tools.get("nuitka", {}) + +WINDOWS_ICO = nuitka_info.get("windows-icon-from-ico", "") +WINDOWS_ICO_PATH = Path(WINDOWS_ICO).resolve() if WINDOWS_ICO else None + def run_command(command: list[str]) -> None: """Run a system command and handle errors.""" @@ -188,7 +197,20 @@ def generate_wix_xml(build_dir: Path, output_wxs: Path) -> None: ) ET.SubElement(feature, "Files", Include=str(build_dir.resolve() / "**")) + # Add / Remove programs info (ARP) ET.SubElement(package, "Property", Id="ARPCOMMENTS", Value=DESCRIPTION) + ET.SubElement(package, "Property", Id="ARPURLINFOABOUT", Value=URL) + ET.SubElement(package, "Property", Id="ARPREADME", Value=DOCS_URL) + ET.SubElement(package, "Property", Id="ARPHELPLINK", Value=ISSUES_URL) + ET.SubElement(package, "Property", Id="ARPURLUPDATEINFO", Value=CHANGELOG_URL) + + if WINDOWS_ICO_PATH: + ET.SubElement(package, "Icon", Id="AppIcon", SourceFile=str(WINDOWS_ICO_PATH)) + ET.SubElement(package, "Property", Id="ARPPRODUCTICON", Value="AppIcon") + + # Don't show modify & repair buttons, only remove + ET.SubElement(package, "Property", Id="ARPNOMODIFY", Value="1") + ET.SubElement(package, "Property", Id="ARPNOREPAIR", Value="1") tree = ET.ElementTree(wix) tree.write(output_wxs, encoding="utf-8", xml_declaration=True)