Archive: Selective compression


Selective compression
There are some strings in my installation script that I need to be uncompressed, because I replace them dynmically, after the installer exists as an EXE. An example for such a string is "ChangeMe".

I tried to use "SetCompress off" before writing "ChangeMe" and "SetCompress auto" afterwards. So now my installer doesn't contain the "ChangeMe" strings when I'm opening them with a text viewer.

If I use SetCompress off once and turn compression off completely, the "ChangeMe" strings can be seen with a text viewer.

Any ideas how to accomplish this?

Thanks!


Sorry I was too tired when I phrased the previous post. Let me try again:

I want to use compression on my installer, but some parts I want to leave uncompressed. I know this is theoratically possible using "SetCompress off".

If I use SetCompress off once on the top of the script, and the installer is uncompressed entirely, strings such as "ChangeMe" are visible if you view the installer EXE with a text viewer.

So I want to compress all the parts that don't have "ChangeMe" inside them, and leave the ones that do uncompressed.

I'm trying to put "SetCompress off" before and "SetCompress auto" after lines that contain "ChangeMe", but then I'm not able to see "ChangeMe" with a text viewer in the installer EXE.

Any ideas why?

Thanks!


SetCompressor does not work on a line by line basis. It either turns compression on or it doesn't. Whatever last value you used for SetCompressor will be applied to the whole installer.

Maybe this is what you're after:
http://nsis.sourceforge.net/ReadCustomerData

Stu


Afrow suggested the best solution for what you're probably looking for. There's also this.

As for SetCompress, if it's set to off at the end of the script, the headers won't get compressed. It's the headers that contain the file names which I suppose you refer to when you say "ChangeMe". Any files added between SetCompress off and SetCompress auto will not have their content compressed. Their name, however, depends on the value used for the last SetCompress as explained.


Sorry I read that as SetCompressor, my bad :)

Stu