Having extreme slowdown when using the Destination path to enter a UNC path. I believe it's the free space calculation causing the issue. Seems to be recalculating on every letter that's typed in, until the whole path is typed.
Either that, or the DirectoryLeave function is getting triggered improperly. etc etc..
Here's the code:
; Source Directory
!define SRCDIR "\\server\Update\Source" ; Project Source
!system "${SRCDIR}\GetFileDate.exe"
!include "${SRCDIR}\FileDate.txt"
; Main Configuration Settings
!define PRODUCT_NAME "Test Update"
!define PRODUCT_PUBLISHER "Test"
!define PRODUCT_VERSION "2"
; MUI Settings
!include "MUI.nsh"
!define MUI_ABORTWARNING
; Directory Page
!define MUI_PAGE_HEADER_TEXT " ${FileDate} Update"
!define MUI_PAGE_HEADER_SUBTEXT "Select Update Location"
!define MUI_DIRECTORYPAGE_TEXT_TOP "Warning"
!define MUI_DIRECTORYPAGE_TEXT_DESTINATION "Destination"
!define MUI_PAGE_CUSTOMFUNCTION_LEAVE DirectoryLeave
!define MUI_DIRECTORYPAGE_VERIFYONLEAVE
AllowRootDirInstall true
!insertmacro MUI_PAGE_DIRECTORY
!define MUI_PAGE_HEADER_TEXT "Program Update"
!define MUI_PAGE_HEADER_SUBTEXT "Updating files..."
!insertmacro MUI_PAGE_INSTFILES
; Finish Page
!insertmacro MUI_PAGE_FINISH
; Language files
!insertmacro MUI_LANGUAGE "English"
Name "${PRODUCT_NAME}"
OutFile "program.exe"
InstallDir "C:\ProgramFolder"
ShowInstDetails hide
Function DirectoryLeave
GetInstDirError $0
${Switch} $0
${Case} 0 ; Valid Path
IfFileExists "$INSTDIR\{PRODUCT_VERSION}\*.*" PathOK 0
MessageBox MB_OK "Invalid path selected."
Abort
PathOK:
${Break}
${Case} 1 ; Invalid Path
MessageBox MB_OK "Invalid path selected."
Abort
${Break}
${Case} 2 ; Out Of Free Space
MessageBox MB_OK "Not enough free space on the drive selected."
Abort
${Break}
${EndSwitch}
FunctionEnd
Section "Main" SEC01
Files...
SectionEnd
MUI_PAGE_DIRECTORY calculation issue
4 posts
I created a patch for this @ https://sourceforge.net/p/nsis/patches/248/ but I'm not sure if/when it will be merged.
Thanks for the update
Thanks for the quick response! It sounds like v3 NSIS also doesn't resolve this then? Or operates entirely differently?
Thanks for the quick response! It sounds like v3 NSIS also doesn't resolve this then? Or operates entirely differently?
No it has the same problem.