Archive: Huge installer file and slow loading...


Huge installer file and slow loading...
Hi, i haven't found any information about this ...
i am using NSIS to build an installer for a little software but in need an installer for the huge ressources files (something like 2.50 gigs).
so my installer's exe size is 1.55 gigs.

as i'm want to burn the file on a dvd-r for distribution, it takes a very long time to start my installer, maybe 10 / 15 minutes ? maybe more ...
anyway it should not wait even 30 seconds ...

here is my script, do someone knows how to optimise it to have normal performances ?
thanks much !

;--------------------------------
; Includes
!include "MUI.nsh"

;--------------------------------
; Parameters
Name "Software name"

OutFile "setup.exe"
!define MUI_ICON "c:\software\icons\icon.ico"
!define MUI_HEADERIMAGE true
!define MUI_HEADERIMAGE_BITMAP "c:\software\_Installers\ressources\little.bmp"
!define MUI_HEADERIMAGE_BITMAP_NOSTRETCH true
!define MUI_HEADERIMAGE_RIGHT true
!define MUI_WELCOMEFINISHPAGE_BITMAP "c:\software\_Installers\ressources\pic.bmp"
!define MUI_COMPONENTSPAGE_SMALLDESC

BrandingText " "
CRCCheck off
InstallDir ""
InstallDirRegKey HKLM "SOFTWARE\software" "InstallPath"



;--------------------------------
; Pages

!define MUI_ABORTWARNING
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_LANGUAGE "French"

;--------------------------------
; Installations

InstType "Full install"

;--------------------------------
; Sections

Section "-testInstall"
SectionIn 1

StrLen $0 $INSTDIR
IntCmp $0 0 NotInstalled NotInstalled Installed

NotInstalled:
MessageBox MB_OK|MB_ICONSTOP "Can't find installation folder in registry"
Abort

Installed:
Sectionend

Section "Full install" sec
SectionIn 1

SetOutPath $INSTDIR
File /r files\*.*
SectionEnd

;--------------------------------
; Descriptions

LangString DESC_sec ${LANG_FRENCH} "Full install."

!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${sec} $(DESC_sec)
!insertmacro MUI_FUNCTION_DESCRIPTION_END


Instead of including the files in the installer why don't you just copy them from a folder on the DVD using CopyFiles instead of File.


i wanted to have a single fine installer...
but it could be a solution. is there really no solution to speed-up the installer loading ? if moving functions on top of the script ? i seen also ReserveFile instruction, it told it could help in such case , but i don't see how ... in fact, would be good if the script whould be stored at the begining of the installer, and the files at the end .
i hoped that disactivating CRC check whould solve the problem , but it's not.


Try using the no solid compression build and switching to BZIP2 or LZMA compression. I did a test with it and got the start up time from around 20 seconds to 1-2 seconds. I used the LZMA compression. You can download the no solid compression executable from here: http://nsis.sourceforge.net/download/specialbuilds/

I've never tried the ReserveFile command for a large installer but you would only haver to change your File command to ReserveFile to try it out.


my problem is rather counting in minutes than seconds :op
i tried reservefile, there is no amelioration, and lzma compression is waayyyyy to slow to uncompress for almost same compressed size ... so my solution will be to use ZipDLL and having an installer plus a zip file ... i don't like it much, but .. it's best solution and found, and fastest

thanks for your help ;)


The script is saved at the beginning of the file. The problem is usually with files which are extracted when the installer is loading, but are located at the end of the file. The ReserveFile command is meant to be used on the top of the script with files that needs to be located at the beginning of the file.

However, your script doesn't even have an .onInit function. Your script doesn't even use solid compression. If solid compression isn't used, it doesn't matter where anything is located in the file. Without solid compression, seeking in the file is very cheap. Do you have an anti-virus? It might be scanning the executable. Check out the task manager when the installer loads and see which process takes the most CPU time.


I've got exactly the same problem:
1. Total size: about 1Gb (3000 files)
2. When I compile and start the resulting *.exe file, it takes 10-12 seconds _before_ even "verifying installer" message shows up (tested on good new HDD, and I don't even trying to burn it :))
3. I've tried both solid and non-solid compression methods (LZMA) which gave me almost the same installer startup speed.
4. It was an important breakthrough that without solid compression, temp file that has over 600Mb in size is not creating anymore.
5. But anyway, startup speed is very low.

What else can be done to increase startup speed? This factor is very limiting... 10-12 seconds from hdd will be equal to 3-5 minutes from cd/dvd, which render useless large NSIS installers.


Which NSIS version are you using?

Someone had this problem quite a while ago, and I'm wondering if it was fixed (I can't remember).

-Stu


2.0.5 release
Also tried with CRCCheck off - same thing. "Verifying installer" message is not showing up, but the problem i've described earlier still persists.

P.S. even 600Mb image is very slow. I wonder if i decide to make my own half-life2 repack... Definitely something should be done with it.

P.P.S. i've noticed that after this first "frozen" period, the following files are extracted to the %TEMP% folder:

modern-wizard.bmp
InstallOptions.dll
ioSpecial.ini

Those are definitely "NSIS-internal" files because they aree absent in my source directory and i didn't include them with File or ReserveFile directives.

As far as i can understand, those files somehow located at the end of the archive, but installer tries to decompress them first. But why so long - archive is non-solid... Very odd.


Performed another small experiment:
1. Speed is independant from compressor (ZLIB/LZMA/etc)
2. Speed is independant from user interface (oldstyle/modern).

As long as oldstyle UI doesn't decompress any files I can only assume that this problem is in NSIS itself. For example, standalone archivers (winrar, 7zip, etc) open 3-4 GB archives with ~10000 files at once.


NSIS performs no time consuming operations before showing the "verifying installer" window. All of the files you've seen in your temporary directory are also extracted after the "verifying installer". Nothing is extracted before the CRC check is done.

I still believe a virus scan is making the load time so long. I wouldn't be surprised if some anti-virus applications scan NSIS installers after all of the false virus alarms.

However, I could be missing something. So, to test it, I've created a special build which shows a message box before doing anything. It calls MessageBox on the very top of WinMain, right after the variable definitions. Download it and let me know how much time it takes the message box to show.


Thanks. I've done as you suggested and it became clear that delay occurs when loading any large exe file into memory. Wondering why, i've created another similar installer with InnoSetup and also made self-extracting WinRAR archive . When starting any of those executables, the delay was quite the same.

Despite that I always disable my anti-virus software before running installers, problem still stays.

Anyway, it became clear that NSIS is not the origin of this issue.


Check the codes/functions within ".onInit" function and see if any of those making delay. That's what happened to me before. ;)