Installing Textpad to Flash Drive for use on public computer

Instructional HowTos, posted by users. No questions here please.

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
Angryguy
Posts: 4
Joined: Sat Jul 12, 2003 11:19 pm
Contact:

Installing Textpad to Flash Drive for use on public computer

Post by Angryguy »

I asked this question on the forums here a few months ago, but I finally decided to figure out a way to do it myself since nobody here knew.

The main problem with running TextPad from a USB Flash Drive is that TextPad stores most, if not all, of it's settings in the registry. After some Google Searching I've written a bat file that can be used to safely install TextPad to a Flash Drive, and to save all of your settings (including installed plugins/macros/etc) between uses. No remnants (registry entries) of TextPad will be left on the computer it is being run by using this method. This procedure could also be modified easily enough to work for most other applications as well.

Disclaimer: While this should work without problems, I should probably state this anyway. Modifying the Registry can be dangerous, and you should not make changes to it unless you know what you are doing and/or have backed up your registry settings. Use the information provided in this post at your own risk. This has only been tested under Win XP.

For simplicity, I have divided this into several files to make it easier to use/modify. The only problem with this method is that the path to the TextPad installation (flash drive) must be manually updated in Textpad.reg file in order for this to work. If anybody knows a better way of doing this, feel free to post it here.

A)Install TextPad on your home computer (if not already installed) and set the settings to the way you want. Then copy the TextPad Directory (ie: C:/Texpad, or C:/Program Files/TextPad) to your flash drive in it's entirety. You may also alternatively install it directly to the Flash Drive if you wanted to. Open up a command prompt (Start->Run->COMMAND.COM) and enter the following to back up your settings (change the path as needed to the folder where Textpad.exe is on your Flash Drive) Alternatively you can also export these keys using Regedit.:
REGEDIT /E E:\TextPad\TextPad.reg "HKEY_CURRENT_USER\Software\Helios"
B)Edit the newly created .reg file in your favorite text-editor (notepad or textpad). Replace the drive letter in the path to Textpad to that of your Flash Drive. ie: If Textpad was originally installed to drive C, and your Flash Drive is in E do a find and replace of C:\ with E:\ and save. This step may have to be repeated if the computer you are using TextPad on assigns the Flash Drive to a different letter. For this reason, it's best to edit the .reg file with notepad so you can quickly configure it for use on any computer. *Note*:This step can probably be automated, but I don't know enough about batch files (yet) to do so.

C)Create the Following Files in the directory with TextPad.exe and TextPad.reg on your Flash Drive.
TextPadRemove.reg - Merge this file to manually remove TextPad from system's registry

Code: Select all

Windows Registry Editor Version 5.00

[-HKEY_CURRENT_USER\Software\Helios]
TextPadUninstall.bat - Backs Up Settings and Removes from Registry

Code: Select all

REGEDIT /E TextPad.reg "HKEY_CURRENT_USER\Software\Helios"
REGEDIT /S TextPadRemove.reg
TextPadInstall.bat - This file needs to be modified in order to update the file paths. In the meantime, you must manually do a find/replace in TextPad.reg file as described above to ensure it's set to the right drive letter for the computer you are on.

Code: Select all

REGEDIT /S TextPad.reg
RunTextPad.bat - Assuming paths in the reg file are correct, all you need to do is open this file to safely execute TextPad on a public computer.

Code: Select all

CALL TextPadInstall.bat
START /W TextPad.exe
CALL TextPadUnInstall.bat
D)That's it. To run Textpad simply execute RunTextPad.bat from MyComputer. Your settings will be automatically extracted when you run the program, and saved again when you close it, with all registry entries removed from the given computer. You may also manually run the appropriate Install or Uninstall .bat files if you need to (instead of RunTextPad.bat), such as when running multiple instances of TextPad.[/code]
jmmp
Posts: 5
Joined: Mon Apr 28, 2003 11:01 am
Location: Aberdeen,Scotland

Post by jmmp »

>>> The only problem with this method is that the path to the TextPad installation (flash drive) must be manually updated in Textpad.reg file in order for this to work. If anybody knows a better way of doing this, feel free to post it here. <<<

I had a related problem - I use TP's file:C:/path/path/otherfile.txt facility to build up a hypertext reference. But, I wanted to use it at home as well as work. so I started moving it across to a Flash drive. It works so well, that I want to move my music across - you can reference it, and images, from within a textfile this way. 5 Gbytes of music won't fit onto a Flash drive, so I am considering getting a 300GByte external USB drive as my "memory stick". And I thought, "What would be the problems installing TP on the external drive?" - Which is what brought me to your post.

To answer your question, in XP you can go to: ControlPanel:AdministrativeTools:ComputerManagement:DiskManagement, and set your drive letter ( so long as some other disk isn't using it - in which case move that elsewhere to free the driveletter you want ).

Having a predicatable drive letter has the added benefit that all my F://blah.. path's continue to work on a strange computer and my hyper-text & audio reference network continues to be accessible - not a single, tedious, HTML tag in sight. Nice!
:-)
John Montgomery
Aberdeen, Scotland.
Helge
Posts: 1
Joined: Wed Aug 17, 2005 12:39 pm

Installing Textpad on USB stick for use on public computers

Post by Helge »

You can use %~d0 in a Cmd or Bat file to extract the drive letter of the USB stick.
For information, try "Call /?" at a command prompt.

Next, you need a small command line search-and-replace tool to replace the original TextPad path by the new one (in the reg-files).
I would suggest
MiniSed (source files in C: http://www.exactcode.de/oss/minised/) or
Sed (executable: http://gnuwin32.sourceforge.net/packages/sed.htm).
Use MiniSed if you have a C compiler.

I hope that this will help you in stream-lining your TextPad.
Cringing Dragon
Posts: 7
Joined: Fri May 04, 2007 11:39 pm

Post by Cringing Dragon »

I love the idea of being able to run TextPad (or any other application) off a flash drive or external drive. Unfortunately the use of regedit effectively stops me from being able to use this method at work. We have followed the increasing trend towards "locking down" the networked PCs so that the average user/employee does not have sufficient permissions to edit the registry. I would expect also that many public access computers do not enable guest users to edit the registry (for obvious reasons).

Aside from that, the main issue I see with this approach is that of you were to try this on a computer that already had TextPad locally installed, then your uninstall batch file would remove all the TextPad registry settings and render the local install of TextPad unusable.
Perhaps you could add code that backs up and restores existing registry settings? I haven't tested the code below to confirm that it will work. It might fail if HKEY_CURRENT_USER\Software\Helios doesn't exist in the registry, and it might not need START /W to make it wait for the first regedit to finish.

Code: Select all

START /W REGEDIT /E backup.reg "HKEY_CURRENT_USER\Software\Helios"
CALL TextPadInstall.bat 
START /W TextPad.exe 
CALL TextPadUnInstall.bat
REGEDIT /S backup.reg
lgpiper
Posts: 7
Joined: Sun May 20, 2007 8:20 pm

Post by lgpiper »

This is a really bad idea. Not the idea of installing a decent text editor to run off the flash drive. But the idea of changing the registry of every computer you visit. There's no reason to do this on your own computer. So it only has value when you're on the road and using the computer in a local library or net cafe. Those people would string you up if you started messing with their registry, as they should.

There is a decent competitor to TextPad that runs off a USB drive. I would switch text editors before I started messing up someone's computer registry settings. Better yet, convince the TextPad folks that it's worth their while to change architecture enough to allow this.
joelmw
Posts: 20
Joined: Wed Mar 10, 2004 4:48 pm
Location: DFW
Contact:

Post by joelmw »

The truth is that software is always messing with the registry and probably with a lot less restraint than is being discussed here. Moreover, in my experience, it's not so spooky as everyone tries to tell you, and TextPad's entries in particular are discretely located. Frankly, I trust the reg files I manage a lot more than the crap that comes through installs, uninstalls, et al., even from reputable developers.

Nevertheless, I agree that Helios needs to come up with a better solution.
Grace and Peace,
Joel
Post Reply