My current installer uses a lot of string manipulation functionality. I'm trying to port it to InstallBuilder but can't find any documentation that will support what I need to do. Can you point me to a list?

Here's what I'm doing in tcl:

regexp (\d+\.)(\d+\.)(\d+\.)(\d+) ${InstallVersion} all a b c build_number

set padded_build_number [format %05d $build_number]

I was able to split the installversion into the 4 variables using 4 setInstallerVariableFromRegEx statements, but can't find a way to pad the last. Any help would be appreciated!

Thanks

asked 09 Nov '12, 11:09

danish's gravatar image

danish
1393940
accept rate: 0%


Once you have the build_number, you could use the below code to pad it:

<setInstallerVariableFromRegEx>
    <name>padded_build_number</name>
    <pattern>.*(.{5}$)</pattern>
    <substitution>\1</substitution>
    <text>00000${build_number}</text>
</setInstallerVariableFromRegEx>

That will prepend the number with zeros and then take the last 5 digits

link

answered 09 Nov '12, 11:54

juanjo's gravatar image

juanjo ♦♦
5.8k413
accept rate: 23%

Thanks, that works!

(09 Nov '12, 12:17) danish
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×13
×5

Asked: 09 Nov '12, 11:09

Seen: 1,110 times

Last updated: 09 Nov '12, 12:17