TBWinRE doesn't load WiFi profiles

User discussion and information resource forum for Image products.
PsychBiller
Posts: 61
Joined: Sun Aug 05, 2012 4:45 pm

TBWinRE doesn't load WiFi profiles

Post by PsychBiller »

I followed the instructions on https://www.terabyteunlimited.com/howto ... _settings/, and exported three WiFi profiles from another machine. I named the files as directed, and put the files in the C:\tbwinre folder. The instructions say to put them in the "build folder," which I hope meant the same thing.

When I try to use the USB, it does not have the profiles. That menu option is grayed out under Tools.

I'm trying to build a USB that will boot, automatically connect to a WiFi network, then run the commands in the INITSCRIPT.CMD file. The CMD files run, but I'm not getting connected to WiFi automatically.
TeraByte Support(PP)
Posts: 1644
Joined: Fri Aug 12, 2011 12:51 am

Re: TBWinRE doesn't load WiFi profiles

Post by TeraByte Support(PP) »

The "build folder" is the folder with the build files (TBWinPE.exe, etc.). If your "build" folder is C:\tbwinre then that's where you'd put the files.

Does Builder's log show the profiles were exported? There should be a message or error for each one. I assume the TBLauncher option to run Wi-Fi initialization is enabled.

Can you manually connect to the network in question? Auto-connecting to the manually exported profiles is currently disabled. However, you should be able to automatically connect by running the appropriate commands in InitScript.cmd. The steps would be:

1. Copy the desired profile .xml files into the build. You can use BuildScript to do this or you can do it manually (pause build, copy in files). For example, copy the files to the \Profiles folder. In BuildScript, assuming the profile .xml files are in the build's folder, the commands would be:
md "%TBWinPE_MountPath%\Profiles"
copy "%TBWinPE_BuildPath%\Wi-Fi-MyNetwork.xml" "%TBWinPE_MountPath%\Profiles"

If you have more .xml files then add the appropriate copy commands. Examples of copying in files for a custom build can be found in this KB article: https://kb.terabyteunlimited.com/kb-art ... re-builds/

2. Configure InitScript to add the profiles (if necessary) and connect to the one you want. For example, if the profile is located at X:\Profiles\Wi-Fi-MyNetwork.xml, then use:
netsh wlan add profile X:\Profiles\Wi-Fi-MyNetwork.xml
netsh wlan connect MyNetwork

Use the correct profile name for your network (I used "MyNetwork" here). If you get the manual profiles exporting into the build then you may not need to use netsh to add the profiles (they would already exist). In that case, you should just need the connect command. The "netsh wlan show profiles" command will list what's there.

---

For troubleshooting:

If TBLauncher's log is enabled you can check that and see what it shows for Wi-Fi related entries (X:\Windows\System32\TBLauncher.log).

If the Connect Wi-Fi Profile menu option is grayed out it means there are no profiles or no Wi-Fi interfaces found. If the Wi-Fi Scan & Connect menu item is grayed out it means Wi-Fi support isn't available. Are the WiFi network drivers being included in the build? Make sure you're including the drivers for the system(s) that will be booting the media. In most cases, Builder can get them if the "Add installed storage and network drivers" option is enabled (Build Options tab in Settings). Of course, these would be for the system Builder is being run on. Drivers for other systems/devices would need to be pulled manually.

Since you need network access in InitScript.cmd, make sure to disable background initialization in TBLauncher. Otherwise, the network may not be ready before the script is run.
PsychBiller
Posts: 61
Joined: Sun Aug 05, 2012 4:45 pm

Re: TBWinRE doesn't load WiFi profiles

Post by PsychBiller »

Please keep in mind that I am running TBWinRE, which I think of as the GUI version, not the TBWinPE command line version. I am not an experienced user of this program and all of your discussion about BuildScript is over my head.

The TBWinPE log file was silent on the profiles. Keep in mind I am not exporting the WiFi profiles with TBWinPE. This was done manually. I took your recommendation to place the WiFi profiles in the C:\tbwinre\Profiles folder, if I understood you correctly. But the log file didn't say, hey, I put these WiFi profiles in your build.

When I try to use the USB, the TBLauncher.log file says "Wi-Fi profile data not found" so it appears that the profiles aren't being added to the build. The TBLauncher Tools menu shows "Connect Wi-Fi profile" as grayed out, which is further evidence that the profiles didn't make it into the build.

So back to basics. I am not exporting profiles during creation of the build. I have XML files of my profiles. Where do I put them and how I do I get them into the build using TBWinRE in GUI mode?
TeraByte Support(PP)
Posts: 1644
Joined: Fri Aug 12, 2011 12:51 am

Re: TBWinRE doesn't load WiFi profiles

Post by TeraByte Support(PP) »

The BuildScript is also supported in Builder so you don't need to be running the command line version. The \Profiles folder I suggested is "inside" the build (not in the C:\tbwinre folder). Also, you didn't say if you could scan and connect to the network so we know that part is working.

Is there a reason why you're not just exporting the profiles? Do you have Wi-Fi profiles on the system you're using to create the build that you don't want exported? Otherwise, I don't see why you're not using the easy method of putting the .xml files in the build folder and using the export option. This will copy them into the build automatically. However, both methods are shown below (use the one you prefer).

Here are the steps to copy the .xml profiles into the build using the export option:
1. Put the .xml files into the build's folder (C:\tbwinre). The filenames should start with "Wi-Fi" (they won't be included otherwise).
2. Run TBWinPE/RE Builder.
3. Open Settings (File menu, Settings).
4. On the Build Options tab, enable the "Export Wi-Fi profiles" option.
5. On the TBLauncher tab, enable the "Run Wi-Fi initialization" and "Run network initialization" options. Disable the "Run initialization programs in background" option.
6. Click OK to save the change.
7. Create the build.
8. Check Builder's log (TBWinPE.log) and verify the profiles were successfully copied into the build.

Here are the steps to use the BuildScript to copy in the profile files:
1. Put the .xml files into the build's folder (C:\tbwinre). The filenames should start with "Wi-Fi" (they won't be included otherwise).
2. Run TBWinPE/RE Builder.
3. Open Settings (File menu, Settings).
4. On the TBLauncher tab, enable the "Run Wi-Fi initialization" and "Run network initialization" options. Disable the "Run initialization programs in background" option.
5. On the Scripts tab, enable the "Use BuildScript.cmd" option. Then click the "Edit" link to open the script in Notepad.
6. At the end of the file, add the command lines to copy the profile files into the build. For example, the following two commands will create the \Profiles folder and copy all Wi-Fi*.xml files into it:

Code: Select all

md "%TBWinPE_MountPath%\Profiles"
copy "%TBWinPE_BuildPath%\Wi-Fi*.xml" "%TBWinPE_MountPath%\Profiles"
7. Save the file and exit Notepad.
8. Click OK to save the Settings changes.
9. Create the build.

Note that profiles copied in this way will not be available in TBLauncher's menu. You will need to manually add and connect them using InitScript or the Command Prompt as detailed in the previous post.
PsychBiller
Posts: 61
Joined: Sun Aug 05, 2012 4:45 pm

Re: TBWinRE doesn't load WiFi profiles

Post by PsychBiller »

Exactly--the reason I wasn't exporting the profiles with the checkbox in TBWinPE is that the machine I am running on has WiFI profiles that I don't want included. It has 6 profiles and I only want 3. So I thought that by manually exporting the ones I wanted and putting their XML files in the C:\TBWinRE folder, I would just get those three. Checking the Export box seems to do exactly that--export from the machine where TBWinRE is being run.

It looks like I'm going to have to compromise and accept the three profiles I don't want to get the fully automatic build. I don't see why your BuildScript method won't include the profiles in the TBLauncher menu.
TeraByte Support(PP)
Posts: 1644
Joined: Fri Aug 12, 2011 12:51 am

Re: TBWinRE doesn't load WiFi profiles

Post by TeraByte Support(PP) »

It's assumed the user would want the profiles on the system so they are always exported if available to make it easier. However, an option could probably be added to exclude them so only the .xml files get copied in.

If you disable the Wi-Fi network adaptor(s) on the system before you create the build it should prevent them from being found and only export the .xml files (the log will show what's exported). Note that TBLauncher still won't auto-connect because it only supports that for the internal profiles (those connected when the build is created), but they'll show in the menu. You can use the "netsh wlan connect <profile_name>" command in InitScript to connect, though. You may also need to add a delay after running the command to allow the connection to establish (sometimes it takes a period of time to actually show up). The 'timeout' program is included in the build (e.g. timeout 20). For example, if your profile name is MyNetwork:

Code: Select all

netsh wlan connect MyNetwork
timeout 20
PsychBiller
Posts: 61
Joined: Sun Aug 05, 2012 4:45 pm

Re: TBWinRE doesn't load WiFi profiles

Post by PsychBiller »

Disabling the wireless network adapter did restrict the inclusion of profiles to only those XML files I had placed in the C:\tbwinre folder. So that's progress.

I added the following lines to my InitScript.CMD as you recommended:

netsh wlan connect Wi-Fi-Profile1
timeout 20

When I booted from the USB, I saw the InitScript.CMD being executed. While the timeout was counting down, I saw an error saying that there was no profile Wi-Fi-Profile1 assigned to the specified interface. Yet when I opened TBLauncher.log, I saw the profile loading and being added to the interface. The interface and profiles do appear in the Tools menu, and I can connect manually. However, the InitScript.CMD method isn't automating the connection as expected.

Does the netsh command need .XML appended to the profile name?
TeraByte Support(PP)
Posts: 1644
Joined: Fri Aug 12, 2011 12:51 am

Re: TBWinRE doesn't load WiFi profiles

Post by TeraByte Support(PP) »

You need to specify the actual profile name and not the filename. I don't know what your profile name is so I've just used examples. When you export to the .xml it's usually the last part (might be 'Profile1' in your example). You can look in the .xml file in Notepad and check the first <name>....</name> item or you can run the following command to show them: netsh wlan show profiles

Your command might be:
netsh wlan connect Profile1
PsychBiller
Posts: 61
Joined: Sun Aug 05, 2012 4:45 pm

Re: TBWinRE doesn't load WiFi profiles

Post by PsychBiller »

Using the actual network name to connect doesn't work, either.
TeraByte Support(PP)
Posts: 1644
Joined: Fri Aug 12, 2011 12:51 am

Re: TBWinRE doesn't load WiFi profiles

Post by TeraByte Support(PP) »

Have you disabled background initialization? If not, do that because it needs to get done before InitScript is run. (I assume it is, but double-checking.)

Are you using the profile name shown when you run the "netsh wlan show profiles" command?

Does it connect if you run the command from the Command Prompt?

----
An option has been added to the next version to allow selecting the profile types (system, .xml) to export and can auto-connect from an .xml profile.
Post Reply