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
2 changes: 2 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ jobs:
mingw-w64-clang-x86_64-bzip2
mingw-w64-clang-x86_64-zstd
mingw-w64-clang-x86_64-xz
mingw-w64-clang-x86_64-imagemagick
mingw-w64-clang-x86_64-librsvg

- name: Workspace Path Fixup
run: |
Expand Down
16 changes: 16 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,22 @@ add_subdirectory("${CMAKE_SOURCE_DIR}/dependencies/Nui" EXCLUDE_FROM_ALL)
add_executable(${PROJECT_NAME})
target_link_libraries(${PROJECT_NAME} PUBLIC core-target)

if (WIN32)
include("${CMAKE_CURRENT_LIST_DIR}/_cmake/windows/icon.cmake")
file(TO_CMAKE_PATH "${NUI_SFTP_ICO}" NUI_SFTP_ICO_FORWARD)
configure_file(
"${CMAKE_CURRENT_LIST_DIR}/_cmake/windows/nui-sftp.rc.in"
"${CMAKE_BINARY_DIR}/generated/nui-sftp.rc"
@ONLY
)
target_sources(${PROJECT_NAME} PRIVATE "${CMAKE_BINARY_DIR}/generated/nui-sftp.rc")
set_source_files_properties(
"${CMAKE_BINARY_DIR}/generated/nui-sftp.rc"
PROPERTIES OBJECT_DEPENDS "${NUI_SFTP_ICO}"
)
add_dependencies(${PROJECT_NAME} nui-sftp-icon)
endif()

# Third-party license drift check: fails the build if a CMake-declared dep
# is missing from licenses/third_party.spdx.json (or vice versa) or any
# referenced license text file is empty / still a PLACEHOLDER.
Expand Down
25 changes: 25 additions & 0 deletions _cmake/windows/icon.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
set(NUI_SFTP_SVG "${CMAKE_SOURCE_DIR}/static/assets/icons/nui-sftp-logo.svg")
set(NUI_SFTP_ICO "${CMAKE_BINARY_DIR}/generated/icons/nui-sftp.ico")

find_program(MAGICK_EXECUTABLE
NAMES magick
DOC "ImageMagick CLI (used to rasterize SVG -> ICO for the Windows executable resource)"
)
if (NOT MAGICK_EXECUTABLE)
message(FATAL_ERROR
"ImageMagick (magick) is required on Windows to generate nui-sftp.ico from the SVG. "
"Install via MSYS2: pacman -S mingw-w64-clang-x86_64-imagemagick"
)
endif()

add_custom_command(
OUTPUT "${NUI_SFTP_ICO}"
COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_BINARY_DIR}/generated/icons"
COMMAND ${MAGICK_EXECUTABLE} -background none "${NUI_SFTP_SVG}"
-define "icon:auto-resize=256,128,64,48,32,24,16"
"${NUI_SFTP_ICO}"
DEPENDS "${NUI_SFTP_SVG}"
COMMENT "Generating nui-sftp.ico from ${NUI_SFTP_SVG}"
VERBATIM
)
add_custom_target(nui-sftp-icon DEPENDS "${NUI_SFTP_ICO}")
34 changes: 34 additions & 0 deletions _cmake/windows/nui-sftp.rc.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#include <winver.h>

// Numeric ID 1 ensures Explorer / taskbar use this as the default exe icon
// (Windows picks the lowest-numbered ICON resource).
1 ICON "@NUI_SFTP_ICO_FORWARD@"

VS_VERSION_INFO VERSIONINFO
FILEVERSION @SEMVER_MAJOR@,@SEMVER_MINOR@,@SEMVER_PATCH@,0
PRODUCTVERSION @SEMVER_MAJOR@,@SEMVER_MINOR@,@SEMVER_PATCH@,0
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
FILEFLAGS 0
FILEOS VOS_NT_WINDOWS32
FILETYPE VFT_APP
FILESUBTYPE 0
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "CompanyName", "Tim Ebbeke"
VALUE "FileDescription", "nui-sftp - SSH & SFTP workbench"
VALUE "FileVersion", "@VERSION@"
VALUE "InternalName", "nui-sftp"
VALUE "LegalCopyright", "Copyright (C) Tim Ebbeke"
VALUE "OriginalFilename", "nui-sftp.exe"
VALUE "ProductName", "nui-sftp"
VALUE "ProductVersion", "@VERSION@"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x0409, 0x04B0
END
END
6 changes: 6 additions & 0 deletions scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ cp -r "${SOURCE_DIRECTORY}/static/assets/." "${INSTALL_TARGET}/assets"
cp "${SOURCE_DIRECTORY}/static/assets/icons/file.png" "${INSTALL_TARGET}/assets/icons/"
cp "${SOURCE_DIRECTORY}/static/assets/icons/nui-sftp-logo.svg" "${INSTALL_TARGET}/assets/icons/"

# Generated Windows .ico (only present on Windows builds; used by the Inno Setup
# installer as SetupIconFile and Start Menu shortcut icon).
if [ -f "${BUILD_DIRECTORY}/generated/icons/nui-sftp.ico" ]; then
cp "${BUILD_DIRECTORY}/generated/icons/nui-sftp.ico" "${INSTALL_TARGET}/assets/icons/"
fi

# Extra icons bundle (e.g. OS folder icons).
if [ -n "${ICONS_SOURCE}" ] && [ -d "${ICONS_SOURCE}" ]; then
cp -r "${ICONS_SOURCE}/." "${INSTALL_TARGET}/assets/icons/"
Expand Down
8 changes: 5 additions & 3 deletions webpage/frontend/source/frontend/sections/platforms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ namespace NuiSftpPage::Sections
// "Windows 10 · 11 · x86_64" — middle dot U+00B7
std::string const versionLine = "Windows 10 " + Utf8::cp(0x00B7) + " 11 " + Utf8::cp(0x00B7) + " x86_64";

std::string const description = "Download and unpack in the location of your choice.";
std::string const description =
"Pick the installer for a Start Menu entry and clean in-place upgrades, "
"or grab the portable zip and unpack anywhere.";

return div{class_ = "platform-card glass shine"}(
div{
Expand All @@ -73,8 +75,8 @@ namespace NuiSftpPage::Sections
}(versionLine)
)),
p{style = "margin: 0; color: var(--ink-dim); font-size: 14px"}(description),
pkgRow("nui-sftp-portable.zip", ".zip"),
pkgRow("nui-sftp-setup.exe", ".exe", true),
pkgRow("nui-sftp-setup.exe", "installer"),
pkgRow("nui-sftp-portable.zip", "portable"),
a{
class_ = "btn primary shine",
href = "https://github.com/5cript/nui-sftp/releases",
Expand Down
Loading