# VB6 Versioning

**URL:** https://www.finalbuilder.com/forums/t/vb6-versioning/104
**Category:** Discussion
**Created:** [June 6, 2006, 4:59am UTC](https://www.finalbuilder.com/forums/t/vb6-versioning/104 "2006-06-06T04:59:51Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)
#### Post date: [June 6, 2006, 4:59am UTC](https://www.finalbuilder.com/forums/t/vb6-versioning/104/1 "2006-06-06T04:59:51Z")

</div>

using v4.1.0.228 on Windows Server 2003, SP1:  
  
while trying to update the versioning during build time, i would like to use an INI to set the version information on the projects.  
  
the help alludes to the ability to use variables to set the versioning, but the version fields don't allow the entry of variables.   
  
how are the variables used for this type of requirement?  
  
thx!

---

<div class="post-metadata">

### Author: ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)
#### Post date: [June 7, 2006, 12:48pm UTC](https://www.finalbuilder.com/forums/t/vb6-versioning/104/2 "2006-06-07T12:48:52Z")

</div>

You can set the values using a few lines of VBScript in the BeforeAction script event :  
  
Action.MajorVersion = MyMajorVersionVariable  
Action.MinorVersion = MyMinorVersionVariable  
Action.RevisionVersion = MyRevisionVersionVariable  
  
HTH

---

<div class="post-metadata">

### Author: ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)
#### Post date: [July 27, 2006, 7:32am UTC](https://www.finalbuilder.com/forums/t/vb6-versioning/104/3 "2006-07-27T07:32:12Z")

</div>

I am trying to have FinalBuilder increment the version number of the dll it is about to compile.\<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /\>

My workflow was going to go something like this:

·Check if current(old) dll exists

·If it does

oExtractVersionInfo (to get version of dll I am about to replace)- stored as VSNINFO

oParse VSNINFO into a property set.

oContinue on…

The problem I am having is that the function ExtractReleaseVer seems to choke on VB6 version numbers obtained through using ExtractVersionInfo property. The major and minor extraction is fine, but I get a type mismatch on release. Two questions on this:

1. Is this a bug? I mean I can write my own version parser in VBScript- I just wanted to know if I am using this correctly.

2. Is there a better workflow for a. finding current version info, b. incrementing it?

Thanks,

Owen

---

<div class="post-metadata">

### Author: ![angus](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/a/b3f665/32.png) [@angus](https://www.finalbuilder.com/forums/u/angus)
#### Post date: [July 28, 2006, 2:40am UTC](https://www.finalbuilder.com/forums/t/vb6-versioning/104/4 "2006-07-28T02:40:25Z")

</div>

Hi Owen,  
  
At the moment the “best practices” method is probably to store the version numbers in an ini file and use the PropertySet From INI File and PropertySet Save To INI File actions. We do have an action to directly extract property set version info from a dll/exe on the “to-do” list, but it’s unfortunately not available yet.  
  
However, the method you are using should work fine. What is the exact value of the VSNINFO variable? (you can find out by inserting Action.SendLogMessage(VSNINFO) in the AfterAction event of the Extract Version Info action.)  
  
Hth.  
  
- Angus

---

<div class="post-metadata">

### Author: ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)
#### Post date: [August 8, 2006, 9:17am UTC](https://www.finalbuilder.com/forums/t/vb6-versioning/104/5 "2006-08-08T09:17:26Z")

</div>

Thanks Angus.  
  
I was able to work around this by doing the following:  
  
-Extract Version Info  
 Sets the variable 'PRJ\_BIN\_VSN\_OLD' to the extracted version number  
  
-After Action script  
 Parses the version info from the variable into discreet variables for each part of the version:  
  
 Dim arrStrSplit  
 arrStrSplit = Split(PRJ\_BIN\_VSN\_OLD,".")  
 MajorVSN = Right(arrStrSplit(0),1)  
 If (UBound(arrStrSplit) \> 0) Then  
 MinorVSN = Right(arrStrSplit(1),1)  
 Else  
 MinorVSN = "0"  
 End If  
 If (UBound(arrStrSplit) \> 1) Then  
 RevisionVSN = Right(arrStrSplit(2),1)  
 Else  
 RevisionVSN = "0"  
 End IF

VSN\_NAME\_OLD = MajorVSN & "." & MinorVSN & "." & RevisionVSN  
  
-PropertySet assign properties  
 Set VSN\_PS property set to my discreet variables:  
 MajorVersion = %MajorVSN%  
 MinorVersion = %MinorVSN%  
 RevisionVersion = %RevisionVSN%  
  
We essentially just roll every version type up one from 0 to 9, I just have a bunch of if statements for each version type that run through (If %RevisionVSN% \< 9 etc...) that increment it.  
  
I've only gotten through VB6 projects so far, and it seems to work. Am looking at .NET versioning now.  
  
Thanks again,  
  
Owen
