0
votes

I have a line of text in my Inno Setup file that is:

  • TextBox.Text := GetComputerNameString();

to get the computers name. I'm getting this error when trying to go through the setup wizard once it's built:

enter image description here

Do I have to do some sort of code setup (like registering an external function or something) to call this function or should I just be able to call it since it's built in?

1
On which OS are you facing this problem?Wosi
Windows Server 2008 R2 Standard, 64 bit.B-M
What does GetLastError return after trying to retrieve the computer name? vincenzo.net/isxkb/index.php?title=GetLastError_%28%29Wosi
Unknown at the moment, I shall put that in and give it a look.B-M
Are you sure the error is caused by the GetComputerNameString? Can you put Log('Before GetComputerNameString'); before the TextBox.Text := GetComputerNameString(); and Log('After GetComputerNameString'); after and show us the installer log?Martin Prikryl

1 Answers

-1
votes

You declare a variable as a global variable

[code]
var
    glbComputerName String;

...
step by 1 function
    glbComputerName := GetComputerNameString();
    TextBox.Text := glbComputerName;
...
step by 2 function
    //glbComputerName use...
    MsgBox( 'Computer Name :' + glbComputerName, mbError, MB_OK );