Hi.
I'm using the InstallShield DevStudio 9 - Install Script Project - and I don't know how to get the computer name in the InstallScript. Is there a variable or a function that return the computer name ?
Thanks.
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.

Computer name.
Started by
Marcia Cardoso
, Oct 05 2005 19:48
3 replies to this topic
Posted 06 October 2005 - 12:07
I think you can use the COMPUTERNAME environment variable.
Stefan Krüger
InstallSite.org twitter facebook
Posted 18 October 2005 - 22:33
Try this
NOTE: sv_COMPUTER_NAME must be defined as a Global Variable in your code.
NOTE: sv_COMPUTER_NAME must be defined as a Global Variable in your code.
CODE |
///////////////////////////////////////////////////////////// // // FUNCTION: Get_Computer_Name() // // PURPOSE: Retrieve the Computer Name and place it in // the Global variable sv_COMPUTER_NAME // // LAST UPDATED: 05-02-2005 - Created - TEB // // Look in the registry entry below. // HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName // ///////////////////////////////////////////////////////////// prototype Get_Computer_Name(); //...........// Retreives the computer name from the registry function Get_Computer_Name() NUMBER nvType , nvSize; begin // Set the Root Key RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE); if (RegDBKeyExist("SYSTEM\\CurrentControlSet\\Control\\ComputerName\\ComputerName") = 1) then // exists if (RegDBGetKeyValueEx("SYSTEM\\CurrentControlSet\\Control\\ComputerName\\ComputerName" , "ComputerName" , nvType, sv_COMPUTER_NAME, nvSize ) = 0) then // got value if (StrLengthChars ( sv_COMPUTER_NAME ) < 1) then // No entry sv_COMPUTER_NAME = "No Computer Name Entry"; endif; else // NOT got value sv_COMPUTER_NAME = "No Computer Name Entry"; endif; else // No entry sv_COMPUTER_NAME = "No Computer Name Entry"; endif; end; |
Edited by Ozone, 18 October 2005 - 22:36.