Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account



Photo

Windows 7 component remover


  • Please log in to reply
19 replies to this topic

#1
justibus

justibus

    Junior

  • Member
  • Pip
  • 66 posts
  • Joined 27-March 05
Hi,

While working on xml creator, I became fed up always having to start up 7Customizer, clicking around selecting components and decided to write my own removal tool. It's nothing fancy, mind you, just a command line tool. And it doesn't do any image mounting and iso creating yet (it's planned, though). But it can remove components from Windows 7 based on xml files fairly reliably and quickly. It is mainly geared towards automation with batch files, but can easily be used manually.
The idea of removing components with xml files comes from blue4603 who is the author of 7Customizer. A big thanks goes to him. I just evolved the method a bit.
Below is a quick step by step guide on how to use it (from the readme).

1. Put the xml files for components you want to remove into the "xmls" folder and remove all the others. This tool comes with a bundle of xml files that will be extended and updated periodically. If you want to know what each xml file removes, use the -p option.
[You can also define your own xml folder with -d; use -h for help]

2. Mount a Windows 7 image into the mount folder (for example using Windows 7 Toolkit).
[You can also define another mount folder with -m; use -h for help]

3. Open an elevated command prompt at the folder where remove.exe is located and run it (e.g. type "remove" [without the quotes] and press enter). You can also right click remove.exe and select "Run as Administrator". This will open a console window with the progress and close it when it's done, but if something goes wrong, you might not catch the error message.

4. Lean back and watch the progress bars. This tool is much faster than 7Customizer or RT7lite, but it still takes quite some time for a lot of components. Maybe get a coffee?

5. Unmount, create an iso and test your new image in a virtual machine. You can automate this task by either creating a batch file or using Windows 7 Toolkit.


Some words of caution: This tool is still very beta! Always test the installation and frequently used applications in a virtual machine. There are most definitely bugs in there somewhere.
Also, your success removing stuff from Windows depends very much on the quality of the xml files you feed this tool. Some components are mighty complex and need a lot of testing from different people before they're right.

I will periodically release new xml files on the sourceforge.net project site in the files section.


System Requirements
- Windows 7

Download
component remover v0.9.1
Go to the sourceforge project web site for the sources.

Todo
- ability to add files and registry entry through xml files
- gui
- mount/unmount image (with rebuilding the image for smaller size)
- create iso

Known bugs
- Installation of Internet Explorer 9 terminates with an error if all components are removed (I haven't pinpointed yet which component's fault it is).
- "Odd number of elements in anonymous hash at script/remove.pl line 1070." warning message. It's nothing to worry about, everything works as expected. Will be fixed in the next release.

Changelog

version 0.9.1
- fix warning message and bug where components are not removed correctly (thanks to NateExMachina)

version 0.9
- note: Please delete all xml files if updating (xml format changed slightly); you can also delete libexpat_1.dll
- added dependency checking; can be skipped with -n option
- added option -b for benchmarking the removal process
- added: help documentation for -s option (skipping the removal process)
- updated and added xml files
- fix bug where custom mount dir was not found
- fix corrupt progress bar
- fix editing xml files to only remove lines that have a complete word as a string in them; the removal string must not be folowed by any alphanumeric characters in addition to '.' and '-'. Non-xml files are not affected.
- fix: if packages are removed, the "Turn windows featues on and off" windows is empty (ticket #15)
- upgraded perl runtime environment to 5.16.2; xml handling bug seems gone
- updated build process; libexpat is included in executable and it's much smaller now

version 0.8
- added support for scanning subfolders for xml files. You can organise your xml file your way now.
- added support for new xml format introduced in xml creator v0.9.96.
- changed internal data structures: files, folders and registry keys are only processed once now.
- changed the way xml files are edited (like manifest of package files). It takes a little longer but is safer.
- changed: downgraded to perl 5.10.1.5 because of a serious bug in newer versions of perl which crashed on some manifest files.
- added one xml file (UAC) and fixed actioncenter xml

version 0.7
- added support for resolving packages dynamically; only use xmls created with xml creator v0.9.94 or newer
- added option -d: print information on components
- added a few more xmls
- changed resolving of registry wildcards; subkeys are not added any more
- fixed crash with option -d

If you find any bugs or have problems/feedback, don't hesitate to post here or in the sourceforge forum.

Cheers!

Edited by justibus, 08 February 2013 - 03:10 PM.



How to remove advertisement from MSFN

#2
digital john

digital john

    Junior

  • Member
  • Pip
  • 54 posts
  • Joined 15-August 07
  • OS:Windows 7 x86
  • Country: Country Flag
thanx for creating the tool,
i will try

#3
justibus

justibus

    Junior

  • Member
  • Pip
  • 66 posts
  • Joined 27-March 05
Your'e welcome. :)
Let me know what you think!

#4
Octopuss

Octopuss

    I am the walrus

  • Member
  • PipPipPipPipPipPip
  • 1,127 posts
  • Joined 31-January 07
  • OS:Windows 7 x64
  • Country: Country Flag

Donator

Does it work in similar fashion to install_wim_tweak?

#5
justibus

justibus

    Junior

  • Member
  • Pip
  • 66 posts
  • Joined 27-March 05
Not at all. It works on the basis of xml files. These xml files contain all files, folders and registry entries that are directly deleted from the image.
The information is gathered by another tool in this project, xml creator. It basically looks inside the winsxs\Manifests folder where information to all Windows components are stored in manifest files (they're really just xml files) and extracts the needed information for deleting said components.

This approach is much more flexible. You are not limited to remove whole packages, but can remove only parts of it, not to mention stuff that's in no package. RT7lite goes the same way. The problem with that tool is, you as a user have no power over what files are specifically removed for a component because you don't have access to it. If you find a bug, say a missing file, you can only contact the developer.
With this approach, you can fix it yourself and give back to the community.
The idea behind is, as more people participate, the xml files get better and better until they produce compatible and stable outcomes.

#6
Moonchilde

Moonchilde

    Junior

  • Member
  • Pip
  • 52 posts
  • Joined 10-September 10
  • OS:Windows 7 x64
  • Country: Country Flag
Hey, so glad to finally see this after all the discussions about it. I've been worked to death lately and haven't had a chance to really jump on yet, but I'm going to start pumping out those base XML's for us to start working off. I just got my system back up and running after finding out SP1 has quite different partition requirements from the original W7, and had to repartition my drive which is a huge pain in the arse to meet it's bloated needs.

#7
Octopuss

Octopuss

    I am the walrus

  • Member
  • PipPipPipPipPipPip
  • 1,127 posts
  • Joined 31-January 07
  • OS:Windows 7 x64
  • Country: Country Flag

Donator

Not at all. It works on the basis of xml files. These xml files contain all files, folders and registry entries that are directly deleted from the image.
The information is gathered by another tool in this project, xml creator. It basically looks inside the winsxs\Manifests folder where information to all Windows components are stored in manifest files (they're really just xml files) and extracts the needed information for deleting said components.

This approach is much more flexible. You are not limited to remove whole packages, but can remove only parts of it, not to mention stuff that's in no package. RT7lite goes the same way. The problem with that tool is, you as a user have no power over what files are specifically removed for a component because you don't have access to it. If you find a bug, say a missing file, you can only contact the developer.
With this approach, you can fix it yourself and give back to the community.
The idea behind is, as more people participate, the xml files get better and better until they produce compatible and stable outcomes.

Ah this is nice! So basically what W7 Customizer was supposed to do before Blue disappeared.

I will give this a shot despite not having the "must remove stuff to make it faster" thing in my mind anymore as I grew older :D




#8
Worf

Worf

    Worf

  • Member
  • PipPip
  • 189 posts
  • Joined 26-October 04
Thank you for this, will give it a try.

#9
justibus

justibus

    Junior

  • Member
  • Pip
  • 66 posts
  • Joined 27-March 05
I uploaded version 0.6. In combination with the xml creator, it fixes the package removal which led to some errors in Windows Update and an inaccessible feature list. There are also a lot more xml files (components to remove). The download link is in the first post. Let me know what you think.

#10
Sp0iLedBrAt

Sp0iLedBrAt

    MSFN Addict

  • MSFN Sponsor
  • 1,727 posts
  • Joined 19-March 09
  • OS:XP Pro x86
  • Country: Country Flag
Is the word "component" misspelled "componenet" on purpose in the xml files?

#11
Moonchilde

Moonchilde

    Junior

  • Member
  • Pip
  • 52 posts
  • Joined 10-September 10
  • OS:Windows 7 x64
  • Country: Country Flag

Is the word "component" misspelled "componenet" on purpose in the xml files?


That's inherited from the 7Customizer beginnings. For whatever reason, that was how it was programmed into 7Customizer and this tool was originally created to help automate XML creation form 7C, hence it had to adhere to the XML structure required for 7C. So no, it isn't on purpose, but probably hasn't been updated in favor of progress of the external removal app.

#12
justibus

justibus

    Junior

  • Member
  • Pip
  • 66 posts
  • Joined 27-March 05

Is the word "component" misspelled "componenet" on purpose in the xml files?


Moonchilde is right. It's probably a misspelling, at least I see no reason for it being spelled that way, but since the format is originally from blue4603, I kept it.

#13
justibus

justibus

    Junior

  • Member
  • Pip
  • 66 posts
  • Joined 27-March 05
There is a new version, 0.7. It has a few more xmls and comes with a new -d option for printing the description of all xml files to the console. You can redirect that to a file by simply appending "> file.txt" to the end of the command line (without the quotes).

Cheers!

#14
justibus

justibus

    Junior

  • Member
  • Pip
  • 66 posts
  • Joined 27-March 05
I uploaded a new version (0.8). This one only comes with one new xml file (UAC). But there are a lot of internal changes, some of them visible (like more progress bars! Yay!).

There is also a gui in the works by Winterstorm2050. But you'll have to wait for that one a little.

#15
smilodon

smilodon

    Newbie

  • Member
  • 25 posts
  • Joined 27-September 07
Reporting a bug !

Read xml files and gather information..
..reading xml files..
100% [========================================================================]
..resolving folder wildcards..
..resolving file wildcards..
..resolving registry wildcards..
..resolving package dependencies..
100% [========================================================================]
..done!
Write batch file..
..directories..
..files..
..deleteLine entries..
..done!
Write .reg file..
..done!
Removing components..
..backing up permissions..
..setting permissions and removing files..
100% [========================================================================]
..removing registry entries..
..editing files..
0% [ ]

Then process stops..

DIR..
\remove_v0.8\xmls

accessoires_screensavers.xml
drivers_modems.xml
drivers_printers.xml
drivers_tuners.xml
multimedia_games.xml
multimedia_marketthemes.xml
multimedia_samplemedia.xml
system_actioncenter.xml
system_anytimeupgrade.xml
system_tabletpc.xml
system_virtualpc.xml
system_winsat.xml

These are xmls i used.


For example..
<File method="deleteLine" path="Windows\winsxs\pending.xml" string="Microsoft-Windows-Shell-InboxGames-CardGames" xmlParents=""/>


But this line still exist in pending.xml..
...
<Install RefExtra="" RefIdentifier="Microsoft-Windows-Shell-InboxGames-Package~31bf3856ad364e35~amd64~en-US~6.1.7601.17514.CardGames" RefGuid="{d16d444c-56d8-11d5-882d-0080c847b195}" Application="Microsoft-Windows-Shell-InboxGames-CardGames-Deployment-LanguagePack, Culture=en-US, Version=6.1.7600.16385, PublicKeyToken=31bf3856ad364e35, ProcessorArchitecture=amd64, versionScope=NonSxS"/>
...
<Change New="6.1.7600.16385" Family="Microsoft-Windows-Shell-InboxGames-CardGames-Deployment-LanguagePack, Culture=en-US, PublicKeyToken=31bf3856ad364e35, ProcessorArchitecture=amd64, versionScope=NonSxS"/>

1...


To reproduce, I am using X17-58997 which is SP1 Windows 7 Home Premium x64 English.
install.wim mounted with command:
imagex /mountrw C:\win7custom\GSP1RMCHPXFRER_EN_DVD\sources\install.wim 2 C:\win7custom\10_Tools\remove_v0.8\mount



Really sad :(

#16
justibus

justibus

    Junior

  • Member
  • Pip
  • 66 posts
  • Joined 27-March 05
I just wanted to let you know that I released a new version of remove (v0.9; see first post). It has mainly a few bug fixes, some new xmls, dependency checking is implemented and seems to be working (skip with -n) and there a few new command line options (-n and -b for benchmarking).
I know it's been a while and in the meantime Windows 8 is out, but I'm still working on it, though not so frequently any more.

Let me know how it works for you.

@smilodon: If you're still around, can you test this release and report back?

#17
NateExMachina

NateExMachina
  • Member
  • 2 posts
  • Joined 04-February 13
  • OS:Windows 7 x64
  • Country: Country Flag
I've been using previous versions without problem but I'm having an issue with v0.9. I'm getting an error and the image size is not shrinking.

I am calling this from a batch file, using the command:
Remove.exe -d "..\..\..\Config\RemoveFiles" -m "%MountDir%"

The XMLs have been updated with the new ones in the zip.

The output says:

Checking dependencies..
Read xml files and gather information..
        ..reading xml files..
100% [========================================================================]
        ..resolving folder wildcards..
        ..resolving file wildcards..
        ..resolving registry wildcards..
        ..resolving package dependencies..
100% [========================================================================]
        ..done!
Write batch file..
        ..directories..
        ..files..
        ..deleteLine entries..
        ..done!
Write .reg file..
        ..done!
Removing components..
        ..backing up permissions..
        ..setting permissions and removing files..
100% [========================================================================]
        ..removing registry entries..
        ..editing files..
  0% [=                                                                       ]O
dd number of elements in anonymous hash at script/remove.pl line 1070.
Odd number of elements in anonymous hash at script/remove.pl line 1070.
Odd number of elements in anonymous hash at script/remove.pl line 1070.
Odd number of elements in anonymous hash at script/remove.pl line 1070.
Odd number of elements in anonymous hash at script/remove.pl line 1070.
Odd number of elements in anonymous hash at script/remove.pl line 1070.
Odd number of elements in anonymous hash at script/remove.pl line 1070.
Odd number of elements in anonymous hash at script/remove.pl line 1070.
Odd number of elements in anonymous hash at script/remove.pl line 1070.
Odd number of elements in anonymous hash at script/remove.pl line 1070.
Odd number of elements in anonymous hash at script/remove.pl line 1070.
Odd number of elements in anonymous hash at script/remove.pl line 1070.
Odd number of elements in anonymous hash at script/remove.pl line 1070.
Odd number of elements in anonymous hash at script/remove.pl line 1070.
Odd number of elements in anonymous hash at script/remove.pl line 1070.
Odd number of elements in anonymous hash at script/remove.pl line 1070.
Odd number of elements in anonymous hash at script/remove.pl line 1070.
Odd number of elements in anonymous hash at script/remove.pl line 1070.
Odd number of elements in anonymous hash at script/remove.pl line 1070.
Odd number of elements in anonymous hash at script/remove.pl line 1070.
Odd number of elements in anonymous hash at script/remove.pl line 1070.
Odd number of elements in anonymous hash at script/remove.pl line 1070.
Odd number of elements in anonymous hash at script/remove.pl line 1070.
Odd number of elements in anonymous hash at script/remove.pl line 1070.
Odd number of elements in anonymous hash at script/remove.pl line 1070.
Odd number of elements in anonymous hash at script/remove.pl line 1070.
Odd number of elements in anonymous hash at script/remove.pl line 1070.
Odd number of elements in anonymous hash at script/remove.pl line 1070.
Odd number of elements in anonymous hash at script/remove.pl line 1070.
Odd number of elements in anonymous hash at script/remove.pl line 1070.
Odd number of elements in anonymous hash at script/remove.pl line 1070.
Odd number of elements in anonymous hash at script/remove.pl line 1070.
100% [========================================================================]
        ..restoring permissions and removing temporary files..
..done!


#18
justibus

justibus

    Junior

  • Member
  • Pip
  • 66 posts
  • Joined 27-March 05
hmm, I missed that warning before releasing it. It's fixed, but since it's a purely cosmetic issue, it will have to wait until the next release. But, it's nothing to worry about. I just tested it and it works all right. Your image size does not shrink if you do not export the modified image from the ortiginal wim file to a new one. I use imagex for that (imagex /export), but there are other tools out there (windows 7 toolkit springs to mind). Have you tested the installation in a virtual machine? Did it remove the components you selected?

Thanks for reporting the bug!

#19
NateExMachina

NateExMachina
  • Member
  • 2 posts
  • Joined 04-February 13
  • OS:Windows 7 x64
  • Country: Country Flag
I do export the image. I have a scripting system in place that automates the entire customization process. The only thing I'm changing is replacing remove.exe. I'm using XMLs from the v0.9 zip.

When looking at your git hub, version 73b2d4 on date 2013-01-23 and all previous versions work as expected.
http://sourceforge.n.../bin/remove.exe

Without running remove.exe, the ISO size is 5,153,614 KB.
Using remove.exe from the v0.9 zip, the size is 5,148,822 KB
Using remove.exe from tree 73b2d4, the size is 4,299,794 KB.

I didn't thoroughly test it in VirtualBox; but at a glance, wordpad and some other things were still there.

Edited by NateExMachina, 06 February 2013 - 08:59 PM.


#20
justibus

justibus

    Junior

  • Member
  • Pip
  • 66 posts
  • Joined 27-March 05
I checked again more thoroughly, and you're right. Thanks for pointing it out. I'm uploading a fixed version.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users