Video Screencast Help
Symantec to Separate Into Two Focused, Industry-Leading Technology Companies. Learn more.

SWV Clean Up Utility

Created: 17 Jul 2013 • Updated: 06 Aug 2013 | 9 comments
ateamrh's picture
+2 2 Votes
Login to vote

Clear layer for unwanted registry entries, files/folders and add file extension's to exclude before compile.

Tested on:
Windows XP, Windows Vista, Windows 7, Windows 8, all both x86 and x64

Tested with SWV/SWS versions:
6.1 SP7 +
7.5 Beta 1 + (notice that 7.5 Release Preview already have file exclude included in the composer)

Included in the zip file:
SWV-CleanUp.exe
Cleanup.ini

How does it work:
SWV-CleanUp.exe reads the values in Cleanup.ini for which registry entries and files and folders to remove from the layer.
It also adds file extension's to the exclude based on the file extensions in the layer.
Cleanup.ini is self explaining.

How to use it:
Execute the executable and select the layer from the menu you want to cleanSWVCleanupMenu.png

What does it require:
The program requires administrative rights to run.
Nothing else, it's created in AutoIt and do not have any dependencies.

Features:
--- 0.9.1 ---
- Added RemoveDirectory handle to remove folders, see cleanup.ini on how to use it.
- Changed displayed version in the command window to reflect the real version of the application.

--- 0.9 ---
- Remove registry entries
- Remove single files
- Cleanup a folder for files and folders (recursive)
- Add File Excludes to layer based on registry entries in the layer
- Controlled by Cleanup.ini
- Basic logging of what it's doing with the layer (located in %ProgramPath%\Logs\"Layername".log)
- Basic error handling

Feel free to comment on improvements and more cleanup areas (registry and files) to add.

Happy creation of virtual packages yes
 

Comments 9 CommentsJump to latest comment

ksreek's picture

This is a great utility Martin. Thanks for posting this as an download.

0
Login to vote
Peter Sevcik's picture

Hello,

what is the syntax if I want to delete files/folders from system folder? For example from [_B_]PROGRAMFILES[_E_]?

swscleanup.jpg

Thank you.

0
Login to vote
ateamrh's picture

Hey Peter,

I have updated the application to version 0.9.1 which adds RemoveDirectory handle.

To remove compapps from PROGRAMFILES using the new version add the following to the cleanup.ini

[FILES.PROGRAMFILES]
RemoveDirectory = compapps

Kind Regards
Martin

+1
Login to vote
Peter Sevcik's picture

Martin,

this is really great. Thank you!

Peter

0
Login to vote
Tomas Iskra's picture

Hi Martin,

is there a way how to automatize deletion process for the writable layer?

Current settings allows you to delete files onfly from RO layer.

Thanks.

Tom.

0
Login to vote
ateamrh's picture

Hi Tomas,

If you do a reset of the layer after you have run this application (best pratice, before you compile a layer), the reset deletes everything in the RW layer and then copies over the RO layer to the RW layer. That is why I do not see a need to delete anything from the rw layer.

There are allready a routine in the program that are made to do a reset of the layer after clean up, but I have issues with getting the WMI commands to work.

Kind Regards

Martin

+1
Login to vote
A.J's picture

Good work as always Martin :)

-Arne

+1
Login to vote
ateamrh's picture

Thanks Arne :)

0
Login to vote
Peter Sevcik's picture

Hey Martin,

Iam modifing this tool for our needs and I would like to ask two questions regarding this tool:

1. Most of the times when I tried to run this utility after capturing and before compiling i got an error: 'Error mounting registry hive, hive is locked by Virtualization Admin, please restart the computer first!' (even if WVC and SWV admin were closed). Is there any condition when this utility require restart of PC or is there any way how to avoid the restart at all?

2. Does this utility support wildcards, adding different operators or operands like begins with, contains, exclude?

Ex: Del all from specific folder except *.ico

Ex: Del all files starting with 'ntuser' from specific location?

Thank you very much.

Peter 

0
Login to vote