# .Res file over written after setting OnSetVersionNumbers

**URL:** https://www.finalbuilder.com/forums/t/res-file-over-written-after-setting-onsetversionnumbers/1548
**Category:** Discussion
**Created:** [August 6, 2010, 1:56am UTC](https://www.finalbuilder.com/forums/t/res-file-over-written-after-setting-onsetversionnumbers/1548 "2010-08-06T01:56:44Z")
**Posts on this page:** 3
**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: [August 6, 2010, 1:56am UTC](https://www.finalbuilder.com/forums/t/res-file-over-written-after-setting-onsetversionnumbers/1548/1 "2010-08-06T01:56:44Z")

</div>

Hello team,

&nbsp;FinalBuilder and Final BuilderServer 6,&nbsp;OS Windows 7, Delphi 2010.

I have noted that my application program icon has gone "missing." &nbsp;I suspect it is because the application res file (which contains various icons including the MAINICON, and other resources) is being replaced when compiling the application, as I "guess" I am setting the "BuildVersion" at the time. &nbsp;Instead of simply adding the Build Version to the existing file, the entire res file is replaced with no consideration the current res file contents.

I am attempting to set a build number when compiling the application. &nbsp;I only wish to add a build number when creating an installation build. &nbsp;All other times I do not care what the build number is. &nbsp;The major, minor and patch numbers are read directly from the Delphi project file. &nbsp;The build number is a text file which is stored in our source control repository and is updated as required in the FB project.

I have a "OnSetVersionNumbers" script action on the Compile Delphi Project action. &nbsp;The script contents will only update the "BuildVersion" variable if the BUILDTYPE&nbsp;variable&nbsp;(FB Project Variable) &nbsp;is equal to "INSTALL" (FB Server Variable). &nbsp;However, I think as there is a script in the&nbsp;"OnSetVersionNumbers" tab, the res file is compiled and over writes the existing file.

Is this a FB bug or am I taking the incorrect approach to setting the build number?

Thanks in advance,

Mark

---

<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: [August 6, 2010, 2:36am UTC](https://www.finalbuilder.com/forums/t/res-file-over-written-after-setting-onsetversionnumbers/1548/2 "2010-08-06T02:36:02Z")

</div>

Hi Mark   
  
 In delphi apps, the version information and the icon are in the same file, so in order to generate version information during a build we need to recompile the resource file. You can specify the ICON in the action settings. If you don’t want to regenerate the resource file then you will have to find another way to update the version information.   
  
 You can enable/disable the resource generation via script and a project variable, for example :   
  
 Action.RegenerateResource = FBVariables.REGENRESOURCE   
  
 where REGENRESOURCE is your Project variable with a boolean value.

---

<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 6, 2010, 4:07am UTC](https://www.finalbuilder.com/forums/t/res-file-over-written-after-setting-onsetversionnumbers/1548/3 "2010-08-06T04:07:13Z")

</div>

Hello Vincent   
  
 Thank you for your response and suggestion. Unfortunately neither option is suitable for us. I think we have an alternate plan. Will let you know how we get along.   
  
 I would have been useful if FB could append information to the res file as opposed to just over writing it.   
  
 Thanks   
 Mark
