diff --git a/Docs/src/generalpurpose.but b/Docs/src/generalpurpose.but index 3f82fefe..08f22fc1 100644 --- a/Docs/src/generalpurpose.but +++ b/Docs/src/generalpurpose.but @@ -84,7 +84,20 @@ This is similar to GetFileTime, only it acts on the system building the installe \c [/SHORT] user_var(output) path_or_file -Assign to the user variable $x, the full path of the file specified. If the path portion of the parameter is not found, the error flag will be set and $x will be empty. If /SHORT is specified, the path is converted to the short filename form. +Assign to the user variable $x, the full path of the file specified. If the path portion of the parameter is not found, the error flag will be set and $x will be empty. If /SHORT is specified, the path is converted to the short filename form. However, if /SHORT is not specified, the path isn't converted to its long filename form. To get the long filename, call GetLongPathName using the System plug-in. Note that GetLongPathName is only available on Windows 98, Windows 2000 and above. + +\c StrCpy $INSTDIR $PROGRAMFILES\NSIS +\c SetOutPath $INSTDIR +\c GetFullPathName $0 .. +\c DetailPrint $0 # will print C:\Program Files +\c GetFullPathName /SHORT $0 $INSTDIR +\c DetailPrint $0 # will print C:\Progra~1\NSIS + +\c StrCpy $0 C:\Progra~1\NSIS +\c System::Call 'kernel32::GetLongPathName(t r0, t .r1, i ${NSIS_MAX_STRLEN}) i .r2' +\c StrCmp $2 error +2 +\c StrCpy $0 $1 +\c DetailPrint $0 # will print C:\Program Files\NSIS, where supported \S2{gettempfilename} GetTempFileName