Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 28th May 2004, 10:36   #1
hlogmans
Junior Member
 
Join Date: May 2004
Location: Leusden, The Netherlands
Posts: 5
Possible bug in GetFullPathname

Hi all,

I seem to have a problem on win98 with the function GetFullpathname. If i add a filename that does not exist, it returns an empty string. This is different than what is mentioned in the help:

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.
hlogmans is offline   Reply With Quote
Old 28th May 2004, 10:42   #2
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,337
As you quoted yourself:
Quote:
$x will be empty
What's the problem?

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
Old 28th May 2004, 11:08   #3
hlogmans
Junior Member
 
Join Date: May 2004
Location: Leusden, The Netherlands
Posts: 5
Quote:
Originally posted by kichik
As you quoted yourself:What's the problem?
The path is empty even if the path exists. The function DOES return the path if i omit the file-part. The help states that only the path needs to exist. I use if for the DLL upgrade macro to get a short path to a file, but now i need to remove the file-portion first.

Thanks for the quick reply!
hlogmans is offline   Reply With Quote
Old 28th May 2004, 13:25   #4
Joel
Debian user
(Forum King)
 
Joel's Avatar
 
Join Date: Jan 2003
Location: Arch land
Posts: 4,896
Well, maybe this is not your awnser, but the GetFullPathName is the same as msdn's.
You'll need some files installed, they call them Microsoft Layer for Unicode on Windows 95/98/Me Systems.


* PC: Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM: Archlinux w/ xfce4.
* Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: Debian unstable w/ xfce4.
Joel is offline   Reply With Quote
Old 28th May 2004, 13:59   #5
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,337
I'll try to find out what the documentation is referring to.

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
Old 28th May 2004, 21:32   #6
deguix
Major Dude
 
deguix's Avatar
 
Join Date: Dec 2002
Location: Everett - MA, USA
Posts: 1,351
Send a message via ICQ to deguix
Quote:
The function DOES return the path if i omit the file-part.
Maybe he is trying to say something I said in a recent post (if you didn't read it), GetFullPathName doesn't return totally the full name. Example:

"C:\PROGRA~1\COMMON~1"

Will return

"C:\PROGRA~1\Common Files"

And the Windows original GetFullPathName does return the correct folder name.

The bug is in front of you now, kichik. Just say when it's fixed.

My Wiki Pages

Working now on:
New projects. (language: any)
deguix is offline   Reply With Quote
Old 31st May 2004, 18:38   #7
hlogmans
Junior Member
 
Join Date: May 2004
Location: Leusden, The Netherlands
Posts: 5
Quote:
Originally posted by Lobo Lunar
Well, maybe this is not your awnser, but the GetFullPathName is the same as msdn's.
This link resolves it: msdn states the FILE must exist (a folder is a file). So it fails if the file does not exist, which is exactly what happened. So my conclusion is that the helpitem is not entirely true, or just confusing. It tries to say the same, but it isn't. The helpfile makes you believe you can get the fullpathname of a theoretically existing file if the destination folder exists (which is true for the updatedll macro), but this is obviousely not true.

Maybe it won't be a bad idea at all to include links to the MSDN pages in the helpdocs if those functions are used (on the other side, who wants to write docs at all... If i suggest this, i probably would get 50 invitations to help write the docs ).
hlogmans is offline   Reply With Quote
Reply
Go Back   Winamp 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