Old 11th October 2006, 14:27   #1
banksr0
Junior Member
 
Join Date: Oct 2006
Posts: 3
Possible bug in GetServerName macro.

I was trying out the GetServerName macro found here and I think it might be bugged on Windows 98.
It uses the GetComputerNameW to support older operating systems. However, GetComputerNameW is not implemented in 9x/ME and will not work without the support of something like MSLU.

Therefore, I was thinking that the ANSI GetComputerNameA should be used instead of the Unicode GetComputerNameW.

Can anyone confirm that my understanding of this is correct, or am I missing something?

If I am right, would it be appropriate if I updated the wiki appropriately?

Many thanks
banksr0 is offline   Reply With Quote
Old 11th October 2006, 19:36   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,449
yeah use the A version

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 11th October 2006, 21:23   #3
CancerFace
Senior Member
 
Join Date: Apr 2006
Posts: 289
Send a message via ICQ to CancerFace
The GetComputerName API call was added in order to provide support for NT4 and not 9x/ME. Besides, the Netapi32 calls used on that Wiki page are not available in 9x/ME
CF
CancerFace is offline   Reply With Quote
Old 12th October 2006, 09:50   #4
banksr0
Junior Member
 
Join Date: Oct 2006
Posts: 3
CancerFace:

The function could perhaps be implemented in the following way, to ensure it works on all the systems it used to work on, and works on 9x too.

Currently it is:
sName = GetComputerNameExW // For XP, 2003, etc.
If sName = ""
sName = GetComputerNameW // For NT (4?)

It could be changed to
sName = GetComputerNameExW // For XP, 2003, etc.
If sName = ""
sName = GetComputerNameW // For NT (4?)
If sName = ""
sName = GetComputerNameA // For 9x.

This won't change existing functionality, but will allow 9x machines to use the correct API call (as neither of the 2 previous calls are implemented on 9x machines).

How does that sound?
banksr0 is offline   Reply With Quote
Old 12th October 2006, 10:09   #5
CancerFace
Senior Member
 
Join Date: Apr 2006
Posts: 289
Send a message via ICQ to CancerFace
@banksr0
There is no arguement about what you propose since the macro on the Wiki does not work on 9x/ME machines.

However my point was that the above Wiki page describes user management functions that do not exist in 9x/ME and as such I don't see a point in updating the code on that page.

If you really think that there should be some information on the Wiki about getting the computer name in a 9x/ME system, using API calls, then I suggest to look into this page and add a similar macro/function there.
CF
CancerFace is offline   Reply With Quote
Old 12th October 2006, 10:25   #6
banksr0
Junior Member
 
Join Date: Oct 2006
Posts: 3
Ahhhh!!! Sorry - I completely misunderstood you! I see your point and completely agree with it. I hadn't really thought about what the purpose of the page as a whole was, as I wasn't doing any user-management stuff.

Thanks for the pointer - I'll look into the other page
banksr0 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