Operations
The operations are prepared by component and controller scripts and performed by the installer.
Note: Operations are performed threaded.
Internally, each operation has a DO step that contains instructions for the installer and an UNDO step that contains instructions for the uninstaller.
Summary of Operations
The following table summarizes the available operations and their syntax.
| Operation | Syntax | Use | 
|---|---|---|
| Copy | "Copy" sourcetarget | Copies a file from sourcetotarget. | 
| Move | "Move" sourcetarget | Moves a file from sourcetotarget. | 
| SimpleMoveFile | "SimpleMoveFile" sourcetarget | Moves a file from sourcetotarget. | 
| Delete | "Delete" filename | Deletes the file specified by filename. | 
| Mkdir | "Mkdir" path | Creates the directory path path. | 
| Rmdir | "Rmdir" path | Removes the directory path path. | 
| CopyDirectory | "CopyDirectory" sourcePathtargetPath | Copies a directory from sourcePathtotargetPath. | 
| AppendFile | "AppendFile" filenametext | Appends textto the file specified byfilename.textis treated as ASCII text. | 
| PrependFile | "PrependFile" filenametext | Prepends textto the file specified byfilename.textis treated as ASCII text. | 
| Replace | "Replace" filesearchreplace | Opens fileto findsearchstring and replaces that with thereplacestring. | 
| LineReplace | "LineReplace" filesearchreplace | Opens fileto find lines that start withsearchstring and replaces that with thereplacestring. Lines are trimmed before the search. | 
| Execute | "Execute" [{ exitcodes}]command[parameter1[parameter...[parameter10]]] | Executes the command specified by command. Up to 10 parameters can be passed. If that is not enough, you can use a JavaScript string array.Optionally, you can pass a comma-separated list of exit codes within curly brackets ({}) as the first argument to specify the exit codes for successful execution. This defaults to "{0}". Other optional named arguments are: "workingdirectory=<your_working_dir>"; "errormessage=<your_custom_errormessage>" In addition, a special argument, UNDOEXECUTE, separates the DO step of the operation from the UNDO step. Example:  | 
| CreateShortcut | "CreateShortcut" filenamelinkname[arguments] | Creates a shortcut from the file specified by filenametolinkname. On Windows, this creates a .lnk file which can havearguments. Furthermore, on Windows,filenamecan be an HTTP or FTP URL in which case a URL shortcut is created. On Unix, this creates a symbolic link. | 
| CreateDesktopEntry | "CreateDesktopEntry" filename "key=value[ key2=value2[ key3=value3]]]" | Creates a .desktop initialization file, as specified by freedesktop.org. If  The key-value pairs are written to the file. The file is set to use UTF-8 encoding. | 
| InstallIcons | "InstallIcons" directory[Vendorprefix] | Installs the contents of directoryinto a location, as specified by freedesktop.org. That is, into$XDG_DATA_DIRS/icons,/usr/share/icons, or$HOME/.icons. The files are removed from their initial location. Make sure to add this operation after the operation that extracts the files from the archive. If you provide aVendorprefixit replaces all characters up to the first dash (-) in the filename of the icon with this prefix. | 
| Extract | "Extract" archivetargetdirectory | Extracts archivetotargetdirectory. | 
| GlobalConfig | "GlobalConfig" companyapplicationkeyvalueor "GlobalConfig"  or "GlobalConfig"  | Stores valueforkeyin a configuration file. The configuration file is specified either byfilename(usingQSettings::NativeFormat, which might be the Windows registry) or byapplicationandcompanyname. Setscopeto "SystemScope" to create an entry in the system scope.Note: The operation is using QSettings to store the key value pair. QSettings always treats backslash as a special character and provides no API for reading or writing such entries. Do not use slashes ('/' and '') in section or key names; the backslash character is used to separate sub keys. On windows, '' are converted by QSettings to '/', which makes them identical. Because the backslash character is used by QSettings to separate sub keys, you cannot read or write windows registry entries that contain slashes or backslashes. You should use a native windows API if you need to do so. | 
| EnvironmentVariable | "EnvironmentVariable" keyvalue[persistent[system]] | Sets the environment variable keytovalue. Ifpersistentis set totrue, the variable is set persistently. This is currently only supported on Windows. Ifsystemis set totrue, the persistent variable is set system-wide, not only for the current user. | 
| RegisterFileType | "RegisterFileType" extensioncommand[description[contentType[icon]]]. | Registers the file type with extensionto be opened viacommand. Optionally, you can specifydescription,contentType, andicon. This is currently only supported on Windows. | 
| ConsumeOutput | "ConsumeOutput" installerKeyNameexecutablePathprocessArguments | Saves the output from running the executable located at executablePathwith the argumentsprocessArgumentsto the installer key specified byinstallerKeyName. Additional arguments can be passed. | 
| CreateLink | "CreateLink" linkPathtargetPath | Creates a link from the location specified by linkPathto the location specified bytargetPath. | 
| CreateLocalRepository | "CreateLocalRepository" binaryPathrepoPath | Creates a local repository in the directory specified by repoPath. For offline installers, stores binary data in the directory specified bybinaryPath. | 
| FakeStopProcessForUpdate | "FakeStopProcessForUpdate" processlist | Matches running processes against the comma-separated entries in processlistduring uninstallation. If matches are found, shows a messagebox asking the user to stop those processes before continuing. | 
| License | "License" licenses | Copies the license files specified by licensesto a subfolder calledLicensesin the target directory. This operation is automatically added for packages declaring<Licenses>in their package description file. | 
| MinimumProgress | "MinimumProgress" | Increases the progress value by one. | 
| SelfRestart | "SelfRestart" core | Restarts the updater or package manager specified by core. | 
| Settings | "Settings" pathmethodkeyaValue | Sets or removes the value aValueofkeyin the settings file or registry located atpath, depending on the value ofmethod:set,remove,add_array_value, andremove_array_value. | 
The Extract, License, and MinimumProgress operations are automatically added for matching components that do not overwrite the component::createOperations() method. See also component::autoCreateOperations.
If errors occur, you can test operations manually using the devtool. However, variables are not resolved, so you need to use absolute values.
For example, to test copying a file:
devtool --operation DO,Copy,<source>,<target>