yaP is a universal DIY style launcher for creating portable applications on Windows.
When launching yaP it reads settings from an ini file to what files/directories to copy and which registry keys to backup, etc. Then launches the main application and waits until it is closed. When that happens, yaP saves application settings to the portable directory and restores local backups.
Before start, examine the application you are about to portablize and find out where does it store settings, how deeply integrates to the system, etc. This is necessary to be able to tell yaP what directories, files, registry keys to take care of.
Create a new directory (
MyApp
) and put application's files to a subdirectory (e.g
MyApp\App
).
Use Universal Extractor to get application files if
it is an installer or install & uninstall if other methods fail.
Copy yaP.exe to MyApp directory and rename it to a custom name (eg. MyAppPortable.exe ).
Run MyAppPortable.exe and click Ok to generate a new yaP settings file ( MyAppPortable.ini ).
Edit MyAppPortable.ini and fill the necessary fields.
Refer to the configuration section for ini syntax or check the examples for ready-made configurations.
Note: if your portable needs advanced logic you can execute custom batch files with yaP.
Downloaded 17675 times since 05/2013
yaP is free. You can use, distribute and modify as you like it. The author is not liable for any damages arising from its use.
yaP is provided "as is" and "with all faults." The developer makes no representations or warranties of any kind concerning the safety, suitability, lack of viruses, inaccuracies, typographical errors, or other harmful components of yaP. There are inherent dangers in the use of any software, and you are solely responsible for determining whether yaP is compatible with your equipment and other software installed on your equipment. You are also solely responsible for the protection of your equipment and backup of your data, and the developer will not be liable for any damages you may suffer in connection with using, modifying, or distributing yaP.
Read the full yaP changelog here.
From v0.34 it is possible to add encrypted text to config files. The purpose is to avoid sensitive data in plain text format (passwords, file paths, etc).
Example:
commandline=!@@DzwUOTICZidVHBEGIRgdXw5sISM3Ii87Vi9OKTMVGFMNYRNoPRAXATs6WDJaCh41ODkVBw5pEyM3IiM/V3JOajVhPgoeU0E9AA==
This is the encrypted equivalent of
commandline="d:\mySensitiveData.file" -pw:"myPassword"
using the password "admin".
If a password is used during encryption, yaP will launch the main application only if the valid password is entered. This means that you can add password protection to the launcher by encrypting a config item value, eg. the main application path. Encrypted values without passwords are to hide information without password prompt.
If you need to modify the config value later, simply decrypt it with yaPcrypt, then modify and encrypt again.
There is no 100% secure encryption available and neither is yaPcrypt an exception.
However, choosing a proper password will make decoding impossible for the average human beings.
Please note that even if you launch the main application with encrypted commandline parameters, yaP will pass unencrypted data to the application which may be visible to other applications.
keyword = segment1 config item with one segment keyword = segment1 :: segment2 :: segment3 item with three segments keyword = segment1 :: NULL :: segment3 item with three segments (second segment is empty) keyword = segment1 [ :: segment2] item with an optional second segment ; keyword = segment1 commented item, not processed
The first item should always be "application" in the GENERAL section. The order of the items are arbitrary otherwise.
Some keywords are restricted to BEFORE or AFTER sections, these are indicated below. Keywords in wrong sections are skipped.
Paths can be absolute or relative to the launcher. No need to add quotes around them if they contain spaces.
Environment variables, shell folders and yaP macros can also be used when constructing paths.
application
application = Application path application = C:\Dir\App.exe :: ..\Dir\AppX64.exe application = %ProgramFiles%\App.exe :: %ProgramFiles%\AppX64.exe
Path of the main application to run. Required.
On a 64bit OS yaP automatically launches the application set in the second segment (if available).
commandline
commandline = Commandline parameters commandline = /nosplash commandline = --dir="{YAPROOT}\Settings"
Commandline parameters to pass to the main application.
workdir
workdir = Directory path workdir = C:\MyApp workdir = %Appdata%\MyApplication
Working directory of the main application.
Defaults to the main application's directory if not specified otherwise.
!admin
!admin = 1 start the launcher in admin mode !admin = 2 show a message if user is not admin and quit !admin = -1 quit if user is not admin (no message)
Indicate that admin rights is required for the main application to run.
!dotnet
!dotnet = 4.0 !dotnet = 2.1!
Notify the user if the specified .NET version is needed to run the main application and is not available on the host machine.
Use an exclamation mark to exit if the specified version is not available.
!java
!java = 1.6 !java = 1.7!
Notify the user if the specified Java version is needed to run the main application and is not available on the host machine.
Use an exclamation mark to exit if the specified version is not available.
!multiple
!multiple = 1 always enable multiple instances (no prompt) !multiple = 2 run the main application without BEFORE and AFTER items !multiple = -1 always disable multiple instances (no dialog)
Enable or disable multiple instances of the main application.
If not specified otherwise yaP asks whether to launch another instance.
!online
!online = 1 ask to continue (if offline) !online = 2 show a dialog box that online connection is required (if offline) !online = -1 quit without prompt (if offline) !online = -2 ask to continue if offline status is required (if online) !online = -3 show a dialog box that offline status is required (if online)
Notify the user that internet connection is required for the main application if offline (or vice versa).
!os
!os = XP the main application requires Windows XP or newer !os = Vista the main application requires Windows Vista or newer !os = <7 the main application requires Windows 7 or older !os = 8 the main application requires Windows 8 or newer
Notify the user if the current OS version does not meet the main application's minimum or maximum OS requirement.
Use the "<" character to indicate the max OS version.
!waitprocess
!waitprocess = Full or partial process title !waitprocess = - Notepad++ wait for all apps to close having "- Notepad++" in title
(Partial) title of a process that should be closed before executing AFTER items.
Some applications are only launchers to other applications and in these cases yaP would fire AFTER items right after closing the main app. By specifying a process to wait it is possible to run AFTER items only when the process terminates.
dir BEFORE section only
dir = Source directory path :: Target directory path dir = C:\Dir :: SubDir dir = C:\Dir Settings subdirectory will be used as target directory
Backup, save and restore contents of a directory.
If target directory is missing the "Settings" subdirectory of the launcher will be used.
Operations on BEFORE run:
Operations on AFTER run:
file BEFORE section only
file = Source file path :: Target file or directory path file = %Appdata%\MyFile.ini :: SubDir\MyFile.ini file = C:\Dir\MyFile.ini :: SubDir\ file = C:\Dir\MyFile.ini launcher directory will be used as target directory
Backup, save and restore a file.
Operations on BEFORE run:
Operations on AFTER run:
regkey BEFORE section only
regkey = Source registry key :: Target registry export file or target directory path regkey = HKCU\Software\RegKey :: SubDir\settings.reg regkey = HKCU\Software\RegKey :: settings.reg regkey = HKCU\Software\RegKey :: SubDir\ save reg key to {YAPROOT}\SubDir\settings.reg regkey = HKCU\Software\RegKey save reg key to {YAPROOT}\settings.reg
Backup, save and restore a registry key.
Operations on BEFORE run:
Operations on AFTER run:
regvalue BEFORE section only
regvalue = Source registry value :: Target registry export file or target directory path regvalue = HKCU\Software\Key\Value :: SubDir\settings.reg regvalue = HKCU\Software\Key\Value :: settings.reg regvalue = HKCU\Software\Key\Value :: SubDir\ save value to {YAPROOT}\SubDir\settings.reg regvalue = HKCU\Software\Key\Value save value to {YAPROOT}\settings.reg
Backup, save and restore a registry value.
Operations on BEFORE run:
Operations on AFTER run:
(dir) BEFORE section only
(dir) = Directory path (dir) = C:\Dir
Backup and restore a directory.
Operations on BEFORE run:
Operations on AFTER run:
(file) BEFORE section only
(file) = File path (file) = C:\Dir\MyFile.ini
Backup and restore a file.
Operations on BEFORE run:
Operations on AFTER run:
(regkey) BEFORE section only
regkey = Registry key regkey = HKCU\Software\RegKey
Backup and restore a registry key.
Operations on BEFORE run:
Operations on AFTER run:
(regvalue) BEFORE section only
(regvalue) = Registry value (regvalue) = HKCU\Software\Key\Value
Backup and restore a registry value.
Only "REG_SZ" and "REG_DWORD" registry value types are supported.
Operations on BEFORE run:
Operations on AFTER run:
->dir
->dir = Source directory path [ :: Target directory path] [ :: move, no overwrite] ->dir = %Temp%\Dir :: SubDir copy contents of %Temp%\Dir to {YAPROOT}\SubDir <-dir = %Temp%\Dir :: SubDir :: move move contents of {YAPROOT}\SubDir to %Temp%\Dir ->dir = C:\Dir :: C:\Dir_old :: no overwrite backup dir to C:\Dir_old (copy, skip existing) <-dir = C:\Dir :: C:\Dir_backup :: move restore dir C:\Dir_backup to C:\Dir (move) ->dir = %Desktop%\OldDir :: %Desktop%\NewDir :: move rename OldDir to NewDir on Desktop
Copy or move contents of a directory to another directory.
->file
->file = Source file path [ :: Target file or directory path] [ :: move, no overwrite] ->file = C:\File.ini :: Dir copy C:\File.ini to {YAPROOT}\Dir ->file = C:\File.ini :: Dir\File.ini :: move move C:\File.ini to {YAPROOT}\Dir <-file = C:\File.ini :: Dir\File.ini :: move move {YAPROOT}\Dir\File.ini to C:\ ->file = %Appdata%\settings.xml copy %Appdata%\settings.xml to launcher directory <-file = C:\a.7z :: NULL :: no overwrite copy {YAPROOT}\a.7z to C:\, skip existing ->file = File.txt :: Todo.txt :: move rename File.txt to Todo.txt
Copy or move a file.
->regkey
->regkey = Source registry key :: Target registry key [ :: move] ->regkey = HKCU\Software\A :: HKCU\Software\B copy contents of regkey A to B <-regkey = HKCU\Software\A :: HKCU\Software\B :: move move contents of regkey B to A ->regkey = HKCU\Software\OldKey :: HKCU\Software\NewKey :: move rename regkey
Copy or move contents of a registry key to another registry key.
->regvalue
->regvalue = Source registry value :: Target registry value [ :: move] ->regvalue = HKCU\Software\Key\A :: HKCU\Software\Key\B copy value of A to B <-regvalue = HKCU\Software\Key\A :: HKCU\Software\Key\B :: move move value of B to A ->regvalue = HKCU\Software\Key\OldValue :: HKCU\Software\Key\NewValue :: move rename value
Copy or move contents of a registry value to another registry value.
+dir
+dir = Directory path +dir = C:\Dir
Create a new directory.
+file
+file = File path [ :: overwrite | no overwrite] [ :: file contents] +file = C:\Dir\MyFile.ini +file = C:\Dir\MyFile.ini :: overwrite :: Hello world +file = C:\Dir\MyFile.ini :: no overwrite :: [SETTINGS]{LINEBREAK}update=0
Create a new file.
If the "no overwrite" flag is present the file will not be created if already exists.
File contents can be set in the third segment.
+regkey
+regkey = Registry key +regkey = HKCU\Software\RegKey
Create a new registry key.
+regvalue
+regvalue = RegKey :: RegValueName :: RegValueData :: DataType :: RegSeparator +regvalue = HKCU\Software\MyApp :: Language :: English +regvalue = HKCU\Software\MyApp :: FirstStart :: 0 :: REG_DWORD
Create a new registry value.
-dir
-dir = Directory path [ :: ifempty] -dir = %Appdata%\Dir -dir = C:\Dir :: ifempty delete C:\Dir only if it contains no files or subdirectories -dir = %Temp%\cache-* delete all directories from %Temp% that starts with "cache-"
Delete directory or directories.
-file
-file = File path -file = C:\Dir\MyFile.ini -file = %Temp%\*log* delete all files from %Temp% that contains with "log"
Delete file or files.
Wildcard characters "?" and "*" are allowed in filenames.
-regkey
-regkey = Registry key [ :: ifempty] -regkey = HKCU\Software\RegKey -regkey = HKCU\Software\RegKey :: ifempty
Delete a registry key.
If the "ifempty" flag is present, yaP will delete the registry key only if the key is empty.
-regvalue
-regvalue = Registry key :: Registry value name -regvalue = HKCU\Software\MyApp :: Lang
Delete a registry value.
attributes
attributes = File or directory path [ :: attributes separated with commas] attributes = C:\Dir :: system attributes = MyFile.ini :: readonly, hidden set MyFile.ini to readonly and hidden attributes = ..\MyFile.ini set MyFile.ini to normal in parent directory
Set directory or file attributes.
batch
batch = C:\before.bat batch = SubDir\before.bat :: show
Execute a batch file.
clip
clip = Text or empty clip = Hello world! puts Hello World! on clipboard clip = *EMPTY* set clipboard empty
Text to put on clipboard.
Set its value to "*EMPTY*" to clear clipboard.
date
date = File [ :: Date] [ :: Date type] date = New.7z :: 2013.12.31 23:59 :: modified set New.7z date modified to 2013.12.31 23:59 date = File.txt :: now :: accessed set File.txt date accessed to current system date date = File.txt set File.txt date modified to current system date
Set file date.
delay
delay = 500
Milliseconds to wait before executing the next item in the config file.
envvar
envvar = LANG :: English
Set environment variable. It will be visible for the main application and its child processes only.
iniread
iniread = IniFile :: [Section] :: Key :: User variable iniread = File.ini :: SETTINGS :: Lang :: MyVar read Lang key value to variable MyVar iniread = File.ini :: NULL :: Lang :: MyVar read Lang key value to MyVar (no section)
Read a value from an ini file and save it to a user variable.
Leave the Section segment empty to read a key that is outside a section.
The new variable can be used as "{MyVar}" later on.
iniwrite
iniwrite = IniFile :: [[--]Section] :: Key [ :: Value] iniwrite = Dir\File.ini :: SETTINGS :: Lang :: EN write Lang=EN to SETTINGS section iniwrite = Dir\File.ini :: SETTINGS :: Lang remove Lang key from SETTINGS section iniwrite = Dir\File.ini :: --SETTINGS delete SETTINGS section
Write a key-value to an ini file.
killprocess
killprocess = Process name killprocess = Notepad.exe killprocess = Notepa*
Terminate all instances of the specified process.
The "*" character can be used as a wildcard at the end of the process name.
message
message = Text [ :: cancellable] message = Hello world! message = Commandline is: {COMMANDLINE} :: cancellable
Show a topmost dialog box with the specified message.
nowait
nowait = 1
Quit after launching the main application without executing AFTER items.
quit
quit = 1
Terminate the launcher.
regdll
regdll = Dll file path [ :: unregister] regdll = Dir\Library.dll regdll = Dir\Library.dll :: unregister
Register or unregister a dll file.
Note that admin rights may be required for this operation.
regexport
regexport = Registry key or value [ :: Target file or directory path] regexport = HKCU\Software\App\ :: C:\Dir\reginfo.reg regexport = HKCU\Software\App\ :: Dir\reginfo.reg export key to {YAPROOT}\Dir\reginfo.reg regexport = HKCU\Software\App\ :: Settings\ export key to {YAPROOT}\Settings\settings.reg regexport = HKCU\Software\App\ export key to {YAPROOT}\settings.reg regexport = HKCU\Software\App\Lang export value to {YAPROOT}\settings.reg
Export a registry key or value to file.
regimport
regimport = RegFile.reg regimport = Dir\reginfo.reg
Import a registry file to the registry.
regmerge
regmerge = RegFile.reg :: RegFile.reg regmerge = Settings\settings.reg :: Settings\anotherfile.reg
Merge two reg files into one.
The contents of the second reg file will be appended to the first reg file.
replace
replace = File :: StringToFind :: Replacement replace = C:\MyFile.txt :: "hello" :: "hi"
Replaces all occurences of StringToFind with Replacement in a file.
replaceline
replaceline = File :: Beginning of line to find :: Replacement replaceline = Settings.xml :: <checkForUpdates :: <checkForUpdates value="0"/>
Replaces the first matching line with the Replacement in a file.
restore AFTER section only
restore = 1
Indicates when should yaP run automatic AFTER items.
When using keywords "dir", "file", "regkey", "(dir)", "(file)", "(regkey)" and "symlink" yaP automatically adds their AFTER operations to the processing queue. By default these items are run right after closing the main application. If the "restore" keyword with value 1 is present then yaP will run these items where this keyword is found in the list.
run
run = Application [ :: wait] [ :: commandline parameters] [ :: working directory] run = %Windir%\Notepad.exe :: wait :: C:\MyFile.txt :: {YAPROOT} run = %Windir%\Notepad.exe :: NULL :: C:\MyFile.txt :: {YAPROOT} run = %Windir%\Notepad.exe
Run an application.
If the "wait" flag is used yaP will wait for the application to terminate before processing the next config item.
stringreplace
stringreplace = Text :: String to find :: Replacement :: User variable stringreplace = {YAPROOT} :: \ :: // :: MyVar replace all "\" to "//" in {YAPROOT} stringreplace = %Desktop% :: \ :: NULL :: MyVar remove all "\" from %Desktop%
Search and replace string in a string and save the result to a user variable.
The new variable can be used as "{MyVar}" later on. An existing user variable will be overwritten.
symlink BEFORE section only
symlink = Link: file or directory path :: target file or directory path symlink = %Appdata%\MyDir\ :: Settings\MyDir\ symlink = %Appdata%\MyFile.ini :: Settings\MyFile.ini
Create a directory or file symbolic link.
systemrefresh
systemrefresh = 1
Refresh the system.
uservar
uservar = Variable name :: Variable value uservar = MyRegKey :: HKCU\Software\MyApp
Add a custom user variable.
Path macros
{YAPROOT}
absolute path of the launcher's directory
{EXEPATH}
absolute path of the main application's directory
{APPEXE}
absolute path of the main application
{DRIVE}
current drive letter of the launcher, eg. "D"
{USERFILE}
browse file dialog to dynamically add filepath
{USERDIR}
browse directory dialog to dynamically add path
{WORKDIR}
working directory of the main application
Text macros
{CLIPBOARD}
text on clipboard
{LINEBREAK}
new line
{USERTEXT}
text input dialog to dynamically add text
Date and time macros
{d}
day of the month, 2 digits with leading zeros
{j}
day of the month without leading zeros
{m}
numeric representation of a month, with leading zeros
{n}
numeric representation of a month, without leading zeros
{Y}
a full numeric representation of a year, 4 digits
{y}
a two digit representation of a year
{g}
12-hour format of an hour without leading zeros
{G}
24-hour format of an hour without leading zeros
{h}
12-hour format of an hour with leading zeros
{H}
24-hour format of an hour with leading zeros
{i}
minutes with leading zeros
{s}
seconds, with leading zeros
{U}
seconds since the Unix Epoch (January 1 1970 00:00:00 GMT)
Language and locale macros
{LANG}
"English"
{LOCALE}
"EN"
{LOCALENAME}
"en-GB"
{LOCALENAME_SHORT}
"en"
{COUNTRY}
"United Kingdom"
Misc macros
{COMMANDLINE}
parameters passed to the main application
{PARAMETERS}
parameters passed to the launcher
User-defined variables
See keyword "uservar".
Shell folders
Environment variables
See the Wikipedia page for the complete list of environment variables.
I don't understand a thing.
Though yaP is intended to be easy to use it is not for beginners. If you are looking for ready-made portable applications visit
The Portable Freeware Collection,
Lupo PenSuite,
PortableApps.com,
LiberKey,
WinPenPack or other portable collection sites.
How can I update yaP-ped portables?
Manually update main application files even if an auto update feature is available. Otherwise the main application may restart itself and
leave settings in the system. Also check whether the new version saves settings to the same locations - if not, change the configuration ini
accordingly.
Is there any directory structure convention to follow?
Nope. yaP needs only the config file (LauncherName.ini or yaP.ini) to be next to the launcher exe. Application and settings files can be
anywhere.
How can I change yaP.exe icon?
Use a 3rd party software, eg.
QIcon-Changer.
Is yaP PortableApps format
compatible?
yaP is not designed to be compatible with PA but creating the extra dirs/files that PA requires it can be done.
Can I use UPX to further reduce the launcher size?
Yes, but keep in mind that some AV software may flag it as malicious.
Can I use "HKCU" and "HKEY_CURRENT_USER" interchangeably?
Yes, just like "HKLM" and "HKCR" as well.
Can yaP show a splash screen?
No.
Will yaP create a directory if the parent directory is not available?
Yes, yaP creates a directory tree.
Can I use "..\" or nested directories in paths?
Yes. "+file = ..\Subdir1\Subdir2\MyFile.txt" will work.
What programming language is yaP written in? Is the source code available?
yaP is written in PureBasic. The source code is not available yet.
Where can I submit a new example configuration or report a bug?
Visit the yaP forum topic at The
Portable Freeware Collection or use the discussion section below.
© 2024 rolandtoth