Closed ghost closed 2 months ago
Not tested but something like that i think:
<settings pass="windowsPE">
<component name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ImageInstall>
<OSImage>
<InstallToAvailablePartition>false</InstallToAvailablePartition>
</OSImage>
</ImageInstall>
</component>
</settings>
<settings pass="offlineServicing">
<component name="Microsoft-Windows-NetFx3" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Enable>true</Enable>
</component>
</settings>
@Subhashis2007 can you test out @Syntax3rror404 script and see if it works for you?
For sure, I'll try today.
@memstechtips @Syntax3rror404 I added it before audit user part and it simply resulted the iso into this,
my unattended.xml https://hastebin.skyra.pw/kewuvofiyu.htm
Hmmmm if this not works, we can try it with dism like that:
Offline, but needs the cab containing the req files.
DISM /Image:C:\test\offline /Enable-Feature /FeatureName:NetFx3 /All /LimitAccess /Source:D:\sources\sxs
OR
Online, needs internet connection.
DISM /Online /Enable-Feature /FeatureName:NetFx3 /All
@memstechtips do you know, if the microsoft images containing the .net framework 3.5? If yes we sould be able to add the offline dism command to the powershell scripts????
@memstechtips do you know, if the microsoft images containing the .net framework 3.5? If yes we sould be able to add the offline dism command to the powershell scripts????
It does, I know for sure. Since this exists
see
In your link the source of .net framework is the network:
To install .NET Framework 3.5 from installation media located on a network share, use the following command:
PowerShell
Install-WindowsFeature Net-Framework-Core -source \network\share\sxs Where \network\share\sxs is the location of the source files.
For more information about the Install-WindowsFeature cmdlet
But you can try the following command on a clean system
DISM /Image:C:\test\offline /Enable-Feature /FeatureName:NetFx3 /All /LimitAccess /Source:D:\sources\sxs
Please set Source path to your right path. If this works, we you can simply add this to the xml and you're done :)
Ok, then we can try this. Not tested hope this works. I can test it tomorrow.
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="windowsPE">
<component name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
<RunSynchronous>
<RunSynchronousCommand wcm:action="add">
<Order>1</Order>
<Description>Install .NET Framework 3.5</Description>
<Path>DISM /Image:C:\test\offline /Enable-Feature /FeatureName:NetFx3 /All /LimitAccess /Source:D:\sources\sxs</Path>
</RunSynchronousCommand>
</RunSynchronous>
</component>
</settings>
</unattend>
If this is not enough, we need a more complex batch script
Or something like this to get near to your example in your link:
<!-- Command File Template for DISM Execution -->
<File path="C:\Windows\Setup\Scripts\install_netfx35.cmd"><![CDATA[
@echo off
Title .NET Framework 3.5 Offline Installer
for %%I in (D E F G H I J K L M N O P Q R S T U V W X Y Z) do if exist "%%I:\\sources\boot.wim" set setupdrv=%%I
if defined setupdrv (
echo Found drive %setupdrv%
echo Installing .NET Framework 3.5...
Dism /online /enable-feature /featurename:NetFX3 /All /Source:%setupdrv%:\sources\sxs /LimitAccess
echo.
echo .NET Framework 3.5 should be installed
echo.
) else (
echo No installation media found!
echo Insert DVD or USB flash drive and run this file once again.
echo.
)
pause
]]>
</File>
<!-- Start the script to install NET Framework 3.5 -->
<Extensions>
<File path="C:\Users\Default\AppData\Local\Microsoft\Windows\Shell\LayoutModification.xml"><![CDATA[
<LayoutModificationTemplate Version="1" xmlns="http://schemas.microsoft.com/Start/2014/LayoutModification">
<LayoutOptions StartTileGroupCellWidth="6" />
<DefaultLayoutOverride>
<StartLayoutCollection>
<StartLayout GroupCellWidth="6" xmlns="http://schemas.microsoft.com/Start/2014/FullDefaultLayout" />
</StartLayoutCollection>
</DefaultLayoutOverride>
</LayoutModificationTemplate>
]]></File>
</Extensions>
</unattend>
I haven't tested your script yet but I think we have 2 choices:
Thoughts?
It looks to me, that .Net 3.5 is offline available.
See link from @Subhashis2007 https://winaero.com/how-to-offline-install-net-framework-3-5-in-windows-11-with-dism/
The batch script is also from this side. I think to call this script in the setup should work?!
I haven't tested your script yet but I think we have 2 choices:
- Either write a script that automatically downloads and installs .NET FX 3.5 during the OOBE phase (This will require an internet connection)
- Download the .NET FX 3.5 package and add it to your ISO with AnyBurn. Then include a command in the answer file that runs that package during one of the Windows installation phases.
Thoughts?
it is better offline, since the package already exists inside the iso
The batch script is also from this side. I think to call this script in the setup should work?! the script looks good tho. and it is dynamically detects installation drive. I'll try and tell.
.NET 3.5 auto enabled in https://github.com/memstechtips/UnattendedWinstall/commit/a9348a19ad425bb840c2a3e4e67501a81715ef66
PS: I flash windows on a lot of PCs and most of them need this framework for various purposes, and it really is hectic to install it in each PCs since I batch install