Closed kendi182 closed 1 day ago
Certainly. For example, this is how I install Google Chrome with a custom .ps1 script in the Scripts to run in the system context, before user accounts are created section:
$file = "$env:TEMP\ChromeSetup.exe";
$uri = 'https://dl.google.com/chrome/install/chrome_installer.exe';
[System.Net.WebClient]::new().DownloadFile( $uri, $file );
Start-Process -FilePath $file -ArgumentList '/silent /install' -Wait;
This link will configure the form accordingly.
The system context is the natural phase to install software, but some installers expect user accounts to be present, and hence you need to call such installers from a custom script in the Scripts to run when the first user logs on after Windows has been installed section.
Some users prefer winget to install software. I have no experience with winget, but this script seems to do the job:
Invoke-WebRequest -Uri https://aka.ms/getwinget -OutFile Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle
Invoke-WebRequest -Uri https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx -OutFile Microsoft.VCLibs.x64.14.00.Desktop.appx
Invoke-WebRequest -Uri https://github.com/microsoft/microsoft-ui-xaml/releases/download/v2.8.6/Microsoft.UI.Xaml.2.8.x64.appx -OutFile Microsoft.UI.Xaml.2.8.x64.appx
Add-AppxPackage Microsoft.VCLibs.x64.14.00.Desktop.appx
Add-AppxPackage Microsoft.UI.Xaml.2.8.x64.appx
Add-AppxPackage Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle
winget install -e --accept-package-agreements --accept-source-agreements Google.Chrome
This link will configure the form accordingly.
Thank you so much for the examples, I was looking for a way to do this. Winget seems better suited for a future picker where the generator can offer a way to install programs using sites like https://winstall.app/, see my example:
Invoke-WebRequest -Uri https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx -OutFile Microsoft.VCLibs.x64.14.00.Desktop.appx
Invoke-WebRequest -Uri https://github.com/microsoft/microsoft-ui-xaml/releases/download/v2.8.6/Microsoft.UI.Xaml.2.8.x64.appx -OutFile Microsoft.UI.Xaml.2.8.x64.appx
Add-AppxPackage Microsoft.VCLibs.x64.14.00.Desktop.appx
Add-AppxPackage Microsoft.UI.Xaml.2.8.x64.appx
Add-AppxPackage Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle
winget install -e --accept-package-agreements --accept-source-agreements abbodi1406.vcredist Microsoft.DirectX Google.Chrome.Dev 7zip.7zip Valve.Steam ente-io.auth-desktop 64Gram.64Gram VideoLAN.VLC GIMP.GIMP.Nightly smartfrigde.Legcord Roblox.Roblox
winget install -e --accept-package-agreements --accept-source-agreements 9N0866FS04W8 9NBLGGH516XP 9NMPJ99VJBWV -s msstore
I would like to take the chance to jump in this topic.
How can i access/ handle files which are located on the same USB Stick as the windows iso an unattended.xml ? For example to install Programms which are not available for download or to copy custom configuration files?
thx
How can i access/ handle files which are located on the same USB Stick as the windows iso an unattended.xml ?
I assume that your question is about how to reliably determine its drive letter. In a .ps1 custom script, you can easily iterate over all drives and test if there is an autounattend.xml file in the root directory, like so:
foreach( $drive in [System.IO.DriveInfo]::GetDrives() ) {
if( Join-Path -Path $drive.RootDirectory -ChildPath 'autounattend.xml' | Test-Path ) {
# Do something with $drive...
}
}
For example, VMwareTools.ps1 uses a very similar method.
Furthermore, I have recently added a constant volume label unattend_iso to the .iso file generated by the the Download .iso file button, so you can also test for that volume label:
foreach( $drive in [System.IO.DriveInfo]::GetDrives() ) {
if( $drive.VolumeLabel -eq 'unattend_iso' ) {
# Do something with $drive...
}
}
Certainly. For example, this is how I install Google Chrome with a custom .ps1 script in the Scripts to run in the system context, before user accounts are created section:
$file = "$env:TEMP\ChromeSetup.exe"; $uri = 'https://dl.google.com/chrome/install/chrome_installer.exe'; [System.Net.WebClient]::new().DownloadFile( $uri, $file ); Start-Process -FilePath $file -ArgumentList '/silent /install' -Wait;
This link will configure the form accordingly.
The system context is the natural phase to install software, but some installers expect user accounts to be present, and hence you need to call such installers from a custom script in the Scripts to run when the first user logs on after Windows has been installed section.
Some users prefer winget to install software. I have no experience with winget, but this script seems to do the job:
Invoke-WebRequest -Uri https://aka.ms/getwinget -OutFile Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle Invoke-WebRequest -Uri https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx -OutFile Microsoft.VCLibs.x64.14.00.Desktop.appx Invoke-WebRequest -Uri https://github.com/microsoft/microsoft-ui-xaml/releases/download/v2.8.6/Microsoft.UI.Xaml.2.8.x64.appx -OutFile Microsoft.UI.Xaml.2.8.x64.appx Add-AppxPackage Microsoft.VCLibs.x64.14.00.Desktop.appx Add-AppxPackage Microsoft.UI.Xaml.2.8.x64.appx Add-AppxPackage Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle winget install -e --accept-package-agreements --accept-source-agreements Google.Chrome
This link will configure the form accordingly.
hello, I tested both solutions you gave me and neither worked. Follow the xml that I originally use without the program installation commands.
I tested both solutions you gave me and neither worked.
This link will add the Chrome install script from above to your existing autounattend.xml file. Note how I pasted the script in the form:
Hello, is there any field where I can install programs silently, such as Chrome, Adobe Reader, K-Lite, among others?
If I have a complete link to download the files, would this be possible?