Windows 11 installation with Winget for Batch applications

morphost

New Member
Messages
1
Reaction score
0
Hello, I need to deploy Windows 11, in French mode, using OOBE and a simple local user account. In addition, I would like to install certain applications via Winget after the first user session. I created a Batch installation script on a VM to test the script. Everything launches fine. The thing I want to do is have a connection. Without a Winget connection, I can't download and install the applications. I would like to do this either via Wi-Fi or wired in order to launch the script via Batch. So, Wi-Fi connection (preconfigured in .bat files, zt in .xml profiles file) connection validated --> launch of Winget applications. How do I integrate the Batch and Wi-Fi .xml files? To achieve automation.
 
1. Export the Wi-Fi profile from a working system:
Code:
netsh wlan show profiles
netsh wlan export profile WiFiNetworkName key=clear folder=.

Replace WiFiNetworkName with the actual network name. It makes it easier for you to know which network we're exporting.
Due to the way profiles are transferred to another system, the Wi-Fi password is in clear text.

2. From the Post-Setup (Before logon), add the exported XML file.

3. Add the commands:
CommandParameters
netwlan add profile filename="%SYSTEMROOT%\Setup\WiFiNetworkName.xml" user=all

4. If you're using a licensed version of NTLite, Updates Downloader will offer the winget packages for download and integration. You will need to add a PowerShell command to force DesktopAppInstaller (winget's parent package) to immediately activate. Otherwise winget won't be available for a few minutes until after the install is done.

CommandParameters
powershellAdd-AppxPackage -RegisterByFamilyName -MainPackage Microsoft.DesktopAppInstaller_8wekyb3d8bbwe
wingetinstall Google.Chrome --disable-interactivity --silent --accept-source-agreements --accept-package-agreements

You could run the same commands from your own batch script, just add the file from (Before logon) with no parameters.
 
Back
Top