Jump to content

Windows 7 component remover


Recommended Posts

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
Link to comment
Share on other sites


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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

  • 1 month later...

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.

Link to comment
Share on other sites

  • 8 months later...

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 :(

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...