How to change the number in the string script?

Hi, the question is, is there a script for InnoSetup that the registry adds the instance number of the installer. I want to write a script in Python that will installers to collect with different numbers. I can not figure out how to conveniently change the number, it is located in the row and looks like a ValueName: "InstallID"; ValueData: "8" and the number 8 should be changed to the other. at least in order. How to do it better? one of the obvious options - too much to write and the regular season. Second never did, first not good in the shower comments
June 26th 19 at 14:06
2 answers
June 26th 19 at 14:08
Solution
Used this method when I had to collect a lot of installers in InnoSetup with different settings that should have been changed in the script itself .iss.
When you create the installer (call ISCC.exe) to pass in custom parameters that can be used inside the script. All such parameters are passed in the form /dMY_PARAM = param_value. Ie /d is a mandatory part of the standard, then it must contain the name that you specify. In the script, these parameters can be treated as {#MY_PARAM}. Without d.
For example, the complete command line to the build script might look like this:
ISCC.exe /dMY_PARAM_1 = 123.44 /dMY_PARAM_2 = "hello" myscript.iss
Inside myscript.iss values of these parameters can be used like this:
{#MY_PARAM_1} and {#MY_PARAM_2}
here I didn't know that, thank you! this solves all my problems much more elegant! - magnolia_VonRueden13 commented on June 26th 19 at 14:11
June 26th 19 at 14:10
Oak solution.
import re
string = 'ValueName: "InstallID"; ValueData: "8"'
number = "12"
print(re.sub('ValueData: "[0-9]*"', 'ValueData: "{}"'.format(number), string))
and that it is oak? - magnolia_VonRueden13 commented on June 26th 19 at 14:13
the regular season koryavenko - magnolia_VonRueden13 commented on June 26th 19 at 14:16

Find more questions by tags Python