Automating WiFi Configuration

From Wiki

Revision as of 16:44, 23 June 2008 by SYNACK (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to:navigation, search

You will need;

  • Windows XP Pro clients with Service Pack 2
  • Method of creating ISO image files (e.g. Nero, BurnAtOnce)
  • DaemonTools (or equivalent ISO mounting utility)
  • AutoItV3 and some simple AutoIt scripting skills (I will have to check with my boss if I can release the source code)

Method

1 - Use Wireless Network Setup Wizard (launch from Control Panel) to create a Smart Network Key (can be on floppy disk) with the WLAN details (SSID and WEP key)

2 - Create an ISO image of the Smart Network Key

Repeat the above steps as necessary to create ISO files for all WLANs

3 - Create an AutoIT script which does the following ((My script is a little bit more complicated;

  • Each time it runs, it adds an entry to the HKLM\Software\Microsoft\Windows\CurrentVersion\Run key to ensure it will execute again at the next logon.
  • It tests for the presence of the required DaemonTools drive (I install DaemonTools with Group Policy. It can take a couple of reboots before the virtual drives become visible)
  • If the drive is not present, the script terminates.
  • If the drive is present, then it processes and deletes all the ISO files and removes itself from the registry.))
    • Scans it's own folder, looking for .ISO files
    • For each .ISO file,
      • Mount the ISO using DaemonTools (or equivalent tool)
      • Execute SETUPSNK.EXE on the mapped drive
      • Wait for and automatically click necessary buttons to effect silent installation (This is AutoITs speciality)
      • NB - SETUPSNK attempts to write to the drive from which it runs, causing an error message. This must be dealt with by an AutoIt action, but does not cause a problem.
      • Pause to ensure SETUPSNK has finished
      • Dismount DaemonTools drive (or whatever)
      • Delete the ISO file (Important, as it contains the WEP key)

4 - Compile the AutoIt script to an executable

5 - Create a folder which contains the script and ISO files for each WLAN to be configured

You can test at this point by running the compiled script. REMEMBER that it will DELETE the ISO files, so be sure to keep copies!

6 - Arrange for a newly built PC to log on as local Administrator and execute the script

I build PCs with RIS and use the 'RunOnceEx' method detailed on http://unattended.msfn.org

The following $OEM$ structure exists in my RIS image

$OEM$
       -> $1
           -> INSTALL
                 -> WLAN - This folder contains the compiled AutoIT script and ISO files

Add a RunOnceEx entry which will execute the compiled script

Arrange for newly built RIS PCs to 'auto logon' as Administrator at least once so that the script will execute

Disclaimer

It's a real dog's breakfast, but it does seem to work. The WLAN connections sometimes seem to take an age to appear, but they usually do.

Disclaimer

It's a real dog's breakfast, but it does seem to work. The WLAN connections sometimes seem to take an age to appear, but they usually do.