Ath wrote:
> "Netx" <✉go2.pl> schreef in bericht > news:farrbv$8ci$✉news.jrsoftware.org... >> Function "GetFileVersion" gives me four numbers separatet with "." . I >> have a question how to convert version into "two numbers" from >> "GetFileVersion", so that in the following fragment of script I could >> obtain "OutbutBaseFilename" with two numbers only. Don's ask why I need >> two numbers; this requirement is not up to me. >> >> [Definitions] >> #define versioninfo >> GetFileVersion("vspublish\SlavisTools_1_0_0_0\SlavisTools.EXE") >> [Setup] >> OutputBaseFilename=install-{#exeName}-{#versionInfo} >> AppVerName={#fullName} - {#versionInfo} >> VersionInfoVersion={#versionInfo} > > This is what I did to get only the first 3 positions of the versionnumber: > > #define major > #define minor > #define rev > #define build > #define > fullVersion=ParseVersion(FileBaseDir+MyAppExeName,major,minor,rev,build) > #define MyAppVersion = Str(major)+"."+Str(minor)+"."+Str(rev) > > > ParseVersion is from builtins.iss, that is automatically included by ISPP
I used something very similar and added this to my common iss file: #define GetShortFileVersion(str FileName) \ ParseVersion(FileName, Local[0], Local[1], Local[2], Local[3]), \ Str(Local[0]) + "." + Str(Local[1])
I then use this in exactly the same way as GetFileVersion: AppVerName=i-Catcher Console {#GetShortFileVersion("..\Console.exe")}
-- Dean Earley (✉icode.co.uk) i-Catcher Development Team
iCode Systems