### Example defaults.conf for Signing and Notarization Source: https://github.com/hydraulic-software/conveyor/blob/master/guidebook/docs/configs/keys-and-certificates.md A complete example of a defaults.conf file showing signing key and macOS notarization configurations. ```hocon app.signing-key = "<24 words>/2021-05-27T17:45:47Z" app.mac.notarization { issuer-id = 12345678-1234-1234-1234-123456789012 key-id = ABCDEF1234 private-key = AuthKey_ABCDEF1234.p8 } app.mac.certificate = apple.cer app.windows.certificate = windows.cer ``` -------------------------------- ### Initial JSON Configuration Source: https://github.com/hydraulic-software/conveyor/blob/master/guidebook/docs/configs/hocon-tutorial.html The starting point is a standard JSON configuration that is also valid HOCON. ```json { "devServer": { "host": "localhost", "port": 3000, "useSSL": false }, "prodServer": { "host": "www.example.com", "port": 443, "useSSL": true }, "servers": [ "devServer", "prodServer" ] } ``` -------------------------------- ### Example Signtool Command for Signing Source: https://github.com/hydraulic-software/conveyor/blob/master/guidebook/docs/configs/windows.md An example of a batch script using Microsoft's signtool to sign a package. This demonstrates how to integrate external signing tools. ```batch @signtool sign /fd sha256 /a /f mycert.pfx /p mypassword %1 ``` -------------------------------- ### Basic SystemD Service Configuration Source: https://github.com/hydraulic-software/conveyor/blob/master/guidebook/docs/stdlib/systemd.md Include this snippet to set up a basic SystemD service for your application. The service will be automatically started on installation and boot, and restarted if it fails. The service name defaults to the application's long filesystem name. ```HOCON app { // ... // The ".server" part here can be anything - the included snippet will override the file name. linux.services.server { include "/stdlib/linux/service.conf" } } ``` -------------------------------- ### Install Conveyor via npm Source: https://github.com/hydraulic-software/conveyor/blob/master/guidebook/docs/download-conveyor.md Use this command to install Conveyor globally using npm. This is a quick way to get the tool if you have Node.js and npm set up. ```shell npm install -g @hydraulic/conveyor ``` -------------------------------- ### Custom JDK Configuration Example Source: https://github.com/hydraulic-software/conveyor/blob/master/guidebook/docs/stdlib/jdks.md Example of a custom JDK configuration for Amazon Corretto 17.0, specifying download URLs for various platforms and architectures. ```HCL // Snippet: JDK 17.0 by corretto app.jvm.feature-version = 17 app.jvm.version = 17.0 app.jvm { linux.aarch64.glibc.inputs += "https://corretto.aws/downloads/resources/17.0.0.35.1/amazon-corretto-17.0.0.35.1-linux-aarch64.tar.gz" linux.amd64.glibc.inputs += "https://corretto.aws/downloads/resources/17.0.0.35.1/amazon-corretto-17.0.0.35.1-linux-x64.tar.gz" linux.amd64.muslc.inputs += "https://corretto.aws/downloads/resources/17.0.0.35.1/amazon-corretto-17.0.0.35.1-alpine-linux-x64.tar.gz" mac.aarch64.inputs += "https://corretto.aws/downloads/resources/17.0.0.35.2/amazon-corretto-17.0.0.35.2-macosx-aarch64.tar.gz" mac.amd64.inputs += "https://corretto.aws/downloads/resources/17.0.0.35.1/amazon-corretto-17.0.0.35.1-macosx-x64.tar.gz" windows.amd64.inputs += "https://corretto.aws/downloads/resources/17.0.0.35.1/amazon-corretto-17.0.0.35.1-windows-x64-jdk.zip" } ``` -------------------------------- ### Install Dependencies Source: https://github.com/hydraulic-software/conveyor/blob/master/guidebook/docs/control-api-electron.md Install the necessary packages for the Electron Online Updater API. ```bash npm install @hydraulic/conveyor-control koffi ``` -------------------------------- ### Compose Desktop App Example (build.gradle.kts) Source: https://github.com/hydraulic-software/conveyor/blob/master/guidebook/docs/configs/maven-gradle.md Example Gradle build script for a Compose Desktop application using the Conveyor plugin. It configures Kotlin, Compose, and platform-specific dependencies. ```kotlin import org.jetbrains.kotlin.gradle.dsl.KotlinJvmCompile plugins { kotlin("jvm") version "1.6.10" kotlin("kapt") version "1.6.10" id("org.jetbrains.compose") version "1.2.0" id("dev.hydraulic.conveyor") version "2.0" } version = "1.0" group = "dev.hydraulic.samples" repositories { mavenCentral() google() maven("https://maven.pkg.jetbrains.space/public/p/compose/dev") } java { toolchain { languageVersion.set(JavaLanguageVersion.of(17)) } } compose.desktop { application { mainClass = "MainKt" nativeDistributions { vendor = "Hydraulic Software" description = "An example of how to package a Compose Desktop app with Conveyor" } } } dependencies { "linuxAmd64"("org.jetbrains.compose.desktop:desktop_linux_x64:1.2.0") "macAmd64"("org.jetbrains.compose.desktop:desktop_macos_x64:1.2.0") "macAarch64"("org.jetbrains.compose.desktop:desktop_macos_arm64:1.2.0") "windowsAmd64"("org.jetbrains.compose.desktop:desktop_windows_x64:1.2.0") } ``` -------------------------------- ### Generate Native Starter Project Source: https://github.com/hydraulic-software/conveyor/blob/master/guidebook/docs/tutorial/tortoise/2-create-or-adapt-a-project.md Use this command to generate a basic native project structure. Ensure CMake and a suitable compiler are installed. Navigate into the created directory and build the site afterwards. ```bash conveyor generate cmake com.example.my-project cd my-project conveyor make site ``` -------------------------------- ### Set Linux Installation Prefix Source: https://github.com/hydraulic-software/conveyor/blob/master/guidebook/docs/configs/linux.md Define the base directory for application files and symlinks. Defaults to /usr. ```properties app.linux.prefix = /usr/local ``` -------------------------------- ### Flutter App Deployment Example Source: https://github.com/hydraulic-software/conveyor/blob/master/actions/build/README.md An example GitHub Actions workflow demonstrating how to deploy a Flutter app using the Conveyor build action. This workflow includes steps for checking out code, downloading build artifacts for different platforms, setting up SSH, and running Conveyor with specific commands and flags. Sensitive information should be stored in GitHub secrets. ```yaml # This file can be stored in your repository under .github/workflows/deploy.yml, for example. name: Deploy on: [workflow_dispatch] jobs: build: # Here we expect a build.yml similar to the one in # https://github.com/hydraulic-software/flutter-demo/blob/master/.github/workflows/build.yml uses: ./.github/workflows/build.yml deploy: needs: [build] # Important: must be run from Linux. runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v3 # The artifacts in this example are expected to be in the layout from the build.yml mentioned above. - name: Download macOS ARM build uses: actions/download-artifact@v3 with: name: build-macos-aarch64 path: ./artifacts - name: Download macOS AMD64 build uses: actions/download-artifact@v3 with: name: build-macos-amd64 path: ./artifacts - name: Download Windows build uses: actions/download-artifact@v3 with: name: build-windows-amd64 # Windows is not in a tarball, so we extract to a separate directory. path: ./artifacts/windows - name: Download Linux AMD64 build uses: actions/download-artifact@v3 with: name: build-linux-amd64 path: ./artifacts - name: Set up SSH uses: shimataro/ssh-key-action@v2 with: # Use secrets for sensitive data. key: ${{ secrets.SSH_KEY }} known_hosts: ${{ secrets.KNOWN_HOSTS }} - name: Run Conveyor uses: hydraulic-software/conveyor/actions/build@v22.0 with: command: make copied-site signing_key: ${{ secrets.SIGNING_KEY }} agree_to_license: 1 # If your SSH address is sensitive, you can hide it behind a secret as well. # Otherwise, you can just add it directly to your 'conveyor.conf' file under key 'app.site.copy-to' extra_flags: -Kapp.site.copy-to="${{ secrets.COPY_TO }}" ``` -------------------------------- ### Allowing SystemD Service to Write to Installation Directory Source: https://github.com/hydraulic-software/conveyor/blob/master/guidebook/docs/stdlib/systemd.md Use `writable-service-install.conf` if your server requires writing to its installation directory. Note that this significantly reduces security and should be used with caution. ```HOCON include "/stdlib/linux/writable-service-install.conf" ``` -------------------------------- ### Example App Configuration Source: https://github.com/hydraulic-software/conveyor/blob/master/guidebook/docs/configs/names.md Demonstrates how Conveyor calculates various name and metadata fields based on input and vendor configuration. ```hocon app.vendor = LittleCorp app.inputs += example-app-1.1.zip ``` ```hocon app.version = 1.1 app.fsname = example-app app.long-fsname = littlecorp-example-app app.long-fsname-dir = littlecorp/example-app app.display-name = LittleCorp Example App ``` -------------------------------- ### conveyor.conf Example Source: https://github.com/hydraulic-software/conveyor/blob/master/guidebook/docs/tutorial/tortoise/2-gradle.md A typical conveyor.conf file demonstrating hashbang includes for dynamic configuration and app settings. ```javascript include "#!/gradlew -q printConveyorConfig" // (1)! app { display-name = My Amazing Project // (2)! site.base-url = downloads.myproject.org/some/path // (3)! icons = "icons/icon-rounded-*.png" // (4)! windows.icons = "icons/icon-square-*.png" } ``` -------------------------------- ### Specify Linux Install Path Source: https://github.com/hydraulic-software/conveyor/blob/master/guidebook/docs/configs/linux.md Override the default installation path for application files. Defaults to ${app.linux.prefix}/lib/${app.long-fs-dir}. ```properties app.linux.install-path = /opt/myapp ``` -------------------------------- ### Minimal App Configuration Example Source: https://github.com/hydraulic-software/conveyor/blob/master/guidebook/docs/configs/index.md This snippet shows a basic app configuration defining inputs for different operating systems and architectures, along with the base URL for serving downloads. It infers app metadata from the input file names. ```HOCON app { windows.amd64.inputs = win/example-app-1.1.zip mac.amd64.inputs = mac/intel/example-app-1.1.zip mac.aarch64.inputs = mac/arm/example-app-1.1.zip site { base-url = yourserver.net/downloads # Where your downloads and update files will be served from. } } ``` -------------------------------- ### Thinning Mac Binaries with lipo Source: https://github.com/hydraulic-software/conveyor/blob/master/guidebook/docs/configs/flutter.md This example demonstrates how to use the `lipo` command to create a thin binary for a specific architecture (x86_64) from a universal/fat macOS app. This reduces the download size for users on Intel Macs. ```bash lipo build/macos/Build/Products/Release/flutter_demo.app/Contents/MacOS/flutter_demo \ -output build/macos/Build/Products/Release/flutter_demo.app/Contents/MacOS/flutter_demo \ -thin x86_64 ``` -------------------------------- ### Windows Application Settings Source: https://github.com/hydraulic-software/conveyor/blob/master/guidebook/docs/configs/windows.md Defines general Windows-specific inputs, console behavior, and installer theme. ```properties app.windows { # Windows specific inputs. inputs = [ ... ] # Make a terminal window appear on startup. console = true # Which theme should be used for the installer UI. installer.theme = dark } ``` -------------------------------- ### Install Electron Dependencies Source: https://github.com/hydraulic-software/conveyor/blob/master/guidebook/docs/tutorial/tortoise/3-compile.md Run this command to download Electron for development purposes. For production, consider using a bundler like webpack or Vite. ```bash npm install ``` -------------------------------- ### Flutter App Configuration Example Source: https://github.com/hydraulic-software/conveyor/blob/master/guidebook/docs/tutorial/tortoise/2-create-or-adapt-a-project.md Includes standard Flutter configurations, manages Visual C++ runtime, overrides Flutter icons, and uses external tools for dependency management. ```hocon # Example of a Conveyor configuration for a Flutter app # This is a conceptual representation and not a direct code block from the source. # Actual configuration would involve including stdlib files and potentially external command includes. include "/stdlib/flutter/flutter.conf" # Example of overriding Flutter-provided icons icons = "app/icons/icon-*.png" # Example of using yq to convert pubspec.yaml to JSON for inclusion # This demonstrates the concept of hashbang includes for external commands. # pubspec-json = ${exec:yq "." pubspec.yaml} # app.version = ${pubspec-json.version} ``` -------------------------------- ### Example Custom macOS Signing Script Source: https://github.com/hydraulic-software/conveyor/blob/master/guidebook/docs/configs/mac.md An example bash script demonstrating how to use the Apple codesign tool for signing macOS bundles or binaries. This script can be adapted for more complex signing processes. ```bash #!/usr/bin/env bash echo "signing: $@" name="Your Name Here" if [[ "$1" == "bundle" ]]; then codesign --sign "$name" --deep --force --verbose --entitlements "$2" "$3" else codesign --sign "$name" --force --verbose --entitlements "$1" -i "$3" "$2" fi ``` -------------------------------- ### Systemd Service Configuration for Writable Paths Source: https://github.com/hydraulic-software/conveyor/blob/master/guidebook/docs/stdlib/systemd.md This configuration snippet extends a systemd service unit to allow write access to the application's installation path. It also includes a pre-start command to ensure correct ownership of the installation directory. ```systemd-unit Service { ExecStartPre += "!/bin/sh -c \"chown -R --preserve-root -h" ${app.long-fsname}":"${app.long-fsname} ${app.linux.install-path}\"" ReadWritePaths += "+"${app.linux.install-path} } ``` -------------------------------- ### Adding Command Line Arguments to SystemD Service Source: https://github.com/hydraulic-software/conveyor/blob/master/guidebook/docs/stdlib/systemd.md Extend the default `ExecStart` command to include custom command-line arguments when the service is started by SystemD. Ensure proper escaping for arguments containing spaces. ```HOCON app.linux.services.server { include "/stdlib/linux/service.conf" Service { ExecStart = ${app.linux.services.server.Service.ExecStart} --port 8888 --message "\"Hello World\"" } } ``` -------------------------------- ### Array Concatenation Examples Source: https://github.com/hydraulic-software/conveyor/blob/master/guidebook/docs/configs/hocon-spec.md Illustrates various methods for defining an array, including concatenating multiple array definitions. ```hocon a : [ 1, 2, 3, 4 ] ``` ```hocon a : [ 1, 2 ] [ 3, 4 ] ``` ```hocon a : [ 1, 2 ] a : ${a} [ 3, 4 ] ``` -------------------------------- ### Configuring Multiple SystemD Services Source: https://github.com/hydraulic-software/conveyor/blob/master/guidebook/docs/stdlib/systemd.md Define multiple, independently managed SystemD services by picking unique file names and configuring each service's `ExecStart` command. This example shows separate frontend and backend services. ```HOCON app.linux.services { frontend-server { include "/stdlib/linux/service.conf" Service { ExecStart = ${app.linux.services.server.Service.ExecStart} --port 8888 --message "\"Hello World\"" } } backend-server { include "/stdlib/linux/service.conf" file-name = ${app.long-fsname}-backend.service Service { ExecStart = ${app.linux.services.server.Service.ExecStart} --backend-mode --port 8889 } } } ``` -------------------------------- ### Build Copied Site for Open Source Projects Source: https://github.com/hydraulic-software/conveyor/blob/master/guidebook/docs/tutorial/hare/upload-real-site.md Run the 'conveyor make copied-site' command to build and upload your site. This command ensures your installs update to the latest release. ```bash conveyor make copied-site ``` -------------------------------- ### Electron Configuration Example Source: https://github.com/hydraulic-software/conveyor/blob/master/guidebook/docs/tutorial/hare/electron.md This HOCON configuration defines settings for an Electron app, including display name, package name, update strategy, and icon path. It imports standard Electron configurations and package metadata. ```hocon include required("/stdlib/electron/electron.conf") // Import metadata from your package.json file and // which version of Electron to use. package-json { include required("package-lock.json") } app { display-name = "My Project" rdns-name = com.example.my-project site.base-url = "localhost:5000" updates = aggressive icons = icons/icon.svg } ``` -------------------------------- ### Native App conveyor.conf Example Source: https://github.com/hydraulic-software/conveyor/blob/master/guidebook/docs/tutorial/tortoise/2-create-or-adapt-a-project.md This snippet shows a typical `conveyor.conf` file for a native application. It defines application metadata, supported machines, icons, and input file mappings for different operating systems. ```javascript app { display-name = Template App // (1)! fsname = template-app // (2)! rdns-name = org.some-org.some-product version = 1 site.base-url = "localhost:8899" // (3)! machines = [ windows.amd64, linux.amd64.glibc, mac.amd64, mac.aarch64 // (4)! ] icons = "icons/icon-rounded*" // (5)! windows.icons = "icons/icon-square*" mac.inputs = [ // (6)! build/mac/installation/bin -> Contents/MacOS build/mac/installation/lib -> Contents/Frameworks ] windows.amd64.inputs = build/win/installation/bin linux.amd64.inputs = build/linux/installation } ``` -------------------------------- ### Remap Rule Precedence Example 2 Source: https://github.com/hydraulic-software/conveyor/blob/master/guidebook/docs/configs/inputs.md Shows how to invert the rule order to correctly exclude files matching a specific pattern when a general glob pattern is also present. ```plaintext ** -*/foo/*.bar ``` -------------------------------- ### Manage SWT Dependencies with Conveyor Source: https://github.com/hydraulic-software/conveyor/blob/master/gradle-plugin/README.md A sophisticated example demonstrating how to manage platform-specific dependencies for the SWT GUI toolkit. It excludes unnecessary grouping artifacts and uses a helper function to define dependencies for different platforms, integrating with Conveyor's machine-specific configurations. ```kotlin plugins { `java-library` application id("dev.hydraulic.conveyor") version "2.0" } repositories { mavenCentral() } val swt_version = "3.119.0" fun DependencyHandlerScope.swt(platformConveyor: String, platformSwt: String) { // Add the platform specific SWT dependency to the platform specific dependency configuration. add(platformConveyor, "org.eclipse.platform:org.eclipse.swt.$platformSwt:$swt_version") { // We don't need the empty grouping artifact and it gets in the way. exclude("org.eclipse.platform", "org.eclipse.swt.\\\${osgi.platform}") } } dependencies { swt("macAmd64", "cocoa.macosx.x86_64") swt("macAarch64", "cocoa.macosx.aarch64") swt("windowsAmd64", "win32.win32.x86_64") swt("linuxAmd64", "gtk.linux.x86_64") } application { mainClass.set("yourMainClass") // SWT needs this JVM flag. applicationDefaultJvmArgs = listOf("-XstartOnFirstThread") } ``` -------------------------------- ### Google Cloud Platform KMS PKCS#11 Driver Configuration File Source: https://github.com/hydraulic-software/conveyor/blob/master/guidebook/docs/configs/keys-and-certificates.md Example YAML configuration file for the Google Cloud Platform KMS PKCS#11 driver. It specifies the key ring and the certificate content. ```yaml --- tokens: - key_ring: "projects/example-project/locations/us-central1/keyRings/example-keyring" certs: - | -----BEGIN CERTIFICATE----- MIIBfDCCASOgAwIBAgIUR8kwFjcoNdDY+s2/c/fydMxysugwCgYIKoZIzj0EAwIw FDESMBAGA1UEAwwJb3NzbC10ZXN0MB4XDTIzMDkxNDE2MzUwMFoXDTMzMDkxMTE2 MzUwMFowFDESMBAGA1UEAwwJb3NzbC10ZXN0MFkwEwYHKoZIzj0CAQYIKoZIzj0D AQcDQgAEh83KrXS6bznV3G0yysO3ZHAY6pnSqGpLuTshLfAcS0bHYb5nH8q9noDY Of6vJobGk5J1wnMwoXt9xm75WVXsXaNTMFEwHQYDVR0OBBYEFKsgEQ9wY4WCMcVn SRuDn3Kl4+u1MB8GA1UdIwQYMBaAFKsgEQ9wY4WCMcVnSRuDn3Kl4+u1MA8GA1Ud EwEB/wQFMAMBAf8wCgYIKoZIzj0EAwIDRwAwRAIgEwebwA6Njw1nW/gzIT6cNHAs d4XyCB+01OfSk1Hp3TkCIEYxCEMn4oAyAJozzVyApY/Yu1/sM0Ospmh8i3P/thJK -----END CERTIFICATE----- ``` -------------------------------- ### Shell Script to Get Electron Version Source: https://github.com/hydraulic-software/conveyor/blob/master/guidebook/docs/configs/electron.md A bash script to extract the Electron version from yarn.lock using 'yarn list' and 'jq'. Requires yarn and jq to be installed. ```bash #!/usr/bin/env bash yarn list --depth=0 --json -s --no-progress 2>/dev/null | jq -r '.data.trees[] | select(.name | startswith("electron@")) | .name | split("@")[1]' ``` -------------------------------- ### Generate JVM Starter Project (JavaFX) Source: https://github.com/hydraulic-software/conveyor/blob/master/guidebook/docs/tutorial/tortoise/2-create-or-adapt-a-project.md Use this command to generate a starter project for JVM applications using JavaFX. A JDK 17 or higher is required. ```bash conveyor generate javafx com.example.my-project ``` -------------------------------- ### Generate JVM Starter Project (Compose) Source: https://github.com/hydraulic-software/conveyor/blob/master/guidebook/docs/tutorial/tortoise/2-create-or-adapt-a-project.md Use this command to generate a starter project for JVM applications using Compose. A JDK 17 or higher is required. ```bash conveyor generate compose com.example.my-project ``` -------------------------------- ### Install @hydraulic/migrate-to-conveyor for Windows Source: https://github.com/hydraulic-software/conveyor/blob/master/guidebook/docs/migrating-electron-apps.md Install the @hydraulic/migrate-to-conveyor package as a dependency for your Electron app. This utility helps in migrating Windows installations to use Conveyor-generated installers. ```shell npm i @hydraulic/migrate-to-conveyor ``` -------------------------------- ### Make Download Site Source: https://github.com/hydraulic-software/conveyor/blob/master/guidebook/docs/running.md Builds a downloadable site containing packages for all available platforms. This is useful for distributing your application widely. ```bash conveyor make site ``` -------------------------------- ### HOCON: Modular Configuration with Include Source: https://github.com/hydraulic-software/conveyor/blob/master/guidebook/docs/configs/hocon-tutorial.html Shows how to break the configuration into sub-files using the `include` statement for modularity, with the default server configuration in a separate file. ```hocon include "defaultServer.conf" devServer = ${defaultServer} { host = localhost port = 3000 } prodServer = ${defaultServer} { host = www.example.com port = 443 useSSL = true } servers = [ devServer, prodServer ] ``` -------------------------------- ### Equivalent Includes for Unknown Extension Source: https://github.com/hydraulic-software/conveyor/blob/master/guidebook/docs/configs/hocon-spec.md This demonstrates how `include "foo"` can expand to include files with different extensions. ```HOCON include "foo.properties" include "foo.json" include "foo.conf" ``` -------------------------------- ### Build App for macOS (Intel/Apple Silicon) Source: https://github.com/hydraulic-software/conveyor/blob/master/guidebook/docs/tutorial/hare/create-unpackaged-app.md Create macOS application bundles for both Intel (amd64) and Apple Silicon (aarch64) architectures. Use the `-Kapp.machines` flag to specify the target machine architecture. ```bash conveyor -Kapp.machines=mac.amd64 make mac-app ``` ```bash conveyor -Kapp.machines=mac.aarch64 make mac-app ``` -------------------------------- ### Serve Site with Caddy Server Source: https://github.com/hydraulic-software/conveyor/blob/master/guidebook/docs/tutorial/tortoise/5-serve-the-site.md If using Caddy, navigate to the output directory and run this command to serve the files. Ensure Caddy is configured to listen on port 8899 and enable directory browsing. ```bash caddy file-server --browse --listen :8899 ``` -------------------------------- ### Install @hydraulic/override-zip for macOS Source: https://github.com/hydraulic-software/conveyor/blob/master/guidebook/docs/migrating-electron-apps.md Install the @hydraulic/override-zip package as a development dependency for your Electron app. This package assists in replacing Electron Forge's default zip files with Conveyor-generated ones for macOS. ```shell npm i -D @hydraulic/override-zip ``` -------------------------------- ### Build and Serve Package Locally Source: https://github.com/hydraulic-software/conveyor/blob/master/guidebook/docs/tutorial/hare/serve-with-npx.md Build your site using conveyor and then serve the output directory locally with npx. This is useful for testing your self-updating application before deployment. ```shell conveyor make site cd output npx serve . ``` -------------------------------- ### Integrate Conveyor Windows Installer in Entry Point Source: https://github.com/hydraulic-software/conveyor/blob/master/guidebook/docs/migrating-electron-apps.md Add the @hydraulic/migrate-to-conveyor utility to the top of your Electron app's entry point script. This snippet checks if the Conveyor installer should be run and handles the migration process for Windows. ```diff const path = require('path'); if (require('@hydraulic/migrate-to-conveyor')({ // TODO: REPLACE 'my-app.exe' BELOW. windowsInstaller: path.join(__dirname, 'my-app.exe') })) return; // The rest of the code of your app. ``` -------------------------------- ### Import Custom Icons for Download Site Source: https://github.com/hydraulic-software/conveyor/blob/master/guidebook/docs/configs/download-pages.md This snippet demonstrates how to specify custom icon files for the download site, importing them from a different directory and using a pattern to match multiple sizes. ```groovy app.site { base-url = downloads.hydraulic.dev/${channel}/compose-sample icons = "../../packaging/images/icon-{32,64,128,256}.png" } ``` -------------------------------- ### Include Standard JDK Source: https://github.com/hydraulic-software/conveyor/blob/master/guidebook/docs/stdlib/jdks.md Import a standard JDK distribution from the stdlib. Replace YOUR_VERSION with a Java feature version (e.g., 11, 17) or a precise version, and YOUR_DISTRO with the distribution name (e.g., openjdk). ```HCL include required("/stdlib/jdk/YOUR_VERSION/YOUR_DISTRO.conf") ``` -------------------------------- ### Object Concatenation Examples Source: https://github.com/hydraulic-software/conveyor/blob/master/guidebook/docs/configs/hocon-spec.md Demonstrates different ways to define an object, including merging multiple object definitions. ```hocon a : { b : 1, c : 2 } ``` ```hocon a : { b : 1 } { c : 2 } ``` ```hocon a : { b : 1 } a : { c : 2 } ``` -------------------------------- ### Get Current Application Version Source: https://github.com/hydraulic-software/conveyor/blob/master/guidebook/docs/control-api-jvm.md Retrieves the current version of the application. Handle the null case where the version is not available. ```java SoftwareUpdateController.Version currentVersion = controller.getCurrentVersion(); if (currentVersion == null) { // Handle the case where current version is not available return; } ``` -------------------------------- ### Get SoftwareUpdateController Instance Source: https://github.com/hydraulic-software/conveyor/blob/master/guidebook/docs/control-api-jvm.md Obtain an instance of the SoftwareUpdateController. Returns null if the app is not running inside a Conveyor package. ```java import dev.hydraulic.conveyor.control.SoftwareUpdateController; SoftwareUpdateController controller = SoftwareUpdateController.getInstance(); ``` -------------------------------- ### Set Timestamping Server URL Source: https://github.com/hydraulic-software/conveyor/blob/master/guidebook/docs/configs/windows.md Specify the URL for a cryptographic timestamping server. The URL must start with `http://`. ```toml app.windows.timestamping-server = "http://timestamp.example.com" ``` -------------------------------- ### Exporting a multi-line string Source: https://github.com/hydraulic-software/conveyor/blob/master/guidebook/docs/configs/download-pages.md Example of exporting a multi-line string to metadata.properties. The newline characters will be escaped and leading whitespace stripped in the output. ```properties release-notes = """ New feature: We've integrated AI and blockchain to make your work really fizz! Also - bug fixes. " app.site.export-keys += release-notes ``` -------------------------------- ### Adding Files and Directories Source: https://github.com/hydraulic-software/conveyor/blob/master/guidebook/docs/configs/inputs.md Use 'app.inputs' to add files or directories. Globs are supported, but relative paths are not preserved. Files are placed in the app directory by default. ```properties app.inputs += path/to/a/file app.inputs += path/to/a/directory app.inputs += /opt/foo/bar/*.sh ``` -------------------------------- ### Conveyor Configuration Example Source: https://github.com/hydraulic-software/conveyor/blob/master/guidebook/docs/tutorial/hare/native.md This HOCON configuration defines application metadata, version, site URL, and input mappings for different machine architectures. ```hocon app { display-name = "My Project" fsname = "my-project" version = 2 site.base-url = "localhost:3000" rdns-name = "com.example.my-project" machines = [windows.amd64, linux.amd64.glibc, mac.amd64, mac.aarch64] icons { label = "GL" } mac.inputs = [ build/mac/installation/bin -> Contents/MacOS build/mac/installation/lib -> Contents/Frameworks ] windows.amd64.inputs = build/windows/installation/bin linux.amd64.inputs = build/linux/installation } ``` -------------------------------- ### Configure Download Site Generation Source: https://github.com/hydraulic-software/conveyor/blob/master/guidebook/docs/configs/download-pages.md This snippet shows the main configuration for the 'site' task, including display name, base URL for updates, input files, icons, metadata export, custom headers, SFTP copy destination, flat directory structure, and the Conveyor badge. ```groovy app.site { display-name = Title of the web page. # Where the installed packages can check for online updates. base-url = somesite.com/downloads # Import an HTML template or additional files to the generated site. inputs += "my-template-dir/*" -> . # Change the set of images used for the logo, as found in the resolved inputs. icons = "my-icons-*.png" # Which keys appear in the metadata.properties file in the generated site. export-keys = [ app.version, app.revision ] # HTML to add into the
area. extra-header-html = """ """ # Directory to upload/copy the site to over SFTP. copy-to = "//user@myserver.com/var/www/downloads" # If set, controls whether the Debian packages and apt files go into a # subdirectory or not. If not set this is inferred automatically. # You should normally never need to set this. flat = true/false # Whether to show the "Packaged by Conveyor" badge at the bottom of the download page. # Can only be disabled for commercial products. # Open source projects are required to advertise the fact that they're packaged with Conveyor. show-conveyor-badge = true # If you need to move your download site to a different URL, set this so your # users automatically get updated to the new location. move-from { base-url = old-site.com/downloads copy-to = "//user@myserver.com/var/www/old-downloads" } } ``` -------------------------------- ### Array Concatenation with Unquoted Strings Source: https://github.com/hydraulic-software/conveyor/blob/master/guidebook/docs/configs/hocon-spec.md Example of array concatenation involving unquoted strings and substitutions, where whitespace significance depends on the resolved type. ```hocon [ This is an unquoted string my name is ${name}, Hello ${world} ] ``` ```hocon [ ${a} ${b}, ${x} ${y} ] ``` -------------------------------- ### HOCON: Object Inheritance with Substitution Source: https://github.com/hydraulic-software/conveyor/blob/master/guidebook/docs/configs/hocon-tutorial.html Illustrates removing root braces and defining a default server configuration using object inheritance with substitution. ```hocon defaultServer { port = 80 useSSL = false } devServer = ${defaultServer} { host = localhost port = 3000 } prodServer = ${defaultServer} { host = www.example.com port = 443 useSSL = true } servers = [ devServer, prodServer ] ``` -------------------------------- ### Server Control Dependencies Source: https://github.com/hydraulic-software/conveyor/blob/master/guidebook/docs/tutorial/tortoise/2-adapt-a-server.md Specifies the required dependencies for a server control component, including PostgreSQL and a specific Java version. Ensure these are installed before proceeding. ```hcl control { Depends: "postgresql (>= 12), java-11-amazon-corretto-jdk" } } } // You will need to point this to somewhere, as all Conveyor packages expect an update site at the moment. site.base-url = "localhost:1234" ``` -------------------------------- ### Build App for Windows Source: https://github.com/hydraulic-software/conveyor/blob/master/guidebook/docs/tutorial/hare/create-unpackaged-app.md Generate a Windows application bundle. This command is specific to building for the Windows platform. ```bash conveyor make windows-app ``` -------------------------------- ### Configure Application Icons Source: https://github.com/hydraulic-software/conveyor/blob/master/guidebook/docs/tutorial/hare/generate-icons.md Set the `app.icons` key in your configuration to define custom icon properties. This example sets the label to 'XY' and the gradient to 'blue'. ```hcl app { icons { label = XY gradient = blue } } ``` -------------------------------- ### HOCON String Interpolation Example Source: https://github.com/hydraulic-software/conveyor/blob/master/guidebook/docs/troubleshooting/troubleshooting-builds.md Demonstrates how HOCON interpolates values from one key to another. Substitutions must be outside quoted strings to be processed. ```hocon b = bar a = ${b} c d "!!!" // equivalent to a = "bar c d !!!" ``` -------------------------------- ### Get Application User Model ID (AUMID) Source: https://github.com/hydraulic-software/conveyor/blob/master/guidebook/docs/configs/windows.md Use the Conveyor CLI to retrieve the AUMID for your application. This command outputs the AUMID to standard output. ```shell conveyor make app-user-model-id ``` -------------------------------- ### Disable Automatic Updates on macOS (All Apps) Source: https://github.com/hydraulic-software/conveyor/blob/master/guidebook/docs/faq/index.md Use this command to disable update checking for all newly installed applications on macOS. This prevents the user from being prompted about updates. ```bash defaults write -g SUEnableAutomaticChecks -bool NO ``` -------------------------------- ### Basic Icon Configuration Source: https://github.com/hydraulic-software/conveyor/blob/master/guidebook/docs/configs/icons.md Configure icon files using glob patterns for PNG or SVG formats. ```HOCON app.icons = "myapp-icon-*.png" app.icons = "myapp-icon.svg" ``` -------------------------------- ### Place Files Relative to Root Source: https://github.com/hydraulic-software/conveyor/blob/master/guidebook/docs/configs/linux.md Add files to specific locations in the root filesystem, bypassing the prefix or install path. Always set the destination location. ```properties app.linux.root-inputs += extra.conf -> /etc/extra.conf ``` -------------------------------- ### Remap Rule Precedence Example 1 Source: https://github.com/hydraulic-software/conveyor/blob/master/guidebook/docs/configs/inputs.md Demonstrates how glob patterns affect rule precedence. Rules with longer non-glob parts are more specific. '**' is the least specific. ```plaintext -*/foo/*.bar ** ```