Hello friends! Strange issue going on for me here.
My NSIS-based installer is taking about 48 seconds between startup (after user approves admin access for the application) and the time that the first lines in my .onInit() method are called.
How do I know? Because I added some logging functions to .onInit(), which include a timestamp, in addition to popping up a window while my onInit() routines process.
I've tried moving .onInit() to the top of my script, so the single File being written by it is fast to access. I've also added a ReserveFile command for this same file.
I've even tried setting "SetCompress off" but this only makes startup time even longer.
The CRC check window doesn't always appear, but when it does, it appears at the START of this 48-second delay... and for no more than 10 seconds.
So between the CRC check finishing and the first line in my script's .onInit() processing, there is a delay of 38 or more seconds.
I would appreciate any advice on what might be causing this, and what to do about it. Thanks!
-Vern
Installer slow to start up (40-48 seconds)
4 posts
Hi, maybe check if some antivirus program checks the installer...
Vista will copy your .exe to %windir%\temp and then do some type of checking on it before actually starting the program, could this be the cause?
Edit: Bug report here but this is a delay before it even displays the UAC dialog. And your problem is a delay after you click Allow in the UAC dialog.
Can you please give us some more information:
NSIS version?
Windows version?
How large is your .exe?
Have you tried turning off Antivirus software if any?
Edit: Bug report here but this is a delay before it even displays the UAC dialog. And your problem is a delay after you click Allow in the UAC dialog.
Can you please give us some more information:
NSIS version?
Windows version?
How large is your .exe?
Have you tried turning off Antivirus software if any?
Turns out there were two lines executing in my .onInit() prior to logging began. One of them was causing the issue:
AccessControl::GrantOnFile "$APPDATA\My App Data Folder" "BUILTIN\USERS" "GenericRead + GenericWrite + GenericExecute + DeleteChild"
If a user formerly had a large database with many files in this folder, this command would take a long time. I now use a different NSIS extension to display a dialog box to the user while this upgrade is happening, so they are not confused about what is going on.
AccessControl::GrantOnFile "$APPDATA\My App Data Folder" "BUILTIN\USERS" "GenericRead + GenericWrite + GenericExecute + DeleteChild"
If a user formerly had a large database with many files in this folder, this command would take a long time. I now use a different NSIS extension to display a dialog box to the user while this upgrade is happening, so they are not confused about what is going on.