yes 300megs more for the install.wim, because i did not use maximum compression ... and i dont know all the dism commands something like this : imagex /export “G:\DeploymentShare\Operating Systems\ED\ED.wim” 1 c:\ED.wim /compress maximum or Windows Toolkit let you easily rebuild images which shrinks their size ..
If you are using install_wim_tweak.exe and not DISM to remove the packages, is not needed to specify the single packages. Say install_wim_tweak.exe /p "I:\1" /c Microsoft-Xbox /r Should remove all the packages starting with Microsoft-Xbox
tried that, in my case it did not work, but i found out there is two kind of install wim tweak, one need .net and the other not (bigger file size) ??? I will try again with new packages to remove ...
dism /mount-wim /wimfile:C:\DVD\sources\install.wim /index:1 /mountdir:C:\mount\windows Dism /Image:C:\mount\windows /Get-Packages DISM /Image:C:\mount\windows /Remove-Package /PackageName:Microsoft-OneCore-AppRuntime-xbox-Package~31bf3856ad364e35~amd64~en-US~10.0.10240.16384 ;Cortana DISM /Image:C:\mount\windows /Remove-Package /PackageName:Microsoft-Windows-Cortana-Package~31bf3856ad364e35~amd64~en-US~10.0.10240.16384 DISM /Image:C:\mount\windows /Remove-Package /PackageName:Microsoft-Windows-Cortana-Package~31bf3856ad364e35~amd64~~10.0.10240.16384 DISM /Image:C:\mount\windows /Remove-Package /PackageName:Microsoft-Windows-Cortana-PAL-Desktop-Package~31bf3856ad364e35~amd64~~10.0.10240.16384 ;Xbox DISM /Image:C:\mount\windows /Remove-Package /PackageName:Microsoft-OneCore-AppRuntime-xbox-Package~31bf3856ad364e35~amd64~en-US~10.0.10240.16384 DISM /Image:C:\mount\windows /Remove-Package /PackageName:Microsoft-OneCore-AppRuntime-xbox-Package~31bf3856ad364e35~amd64~~10.0.10240.16384 DISM /Image:C:\mount\windows /Remove-Package /PackageName:Microsoft-Xbox-GameCallableUI-Package~31bf3856ad364e35~amd64~en-US~10.0.10240.16384 DISM /Image:C:\mount\windows /Remove-Package /PackageName:Microsoft-Xbox-GameCallableUI-Package~31bf3856ad364e35~amd64~~10.0.10240.16384 DISM /Image:C:\mount\windows /Remove-Package /PackageName:Microsoft-Xbox-IdentityProvider-Package~31bf3856ad364e35~amd64~en-US~10.0.10240.16384 DISM /Image:C:\mount\windows /Remove-Package /PackageName:Microsoft-Xbox-IdentityProvider-Package~31bf3856ad364e35~amd64~~10.0.10240.16384 DISM /Image:C:\mount\windows /Remove-Package /PackageName:Microsoft-OneCore-AppRuntime-WOW64-xbox-Package~31bf3856ad364e35~amd64~en-US~10.0.10240.16384 DISM /Image:C:\mount\windows /Remove-Package /PackageName:Microsoft-OneCore-AppRuntime-WOW64-xbox-Package~31bf3856ad364e35~amd64~~10.0.10240.16384 DISM /Image:C:\mount\windows /Remove-Package /PackageName:Microsoft-OneCore-Networking-XboxLive-Package~31bf3856ad364e35~amd64~en-US~10.0.10240.16384 DISM /Image:C:\mount\windows /Remove-Package /PackageName:Microsoft-OneCore-Networking-XboxLive-Package~31bf3856ad364e35~amd64~~10.0.10240.16384 DISM /Image:C:\mount\windows /Remove-Package /PackageName:Microsoft-OneCore-Networking-XboxLive-WOW64-Package~31bf3856ad364e35~amd64~en-US~10.0.10240.16384 DISM /Image:C:\mount\windows /Remove-Package /PackageName:Microsoft-OneCore-Networking-XboxLive-WOW64-Package~31bf3856ad364e35~amd64~~10.0.10240.16384 DISM /Image:C:\mount\windows /Remove-Package /PackageName:Microsoft-Windows-Client-Drivers-xbox-Package~31bf3856ad364e35~amd64~en-US~10.0.10240.16384 DISM /Image:C:\mount\windows /Remove-Package /PackageName:Microsoft-Windows-Client-Drivers-xbox-Package~31bf3856ad364e35~amd64~~10.0.10240.16384 DISM /Image:C:\mount\windows /Remove-Package /PackageName:Microsoft-Windows-Client-Features-Package-AutoMerged-xbox~31bf3856ad364e35~amd64~en-US~10.0.10240.16384 DISM /Image:C:\mount\windows /Remove-Package /PackageName:Microsoft-Windows-Client-Features-Package-AutoMerged-xbox~31bf3856ad364e35~amd64~~10.0.10240.16384 DISM /Image:C:\mount\windows /Remove-Package /PackageName:Microsoft-Windows-Client-Features-WOW64-Package-AutoMerged-xbox~31bf3856ad364e35~amd64~en-US~10.0.10240.16384 DISM /Image:C:\mount\windows /Remove-Package /PackageName:Microsoft-Windows-Client-Features-WOW64-Package-AutoMerged-xbox~31bf3856ad364e35~amd64~~10.0.10240.16384 ;Onedrive DISM /Image:C:\mount\windows /Remove-Package /PackageName:Microsoft-Windows-OneDrive-Setup-Package~31bf3856ad364e35~amd64~~10.0.10240.16384 ;Telemetry DISM /Image:C:\mount\windows /Remove-Package /PackageName:Microsoft-OneCore-AllowTelemetry-Reduced-Default-Package~31bf3856ad364e35~amd64~~10.0.10240.16384 DISM /Image:C:\mount\windows /Remove-Package /PackageName:Microsoft-OneCore-TroubleShooting-Package~31bf3856ad364e35~amd64~en-US~10.0.10240.16384 DISM /Image:C:\mount\windows /Remove-Package /PackageName:Microsoft-OneCore-TroubleShooting-Package~31bf3856ad364e35~amd64~~10.0.10240.16384 DISM /Image:C:\mount\windows /Remove-Package /PackageName:Microsoft-OneCore-TroubleShooting-WOW64-Package~31bf3856ad364e35~amd64~en-US~10.0.10240.16384 DISM /Image:C:\mount\windows /Remove-Package /PackageName:Microsoft-OneCore-TroubleShooting-WOW64-Package~31bf3856ad364e35~amd64~~10.0.10240.16384 ;Search DISM /Image:C:\mount\windows /Remove-Package /PackageName:Microsoft-Windows-Search2-base-Package~31bf3856ad364e35~amd64~en-US~10.0.10240.16384 DISM /Image:C:\mount\windows /Remove-Package /PackageName:Microsoft-Windows-Search2-base-Package~31bf3856ad364e35~amd64~~10.0.10240.16384 DISM /Image:C:\mount\windows /Remove-Package /PackageName:Microsoft-Windows-Search2-Package~31bf3856ad364e35~amd64~en-US~10.0.10240.16384 DISM /Image:C:\mount\windows /Remove-Package /PackageName:Microsoft-Windows-Search2-Package~31bf3856ad364e35~amd64~~10.0.10240.16384
Because to use, DISM /Online /Remove-Package /packagename:full-package-name this happens Error: 0x80070005
? This is the tutorial, the other messages are helpful as well. If you have any specific question just ask, but be sure i don't want to transform this thread in a basic IT course
Compliments for the edited and now very nice looking OP . Just implmented new Search2 and IE Packages to the REPO. Move on buddy .
Not sure what's going on, I have tried DISM on 3/4 installations and I had no problem. Maybe AV or updates from WU can break some things. The thread is there as a basic idea meant to be evolved with the contribution of everyone. Not as a tutorial written from a guru who knows everything. And ideed already evolved
In my tests to uninstall the packages i found DISM being very unreliable . So i used it only to give a mount and unmount option in my disable tool. The rest is done with install_wim_tweak.exe since it does the best job here.
It's matter of philosophy. Personally, if I can use an official tool meant for the purpose, I use it. Say if I have to shrink a partition I prefer to use the stock disk manager, rather than Acronis or Paragon. Obviously if I have to do something that the disk manager can't do, I use Paragon or Acronis w/o too much worry. Here it's the same.
#1. >> #2. Since one already needs install_wim_tweak to un/hide the packages, i will use it by default, since it's overall more reliable, especially when removing from mounted WIM (in my tests with my script).
Ok, I'll add a disclaimer, although I'm used to give an idea for a receipt, not a "frozen, precooked meal". In short I expect that the people who want to try this has at least a couple of neurons turned on... Sure, the tool looks working fine, but it isn't just matter of program reliability, it's a general rule... The more a procedure is simplified, the less attention is required, the more chances to made an human mistake are present. Say if you write, by mistake install_wim_tweak.exe /o /c Microsoft-Windows-InternetExplorer /r Instead of install_wim_tweak.exe /o /c Microsoft-Windows-InternetExplorer-Optional /r You'll end removing things that are useful for other browsers or programs If you have to look at your packages.txt, hardly that could happen. A partial paste leads to a DISM error and nothing more.
Yeah ... it's better to separate it in general to have a general list for x86 and an additional one for x64, makes no sense to try the latter for the first. One still needs to use the new tool to unhide, so one can use that very reliable solution for all. Check who created this and you will know you can trust it. Wit a general Powershell or DISM command you cand do also a lot of harm, so that point isn't legit for the install_wim_tweak . My script in 'Auto-Mode' now adds the general list first and on x64 it adds the additional list for WOW64. No pointless tries to remove the WOW64 entries on x86 system . AND: If one wants to remove all regarding any package-family he can simply define in a TXT and point the script to that file with [T]XT option .
if you look at %windir%\Logs\CBS\CBS.log You see what install_wim_tweak.exe is doing.. Spoiler Here ex. with removing Adobe-Flash remove-flash.bat: Code: Set PATH=C:\win10 Set MOUNT=%PATH%\tmp install_wim_tweak.exe /p %MOUNT% /c Adobe-Flash /r Code: 2015-08-11 15:06:42, Info CBS pkgmgr called with: pkgmgr.exe /o:"C:\win10\tmp\;C:\win10\tmp\Windows" /up:Adobe-Flash-For-Windows-Package~31bf3856ad364e35~amd64~~10.0.10240.16384 /norestart /quiet 2015-08-11 15:06:42, Info CBS Executing DISM: dism.exe" /image:"C:\win10\tmp" /sysdrivedir:"C:\win10\tmp\\" /quiet /norestart /remove-package /packagename:"Adobe-Flash-For-Windows-Package~31bf3856ad364e35~amd64~~10.0.10240.16384" 2015-08-11 15:07:11, Info CBS Dism.exe returned: 0 2015-08-11 15:07:11, Info CBS pkgmgr return code: 0x0 From source code is look it run only pkgmgr.exe and pkgmagr call dism. pkgmagr is in you system32 like dism. Code: Process RC = new Process(); RC.StartInfo.FileName = "pkgmgr.exe"; if (_online == false) { RC.StartInfo.Arguments = "/o:" + """ + PackL + ";" + PackL + "Windows" + """ + " /up:" + subkeyname + " /norestart /quiet"; } else { RC.StartInfo.Arguments = "/up:" + subkeyname + " /norestart /quiet"; } So you have to call this: Code: pkgmgr.exe /o:"<mount path>;<mount path>Windows" /up: <full package name> /norestart /quiet ex. mount patch is C:\win10\tmp\ pkgmgr.exe /o:"C:\win10\tmp\;C:\win10\tmp\Windows" /up:Adobe-Flash-For-Windows-Package~31bf3856ad364e35~amd64~~10.0.10240.16384 /norestart /quiet But you need find a why to do this Code: if (Contains<string[], string>(nSubKey.GetValueNames(), "DefVis")) { nSubKey.SetValue("Visibility", nSubKey.GetValue("DefVis"), RegistryValueKind.DWord); } rehide all package but not sure how to do that.. sorry. Are all you guys removing your package using win 8.1? I seem that win7 dism and pkgmgr.exe is buggy For me try to remove package from win10 install.wim on 7 both pro and ultimate give me problem even with install_wim_tweak.exe untill got the win 10 ADK using GetWaikTools.exe and recode the install_wim_tweak.exe to point to the new pkgmgr.exe (line 371 to RC.StartInfo.FileName = "C:\\win10\\ADK_6\\amd64\\DISM\\pkgmgr.exe"; in the source code). Code: Deployment Image Servicing and Management tool Version: 10.0.10240.16384 I got GetWaikTools.exe from here hxxps://onedrive.live.com/?id=53F5D45A736673!246&cid=0053F5D45A736673&group=0&parId=53F5D45A736673!156&action=locate I got the install_wim_tweak.exe source here www dot msfn dot org /board/topic/152688-win6x-registry-tweak/ My script i run: Spoiler Start with en_windows_10_enterprise_2015_ltsb_n_x64_dvd_6848316.iso I save install.wim and install_wim_tweak.exe GetWaikTools.exe in C:\win10 create C:\win10\tmp I run GetWaikTools.exe check "ADK Tools for Win 10" , "Dism For Windows 10" and "Download to AppDir\Waik" then i run my script as admin overwrite the install.wim in the iso install win10 every thing is working Code: @echo off Set PATH=C:\win10 Set MOUNT=%PATH%\tmp Set TWEAK=%PATH%\install_wim_tweak.exe Set APPS=%PATH%\ADK_6\amd64 "%APPS%\Dism\Dism.exe" /Cleanup-Mountpoints Echo -------------------------------------------------------------------------------- Echo "Mounting Image" Echo -------------------------------------------------------------------------------- "%APPS%\Dism\Dism.exe" /mount-wim /wimfile:%PATH%\install.wim /index:1 /mountdir:%MOUNT% Echo -------------------------------------------------------------------------------- Echo "Removing Uneeded Packages" Echo -------------------------------------------------------------------------------- cd %PATH% install_wim_tweak.exe /p %MOUNT% /c Adobe-Flash /r rem install_wim_tweak.exe /p %MOUNT% /c Microsoft-Windows-Cortana /r install_wim_tweak.exe /p %MOUNT% /c Windows-Defender /r install_wim_tweak.exe /p %MOUNT% /c Microsoft-Hyper-V /r install_wim_tweak.exe /p %MOUNT% /c Microsoft-OneCore-AppRuntime-xbox /r install_wim_tweak.exe /p %MOUNT% /c Microsoft-Xbox /r install_wim_tweak.exe /p %MOUNT% /c Microsoft-OneCore-AppRuntime-WOW64-xbox-Package /r install_wim_tweak.exe /p %MOUNT% /c Microsoft-OneCore-Networking-XboxLive /r install_wim_tweak.exe /p %MOUNT% /c Microsoft-Windows-Client-Drivers-xbox-Package /r install_wim_tweak.exe /p %MOUNT% /c Microsoft-Windows-Client-Features-Package-AutoMerged-xbox /r install_wim_tweak.exe /p %MOUNT% /c Microsoft-Windows-Client-Features-WOW64-Package-AutoMerged-xbox /r install_wim_tweak.exe /p %MOUNT% /c Microsoft-Windows-OneDrive /r install_wim_tweak.exe /p %MOUNT% /c Microsoft-OneCore-AllowTelemetry-Reduced-Default-Package /r install_wim_tweak.exe /p %MOUNT% /c Microsoft-OneCore-TroubleShooting /r rem install_wim_tweak.exe /p %MOUNT% /c Microsoft-Windows-Search2 /r install_wim_tweak.exe /p %MOUNT% /c Microsoft-WindowsFeedback /r install_wim_tweak.exe /p %MOUNT% /c Microsoft-Windows-ParentalControls /r install_wim_tweak.exe /p %MOUNT% /c Microsoft-Windows-DiagTrack /r Echo -------------------------------------------------------------------------------- Echo "output Package" Echo -------------------------------------------------------------------------------- install_wim_tweak.exe /p %MOUNT% /l "%APPS%\Dism\Dism.exe" /Image:%MOUNT% /Get-Packages /Format:Table "%APPS%\Dism\Dism.exe" /Image:%MOUNT% /Get-Features /Format:Table "%APPS%\Dism\Dism.exe" /Image:%MOUNT% /Get-ProvisionedAppxPackages /Format:Table "%APPS%\Dism\Dism.exe" /Image:%MOUNT% /Get-Drivers /Format:Table Echo -------------------------------------------------------------------------------- Echo "Rehide All Packages" Echo -------------------------------------------------------------------------------- install_wim_tweak.exe /p C:\win10\tmp\ /h /l Echo -------------------------------------------------------------------------------- Echo "Unmounting Image" Echo -------------------------------------------------------------------------------- "%APPS%\Dism\Dism.exe" /unmount-Wim /MountDir:C:\win10\tmp\ /commit "%APPS%\Dism\Dism.exe" /Export-Image /SourceImageFile:install.wim /SourceIndex:1 /DestinationImageFile:install2.wim /Compress:max Echo -------------------------------------------------------------------------------- Echo "Finish" Echo -------------------------------------------------------------------------------- pause final install.wim is 2,862,559 KB
I have several Issues with the Image if I'm using install_wim_tweak. If I just run and unhide all packages and remove them with DISM... I can't manage features anymore (some of them) the componentstore is broken (always) get-features will list just some but not all. (sometimes just one) If I'm using /c -Package- /r I think the files aren't really removed. I checked with System32 folder while removing and the file count did only change or just slidely. The same Packages removed with DISM (currupt store) the count was significant lower and the removing took way longer. And BTW I trust DISM more than IWT. As this is the way Microsoft works. I am curious if you systems are "really" fine... as a quick and dirty way to check: please run optionalfeatures.exe and (de)select something, like telnet or so... and than run optionalfeatures.exe again to see if the programm window is blank or does not have all (except removed) items. My solution for now is to run each item in my list with IWT in a single instance (just /p mount /c -Package-) and than remove it with dism. The difference is that I just unhide packages I intend to remove. This works for me pretty good now, but took 3 days of testing. Sidenote: If you disable Internet Explorer in the features the welcome animation ("This won't take long") does not apper... you get a black screen for a while. Edit: corrections