Skip to main content

Using Placeholders in Script Editors for Custom Software Uploader

Updated today

This article lists the placeholders supported in the script editors for custom software uploads in Swif. These placeholders are automatically replaced with the appropriate values during deployment, making your scripts more portable and secure.

You can use these placeholders in the script editors for custom software uploads, including:

  • Pre-install script

  • Post-install script

  • Install check script

  • Uninstall check script


Placeholder for Custom Software → Script Editor

Placeholder in Custom software → Script editor

Description

Example Usage

Supported Platforms

Notes

{{URL}}

The download URL of the uploaded installer file for this custom software package.

curl {{URL}} -o /tmp/installer.zip

macOS, Windows, Linux → Custom software → Any script editor

Commonly used in pre-install and post-install scripts to download and install the package.


Usage Notes

  • Placeholders must be written exactly as shown
    Use the exact casing and brace format ({{URL}}) with no extra spaces or typos. Variants like {{ url }} or {URL} will not be replaced.

  • Multi-line scripts are fully supported
    All instances of supported placeholders are replaced, even when they appear multiple times or across multiple lines.

  • Inside comments or quoted strings
    Placeholders are replaced even when they appear inside comments or quoted strings. For example:

    echo "Downloading from {{URL}}" # This script will fetch from {{URL}}

    Both occurrences of {{URL}} will be replaced before the script runs on the device.

  • Behavior if placeholders are not used
    If you do not use placeholders, the script executes as a normal script with no special handling.

  • Supported script types
    The {{URL}} placeholder is supported in all script editors for custom software uploads, including:

    • Pre-install

    • Post-install

    • Install check

    • Uninstall check
      (Unless otherwise noted in the Swif UI.)


Example Script Using {{URL}}

#!/bin/sh

# Download the installer file associated with this custom software
curl {{URL}} -o /tmp/installer.pkg

# (Optional) verify or inspect the downloaded file here

# Install the package (example for macOS .pkg)
sudo installer -pkg /tmp/installer.pkg -target /

# Perform any additional post-install configuration as needed
echo "Installation completed from {{URL}}"

This example:

  1. Uses the {{URL}} placeholder to download the installer associated with the custom software.

  2. Installs the downloaded package.

  3. Logs a simple message indicating completion.

You can adapt the commands to match your installer format and target platform (for example, using unzip, msiexec, or other tools).


Placeholders for Command Scripts

If you are looking for placeholders used in command scripts (for device commands rather than custom software uploads), see this public help article:


Related Help Articles


Did this answer your question?