Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Getting the local host name


6 replies to this topic

dkenny

dkenny
  • Members
  • 4 posts

Posted 23 May 2002 - 13:49

Hi all,

Is there any easy way to get the name of the localhost using installshield (6.3). This could be accomplished by reading the %computername% environment variable but i haven't come across a way of doing this..

Cheers,

dkenny

dkenny
  • Members
  • 4 posts

Posted 23 May 2002 - 14:21

Doh!

Got it.. Registry.
SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment";

My head isn't properly screwed on today.

hteichert

hteichert
  • Members
  • 158 posts

Posted 24 May 2002 - 11:37

No, sorry. You haven't. On my NT machine there is no entry for the computername in the registry at the place you noted. Use the String Value of "ComputerName" in the key
"HKLM\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName"
instead.
h.teichert-ott

MKaiser

MKaiser
  • Full Members
  • 88 posts

Posted 24 May 2002 - 16:03

There's an API function called GetComputerName which you can call from Kernel32.dll or so. This function gives you the current computer name.

Regards,
Marko

VVorontsov

VVorontsov
  • Members
  • 1 posts

Posted 05 June 2002 - 17:25

function GetLocalHostName()
NUMBER  nSize;
begin
nSize = 256;
MsiGetProperty(ISMSI_HANDLE, "ComputerName", szHostName, nSize);
end;

hteichert

hteichert
  • Members
  • 158 posts

Posted 10 June 2002 - 10:40

The answer of VVorontsov doesn't apply to Installshield 6. MSIGetProperty is a windows installer function and doesn't exist on IS6.
h.teichert-ott

Ide Nentjes

Ide Nentjes
  • Members
  • 222 posts

Posted 13 June 2002 - 13:26

Or use the script found in  'IS5/6 Samples > Network' :GetComputerName