Skip to content

Add APP icon - #2

Merged
swarfte merged 5 commits into
mainfrom
dev
May 27, 2026
Merged

Add APP icon#2
swarfte merged 5 commits into
mainfrom
dev

Conversation

@swarfte

@swarfte swarfte commented May 27, 2026

Copy link
Copy Markdown
Owner

This pull request improves the build process documentation and enhances cross-platform compatibility and usability for the application, especially regarding resource handling and payload formatting. The most significant changes are grouped by documentation improvements and application functionality updates:

Documentation and Build Process:

  • Expanded and clarified the build.md to provide detailed, platform-specific build instructions for Windows, macOS, and Linux, including icon usage and post-build installation steps. Also added guidance for creating .icns icons for macOS and desktop entries for Linux.

Cross-Platform Resource and Icon Handling:

  • Updated resource directory handling by introducing RESOURCE_DIR to correctly locate bundled resources (like icons) when running as a PyInstaller executable, ensuring icons are found on all platforms.
  • Enhanced window icon support: the application now sets .ico icons on Windows and .png icons on other platforms, improving the native look and feel across operating systems.

Payload Formatting and Usability:

  • Improved payload template definitions by using raw strings (r"...") for network protocol templates, ensuring escape sequences are handled correctly and consistently.
  • Modified the payload formatting logic so that, in "Escapes (\r\n, \x41)" mode, all newlines are converted to \r\n escape sequences, and when displaying protocol templates, human-readable newlines are shown in the text area for better user experience. [1] [2]

swarfte added 5 commits May 27, 2026 17:13
Convert protocol templates (HTTP, POST, Redis, SMTP) to raw string literals so backslashes are preserved. Change payload_to_printf to convert actual newlines to literal "\r\n" in the "Escapes" mode. In NcCommandBuilder, convert literal "\r\n" sequences back to real newlines for the payload preview so the GUI shows human-readable output. These tweaks make escaping consistent between storage, formatting, and display.
Replace minimal platform notes with a full Build (Portable / Single-file) guide. Adds per-OS PyInstaller commands and expected outputs for Windows, macOS, and Linux, macOS .icns conversion notes, and system-wide/user install instructions. Also adds the netcat-logo.ico asset used by the examples.
Add icon assets (netcat-logo.ico, netcat-logo.png, netcat-logo.svg) under icons/ and update main.py to load them at startup. The code checks APP_DIR/icons, uses iconbitmap() with the .ico on Windows and PhotoImage + iconphoto() with the .png (keeping a reference in self._icon_img) so the application window shows the app icon across platforms.
Move icon assets into an icons/ subdirectory and update build instructions to match. Update Windows and macOS pyinstaller commands to use icons/netcat-logo.(ico|png), adjust macOS icon conversion steps to read/write from icons/, produce icons/netcat-logo.icns, and clarify the macOS output as dist/nc-command-builder.app.
Update packaging docs to include --add-data for icons (Windows uses "icons;icons", macOS uses "icons:icons"). In code, add RESOURCE_DIR that uses sys._MEIPASS when frozen and switch icon_dir to RESOURCE_DIR/icons so the packaged executable can locate bundled icon resources.
Copilot AI review requested due to automatic review settings May 27, 2026 10:28
@swarfte
swarfte merged commit 1bb73d7 into main May 27, 2026
@swarfte
swarfte removed the request for review from Copilot May 27, 2026 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant