Modify Variable
Modifies the text of the variable with various actions.
Description
Optionally, you may add comments here describing the purpose of this element.
Variable name
The name of the variable the result string will be written to.
myvalue
Initial text
The initial text that will be processed. It can be empty, in this case, the current value of the variable will be processed.
Substitute Variable Values
No - There will no replace in #varname# variables.
Everywhere - All #varname# variables are replace by their value.
Only in the Initial value - Only replace #varname# variables in the Initial value to their value.
Only in the List - Only replace #varname# variables in the list to their value.
Only in the Variable Name and Initial value - Only replace #varname# variables in the Variable Name and Initial value to their value.
Only in the List and Initial value - Only replace #varname# variables in the List and Initial value to their value.
Modify Variable command
Action
String and numeric functions.
Add - Add the number defined in Additional parameter. Add 1 if the additional parameter is empty.
Append - Append the line defined in Additional parameter.
BOM characters - Remove or add marker characters at the beginning of UTF-8 and Unicode texts.
Calculate Hash - calculate a hash-value with MD5 algorithm for the value of the specified variable or the initial value.
Data formatting - Converting/formatting number data.
Delete duplicate letters - If there are some duplicateletters defined in Additional parameter, the function leaves only one letter.
Delete from beginning - Delete letters at the beginning of the text. The amount is defined in Additional parameter.
Delete from end - Delete letters at the end of the text. The amount is defined in Additional parameter.
Delete letters - Delete any letters from the text.
Delete substring - Delete a substring. The offset and the length are defined in Additional parameter as offset,length.
Divide - Divide by the number defined in Additional parameter.
Duplicate letter - Duplicate letters defined in Additional parameter.
Encoding - Encode the text of the variable.
Get [Filename] - Get a filename only if the initial text is a full path filename. You can also get a full path to the file, its name and extension. For this, you need to define the additional parameter.
Insert at the beginning - Insert a string defined in Additional parameter at the beginning of the text.
Length - Do nothing but it writes the current length of the variable to [varname]len.
Lower - Convert the string to lower case.
Modulo - The remainder of two positive integer divisions.
Multiply - Multiply by the number defined in Additional parameter.
Replace Environment Variables - Replace environment variables like %EnvVar%.
Replace letter - Replace letter defined in Additional parameter.
Substring - Get a substring. The offset and the length are defined in Additional parameter as offset,length.
Subtract - Subtract the number defined in Additional parameter. Subtract 1 if the additional parameter is empty.
Trim - Trim the end spaces and system symbols. Also you can trim any characters.
Upper - Convert the string to upper case.
Additional parameter
Specify an additional parameter depending on action. If you want to specify a space letter then specify #space#.
for Add - the number.
If you use Add, Divide, Multiply, Subtract function, add the letter D, after the number, if you want to display data with decimal accuracy. (example: 1024/100D = 10.24 )
for Append - the string which you want to append.
for Calculate Hash - specify noutf, if you want that the value is not encoded to UTF-8.
for Data formatting - Set the length and accuracy of a number data. Specify values Parameter,Mode,Flag, divided by the comma.
Parameter: Specify the minimum length of the data here. (example: 2 or 5 or 6.2)
Mode: [i] = +/- Decimal number. [u] = Unsigned decimal number. [x][X] = Hexadecimal number. [f] = Decimal floating point. [v] = Version number. [s] = Size conversion from byte -> KB,MB,GB,TB.
Flag: [0]
See the following examples:
Input Number => Values => Result 154 => 5,i,0 => 00154 //min. 5 characters, with 0 on the left. 154 => 5,i,+0 => +0154 //min. 5 characters, with positive numbers + sign, 0 on the left. 154 => 11,f,0 => 0154.000000 //min. 11 characters, 6 decimal places accuracy, 0 on the left. 154 => 8.2,f,0 => 00154.00 //min. 8 characters, right side 2 decimal places accuracy, 0 on the left. 154 => 4,x,0 => 009a //min. 4 characters, hexadecimal number (lowercase), 0 on the left. 154 => 5,X,#0 => 0x09A //min. 5 characters, hexadecimal number (uppercase), 0x and 0 on the left. 0x09a => 2,i,0 => 154 //min. 2 characters, decimal number, 0 on the left. 8.4.2.12 => 3,v,0 => 8.4.2 //Version number, conversion to 3 parts. 8.4.2 => 4,v,0 => 8.4.2.0 //Version number, conversion to 4 parts. 32567 => 1,s,0 => 31.8 KB //Size conversion from byte.
For size conversion, the Parameter is the number of maximum decimal places, if Flag 0, unit is displayed in the installer's language if available. If 1 is always English.
for Delete letters - You can delete any letter. If you define the variable #space#, the 0x20 value will be removed. If you define the variable #tab#, the 0x9 value will be removed. If you define the variable #nl#, the 0D0A value will be removed. You can specify the #nr# as 0D, or the #nn# as 0A, as a character to delete. But it will not affect the combination '0D0A'.
for Deleting from beginning - number of letters to be deleted.
for Deleting from end - number of letters to be deleted.
for Deleting duplicate letters - a letter. If you specify #nl#, will be deleted duplicates of '0D0A'.
- A---A => A-A
for Dividing - the number.
for Duplicate letter - a letter. If you specify #nl#, then '0D0A' will be duplicated.
\ c:\temp => c:\\temp
for Encoding - specify utf-8 to encode the text to UTF-8. If you want to convert UTF-8 encoded text, specify -utf-8. To convert UTF-8 text to Unicode text, specify utf-uni to convert Unicode text to UTF-8 text, specify uni-utf.
for BOM characters - to remove the file markers from the text, specify nobom. If you want to add file markup characters, specify utf-8 or unicode. Be careful only add the markers to the corresponding files!
for Insertion at the beginning - a string to be inserted at the beginning of the text.
for Modulo - the number.
for Multiplication - the number.
For Get [Filename] – You can get the directory where a file is located, as well is its name (without extension) and the file’s extension. For this specify the names of the variables, to which corresponding values will be written, separated by commas. If, for example, only one variable will be specified, then the directory where the file is located will be written there.
filepath,filename,fileext
for Replacing letter - a pair of letters. The function replaces the left letter with the right letter. You can specify the #nr# as 0D, or the #nn# as 0A, as a character to replace. If you want to replace the 0D to 0A, please specify the #nr##nn#, if you want to replace the 0A to 0D, please specify the #nn##nr#. But it will not affect the combination '0D0A'.
#space#- A B C => A-B-C
for Substring - the offset and the length are divided by the comma.
if the string = This is a string 2,7 =>is is a
for Delete a Substring - the offset and the length are divided by the comma.
if the string = This is a string 2,7 =>Th string
for Subtraction - the number.
for Trim - 'L' - trim on the left or 'R' - trim on the right. Otherwise, the function trims both on the left and on the right side. You can specify a character which you want to trim. For example, LA - trims 'A' characters on the left, R0 - trims zero on the right.
If Condition
You can specify a condition that should be met for the action to be performed. If the condition is false then the command is skipped. See How to use If Condition for more details.
Comment
You can add a comment for this setting here.