Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added doc/images/dfetch_logo_only.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
119 changes: 119 additions & 0 deletions doc/images/dfetch_logo_only.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 11 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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."
22 changes: 22 additions & 0 deletions script/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = (
Expand All @@ -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."""
Expand Down Expand Up @@ -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)
Expand Down
Loading