areum
areum

Reputation: 103

nsis - How to set VIProductVersion at runtime

I have .ini file that contains a file version (like X.X.X.X).
So, I used ReadINIStr to get the version in 'var' format.
ReadINIStr $0 "C:\Users\a\Downloads\Info.ini" "Version" "VersionNumber"
StrCpy $varVersion $0

The above code results in the value of 'varVersion' being stored in the Version in the ini file.

So far, the values I want are well stored.

However, the value to be used for VIProductVersion must be a value using !define.

  1. Can not use a variable other than !define?
  2. If variable is not available, can I store the value of a particular entry in the ini file in !define?
  3. I know that the contents of the file can be read using the !define /file command. However it is my intent to read only the entry value of the ini file.

Upvotes: 0

Views: 560

Answers (1)

Anders
Anders

Reputation: 101736

VIProductVersion is an attribute stored in your installer .exe and can only be set at compile-time by makensis.

You can use any of the pre-processor instructions like !define and !searchparse to read/store the version but there is no instruction you can use to read .ini files. !searchparse can be used in a pinch if the .ini value name is only used once in the entire file because it does not understand .ini sections.

Upvotes: 1

Related Questions