-------------------------Disclaimer/License------------------------------
Version 1.87 was released August 26, 2011.
First a word of warning:
WinsxsLite is provided as is, and comes with no warranty.
WinsxsLite makes irreversible changes to the entire system partition.
The only way to undo these changes, is to restore the system partition
from a backup taken before running WinsxsLite.
By chosing to use WinsxsLite, you assume full responsibility for any ill
effects that might arise from using it.
You may use WinsxsLite for free, provided that it's for private use only.
You may not use it, or part of it, commercially - that is, using it to
support a business in any way - without reaching an agreement with me first.
WinsxsLite is Copyright (C) 2009 Christian Bering Boegh
-------------------------Contact/Donations-------------------------------
For bug reports, suggestions, requests or comments in general, email me at:
chrisberingb@live.com
For the latest version, visit:
http://sites.google.com/site/winsxslite
WinsxsLite is freeware, but if you value it, and want to reward me for my
work, you might consider a donation via PayPal:
-------------------------Overview and phases-----------------------------
WinsxsLite is meant as a tool to help reduce the size of winsxs in Vista.
WinsxsLite is split into two phases.
The first phase searches the Program Files and Windows folders for files,
that are exactly identical to files in the winsxs folder.
The second phase replaces all the old versions of each file in winsxs,
with hardlinks to the highest version file.
So, it will still seem like there's, say, 16 different versions of a
particular file, but in reality, there's only one data object pointed to
by 16 directory entries.
Additionally, unused localized files can be eliminated, by replacing them
with hardlinks to the corresponding files in other languages.
Note: Both phases are optional.
Note: If Vista SP1 is installed, make sure vsp1cln.exe has been run.
-------------------------Scan and apply----------------------------------
Each phase is split in two.
The scan generates a ToDo list of files that should be replaced.
After that, selecting apply will perform the changes described in the
ToDo file.
The apply option behaves differently, depending on whether the changes
are to be made to an online system partition, or an offline one.
Typically, WinsxsLite is asked to modify the current, running system.
In that case (online), the apply function changes as much as it can,
and schedules the remaining in-use files to be replaced at reboot.
It's important that the system is rebooted when requested.
So, a typical online-system session would look like this:
Phase 1 scan
Phase 1 apply
Reboot
Phase 2 scan
Phase 2 apply
Reboot
It's easier in a multiboot system, where one can boot the second Vista,
and then modify the first one.
A typical offline-system session would look like this:
Phase 1 scan
Phase 1 apply
Phase 2 scan
Phase 2 apply
No in-use files means no reboots.
Note: Beware of outdated scans!
If the system is modified after a scan, that scan should be considered
outdated, and a rescan should be performed before applying.
Applying an outdated scan may corrupt the system.
Note: If apply is operating in online mode, a few hardlinks may linger in
the temporary C:\$ directory (if root=C:), even after a reboot.
this is because a few system files get locked before pending file
operations are performed during reboot.
Running WinsxsLite again will then present the option to reschedule
these files. Rescheduling also "shuffles" the files in each hardlink
group, in an attempt to cure this problem.
Sometimes, rescheduling may even save one from having to do the post-
apply reboot in the first place.
A related problem is the failure to delete a few obsolete hardlinks
in C:\$, even during a reboot. This is because Vista mistakenly thinks
they are locked, when in reality, it's the files they are linking to,
that are locked. The only way to get rid of these hardlinks, is to put
the partition offline and delete them manually.
Note: Some functions, like the apply function, works under Windows XP.
-------------------------Relocate folders--------------------------------
This, the 3rd phase, takes care of data that is never used,
or almost never used.
There's no reason to keep more than a gigabyte of drivers on the system
drive - particularly if it's a high performance SSD.
The same goes for install packages left by certain software.
Those will only be used again, if the software is ever uninstalled.
See below for config options.
-------------------------Auto start--------------------------------------
This function schedules WinsxsLite to run automatically on the next reboot.
It's very useful, because it runs before everything else, including logon.
This means fewer files are locked, thus fewer 'access denied' issues.
The folder relocate function will activate auto start if errors occurred
during copies, and the user chose 'Complete on reboot'.
-------------------------Configuration-----------------------------------
The first time WinsxsLite is run, it creates an example configuration file.
Close WinsxsLite, and review Config.txt to make sure it fits your needs.
Note: Config.txt is only parsed once - during program startup.
So, restart WinsxsLite for changes in Config.txt to take effect.
The first section of the default Config.txt starts like this:
:PHASE 1 EXCLUDES
\desktop.ini/
\system.ini/
.log/
.etl/
.tmp/
.nt/
.config/
\NTUSER.DAT
\usrclass.dat
$winsxs$\InstallTemp\
$winsxs$\ManifestCache\
(...)
This tells phase 1 that certain files shouldn't be considered for replacement.
The strings are matched against full paths, so specifying:
\System32\DriverStore\
- would exclude all files in that directory.
The optional forward slash, that can be put at the end of a line, means
only-match-against-end-of-full-path.
$root$, $win$, $winsxs$ and $system32$ expands to the the various windows
folder paths (like C: , C:\Windows and so on).
Note: $Phase1Extensions.txt is generated as additional help to see what's
going on. It contains almost the same information as ToDo1.txt,
but sorted according to extensions.
Note: Setting ':PROGRAM FILES DIR=' causes program files to be omitted
during phase 1.
The second section looks like this:
:PHASE 2 LANGUAGE PRIORITIES
en-us=KEEP
en-gb
da-dk=KEEP
sv-se
nb-no
de-de
This example defines six prioritized base languages - English-US,English-GB,
Danish,Swedish,Bokmaal-Norwegian and German.
English-US and Danish are marked as languages to KEEP.
Thus, after running phase 2, all localized files, except Danish, will have
been replaced with hardlinks to English-US.
Why not just:
:PHASE 2 LANGUAGE PRIORITIES
en-us=KEEP
da-dk=KEEP
Under most circumstances, this would yield exactly the same results, except if
English-US and Danish versions of some files are absent. In that case, it
matters which language is down next on the list.
Leaving this section empty - that is, not defining any base languages,
will obviously cause all languages to be left alone during phase 2.
Note: After a phase 2 scan, the help file $LanguageStrings.txt contains all
the different language strings found in winsxs during the scan.
The second part of a language string denotes the country.
A list of two-character country codes can be found here:
http://www.theodora.com/country_digraphs.html
- and language codes:
http://msdn.microsoft.com/en-us/library/ms533052(VS.85).aspx
The last section:
:RELOCATE FOLDERS=D:\
$system32$\DriverStore\FileRepository
$system32$\DriverStore\Temp
$win$\Installer
These defaults define the folder relocate target path to be the D: drive.
It then specifies the folders to be moved.
Note that the $system32$\DriverStore\en-US folder is omitted on purpose.
It only contains hardlinks, that would turn into objects, if moved to D:
Generally, avoid 'breaking' hardlinks, since the only result is wasted space
on the target drive. After running phase 1 and 2 on a fresh Vista install,
the \Program Files folder takes up around 10MB. Relocate it, and the
broken hardlinks makes it balloon to 500MB.
Of course, some software can't be prevented from installing a lot of data in
\Program Files. If this becomes a problem, then just relocate that particular
software.
Be careful - WinsxsLite will try to relocate anything you ask it to.
-------------------------Winsxs size-------------------------------------
This function reports the true size of the winsxs folder.
Explorer doesn't do this. If one puts a single 1MB object with 10 directory
entries in the same folder, Explorer will report 10MB.
That 1MB should be the correct answer, is obvious.
But what if the 10 entries are scattered all over the directory tree ?
Where is that 1MB truly located ?
That's why two numbers are calculated:
The "unique" number, is the size of all objects that only have directory
entries in winsxs.
If one deleted the winsxs folder, this would be the number of bytes freed.
The "shared" number, is the size of all objects that have entries in both
winsxs and in directories outside winsxs.
Thus, deleting winsxs won't free any of these bytes, since the objects are
still referenced from elsewhere. A filesystem object is only deallocated when
its reference count reaches zero.
Adding these two numbers together, one gets the total amount of bytes
referenced from within winsxs.
This isn't the number Explorer reports, because some objects are referenced
more than once from within winsxs - and Explorer counts each reference.
The results for the main subdirectories in winsxs are listed as well, and put
in the log too.
The bad news, is that this operation takes about 10 minutes to complete.
-------------------------3rd party software------------------------------
WinsxsLite makes use of certain pieces of third party software:
SubInACL v5.2.3790.1180
From Microsoft
http://www.microsoft.com/downloads/details.aspx?FamilyID=E8BA3E56-D8FE-4A91-93CF-ED6985E3927B&displaylang=en
Make sure SubInAcl.exe is put where WinsxsLite can find it.
PendMoves v1.1 and MoveFile v1.0
By Mark Russinovich
http://technet.microsoft.com/en-us/sysinternals/bb897556.aspx
Ln v2.6.5.0 - Command Line Hardlinks
By Hermann Schinagl
http://schinagl.priv.at/nt/ln/ln.html#contact
Note: Likely, the runtimes installed by vcredist are already on your system.
Fcmp v1.6 - ATTENTION, DO NOT USE THE BUGGY V1.7!!!
By Greg Wittmeyer
http://gammadyne.com/cmdline.htm#fcmp
MD5File
By Robin Keir
http://keir.net/md5file.html
StringConverter v1.2
By Guillaume Bordier
http://www.gbordier.com/gbtools/stringconverter.htm
-------------------------------------------------------------------------