Archive: Pre-compressing data files


Pre-compressing data files
This has been asked previously by someone else, but there was no definitive answer. So I'll ask in a slightly different context.

We currently have a Linux web server configured to generate NSIS installers on-the-fly when someone purchases our software online. The problem we have is that we "stamp" a unique serial number on the software's executable before it gets packaged into an installer, which means the end-user has to wait an uncomfortably long time while makensis compresses everything. Does makensis currently have a way of utilizing pre-compressed files?


Re: Pre-compressing data files
At design time:
1) Create and compile an installer with your compression mode of choice with all files you want pre-compressed and generate the installer exe(we call Premade.exe)
2) Create the main installer script which will:
a)Extract the serial stamped EXE to its destination
b)Then use the SetCompress off command.
c)Use File command to extract and run the Premade.exe

By using the SetCompress off command, the precompressed Premade.exe will be included in the final main installer, but it will not be compressed, and thus the time to build the final installer will be much faster. So your web server will ahve your main isntaller *.nsi, a Premade.exe, and you will generate your serial stamped application *.exe on the fly.

On demand at user's request:
1) Compile the main installer script which will compress the serial stamped exe, and also package the Premade.exe, but it will not be compressed because of the SetCompress command(since the Premade.exe was created with a compression level of your choice, trying to compress it again would have little gain).

Hope this is what you need.

FYI, during testing I set the "SetCompress off" command in all of my scripts because I can compile extremely quickly that way.


Thanks for the suggestion. That should actually work out nicely.


You are talking about a topic which I had originally brought up (well I know I brought it up too.)

This was only 1/2 of what I needed, unfortunately. I have been also looking for a way of moving away from the single .exe file installer, and moving to single installer executable which installs packages which are downloaded to the user's machine, and has customization options in the form of scripting in each of the packages.

That turned out to be a much taller order than my original suspicions, and will unfortunately take me away from NSIS all together, for our package installer.