jprocto
16th April 2011 02:25 UTC
NSIS GUI unresponsive during file installation
Hi,
I'm using NSIS for my installers and I'm finding that during the installation of large files using either "File" or "CopyFile", the GUI does not update at all so that if I open Windows Explorer and then click back on the installer, the installer does not update its GUI until that file has finished installing. Does anyone else have this problem and is there any way around it?
Thanks,
John.
Afrow UK
16th April 2011 10:34 UTC
Yes. Don't copy or extract files from page callbacks. That is what sections are for. You should never modify the system until the user has clicked Install. If you are then you should rethink your installer design. If you need to extract something between pages, perhaps add another InstFiles page in between (but really you should only ever need one).
Stu
jprocto
16th April 2011 11:41 UTC
Originally posted by Afrow UK
Yes. Don't copy or extract files from page callbacks. That is what sections are for. You should never modify the system until the user has clicked Install. If you are then you should rethink your installer design. If you need to extract something between pages, perhaps add another InstFiles page in between (but really you should only ever need one).
Stu
Yes, I'm afraid that the operations are already being included within a section and not within a page callback. This problem is occurring during the actual installation process.
Afrow UK
16th April 2011 13:42 UTC
If that is the case then how do you click Back? The Back button is disabled unless you have enabled it yourself. Perhaps you should attach some script that reproduces the problem. Extracting files in a section does not freeze up the UI because sections are executed in another thread. If you mean the progress bar does not move, then that's not the UI freezing up. It just doesn't move while a file is extracted; it only works on the number of instructions.
Stu
MSG
16th April 2011 14:46 UTC
With clicking 'back' he means changing focus to another window and then switching back to the installer. At which point the window is not redrawn properly.
Indeed some minimal script that recreates the issue would be helpful.
jprocto
17th April 2011 11:06 UTC
Originally posted by MSG
With clicking 'back' he means changing focus to another window and then switching back to the installer. At which point the window is not redrawn properly.
Indeed some minimal script that recreates the issue would be helpful.
Sorry, yes that's exactly what I meant. I wasn't very clear with my original explanation. Below is the section that I am having the problem with. The actual part where people first reported this problem was the line that is now commented out:
;CopyFiles /silent $EXEPATH "$PROGRAMFILES\Camel Audio\Alchemy\SoundbankInstaller.exe"
I replaced this line with the following two lines because I thought that the problem might be caused by the executable copying itself, but this does not seem to have fixed it:
SetOutPath "$PROGRAMFILES\Camel Audio\Alchemy"
File SoundbankInstaller.exe
Here is the actual section to put this into context:
Section "-Install Support Files" SECINSTALLSUPPORT
${If} $SkipInstallingSupportFiles == "false"
Call FixDataInstallPath
SetOverwrite on
SetOutPath $DataInstallDir
!ifdef PLAYER_VERSION
File ..\AlchemyData\AlchemyPlayer.aky
!endif
CreateDirectory $DataInstallDir
CopyFiles /silent $PluginInstallDir\*.aky $DataInstallDir
Delete $PluginInstallDir\*.aky
;StrCpy $DataInstallDir $DataInstallDir\Alchemy
SetOutPath $DataInstallDir\Libraries
File /r /x .svn /x .DS_Store ..\AlchemyData\Libraries\*.*
!ifdef FULL_VERSION
WriteRegStr HKLM "${REGKEY}" "${FULL_VERSION_INSTALLED_REGISTRY_VALUENAME}" "true"
!endif
SetOutPath $DataInstallDir\Skins
File /r /x .svn /x .DS_Store ..\AlchemyData\Skins\*.*
;CreateDirectory $DataInstallDir\Libraries
CreateDirectory $DataInstallDir\Presets
CreateDirectory $DataInstallDir\Presets\User
CreateDirectory $DataInstallDir\Presets\User\Sounds1
CreateDirectory $DataInstallDir\Samples
;CreateDirectory $DataInstallDir\Skins
CreateDirectory "$PROGRAMFILES\Camel Audio\Alchemy"
;CopyFiles /silent $EXEPATH "$PROGRAMFILES\Camel Audio\Alchemy\SoundbankInstaller.exe"
SetOutPath "$PROGRAMFILES\Camel Audio\Alchemy"
File SoundbankInstaller.exe
;${unregisterExtension} ".CamelSounds" "Camel Audio Sound Library"
${registerExtension} "$PROGRAMFILES\Camel Audio\Alchemy\SoundbankInstaller.exe" ".CamelSounds" "Camel Audio Sound Library"
SetShellVarContext current
FileOpen $0 $PluginInstallDir\AlchemyConfig.txt w
FileWrite $0 "LibraryPath= $DataInstallDir\$\r$\n"
FileWrite $0 "MaxChunkSize= 1048576$\r$\n"
FileWrite $0 "KnobCircular= 0$\r$\n"
FileWrite $0 "ShowAuthor= 1"
FileClose $0
${If} $InstallingRTAS == "true"
FileOpen $0 ${RTAS_INSTALL_DIR}\AlchemyConfig.txt w
FileWrite $0 "LibraryPath= $DataInstallDir\$\r$\n"
FileWrite $0 "MaxChunkSize= 1048576$\r$\n"
FileWrite $0 "KnobCircular= 0$\r$\n"
FileWrite $0 "ShowAuthor= 1"
FileClose $0
${EndIf}
!ifdef PLAYER_VERSION_WITH_CONTENT
SetOutPath $DataInstallDir\Presets
File /r /x .svn /x .DS_Store "..\..\Alchemy Player Content\Presets\*.*"
SetOutPath $DataInstallDir\Samples
File /r /x .svn /x .DS_Store "..\..\Alchemy Player Content\Samples\*.*"
!endif
${EndIf}
SectionEnd
MSG
17th April 2011 12:34 UTC
Ah, so you're copying an executable. There's a good chance your virusscanner is at fault. Try again with your virusscanner disabled.
jprocto
17th April 2011 14:06 UTC
Originally posted by MSG
Ah, so you're copying an executable. There's a good chance your virusscanner is at fault. Try again with your virusscanner disabled.
Ah yes. Good thinking. Obviously I can't tell all my users to switch off their antivirus software and it probably won't be sufficient to do something like changing the extension and then switching it to "exe" once it is copied so I don't think there's much I can do about this.
Thanks for all your help MSG and Stu :)
Afrow UK
17th April 2011 14:54 UTC
Sorry I misunderstood your wording. Have you tried without /silent? I doubt it will help but perhaps if the A/V is holding things up you might at least see a copy progress pop-up dialog box. You could also try doing the copy by calling xcopy.exe.
Stu