- NSIS Discussion
- Loading page defined by me takes noticible time, any way to make it faster
Archive: Loading page defined by me takes noticible time, any way to make it faster
cybereka
2nd April 2003 05:01 UTC
Loading page defined by me takes noticible time, any way to make it faster
Hai all,
I got one problem. Actually i have one page defined by me apart from the provided pages. I is designed as it consist of 4 text boxes in it. When i start my installer, the default pages appears immediatly whereas the page defined by me takes noticeble amount of time to display properly. Is there any way to make it to appear as faster as the default pages.
With Thanks, Eka S.
kichik
2nd April 2003 14:29 UTC
Built in pages are created from resources and Windows has optimized functions to load them. InstallOptions loads the page from INI, reads field by field and creates the windows one by one, it takes a bit more time. How slow is it? A second? 10?
cybereka
3rd April 2003 06:10 UTC
approx. it takes 20 secs..........
kichik
3rd April 2003 11:10 UTC
On what computer? Do you happen to have Windows XP SP1?
virtlink
3rd April 2003 11:14 UTC
Please attach the INI-file (zipped).
cybereka
3rd April 2003 11:25 UTC
I am using Windows 2000 on NT. And the ini file is attached with this
kichik
3rd April 2003 12:38 UTC
Do you have this problem with other examples too or any other INI using applications? Does it load slowly on other computers too? Can you please attach the script too?
virtlink
3rd April 2003 12:53 UTC
I have tested this INI with the InstallOptions sample, but it works fine and without delay on a Win2000 Pro system. Even when I turn those ReserveFile-lines off. (Altough, it was compressed with zlib, so it shouldn't make any difference).
Joost Verburg
3rd April 2003 15:40 UTC
If you are using BZIP2 compression, reserve both InstallOptions and the INI file.
cybereka
4th April 2003 06:57 UTC
How to reserve InstallOptions can u give me a example........
Joost Verburg
4th April 2003 08:10 UTC
Modern or Classic UI? Can you attach the script?
virtlink
4th April 2003 12:27 UTC
If you use BZip2 compression, then it's usefull to reserve the ini and the plugin files. This means that the files are placed at the beginning of the installer, wich may slow the loading of the installer a little bit down, but makes the installer itself much faster.
To reserve the files, use:
ReserveFile "${NSISDIR}\Plugins\InstallOptions.dll"
>ReserveFile "MyIni.ini"
B.t.w. I've also tested the script without ReserveFile, and it makes no noticeable difference in the loading time of the page. (I must say that these results are from a between Release 2.0b2 and release 2.0b3 CVS version, but that should make any difference).
kichik
4th April 2003 12:39 UTC
The documentation explains this command very well:
Reserves a file in the data block for later use. As files are added in the order they are used in the script files that are used in the .onInit function, for example, might be added last and slow the loading of the installer. This is where this command comes useful, allowing you to speed up the loading process by including the file at the top of the data block instead of letting NSIS seek all the way down to the bottom of the compressed data block.
This means that if you have a lot of compressed data and you put the INI file at the end of it even though it's called first the loading time of the INI file will greatly increase. To prevent this you can use ReserveFile at the top of your script which will cause the INI file to be placed at the top of the data block and allow the installer to quickly extract it without seeking through a lot of compressed data.