View Single Post
Old 29th November 2013, 19:36   #6
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,358
There was already a thread for this function (linked on the wiki page), why did you not ask there?

Anyway, I updated the wiki page and it should now support NSIS 2.4x (Ansi) and NSIS 3 (Unicode & Ansi). This does not mean that the Unicode fork you are using will work, if it does not then you should ask why at the scracthpaper.com forum.

If you want to always force Unicode you could try:
Quote:
Function get_universal_name_WIDE
Exch $0
Push $1
Push $2
System::Call '*(i,&w${NSIS_MAX_STRLEN} "")i.r2'
!define /math get_universal_name_UNIWSIZE 2 * ${NSIS_MAX_STRLEN}
System::Call 'mpr::WNetGetUniversalNameW(wr0,i1,i$2,*i${get_universal_name_UNIWSIZE})i.r1'
!undef get_universal_name_UNIWSIZE
IntCmpU 0 $1 0 retlocal retlocal
System::Call "*$2(w.r0)"
retlocal:
System::Free $2
Pop $2
Pop $1
Exch $0
FunctionEnd
...
push "x:\demo.mp3"
call get_universal_name_WIDE
pop $9

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote