"Portable Apps" redirects here. For the portable application launcher platform, see PortableApps.com.
A USB drive, shown with a mm ruler for scale.
A portable application, or portable app for short, is a computer software program that does not need to be installed or copied onto a computer's mass storage device to be executed, running instead from a removable storage device such as a CD-ROM drive, USB flash drive, flash card, or floppy disk. Portable applications can be run on any computer system with which they are compatible; they usually require a certain type of operating system (e.g., Microsoft Windows XP or above, any Linux, etc). Portable software in this sense should not be confused with software portability, where software is designed in a way which allows its source code to be compiled for different computing platforms.
Portable software is usually designed to be able to store its configuration information and data on the storage media containing its program files.
Portable Windows applications
Most software for Microsoft Windows is not designed to be portable. The Windows registry and the structure of the Windows Installer both tie an installed program to the machine it has been installed on. Most Windows applications use the registry intensively, and store state information all over the file system, although software authoring guidelines suggest using the registry for settings and the user's profile (in the "My Documents" or "Documents and Settings" folders) for larger files dependent on a specific installation or the user's habits.
In order to make properly portable applications, software applications must leave the computer they run on exactly as they found it when finished. This means that the application cannot use the registry, nor store its files anywhere on the machine other than in the application's installation directory. When installed to removable media, a program would need to store settings in an INI file (or similar configuration file) rather than in the registry.
An alternative strategy for achieving application portability within Windows, without requiring application source code changes, is application virtualization: an application is "sequenced" or "packaged" against a runtime layer that transparently intercepts its file system and registry calls, then redirects these to other persistent storage without the application's knowledge. This approach leaves the application itself unchanged, yet portable.
The run-time layer can be embedded into an application on-the-fly by injecting a dynamic library into a third party process to create individual per application wrapper [1]. The wrapper is activated at the application startup and hooks/redirects file and registry related system calls to operate with portable (ex: flash) storage space only.
The same approach [1] is used for individual application’s components: run-time libraries, COM components or ActiveX , not for entire application only. As the result, the individual ported in such manner components are able to be: integrated into original portable applications, repeatedly instantiated (virtually installed) with different configurations/settings on the same operating system (OS) without mutual conflicts. As the ported components does not affect the OS protected related entities (registry and files), the components will not required administrative privileges for installation and management.
Portable Macintosh applications
Many programs for Mac OS X have an inherent degree of portability as they are packaged as "drag-install" application bundles, rather than as Installer packages. However, many applications' bundles are not truly portable as they store their preferences in files on the local disk where the OS is installed. Macintosh applications which are designed to be portable store their preferences in the drive they are being run from.
Portability on UNIX-based systems
Programs written with a Unix-like base in mind often do not make any assumptions. Whereas many Windows programs assume the user is an administrator — something very prevalent in the days of Windows 95/98/ME (and to some degree in Windows XP/2000 - though not in Windows Vista) — such would quickly result in "Permission denied" errors in Unix-like environments since users will be in an unprivileged state much more often. Programs are therefore generally designed around using the HOME environment variable to store settings (e.g. $HOME/.w3m for the w3m browser). The dynamic linker also provides an environment variable LD_LIBRARY_PATH so that libraries can be looked up in non-standard directories. This makes it particularly easy (from a technical point of view) to run a program off another spot. Assuming /mnt contains the portable programs and configuration, a command line may look like:
HOME=/mnt/home/user LD_LIBRARY_PATH=/mnt/usr/lib /mnt/usr/bin/w3m en.wikipedia.org
Not all programs honor this however — some completely ignore $HOME and instead do a user lookup in /etc/passwd to find the home directory, therefore thwarting portability.
Double portability
There is a very restricted category of software that can support a sort of double portability, being both stand alone and cross-platform compatible, able to run on different hardware with little or no modifications, perhaps with minor restrictions. One such software is SymbOS, whose main modules can in their present form be executed on both Amstrad CPC and MSX machines without modification. Only some of its bundled applications are hardware-dependent. To a much lesser extent, Macintosh fat binary applications could be considered as cross-platform, but not always truly portable.
See also
References
|