-
Notifications
You must be signed in to change notification settings - Fork 1
Variables and Scripting
You can use variables and a limited scripting logic within the wrapper. You can use the square brackets ([ and ]) to create your code.
To access environment variable you just write them between square brackets. All environment variables can be referenced this way.
[APPDATA]: Is the same as %APPDATA%.
[USERPROFILE]: Is the same as %USERPROFILE% (which is the home of the user directory).
You can reference arguments by using special keywords within the wrapper:
[ARGS]: The argument string as it was given to the application.
[RESOLVED_ARGS]: The argument string but all type of logic that was in it is resolved (You can use this to parse wrapper code within arguments).
[ARGS|Argument]: This can be used to access a certain argument. In this case the value of the parameter argument is resolved.
You can resolve the path to the application directory or the running wrapper file by using the special variables EXENAME and APPDIR:
[APPDIR]: This will resolve to the application directory.
[EXENAME]: This will resolve to path of wrapper executable.
You can change the extension of a file by using the function CHANGEEXTENSION.
[CHANGEEXTENSION|Path to the file|newext]: This change the extension of the referenced file to .newext.
You can retrive a specific value from the registry by using the function RETRIVEFROMREGISTRY. The function retrives a value from the registry if it is set or returns a default value if the registry entry can does not exist.
RETRIVEFROMREGISTRY is usefull to apply policy settings that are configured by a group policy or a mobile device management solution like Microsoft Intune.
[RETRIVEFROMREGISTRY|Registry Hive|Registry Key|Attribute|Default Value]
- Registry Hive: This can be HKLM if the registry hive the HKEY_LOCAL_MACHINE or HKCU for HKEY_CURRENT_USER.
- Registry Key: The path to the key within the registry hive.
- Attribute: The attribute under the specified registry key.
- Default Value: A value that is returned if the value can not be retrived.
[RETRIVEFROMREGISTRY|HKCU|SOFTWARE\Policies\MyApp\MyConfig|MyAttribute|DefaultValue]: This function will retrive the attribute `MyAttribute` from the registry key `HKEY_CURRENT_USER\SOFTWARE\Policies\MyApp\MyConfig`. If the value is not defined the function will return the value `DefaultValue`.