Old 14th June 2003, 01:52   #1
yugemos
Junior Member
 
Join Date: Jun 2003
Posts: 2
Short pathnames (not 8.3)

I am having trouble getting a full path name (ie not 8.3) for my installer. For some unknown reason, the software I'm configuring (PHP) doesn't cope with ~'s too well, so I need to write to the configuration file using long path names.

I am using NSIS v2.0b3 and this is the code extract that does not seem to be functioning (the ReplaceInFile macro is from the NSIS Archive)
code:
GetFullPathName $1 $TEMP
!insertmacro ReplaceInFile "$INSTDIR\Apache\php.ini" "§Temp§" "$1"


However, this writes the following to php.ini
Quote:
session.save_path = C:\DOCUMEN~1\ADMINI~1\LOCALS~1\Temp
Is this how GetFullPathName should be used?
Any suggestions welcome! The full file is attached.

Thanks in advance,
Stefan Norman
Attached Files
File Type: nsi 0.1install.nsi (20.4 KB, 166 views)
yugemos is offline   Reply With Quote
Old 14th June 2003, 12:50   #2
Joost Verburg
NSIS MUI Dev
 
Join Date: Nov 2001
Posts: 3,717
Note that the GetFullPathName command does something else, it does not convert short files names to long file names.

You can call the GetLongPathName API using the System plug-in. However, this is not supported on Windows 95/NT4. If you want it to be compatible with Windows 95/NT4, you have to find another solution.
Joost Verburg is offline   Reply With Quote
Old 15th June 2003, 02:32   #3
yugemos
Junior Member
 
Join Date: Jun 2003
Posts: 2
Sorry, I'm new to NSIS and I haven't used windows for tasks like this before.
Could you please explain how I would do this exactly?
yugemos is offline   Reply With Quote
Old 15th June 2003, 02:48   #4
Joel
Debian user
(Forum King)
 
Joel's Avatar
 
Join Date: Jan 2003
Location: Arch land
Posts: 4,917
lol even I didn't understand
Well, you can first check all about the APIs...
then... check the info in ${NSISDIR}\Contrib\System
In there you'll find the info. about the system.dll plugin...
Also check in this web archive about how to use extra features
about the plugin...


* PC: Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM: Archlinux-i686 with MATE.
* Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: Archlinux-x86-64 with MATE.
Joel is offline   Reply With Quote
Old 15th June 2003, 17:02   #5
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
This will only work on Windows 98+ and 2000+.

code:
StrCpy $0 "C:\Progra~1"
StrCpy $1 ""
System::Call "Kernel32::GetLongPathNameA(t '$0', &t .r1, i \
${NSIS_MAX_STRLEN}) i .s"
Pop $0
IntCmp $0 ${NSIS_MAX_STRLEN} +2 +2 0
Abort "failed!"
DetailPrint "$0 - $1"


NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump