Archive: $EXEDIR to mapped drive on Win7 and Vista


$EXEDIR to mapped drive on Win7 and Vista
  Hi,

i am experiencing a small problem on win7 and vista.
when i want to install from a mapped network share,
the $exedir is always the unc path for this share. even if it is mapped. The behaviour is different (correct) on all other supported operating systems. perhaps there is something new in vista / win7...

i made a small test. i created a visual basic application that will only do this statement:


msgbox app.path 

>
when i execute it on the share, it will say X:\...
when i then execute the same executable from the same place but using the nsis test.exe, the visual basic application will also ouput the unc path for the mapped drive.



i would like to have the mapped path here.
i even used 2 different functions in nsis to get the correct result. but i will always get that unc path.

attached is a small test script for you ...


Name "test"

>OutFile "test.exe"

>Function GetExePath
!define GetExePath `!insertmacro GetExePathCall`

!macro GetExePathCall _RESULT
Call GetExePath
Pop${_RESULT}
!macroend

Push$0
Push$1
Push$2
StrCpy$0 $EXEDIR
System
::Call 'kernel32::GetLongPathNameA(t r0, t .r1, i 1024)i .r2'
StrCmp $2 error +2
StrCpy$0 $1
Pop$2
Pop$1
Exch$0
FunctionEnd

Section
Exec vb6path.exe
${GetExePath} $R0
MessageBox MB_OK "$R0"
System::Call "kernel32::GetCurrentDirectory(i ${NSIS_MAX_STRLEN}, t .r0)"
MessageBox MB_OK "$0"
>SectionEnd
>
Thanks for your help!

Christian

here you have the vb6path.exe as an attachment for those who dont have visual basic ...

greetings

christian


the solution was vistas execution level...
requestexecutionlevel user did the trick,
administrator does not have this network share mapped, so he cannot know.

greetings