Yathosho
13th April 2010 21:38 UTC
weird nsDialogs behaviour
please have a look at the attached dummy-script
when ever you select a directory containing certain file-types (bmp, jpg, avi...), the checkboxes will be checked automatically. however, when i'm deleting the path-name from the text-field, it will always activate the bmp-checkbox.
i haven't been able to spot the problem, any ideas?
ps: the new forum doesn't allow attaching .nsi files
DrO
13th April 2010 22:24 UTC
Test post for nsi attachment handling
Originally posted by Yathosho
ps: the new forum doesn't allow attaching .nsi files
-daz
Yathosho
13th April 2010 23:01 UTC
Originally posted by Yathosho
when ever you select a directory containing certain file-types (bmp, jpg, avi...), the checkboxes will be checked automatically. however, when i'm deleting the path-name from the text-field, it will always activate the bmp-checkbox.
only happens on win7, not on xp :(
Animaether
14th April 2010 02:04 UTC
Perhaps you have a .bmp file in your root folder?
Essentially, add something like this in your checkbox state changing code..
${If} ${FileExists} "$0\*.bmp"
FindFirst $R0 $R1 "$0\*.bmp"
FindClose $R0
/* GetFullPathName $R1 "$0\$R1" */
MessageBox MB_OK "***91;$R1***93;"
..and see what the messagebox believes was found.
For me, the .jpg checkbox would always be checked - simply because I have some JPGs in my root folder ("c:\somefile.jpg").
As for a solution - you should probably trap for an empty line and always uncheck all checkboxes in that situation.. as it's probably not expected behavior for the end-user that you would be looking at the root folder :)
Edit: Ah - you -are- trapping for it.. but your trap is sprung too late :) Your ``${ElseIf} $0 == ""`` should come -before- the IfFileExists checks.
Yathosho
14th April 2010 10:28 UTC
thought i tried changing the order before - obviously i didn't, it works now! thanks