2016-03-24 23:22:05 -04:00
|
|
|
# WiFi Sitter
|
2016-03-24 23:29:55 -04:00
|
|
|
It's a babysitter for your WiFi NIC.
|
2016-03-24 23:22:05 -04:00
|
|
|
|
2016-03-24 23:24:10 -04:00
|
|
|
This is born out of the need to have the wifi adapter disabled when Ethernet is
|
2016-03-24 23:22:05 -04:00
|
|
|
active, seems like this should be a solved problem but there are no good free
|
|
|
|
tools for this. Some PC vendors produce their own which provide this behavior
|
|
|
|
but they also try to be the one stop shop for all your WiFi management needs.
|
2016-03-29 22:21:47 -04:00
|
|
|
Windows does a fine job managing which hotspots you're connected to, this just
|
2016-03-24 23:22:05 -04:00
|
|
|
fills in one gap.
|
|
|
|
|
|
|
|
While running the application watches for IP changed and availability changed
|
2016-03-24 23:24:10 -04:00
|
|
|
events and enables/disables WiFi adapters accordingly. When Ethernet is active,
|
2016-03-24 23:22:05 -04:00
|
|
|
WiFi adapters are disabled if they've made a connection, if WiFi is active but
|
|
|
|
not connected it is left alone, when ethernet gets unplugged or the network
|
|
|
|
availability goes away all WiFi adapters are enabled. That is all it does,
|
|
|
|
there is no configuration, it ignores Bluetooth adapters and MS WiFi Direct
|
|
|
|
Virtual adapters. It compiles to a single .Net 4.0 executable and only makes
|
|
|
|
use of .Net and a few commands present in all standard Windows installs (not
|
|
|
|
tested on Windows embedded).
|
|
|
|
|
|
|
|
Roadmap:
|
2016-03-29 22:21:47 -04:00
|
|
|
|
|
|
|
- [x] Install as Windows service
|
|
|
|
- [x] Log to Windows Event Log
|
|
|
|
- [ ] Systray Icon w/status indicator
|
|
|
|
- [x] Configurable NIC whitelist/blacklist
|
2016-04-11 15:13:53 -04:00
|
|
|
- [x] Prepackaged builds
|
2016-04-24 00:31:44 -04:00
|
|
|
- [ ] Network status polled from iphlpsvc.dll
|
2016-03-29 22:21:47 -04:00
|
|
|
|
2016-03-31 21:13:15 -04:00
|
|
|
## Usage
|
2016-03-29 22:21:47 -04:00
|
|
|
|
|
|
|
Wifi-Sitter can be installed from the command line. First place the exe where
|
|
|
|
you'd like it to stay (if you move it, the service will break), then run like
|
|
|
|
so from an admin shell:
|
|
|
|
|
|
|
|
`WifiSitter.exe /install`
|
|
|
|
|
|
|
|
The service is configured to start automatically but will not be started after
|
|
|
|
if you're automating a deployment, you'll need to run `net start wifisitter`
|
|
|
|
or use your service starting command of choice.
|
|
|
|
|
|
|
|
Similarly, uninstall like so:
|
|
|
|
|
|
|
|
`WifiSitter.exe /uninstall`
|
|
|
|
|
|
|
|
It can be run as a console application for debugging purposes by running:
|
|
|
|
|
|
|
|
`WifiSitter.exe /console`
|
|
|
|
|
|
|
|
|
2016-03-31 21:13:15 -04:00
|
|
|
## Configuration
|
|
|
|
|
|
|
|
There isn't much to configure in WifiSitter but there is one tunable to configure,
|
|
|
|
there may be some network adapters you want ignored complete, Microsoft WiFi
|
|
|
|
Direct for example. Network adapters are named "Ethernet" or "WiFi", names are
|
|
|
|
too generic so the whitelist is made up of the network adapter descriptions.
|
|
|
|
They are string values located at:
|
|
|
|
HKLM\SYSTEM\CurrentControlSet\services\WifiSitter\NicWhiteList
|
|
|
|
Keys are ignored entirely, they are only used to reference the values and can be
|
|
|
|
anything, incrementing numbers are used by default. Regular expressions were
|
|
|
|
overkill for my needs so matching is done by a case-insensitive .StartsWith().
|
|
|
|
Note, these values are removed when uninstalling.
|
|
|
|
|
|
|
|
## Notes
|
|
|
|
|
2016-03-29 22:21:47 -04:00
|
|
|
*Many thanks to Matt Davis for [this](http://stackoverflow.com/a/4865893/977627) answer
|
|
|
|
and Samuael Neff for [this](http://stackoverflow.com/a/12282179/977627). They helped a lot with converting to a service.*
|
|
|
|
|
2016-05-25 02:22:03 -04:00
|
|
|
This repository is mirrored on my site, [here](https://mcardletech.com/git/sean-m/wifi-sitter).
|