PDA

View Full Version : FileGrep doesn't work with files with only LF's (Unix format) anymore?



roskuski
05-03-2006, 01:25 PM
I have an install that uses FileGrep and FileInsertLine to modify Java's java.security file to add a security provider. This worked fine in InstallShield Developer 7, despite the fact the the java.security file was in UNIX format i.e. only new lines delimiting the lines.

I've upgraded the project to InstallShield 11, and now, FileGrep seems to be treating the file as though it contains one large line, so my file editing function fails.

Has something changed with FileGrep in InstallShield 11? Is there any way I can get it back to the old behavior, where it didn't seem to matter if the lines were delimited with LF's or CR-LF's

Thanks.

kgiloo
07-18-2006, 08:00 AM
I have exactly the same problem when migrating from IS 6 to IS 12.
Have you found a workaround? Thanx.

roskuski
07-18-2006, 08:57 AM
What I did was write code to convert the file on the fly from LF's to CR-LF's first and then do my FileGrep/FileInsertLine calls. I never got any answers to this, or even an acknowledgement that the behaviour was changed. Sorry I can't be more helpful.

Paul Boerefijn
04-27-2007, 07:03 AM
Do you mind if i join your club? I have exactly the same problem with the ListReadFromFile function.

Roskuski: Can you please post your program to convert the file on the fly from LF's to CR-LF's? Thank you.

roskuski
04-28-2007, 06:25 PM
Sure. My code was inline in the function that edited the file I was having trouble with, but I pulled it out and tried to generalize it a bit.
Basically, I build a string list of lines by looking for either LFs or CR-LFs (just in case the file has been converted already) and then blast them all out at once using ListWriteToFile, which nicely puts a CR-LF after every string list element.

I haven't tested the function in this particular incarnation, so run it through bit of testing first :)