jdjvr
Posts: 1
Joined: Tue Jul 01, 2008 8:46 am

Property value calculation

Is it possible to do fairly simple custom property value calculations on the Install Parameters page?

Example: I need a custom property called say [|ProductIntegerVersion] which simply is the [|ProductVersion] value multiplied by 100. So if the [|ProductVersion] value is specified as 2.30 om the Product Details page then [|ProductIntegerVersion] value will be 230. Specifying a formula on the property value field to do the calculation does not resolve during building and results in an error message.

Is there any way around this? I am currently hardcoding this value but would prefer simplifying the process.
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Property value calculation

Hi,

I'm afraid that this is not supported by Advanced Installer. However, we will consider adding this improvement into a future version.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
imbolcus2
Posts: 3
Joined: Tue Feb 26, 2008 3:22 pm

Re: Property value calculation

I have the same need...

I found this topic when searching for a solution in archives and :cry:
Ionut
Posts: 605
Joined: Tue Nov 22, 2005 11:29 am
Contact: Website

Re: Property value calculation

Hi,

You can always perform any required calculations at install time from within a Custom Action. For instance, the example provided by jdjvr can be implemented with a simple Immediate VBScript CA such as the following:

Code: Select all

Function ComputeIntegerVersion()
  productVersion = Session.Property("ProductVersion")
  ' tokenize version and obtain field values
  versionArray = Split(productVersion, ".", -1)
  integerVersion = 100 * CInt(versionArray(0)) + CInt(versionArray(1))
  Session.Property("PRODUCT_INTEGER_VERSION") = CStr(integerVersion)
  MsgBox Session.Property("PRODUCT_INTEGER_VERSION")
End Function
You can schedule this Custom Action early in the install process, for instance under "InstallUISequence -> Begin". Make sure that you use a Public Property so that the Property value is available also in the InstallExecuteSequence.

Hope this helps.

Regards,
Ionut
Denis Toma
Advanced Installer Team
http://www.advancedinstaller.com/

Return to “Common Problems”