On Windows, if the version number contains parenthesis ie "1.0 (3) _32 bits", the updater script fails when trying to start the updated app. This happens in the last If block:
The %APP_VERSION% variable is expanded before the code block is executed and the parenthesis make the entire block fail.
Adding setlocal enabledelayedexpansion and refering to the variable with!APP_VERSION! enables the variable to be expanded only when the specific line is executed, and not then the block code is evaluated, thus solving the problem.
On Windows, if the version number contains parenthesis ie "1.0 (3) _32 bits", the updater script fails when trying to start the updated app. This happens in the last If block:
The %APP_VERSION% variable is expanded before the code block is executed and the parenthesis make the entire block fail.
Adding
setlocal enabledelayedexpansion
and refering to the variable with!APP_VERSION!
enables the variable to be expanded only when the specific line is executed, and not then the block code is evaluated, thus solving the problem.