2

I am new to Final Builder 7 and got some work on it.

I want to set minor version from Final Builder 7 to inno setup script by asking user to enter the minor version number.

I have defined user variable called minor, which is set by asking user input, I want to use this variable in one of the .iss files in the project.

Any clue?

Thanks in advance.

-- With best regards Amol

2 Answers2

2

I solved this using following script:

#define AppVersion GetFileVersion("MyApp.exe")
#define Major
#define Minor
#define Rev
#define Build
#define Version ParseVersion("MyApp.exe", Major, Minor, Rev, Build)

[Setup]
AppName=MyApp
AppVerName={#AppVersion}
VersionInfoVersion={#AppVersion}
AppVersion={#AppVersion}
OutputBaseFilename=5{#Build}

-- Cheers

1

Looks like you are looking for user input. We run many builds many times every day and user never needs to enter anything. Final builder 7 has version control, or you can increment variable. We use combination of that. So, Final builder has the version, we don't touch it. For example, final builder has 1.1.2 and it also has incremental variable. In the end we get 1.1.2.345 where 345 is automatically incremented build number.

Now, how we update Inno to the appropriate version. In our scripts we have #define(s) listed like this

#define Major "@@major@@"
#define Minor "@@minor@@"
#define Anything "@@anything@@"

Where @@....@@ is a placeholder. Before running Inno script we execute Text Find / Replace action and our placeholders are replaced with real data. Then we execute Inno using Run DOS Command / Batch File action and executing something like this

iscc.exe "%BaseDir%\Install Files\MyLovelyInstallScript.iss"

This way, there is no need for user input, unless your software changes version completely. Then, we just change variables that represent numbers in 1.1.2 - a rare event.

T.S.
  • 18,195
  • 11
  • 58
  • 78
  • You don't need to do that. Inno Setup can read the version of a file as shown in Amol's answer (which is of course usable only if your product version relies on a certain application file). – TLama Sep 03 '15 at 09:32
  • 1
    @TLama We do not only do version in such way. for example, trademark as well. Trade mark is calculated based on the year in the build script process date. We have at least 10 different placeholders, which customize install package based on build script of FinalBuilder. Also, our files are packaged this way too. We dynamically switch file source location. Same Inno script packages x86 and x64 setups, depends where we tell it to find files. So, it is not only version, it pretty robust customization tool, if our special build produces customer-specific install, using their branding, for example – T.S. Sep 03 '15 at 14:13
  • @T.S. Thanks T.S. that is what I was actually looking for at first, however to make build process automatic I would go with my answer. – Amol Kulkarni Sep 04 '15 at 04:48