Reputation: 37
I need to install OFFLINE features of Windows like "LegacyCompoents", "DirectPlay", ".NET Framework 3.5", "Windows Subsystem Linux" and "Developer Mode" on Windows 10 (Home/Pro x64 1909).
Online, it works fine with that (run as admin, obviously):
cls
@echo off
cd /d "%~dp0"
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" /t REG_DWORD /v "AllowDevelopmentWithoutDevLicense" /d "1" /f >nul
dism /online /add-capability /capabilityname:Tools.DeveloperMode.Core~~~~0.0.1.0 /norestart
dism /online /enable-feature /featurename:NetFx3 /norestart
dism /online /enable-feature /featurename:LegacyComponents /norestart
dism /online /enable-feature /featurename:DirectPlay /norestart
dism /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /norestart
pause
exit
But offline, I can't get packages. So as to, I tried to upgrade an offline image to find packages in a folder like "/sources/sxs".
I unpack my ".iso" image of Windows 10. This command gives me the number of the "Pro" installation = 6.
dism /get-imageinfo /imagefile:"%cd%\Windows 10 x64\sources\install.wim"
I mount the image.
if not exist "C:\test\offline" mkdir "C:\test\offline"
dism /mount-image /imagefile:"%cd%\Windows 10 x64\sources\install.wim" /index:6 /mountdir:"C:\test\offline"
Until here, it works. But just after that, the Developer Mode fails.
dism /image:"C:\test\offline" /add-capability /capabilityname:Tools.DeveloperMode.Core~~~~0.0.1.0 /logpath:"%~dpn0.log"
Error: 0x800f081f The source files could not be found. Use the "Source" option to specify the location of the files that are required to restore the feature. For more information on specifying a source location, see http://go.microsoft.com/fwlink/?LinkId=243077.
After that, .NET Framework 3.5 fails too, same error code.
dism /image:C:\test\offline /enable-feature /featurename:NetFx3 /logpath:"%~dpn0.log"
Otherwise, LegacyComponent, DirectPlay and Linux work fine.
dism /image:C:\test\offline /enable-feature /featurename:LegacyComponents
dism /image:C:\test\offline /enable-feature /featurename:DirectPlay
dism /image:C:\test\offline /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux
After that, I unmount the image, but I can't find the downloaded packages.
dism /unmount-image /mountdir:"C:\test\offline" /commit
My wish is to get ".cab" packages and to be able to install them just with a script like that:
cls
@echo off
cd /d "%~dp0"
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" /t REG_DWORD /v "AllowDevelopmentWithoutDevLicense" /d "1" /f >nul
dism /online /add-capability /capabilityname:Tools.DeveloperMode.Core~~~~0.0.1.0 /limitaccess /source:"%cd%\Packages" /logpath:"%~dpn0.log" /norestart
dism /online /enable-feature /featurename:NetFx3 /limitaccess /source:"%cd%\Packages" /logpath:"%~dpn0.log" /norestart
dism /online /enable-feature /featurename:LegacyComponents /limitaccess /source:"%cd%\Packages" /logpath:"%~dpn0.log" /norestart
dism /online /enable-feature /featurename:DirectPlay /limitaccess /source:"%cd%\Packages" /logpath:"%~dpn0.log" /norestart
dism /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /limitaccess /source:"%cd%\Packages" /logpath:"%~dpn0.log" /norestart
echo.
timeout 5
del /f /q "%~dpn0.log"
Can you help me, please?
Best regards,
Upvotes: 1
Views: 6220
Reputation: 31
I guess you already found the solution since it's an old post. I will write it down in case somebody else is looking for it.
You need to download the Features on Demand Windows 10 ISO file (you'll need a Visual Studio Subscription for this) and then extract the following packages:
Microsoft-OneCore-DeveloperMode-Desktop-Package~31bf3856ad364e35~amd64~~.cab
Microsoft-WebDriver-Package~31bf3856ad364e35~amd64~~.cab
Before installing the package, enable developer mode by setting the following DWORD key to 1:
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock\AllowDevelopmentWithoutDevLicense
The package can be installed with the following command:
dism /online /add-capability /capabilityname:Tools.DeveloperMode.Core~~~~0.0.1.0 /limitaccess /source:"C:\path\to\folder" /norestart
I have tested this on a domain joined computer without access to Windows Update
(WSUS server is configured via GPO and Dual Scan is disabled).
Upvotes: 2