From 2e9e986454194e2c2e3e7578d2f15b5583a95d7e Mon Sep 17 00:00:00 2001 From: kichik Date: Mon, 16 Apr 2007 21:17:37 +0000 Subject: [PATCH] more details for RFE #971467 git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@5092 212acab6-be3b-0410-9dea-997c60f758d6 --- Docs/src/generalpurpose.but | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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