Wednesday, March 21, 2012

ZIP2FIX 1.0

Zip2Fix is a tool to salvage the undamaged files from a ZIP archive that some of the files inside it are corrupted, in this situation the traditional ZIP utilities can't extract the good files and even can't open the archive.
This is exactly what ZIP2FIX can do, very simple and very fast.
ZIP2FIX is not using any ZIP or compliant component to do it, and actually it even doesn't extract the files from the bad archive, instead it creates a new fixed ZIP file.
So how does it works?
ZIP2FIX is reading the bad archive file as a stream and knows how to identify each chunk of the stream as a piece of a file inside the archive, all the chunks of a file are recreated as a stream and then it is checked for integrity if the file is intact then it is recreated on the drive as a new ZIP file, if a file was found corrupted then all his chunks are dismissed.
So the result is a new ZIP file containing only the good files and by that creating a ZIP archive that can be extracted.
Other than that the interface is very simple, when starting the utility it doesn't load anything or change any OS settings.
A click on "Open" launches the Windows Open File dialog, filtered with *.zip and *.exe (for ZIP self-extract files).
When the user selects a ZIP or SFX file, the file is processed immediately, and the status is displayed in the main form log.
The ZIP2FIX executable file is fully portable and can be copied to USB drive or a different computer and can run there without any installation.
ZIP2FIX is also compressed with UPX to achieve a small file size.

Watch 4 Folder 2.3

 
W4F is a utility is kind of a wrapper to Microsoft Windows ShellNotify API, and it can alert and execute different actions based on the rules the user set and the events triggered by the ShellNotify.
When W4F starts, it will initialize some variables that will contain different user input parameters, and check if it was executed with any command line parameters.
If the command line parameters exist, W4F will check if they are valid parameters, if not, it will show a warning message and just load with no parameters.
If the parameters are valid, W4F will open the monitoring ini file passed from the command line parameters and will populate the different monitoring rules and other form fields according to the data loaded from the ini file.
If the command line parameters indicate auto start monitoring, W4F will auto start the monitor, if command line parameters indicate to start minimized, the form will auto minimized itself to the system tray.
In case there are no command line parameters, the monitor form will show cleared without any predefined settings.
A click on "Load" will launch the Windows open file dialog, filtered to *.ini files, selecting a settings ini file will start a short check to validate the format and content of the ini file, if the file is not compatible, a popup message will warn the user, if the ini file is OK, the settings from this file will be loaded into the different monitoring settings fields.
A click on "Save" will take the current settings from the monitor form and will save them to a new ini file named as the user input in the save dialog.
The user can enter the monitoring settings manually directly into the form, the results will be the same.
When the user click on "Start Monitoring", W4F will collect the different user inputs (target folder, watch for sub folders, events to monitor, actions, etc.) and will add them as properties to the monitoring object, and will validate that they are legal settings and if all mandatory parameters exist and they are legal (for example the existence of a target folder).
If something is missing a warning message will popup, if everything is legal, the monitor will start by warping the ShellNotify API and listening to changes according to the events filter created by the user and the "Start Monitoring" button caption will change to "Stop Monitoring".
In case an event was trigger, the ShellNotify will update W4F and it will check the monitoring object for selected actions and will execute the appropriate action based on the user selection (write to log, execute a program, etc.).
Every change in the settings and every event triggered will add a line to the live log tab, even if no action was selected.
W4F executable is fully portable, you can copy it to a USB device or a different computer and it will run with no installation.
The file is also compressed with UPX to achieve a small size.


Tuesday, March 20, 2012

Order in my Folder 1.3


Order in my Folder is based on an original idea by Elliot Morshead, he needed a solution to do a schedule order in a logging system that was creating a huge amount of files based on intensive transactions system.
The entire log files where created inside the same folder and he was looking for a solution to reorder those log files into sub folders.
This is why the first version of OIMF was a command line only version so it can be executed from a batch or a script as a scheduled task.
After this first release a lot of people asked me for a GUI version, so I wrote it, and then with a few more suggestions by Elliot we created version 1.3.
This version has two executable files, a command line version and a GUI version.

The two versions are based on the same core code with almost identical features.

When OIMF is executed, it first checks to see if it appears in the registry context menu section, if not it will write its location in the registry, if it appears in the registry, it will check to see if the registry value is pointing to the current OIMF location (folder).
OIMF can be executed directly from the context menu (right click on a folder), so this check is important to keep OIMF portability and still let you execute it from the context menu, because when you use it from the context menu, the registry is passing the OIMF executable location and parameters to the shell for execution.

The second check is to know if OIMF was executed from the context menu or not, if it was executed from the context menu we need to open OIMF directly in the selected folder.

At this point, the user needs to enter or select the different sorting parameters:
-          Target folder
-          Files mask
-          Sorting type
-          Apply to all files or just for files older than x days

Now we need to process the different parameters entered by the user (GUI or command line), this is done by creating an "Order" object and applying the different parameters as properties of this object so it becomes the sorting rules.

After that, we are ready to process the files, when the user clicks on "Order", OIMF is scanning the target folder, counting the files and each file is compered against the sorting rules.
If the file is compatible with the files mask (*.something) and the file age is compatible with older than… , we can process the file, if not we are moving to the next file.
When a file is compatible with the mask and age, we start the process:
If files are sorted by any of the dates sorting types, we first retrieve the file date, and now we are doing the proper manipulations on this date, if for example we sort the files by date, we need to change the date format xx\xx\xxxx into xx-xx-xxxx, because xx\xx\xxxx is illegal as a folder name.
Now we check if folder xx-xx-xxxx already exists, if it is, we will move the processed file into this folder, if it doesn't exists OIMF will create this folder and then move the processed file into this folder, and continue with the next file.
OIMF can sort files by creation dates or by modified dates.

If we select to sort the files by filename extension, then we extract only the file name extension   of the file, check if a folder with this name exists (if not create it) and move the file to this folder and move on to the next file.
If the file has no extension then it will be moved into a folder named "NoExt".

So basically each file inside the target folder is compered against the sorting rules and handled according to this rules.

OIMF is a portable application (after you extract it from the install package), which means you can run it from a USB drive or from a different computer without installation.
OIMF was compressed with UPX to achieve a small file size.



7 Quick Fix 2.0


This tool is basically a collection of system quick fixes and tweaks that can be found over the net.
7QF is executing those fixes programmatically.
Each fix can be one or a combination of some of the following categories:
- Registry modifications
- ini files modifications
- re-registering a system component
- stop and start a service
- removing a file

When executing the program, it just showing the interface and doesn't do any checking (except if the OS is 32 or 64 bit), and no modification or scanning, this simple startup was made to achieve a simple and fast form display even if your computer is very slow or problematic.

When your mouse cursor enters a button, the information for this button fix is displayed at the bottom memo component, when the mouse cursor is moving out of the button area, the general utility information is displayed.

The form is divided to tabs and you can move between the tabs by clicking on the different tools icons.

When you click on any of the fix buttons, the following process start:

-          Get the location of the executable file (the location where QF.exe is running from) and check if there is a \Backup folder, if not, force create it.
-          Under the backup folder, force the creation of a new folder named as the selected fix (unless this folder already exists).
-          Now we create the restore files inside the \Backup\FixName folder.
-          If the fix is going to be a registry modification then 7QF will export the relevant registry keys into the \FixName folder. 
-          If the fix will include adding keys and values that should not be there by default, 7QF will edit the exported reg file so applying the reg file will also remove the relevant extra keys and values.
-          If the fix is going to modify ini file, the original file will be copied to the \FixName folder.
-          If the fix is going to re-register a component or stop and start a service then 7QF will create inside the\FixName folder a batch file for reversing the fix.
-          If the restore process is not straight forward then 7QF will add to the \FixName folder a readme.txt file containing the restore instructions.

Now after we have a backup, 7QF will execute the fixes which can do several things:
-          Restore the default settings by editing the registry and ini files.
-          Add keys or values to the registry (mostly tweaks).
-          Re-register a dll.
-          Stop and start a service.
Or any needed combination of those options.
Some fixes involves a single modification and some must do several changes to the registry, ini files and more, all the fixes are known fixes that can be done manually, but 7QF is doing it simple, fast and safe.
For each modification, 7QF is running validations to prevent crashes for example before deleting an object we first check if it exists where it should be, etc.
The executable file is portable (after you extract it from the install package) which means you can copy and run it from a USB drive or on a different PC.
This executable file is also compressed with UPX to achieve a small file size.