Kinook Software Forum

Go Back   Kinook Software Forum > Visual Build Professional > [VBP] General Discussion
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 02-19-2004, 12:32 PM
garyb@se.rr.com garyb@se.rr.com is online now
Registered User
 
Join Date: 02-19-2004
Location: Saint Augustine, FL
Posts: 21
Question Build Numbers

When I generate a build of my application (which contains several ActiveX Dll's and an ActiveX EXE Server), I want all my build/version information the same through out all the modules.

I am currently using the %BUILD_NUM% variable which works great, but I sometimes forget to set it.

My Builds are versioned by Generation (first Number), Year of existance (second number) and Month & Day as the third set of numbers. So it would look like "2.6.0219" which tells me that it is generation 2, year 6 and was built on Feburary 19th.

What I would like to do is automate the last set of numbers in case I forget to set them so %build_num% variable looks like "2.6.mmdd".

Can anyone suggest a way to do this (perhaps using the VBScripting)?

Thank you....
Gary Bouchard
Reply With Quote
  #2  
Old 02-19-2004, 08:59 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
Create a project script function based on the system script function vbld_FormatDate, including only the month/day, i.e.:

Function FormatMonthDay()
' returns the current date in the form MMDD

Dim dte

dte = Now
FormatMonthDay = vbld_PadLeft(CStr(Month(dte)), 2, "0") & _
vbld_PadLeft(CStr(Day(dte)), 2, "0")
End Function


Then, the build number value becomes

2.6.[FormatMonthDay()]
Reply With Quote
  #3  
Old 02-20-2004, 11:06 AM
garyb@se.rr.com garyb@se.rr.com is online now
Registered User
 
Join Date: 02-19-2004
Location: Saint Augustine, FL
Posts: 21
Unhappy

Thanks for the Info..

I had found something similar yesterday that I tried, and it did mark my version numbers correctly, however I use that same variable ("Build_Num") and automation to create a release in InstallShield Dev. 8 sp2, but the new installshield project becomes;

"2.6.[vbld_FormatMD]" so it appears that the variable does not get the proper information passed to installshield.

Another way perhaps?
Reply With Quote
  #4  
Old 02-20-2004, 11:19 AM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
Can you provide a sample of the scenario where the script code in brackets is not being interpreted as such? Thanks.
Reply With Quote
  #5  
Old 02-20-2004, 11:50 AM
garyb@se.rr.com garyb@se.rr.com is online now
Registered User
 
Join Date: 02-19-2004
Location: Saint Augustine, FL
Posts: 21
Well, If you can give me an idea what your looking for I can try to.

My version #'s as I mentioned are correct on my exe's and DLL's.

I am using automation to create a new release in Installshield, and I name the release "Build 2.6.####" where ####=MMDD.

I have attacched a MSWord document that has the screenshots and the Automation script to create the project.

Please let me know if you want to see anything else.

Thanks.
Attached Files
File Type: zip vbld example.zip (118.0 KB, 1658 views)
Reply With Quote
  #6  
Old 02-20-2004, 12:17 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
I'm not sure why the script in that macro would not be getting evaluated as script for you (referencing macros containing script expressions in a Run Script step works as expected here).

Here's another way you could approach it:

1) Create a separate macro for the version prefix (i.e. VERSION_PREFIX with a value of 2.6)

2) At the start of the project, add a Set Macro step to create a temporary BUILD_NUM macro with a value of

%VERSION_PREFIX%.[vbld_FormatBldDate]

3) Now when %BUILD_NUM% is referenced later in the project, it won't contain any script references (will already have been evaluated in the Set Macro step).
Reply With Quote
  #7  
Old 02-20-2004, 12:35 PM
garyb@se.rr.com garyb@se.rr.com is online now
Registered User
 
Join Date: 02-19-2004
Location: Saint Augustine, FL
Posts: 21
Unhappy

Ok, I followed your instructions, but it is still creates the InstallShield release with "Build 2.6.[vbld_FormatBldDate]"

It seems that the VBScript is not converting the value or something.
Reply With Quote
  #8  
Old 02-20-2004, 01:35 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
Here is a simple project that uses the technique I described (using the vbld_FormatDate system script function). The last step references %BUILD_NUM% and it displays the expected value of 2.6.20040220. What are you doing differently?
Attached Files
File Type: bld buildnum.bld (621 Bytes, 1444 views)
Reply With Quote
  #9  
Old 02-20-2004, 02:06 PM
garyb@se.rr.com garyb@se.rr.com is online now
Registered User
 
Join Date: 02-19-2004
Location: Saint Augustine, FL
Posts: 21
Talking

Ok,

I guess what I was missing was the project set "Init BuildNum", which I did not have before.

I set that Init Build_Num macro as the first step in the project, and it now appears to be working correctly...

Thank you for your assistance.

Gary
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



All times are GMT -5. The time now is 06:24 PM.


Copyright © 1999-2023 Kinook Software, Inc.