Archive: MUI Version


MUI Version
Hello again everyone,

I was just trying to find a more automated process for updating my MUI_VERSION number inside of the installation script. Since the version number is incremented automatically whenever I build my project it gets updated consistently. What I'm trying to do is read the version information out of the Visual Basic project file:

MajorVer=1
MinorVer=1
RevisionVer=3

I'd like them read into 3 seperate variables so that I can use them inside the script. Right now in my script here's what I've got:

!define APP_MAJOR $R1
!define APP_MINOR $R2
!define APP_REVIS $R3

!define MUI_VERSION "${APP_MAJOR}"

OutFile "..\MyProject ${MUI_VERSION} Installer.exe"

Function .onInit
ReadINIStr $R1 "MyProject.vbp" "" "MajorVer"
ReadINIStr $R2 "MyProject.vbp" "" "MinorVer"
ReadINIStr $R3 "MyProject.vbp" "" "RevisionVer"
FunctionEnd

I was thinking that by doing this on the initialization of the installer package it would read the settings out of the VB Project file and then set the variables accordingly, however it doesn't seem to be working properly. I think that there might be a problem with the vbp file since the variables do not have any quotation marks around them. Anyone have any ideas?


The MUI_VERSION is a define which will be processed on compile-time. The run-time ReadINIStr commands won't work. Maybe launch makensis with the /DMUI_VERSION="bla" flag by a VB program (and remove the MUI_VERSION define from your script).


Argggg, well that explains a lot. Thanks Joost.

What about if I used just VERSION around the script instead of MUI_VERSION? Load the variables using the .oninit function and then went from there?


The name won't make a difference. Use my suggestion above (makensis flag to set the define). That's the best way (compile time, don't waste a variable).


Hmm, well it was worth a shot :) Thanks again for the advice Joost.