Archive: Type an UNC-Path in the Directorypage


Type an UNC-Path in the Directorypage
Hello everyone,

We have a little problem with the auto-complete functionality in the Directorypage.

If we type 'c:\' in the textbox, we will get directly suggestions for the path.

But if we type in an UNC-path like '\\server\path' the installer will block for some seconds after the first three characters.

Does NSIS starts a Computer Browsing in this case?

Can we disable the auto-complete functionality?

Any help will be appreciated.


NSIS just tells windows to auto-complete, it does no processing on its own.

You can control some aspects of autocomplete in the internet explorer advanced options (yes, really)

If you REALLY need to disable the autocompletion, you must do some COM magic with CLSID_AutoComplete on the editbox

edit:
calling IAutoComplete::Enable orIAutoComplete2::SetOptions(xxx) should be what you are after (depending on how much control you want)

You can call COM with the system plugin



function dshow
; ONLY TESTED ON XPSP2, COULD FAIL BADLY ON OTHER SYSTEMS!!!
!include LogicLib.nsh
FindWindow $9 "#32770" "" $HWNDPARENT
GetDlgItem $9 $9 0x3FB
!define CLSCTX_INPROC_SERVER 1
!define CLSID_AutoComplete {00BB2763-6A77-11D0-A535-00C04FD7D062}
!define IID_IAutoComplete {00BB2762-6A77-11D0-A535-00C04FD7D062}
System::Call "ole32::CoCreateInstance( \
g '${CLSID_AutoComplete}', i 0, \
i ${CLSCTX_INPROC_SERVER}, \
g '${IID_IAutoComplete}', *i .r0) i.r1"
${If} $1 = 0
/*<HACK>
IAutoComplete.Init:
punkACL needs a IUnknown that implements IEnumString,
I don't know if IAutoComplete does or if QI is not called by Init, but this seems to work
</HACK>*/
System::Call "$0->3(i $9,i $0,i0,i0)i.r1" ;IAutoComplete.Init
${If} $1 = 0
System::Call "$0->4(i 0)" ;IAutoComplete.Enable
${EndIf}
System::Call "$0->2()" ;Release
${EndIf}
functionend

page directory "" dshow

Can an option be added to disable autocomplete on the directory page?
I am having the same problem as the original poster and the suggested fix did not work for me. It literally take s seconds for NSIS to respond when the user is trying to change the UNC path.

Can an option be added to disable autocomplete on the directory page?


Alternative:


function dshow
FindWindow $9 "#32770" "" $HWNDPARENT
GetDlgItem $9 $9 0x3FB
System::Call 'SHLWAPI::SHAutoComplete(i $9,i 0x80000000|0x20000000)'
functionend
page directory "" dshow
Note that calling SHAutoComplete more than once will cause a leak (probably not a big deal in our case)