# Installaware variable build type

**URL:** https://www.finalbuilder.com/forums/t/installaware-variable-build-type/1782
**Category:** Discussion
**Created:** [June 16, 2011, 4:35am UTC](https://www.finalbuilder.com/forums/t/installaware-variable-build-type/1782 "2011-06-16T04:35:09Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![rasmusw](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/r/46a35a/32.png) [@rasmusw](https://www.finalbuilder.com/forums/u/rasmusw)
#### Post date: [June 16, 2011, 4:35am UTC](https://www.finalbuilder.com/forums/t/installaware-variable-build-type/1782/1 "2011-06-16T04:35:09Z")

</div>

In my FB project I&nbsp;would like to run InstallAware twice. Each time with a different InstallAware build type, once a "compressed single exe", and once a "compressed web based exe".

Since the IA&nbsp;action includes quite a lot of compiler variables and other settings, I would prefer if I&nbsp;didn't have to copy the IA action and keep them both updated in case of changes to the action settings.

Is there a way to loop the IA&nbsp;action and change the build type? Since the build type is selected using a drop-down, I&nbsp;don't see how it can be done just by changing a variable.

I assume that it can be done using scripting, and setting the Action BuildType in the BeforeAction event, but I&nbsp;can't get it to work. I have tried just adding this code in the BeforeAction event on the IA&nbsp;action:

Action.BuildType = btCompressedWebExe

but this fails with the error "Type mismatch: 'Action.BuildType'".

Any help will be greatly appreciated.

---

<div class="post-metadata">

### Author: ![stephen.ryan](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/s/f14d63/32.png) [@stephen.ryan](https://www.finalbuilder.com/forums/u/stephen.ryan)
#### Post date: [June 17, 2011, 5:38am UTC](https://www.finalbuilder.com/forums/t/installaware-variable-build-type/1782/2 "2011-06-17T05:38:12Z")

</div>

Hi   
  
 The build type constants were not being correctly registered for the scripting engine. This has been fixed in the following build:   
 [https://www.finalbuilder.com/downloads/finalbuilder/aex6/FB700\_1353.exe](https://www.finalbuilder.com/downloads/finalbuilder/aex6/FB700_1353.exe)   
  
 The easiest way to do this would be to place your InstallAware action nested under the For Loop action (you don’t need to provide a variable to store the current iteration). Then in the BeforeAction event of your InstallAware action you can use the following code:   
  
 Javascript:   
 [code] // Get the action properties of the for loopvar loopAction = Action.Parent();// Get the current iteration number and set the build type accordinglyswitch (loopAction.CurrentIteration){ case 1: Action.BuildType = btCompressedExe; break; case 2: Action.BuildType = btCompressedWebExe; break;}[/code]   
  
 Hope this helps.   
  
 Regards,   
 Steve

---

<div class="post-metadata">

### Author: ![rasmusw](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/r/46a35a/32.png) [@rasmusw](https://www.finalbuilder.com/forums/u/rasmusw)
#### Post date: [June 17, 2011, 9:37am UTC](https://www.finalbuilder.com/forums/t/installaware-variable-build-type/1782/3 "2011-06-17T09:37:03Z")

</div>

Yes it works, thank you.
