Link

Create shortcuts.

Fields

source_file

The source file path, supports relative and absolute paths.

  • Type: String
  • Example: source_file = "code.exe"
  • Validation rules:
    • Is a valid path

target_name

Optional The shortcut name, supports using the FOLDER/NAME pattern to indicate placing the shortcut in the folder at the creation location.

  • Type: String
  • Example:
    # Create shortcut target_name = "Visual Studio Code" # Create shortcut in directory target_name = "Microsoft/Visual Studio Code"
  • Validation rules:
    • Matches the pattern NAME or FOLDER/NAME
    • Does not contain ..
    • Does not end with .lnk

target_args

Optional The startup parameters for the shortcut.

  • Type: String
  • Example: target_args = "--debug"

target_icon

Optional The shortcut icon.

  • Type: String
  • Example: target_icon = "./icons/code.ico"

at

Optional The creation location.

  • Type: Vec<String Enum>
  • Valid values for elements: Desktop StartMenu , default value: ["Desktop"]
  • Example: at = ["Desktop", "StartMenu"]

Reverse Steps

Delete the generated shortcut.

Manifest

  • If source_file points to a relative path, that path is included in the manifest

Permissions

  • Type: link_desktop
  • Level: Normal
  • Target: Shortcut name, target_name or automatically generated by the path
  • Scenario: When at contains "Desktop"

  • Type: link_startmenu
  • Level: Normal
  • Target: Shortcut name, target_name or automatically generated by the path
  • Scenario: When at contains "StartMenu"