freeman12
3rd April 2002 15:20 UTC
get short path name
---Modified later---
Sorry i should just RTFM
plz delete this shameful post :(
--------------------
Hi,
I need to get the short(8.3) pathname given a long pathname...
here is an example :
From : c:\program files\my application
I would like : c:\progra~1\myappl~1
thx
Yathosho
3rd April 2002 17:18 UTC
phew, tricky... i'm not sure if this information is saved anywhere
rainwater
3rd April 2002 17:28 UTC
It can be done easily with an extension using the GetShortPathName api call. If you want me to write up a basic extension dll I can, and I will post it here.
firepages
4th April 2002 11:07 UTC
well I wish you hadda posted the answer when you found it :)
I need to do the same thing... I need to write this liune to file...
FileWrite $9 "$INSTDIR\phpdev\php\php_win.exe $INSTDIR\phpdev\php\spiny\spiny.php $INSTDIR\phpdev\php\php_win.exe $\r$\n"
BUT using a short path - I did see the [SHORT] flag in the manual but have no clude how to use it in this (or any :)) situation...
any help would be much appreciated... the whole section is...
Function DoBatches
FileOpen $9 "$INSTDIR\startup.bat" w
FileWrite $9 "$INSTDIR\phpdev\php\php_win.exe $INSTDIR\phpdev\php\spiny\spiny.php $INSTDIR\phpdev\php\php_win.exe $\r$\n"
FileClose $9
FunctionEnd
and basically if the user selects c:\program files\
I want to write c:\progra~!\etc to file
kichik
4th April 2002 13:49 UTC
GetFullPathName /SHORT $1 $INSTDIR
$1 will now contain the short name.
firepages
4th April 2002 14:33 UTC
thanks kichik , very very much appreciated.
nafigator
10th November 2002 20:48 UTC
Don't know what's the problem, but I can't make '/SHORT' work on win98 (nsis2a7, win98 se). It works fine on w2k and xp, but not with win98.
Checking with this
GetFullPathName /SHORT $1 $INSTDIR
DetailPrint $1
shows that $1 doesn't contain anything.
kichik
11th November 2002 14:39 UTC
Works for me. Are you sure $INSTDIR contains something? If it does, try using NSIS 2.0b0, if that doesn't help too attach the script.
nafigator
12th November 2002 12:50 UTC
Oops, I've been trying to get short path before actually creating InstDir :rolleyes:
My fault.