====== Hub on Windows ======

The Windows hub works the same as the Linux one, with a Windows service. Synchronet for Windows must be on the same machine. First [[doorhub:running_a_hub#prepare_the_door_bbs|prepare the door BBS]]: the ''sbbs.ini'' and ''modopts.ini'' changes are the same on Windows.

//The Windows hub was tested under Wine with a stand-in BBS. It hasn't yet been run against a real Synchronet for Windows; reports welcome.//

===== Install =====

**1.** Make a folder ''C:\doorhub'' and copy ''doorhub.exe'' from ''doorhub-0.1.0-windows-x64.zip'' into it. (Another folder works too; then add ''-d C:\your\folder'' to every command, or set the environment variable ''DOORHUB_DIR''.)

**2.** Open a **Command Prompt as Administrator** and run:

<code>
cd C:\doorhub
doorhub init
</code>

''init'' makes ''hub.json'' and the host key and prints the key's fingerprint. Give it to member sysops so they can check it.

**3.** If Synchronet isn't in ''C:\sbbs'':

<code>
doorhub set jsexec D:\sbbs\exec\jsexec.exe
doorhub set sbbs_ctrl D:\sbbs\ctrl
</code>

**4.** Name the hub, set the address members will use, and add games and members:

<code>
doorhub set hub_name "Example Door Hub"
doorhub set public_host hub.example.com
doorhub door add lord LORD "Legend of the Red Dragon"
doorhub bbs add EXB "The Example BBS"
</code>

See [[doorhub:games|Games]] and [[doorhub:member_bbses|Member BBSes]].

**5.** Try it:

<code>
doorhub serve
</code>

Windows Firewall asks whether ''doorhub.exe'' may accept connections. Allow it on the networks your members connect from. Ctrl+C stops it.

===== Run it as a service =====

From the Administrator Command Prompt, in ''C:\doorhub'':

<code>
doorhub service install
doorhub service start
</code>

The service is **Door Hub** (''DoorHub''). It starts with Windows, runs as Local System, and restarts itself if it stops. Its log is ''C:\doorhub\doorhub.log''. You can also start and stop it in **services.msc**.

<code>
doorhub service stop
doorhub service remove
</code>

The service remembers the folder it was installed from (it runs ''doorhub.exe -d C:\doorhub serve''). If you move the folder, remove and install the service again.

===== Notes =====

  * The hub makes Synchronet users with ''jsexec.exe''. Local System can write to ''C:\sbbs'' by default. If Synchronet runs as another account and you have tightened permissions on its folders, set the Door Hub service to log on as that account (services.msc, Door Hub, Log On).
  * Keep ''doorhub.exe'', ''jsexec.exe'' and the Synchronet folders on a local drive.
  * The admin commands work while the service runs. Run them from a Command Prompt in ''C:\doorhub'' (or with ''-d'').
  * **Updating:** ''doorhub service stop'', replace ''doorhub.exe'', ''doorhub service start''.
