Truly portable WinImage.

I have some programs on my USB drive that not only write to the registry, but also add an entry to the Add/Remove Programs list which doesn’t make sense considering I’m running the actual program and not the installer. Because of this I’ve been hesitant to use these programs but once again I found a work around to allow me to use them as I usually do but leave nothing behind, not even an entry in the Add/Remove Programs list.
One such program I use is WinImage, which is excellent for making images of floppy disks. I always keep this gem handy.
Here’s how I made WinImage truly portable. After copying the WinImage folder to my USB key drive, I then run it so I can put in the registration code. After that’s done, I go to the registry and export the program settings that reside under HKEY_CURRENT_USER\Software\WinImage to a REG file that I save to the WinImage folder.
The next step is creating a script to remove all the WinImage entries from the registry. Once again AutoIt comes in extremely handy. In making this AutoIt script, I ran Regedit, did a search for the word “WinImage” and copied every key where that word appears. Here’s the resulting script:

RegDelete (“HKEY_CLASSES_ROOT\.bwz”)
RegDelete (“HKEY_CLASSES_ROOT\.dsk”)
RegDelete (“HKEY_CLASSES_ROOT\.ima”)
RegDelete (“HKEY_CLASSES_ROOT\.img”)
RegDelete (“HKEY_CLASSES_ROOT\.imz”)
RegDelete (“HKEY_CLASSES_ROOT\.iso”)
RegDelete (“HKEY_CLASSES_ROOT\.vfd”)
RegDelete (“HKEY_CLASSES_ROOT\.wil”)
RegDelete (“HKEY_CLASSES_ROOT\.wlz”)
RegDelete (“HKEY_CLASSES_ROOT\Applications\winimage.exe”)
RegDelete (“HKEY_CLASSES_ROOT\WinImage”)
RegDelete (“HKEY_CLASSES_ROOT\WinImageIso”)
RegDelete (“HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\App Management\ARPCache\WinImage”)
RegDelete (“HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.IMA”)
RegDelete (“HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.img”)
RegDelete (“HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Uninstall\WinImage”)
RegDelete (“HKEY_CURRENT_USER\Software\WinImage”)
RegDelete (“HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.bwz”)
RegDelete (“HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.dsk”)
RegDelete (“HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.ima”)
RegDelete (“HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.img”)
RegDelete (“HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.imz”)
RegDelete (“HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.iso”)
RegDelete (“HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.vfd”)
RegDelete (“HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.wil”)
RegDelete (“HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.wiz”)
RegDelete (“HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Applications\winimage.exe”)
RegDelete (“HKEY_LOCAL_MACHINE\SOFTWARE\Classes\WinImage”)
RegDelete (“HKEY_LOCAL_MACHINE\SOFTWARE\Classes\WinImageIso”)
RegDelete (“HKEY_USERS\S-1-5-21-1292428093-1993962763-839522115-2640\Software\Microsoft\Windows\CurrentVersion\App Management\ARPCache\WinImage”)
RegDelete (“HKEY_USERS\S-1-5-21-1292428093-1993962763-839522115-2640\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.IMA”)
RegDelete (“HKEY_USERS\S-1-5-21-1292428093-1993962763-839522115-2640\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.img”)
RegDelete (“HKEY_USERS\S-1-5-21-1292428093-1993962763-839522115-2640\Software\Microsoft\Windows\CurrentVersion\Uninstall\WinImage”)
RegDelete (“HKEY_USERS\S-1-5-21-1292428093-1993962763-839522115-2640\Software\WinImage”)
MsgBox (4096, “WinImage”, “Done!”)

The script not only removes the WinImage settings from the registry, it also undoes the file associations and removes WinImage from the Add/Remove Programs list without removing the actual program. I gave this script a test run and it works really well.
Needless to say, there is now a little extra work involved to run WinImage portably. First you double-click on the REG file to import the registry settings. Afterwards you can run WinImage like you normally do and when you’re done, you can run the cleanup script to remove its entries from the registry.

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: