WindowsAPI call from InstallShield
Posted 06 November 2001 - 11:25
How can I call the GetUserName
WinAPI function?
Posted 06 November 2001 - 14:19
I have solved the problem :)))
To call the Windows API From IS:
**********************************************
// your DLL function prototypes (AT the top of the setup.rul)
prototype LONG advapi32.GetUserNameA(BYREF STRING, BYREF LONG);
//To use the function above (GetUserNameA)
STRING svUserName;
LONG nvLength, nvResult;
nvLength = 256;
nvResult = GetUserNameA(svUserName, nvLength);
MessageBox(svUserName, SEVERE);
****************************************************
The above works for all OS.
/Vico
Posted 09 November 2001 - 11:49
Here is a better API function to get information about
CurrentUser, Domain, PrfileString, SystemDrive,
SystemRoot, CurrentOs and more...
***********************************************************
//At the top of the
prototype LONG kernel32.GetEnvironmentVariable(BYVAL STRING, BYREF STRING, BYREF LONG);
//Calling the API Function.
STRING szUserProfile;
LONG nvLength;
nvLength = 256;
nvResult = GetEnvironmentVariable("Userprofile",
szUserProfile, nvLength);
MessageBox(szUserProfile, SEVERE);
***********************************************************