Archive: Select network interface and set to variable


Select network interface and set to variable
Hello,

I am new to this scripting language, but I am trying to automate the install process for our software we use internally. The only problem I have now is that I need to have the user select the network interface name and have the name such as "Local Area Network" set to a variable to be used later. I have checked out most of the tutorials, howtos, and FAQ but either I missed the answer or its not their. Any idea how I could go about doing this?

Thanks,
Jebis


Jebis,

There is a possible solution for your problem. Take a look at the following lines:

1.) Dump all NIC information to a file. You can use the following lines in a command shell:

- netsh interface ip show address > C:\nic.log
or
- netsh -c interface dump > C:\nic.log

Test, what is suitable for you.

2.) Read the necessary information (NIC names) from that log file into the given NSIS user variables ($0 - $R0). Try the FileRead command or may be a plugin can do it in an very easy way.

3.) You should execute step 1 and step 2 in the .oninit function of your script. After you have filled the appropriate variables with the NIC names you can apply the NIC names for example to the description of radiobuttons the user has to select during installation procedure. These radiobuttons are probably parts of your custom dialog.

4.) On the end of your installation procedure you should delete the dump file (here: "nic.log").

May be it helps solving your problem.

Regards
Candu


Thanks
Thanks for the help, I was hopping for a command which could pull the data directly from the system, but this will work also. Thank you very much.