[8525, TyTN, MDA Vario II, JasJam Software Upgradin] cuccureddu:
This is how to create a CAB for your WIFI settings

Okay, so after fiddling about all day with various sample xml codes from MSDN, I was finally able to create a CAB to configure my WIFI connection to my home router (including WPA passkey), so that I can just run the CAB every time I flash / hard-reset.

STEP 1.

Open Notepad and copy the code below to it

<wap-provisioningdoc>
<characteristic type="CM_WiFiEntries">
<characteristic type="[B]SSID: REPLACE_WITH_YOUR_SSID[/B]">
<parm name="DestID" value="[B]Destination GUID: SEE NOTE 1 BELOW[/B]"/>
</characteristic>
</characteristic>

<characteristic type="Wi-Fi">
<characteristic type="[B]CONNECTION TYPE: SEE NOTE 2 BELOW[/B]">
<characteristic type="[B]SSID: REPLACE_WITH_YOUR_SSID[/B]">
<parm name="DestId" value="[B]GUID: SEE NOTE 1 BELOW[/B]"/>
<parm name="Encryption" value="[B]SEE NOTE 3 BELOW[/B]"/>
<parm name="Authentication" value="[B]SEE NOTE 4 BELOW[/B]"/>
<parm name="NetworkKey" value="[B]REPLACE WITH YOUR NETWORK KEY, SEE NOTE 5[/B]"/>
</characteristic>
</characteristic>
</characteristic>
</wap-provisioningdoc>

STEP 2.

Replace the parameters in the sample code depending on the connection you want to configure:

SSID: Self-explanatory

Note 1

Destination GUID

For a connection to "The Internet", use this GUID

{436EF144-B4FB-4863-A041-8F905A62C572}

For a connection to "Work", use this GUID

{A1182988-0D73-439e-87AD-2A5B369F808B}

Note 2

Connection Type

"access-point" for infrastructure connection

"ad-hoc" for computer-to-computer

Note 3

Encryption

0 = WEP

1 = No encryption

4 = TKIP

Note 4

Authentication

0 = Open authentication mode

1 = Shared authentication mode

3 = Specifies Wi-Fi Protected Access (WPA) authentication

4 = Specifies WPA-PSK authentication

5 = Specifies WPA-NONE

Note 5

Network Key

Put your WPA or WEP network key here, just as you would enter in the settings screen. However, make sure that the key does not contain either the ",< or > characters, since this will screw up the XML code.

STEP 3.

Save the Notepad file as .provxml.xml

Choose "ALL FILES" in the "SAVE AS TYPE" box and "UNICODE" in the "ENCODING" dialog box

STEP 4.

Open a command-line window, go to the folder where you saved the xml file and type:

makecab /D COMPRESS=OFF .provxml.xml wifi.cab

STEP 5.

Copy the CAB file to your device and run it. You should now see your Wifi connection under the settings Wi-Fi control Panel

You will have to manually check the "Hidden Network" box if your router is hiding the SSID (I have not figured out the parameter to do this automatically yet)

Voilá! :)

Note: If you use WEP, you need some additional lines of code to specify things like the KeyIndex. See these pages for more info:

http://msdn2.microsoft.com/en-us/library/aa455986.aspx

http://msdn2.microsoft.com/en-us/library/aa456208.aspx

By way of example, below is a sample code for an access-point connection connection to the internet, using WPA-PSK authentication.

<wap-provisioningdoc>
<characteristic type="CM_WiFiEntries">
<characteristic type="My_SSID">
<parm name="DestID" value="{436EF144-B4FB-4863-A041-8F905A62C572}"/>
</characteristic>
</characteristic>

<characteristic type="Wi-Fi">
<characteristic type="access-point">
<characteristic type="My_SSID">
<parm name="DestId" value="{436EF144-B4FB-4863-A041-8F905A62C572}"/>
<parm name="Encryption" value="4"/>
<parm name="Authentication" value="4"/>
<parm name="NetworkKey" value="My_Network_Key"/>
</characteristic>
</characteristic>
</characteristic>
</wap-provisioningdoc>

I hope this works for you. Let me know if you have any problems / questions.