Being proud owner of a U3 capable flash drive, I wanted to add some of the tools I use everyday but which were not U3 compatible.
Running a U3 program from the LaunchPad basically does the following things:
- unpack the
.u3ppackage (which is a
.zip) to your local
- run the hostConfigure command from the manifest file (once per session)
- run the appStart command from the manifest file (this starts the application)
Ejecting the U3 drive does the following for all programs which were ran in that session:
- if the program is still running, run the appStop command from the manifest file
- run the hostCleanUp command from the manifest file
Most programs store their settings in a key in the Windows registry. Some others need an
.ini file in their folder.
So in both cases it’s relatively easy to move them to another location and run them from there.
After I had successful runs using a batch file for hostConfigure which imported a registry file and another batch file for hostCleanUp which exported the new settings to that file, I wanted to create a tool which automates most steps neccessary for a program to run.
So the U3Helper was born.
The first version got too complicated after a while and so I started from scratch. The result it this tool.
This manual assumes you already know which registry branches and/or configuration files and/or OCXes/DLLs your application uses.
actions-section of your
manifest.u3i look like this (the parameters in the
appStart tag are for WebMon,
not for the U3Helper):
Note: The GUID
0f90f88c-5e05-4cab-8c3a-e1c0112b06fd is that of the U3Helper, NOT the one of the application of that
If the application writes something to
%USERPROFILE%\Application Data, change the
appStart line to look like this:
This way, the U3Helper will change some environment variables for the launched application so that it stores all user-data on the flash drive instead of on the local harddisk.
Now create a file
U3Helper.ini and put it into the
host directory in your U3 package so that it gets extracted
Here is a template:
- All registry keys listed under
[RegBackup]are being backed up on eject of the U3-stick to sequential files (
regdata2.regand so on) in
%U3_APP_DATA_PATH%and afterwards, the keys are deleted from the host machine. Also those branches are inserted back into the registry upon the first launch of that app after plugging in the stick.
- if you put a file
datadirectory in your U3 package, this file gets imported into the registry after all other files have been processed. But this file never gets overwritten by a newer dump so it’s perfectly to enforce some settings the program changes every time, like relative paths into absolute paths.
- The section
[RegDelete]just deletes those keys upon eject.
[regsvr32]you can list all
.dllfiles which should be registered before launching the app and unregistered on eject. The files are assumed to be in
[DataToExecDir]lists files which should be copied into the directory containing the application (many applications insist on their config-files lying where the
.exelies) and back to
- if you put a file