Archive: VIProductVersion not performing define substitution?


VIProductVersion not performing define substitution?
Just updated to 2.45, and now VIProductVersion, which in previous builds was converting defines to numbers for me, is no longer working, and complains about the format (requiring X.X.X.X).

I have code that basically does the following:

!searchparse /noerrors /file "version.rc" "#define kReleaseVersion" PRODUCT_VERSION_MAJOR "," PRODUCT_VERSION_MINOR "," PRODUCT_VERSION_SUBRELEASE

!define PRODUCT_VERSION "${PRODUCT_VERSION_MAJOR}.${PRODUCT_VERSION_MINOR}.${PRODUCT_VERSION_SUBRELEASE}"

!define INSTALLER_RELEASE "0"
!define INSTALLER_PRODUCT_VERSION "${PRODUCT_VERSION}.${INSTALLER_RELEASE}"

...

VIProductVersion "${INSTALLER_PRODUCT_VERSION}"


This used to work fine, and no longer does. Bug?

Actually, glancing at the release notes, I see the following ominous note:

Fixed !searchparse (bug #2680110)
Since I rely on !searchparse to perform the above operation, and since now, even if I subsitute literals for the !define values to VIProductVersion, I get errors complaining that the !defines are no longer defined, I'm beginning to suspect that !searchparse isn't doing what it's supposed to anymore.

should still work. why not use "!echo ${INSTALLER_PRODUCT_VERSION}" to check what the value ends up as?


If I remove the /noerrors flag, I get a 'string not found in file' error. This is patently false, since the string does exist in the file.

Upon closer observation, I note that there is now a new bug filed, 2803622, 'SearchParse regression in 2.45', which describes exactly this problem. So I'm not the only one, it appears.


Works fine for me when the file just contains #define kReleaseVersion 1,0,0

Stu


Okay, now put a blank line in front of it, like this:


#define kCMWinReleaseVersion 2,2,2
#define kCMWinReleaseCode 101
#define kCMWinBuildNumber 416

Is that from the file you are using? If so then it's got kCMWinReleaseVersion and not kReleaseVersion in it.

But otherwise if I do put some blank lines in front of it it has no effect.

Stu


Yes, sorry, forgot to cleanse the names. But they're what I'm using.

I've enclosed a zipped copy of a test script and the data file. Try compiling SearchParseTest.nsi; does it work?


The problem is that the file is using only line feeds for new lines as opposed to carriage returns + line feeds. Interesting that this breaks !searchparse

Stu


Yup. That's it exactly. Thought I had checked for that, but I guess not.

In any case, !searchparse used to be able to handle it, but no longer does, apparently.


Hm. May have spoken too soon. I just tried the test file again, having ensured that all my line breaks are CRLF, and it doesn't work. I've enclosed a new copy of the test script and file, zipped. Does this work for you, or not?


Yeh definitely a new bug. It looks like it stops searching when it finds an empty line. As you said if you don't have the blank line or if you just put in some spaces or tabs then it works fine.

Please file a bug report on the tracker:
http://sourceforge.net/tracker/?grou...49&atid=373085

Stu


Shouldn't I just add to the one already filed (2680110)?


Sorry, I meant 2803622, and it looks like that one's been closed as fixed. So hopefully this goes away in the next release.