appstart

Package: WA2L/WinTools 1.2.08
Section: General Commands (1)
Updated: 28 January 2024
Index Return to Main Contents

 

NAME

appstart - start application from search dir

 

SYNOPSIS

WA2LWinTools/(bin|lib)/appstart [ -h | -V ]

appstart "subdir\executable" [ options ]

appstart "label:\dir\executable" [ options ]

appstart -p "subdir\executable"

appstart -p "label:\dir\executable"

 

AVAILABILITY

WA2L/WinTools

 

DESCRIPTION

 

IMPORTANT

Please read also the run(1) manual page.

The run command allows to save the "subdir\executable" or "label:\dir\executable" and options definitions in a central configuration file and start the related application thru an application name.

 

MODE: appstart "subdir\executable"

search a program that is installed in a specific subdirectory in a list of directories and start it from where it is found first.

This permits to install a program on several devices (as: USB-drive or local-drive etc.) and to start it from the (fastest) available drive without to have to change the startup shortcut or the start definition in pstart(1) or the hotkey setup in hotkeyp(1).

The search path can be specified in the optional configuration file etc/appstart.cfg using the SEARCHPATH=path1;path2;pathN... setting. The additional environment variables %INSTALLDIR% that points to the installation directory and %INSTALLDRIVE% that points to the installation drive of WA2L/WinTools can be used in the SEARCHPATH setting.

 

MODE: appstart "label:\dir\executable"

If you want to start a certain program from a specific disk this operation mode helps to be independent of possible changing drive letters when using the (external) disk on different systems or in different USB port locations.

The appstart command searches for the given label on all connected drives and starts the defined executable within the absolute path you defined in dir.

For example:

  appstart myUSB-Stick:\Programs\GIMPPortable\GIMPPortable.exe

would search for a directory myUSB-Stick or the disk name myUSB-Stick on all connected drives and then uses the found drive letter to start the command.

If the label myUSB-Stick is found on drive P: for example, appstart starts the executable as follows:

  P:\Programs\GIMPPortable\GIMPPortable.exe

In this mode the setting SEARCHPATH= is ignored.

 

OPTIONS

-h
usage message.

-V
print program version.

-p
print search matches and parameters for given "subdir\executable" respectively "label:\subdir\executable" without starting the target program. This to review the effect of the used command options.

"subdir\executable"
executable to be started from the location where first found in the SEARCHPATH as defined in the optional etc/appstart.cfg configuration file.

"label:\dir\executable"
executable to be started from the location where first found based on the labels on the disks present on the system.

A label can be a directory placed on the target disk or the disk name that can be set thru Explorer → right mouse-click on drive letter → General tab → Disk-Icon: name → [ OK ].

The dir\executable is the absolute path to the executable (eg.GIMPPortable.exe) without the drive letter.

This allows to start an executable for instance from an USB device whose drive letter changes on different systems or when changing your USB-hub configuration always thru the same startup command:

  appstart myUSB-Stick:\Programs\GIMPPortable\GIMPPortable.exe

Where you created the directory myUSB-Stick in the topmost location on the USB stick. You can also hide the created directory.

options
options to the executable.

 

ENVIRONMENT

The following environment variables are added to the environment by the appstart command and are therefore available within the started commands:

%WA2L_START_FROM_TTY%
this variable is set to True when the appstart command was started from a command window (aka. tty), when started thru a double click directly or via 'Send To' menu the variable is set to False.

This environment variable then can be used in started *.cmd or *.bat files to react accordingly based on the start situation.

%WA2L_INSTALLDIR%
installation base directory of the WA2L/WinTools package.

%PATH%
the %PATH% environment variable is prepended by the setting of PATH_PRE=setting in etc/appstart.cfg.

 

EXIT STATUS

0
no error.

4
usage message displayed.

5
program version printed.

 

FILES

etc/appstart.cfg
optional configuration file for appstart(1) and run(1). See: appstart.cfg(4) for more information.

 

EXAMPLES

Suppose you installed the WA2L/WinTools package on a removable drive in the e:\bin\ directory (where the drive name e: might change on other systems or when plugging it into another USB port).

All portable software is also installed on the removable drive in the bin/ directory, each in it's own subdirectory.

To increase performance, you installed (=copied) certain applications in addition from the removable drive to your user home into the 'my Documents\bin\' directory (which is in reality: c:\users\Fred\Documents\bin\ respectively %USERPROFILE%\Documents\bin\).

1) use appstart in the PStart portable start menu

To start the applications you use the portable start menu pstart(1) which is bundled with WA2L/WinTools.

To avoid to have to create separate icons for the local and the portable installed programs you can use the appstart command as in the following examples:

GIMP (Gnu Image ManiPulator):

  Application / file path: appstart.exe
  Command line parameters: GIMPPortable\GIMPPortable.exe
  Advanced > Window state: minimized

Gnuplot (Mathematical function plotting):

  Application / file path: appstart.exe
  Command line parameters: Octave\octave-4.2.1\bin\wgnuplot.exe 
  Advanced > Window state: minimized

Now when you are working on the PC where you copied the applications to the 'my Documents\bin\' directory or when you just have the removable device available, you can always click the same icon.

When you decide to change the installation directories of the software you just have to change the SEARCHPATH setting in the appstart.cfg(4) file, all the startup settings in PStart can stay the same.

You might notice that you see the >> icon of appstart in PStart for the created entries in the menu. To change this you can set an icon for each command:

To use an icon (*.ico) file:

  Advanced > Replace icon: ..\var\icons\Gnuplot.ico

To extract an *.ico file from an executable, the icongrabber(1) command can be used.

2) use appstart in the HotkeyP portable hotkey manager

To start the applications you use the portable hotkey manager hotkeyp(1) which is bundled with WA2L/WinTools.

To avoid to have to create separate hotkeys for the local and the portable installed programs you can use the appstart command as in the following examples:

GIMP (Gnu Image ManiPulator):

  Command:    appstart.exe
  Parameters: GIMPPortable\GIMPPortable.exe
  Window:     minimized

Gnuplot (Mathematical function plotting):

  Command:    appstart.exe
  Parameters: Octave\octave-4.2.1\bin\wgnuplot.exe 
  Window:     minimized

Now when you are working on the PC where you copied the applications to the 'my Documents\bin\' directory or when you just have the removable device available, you can always use the same hotkey.

When you decide to change the installation directories of the software you just have to change the SEARCHPATH setting in the appstart.cfg(4) file, all the hotkey settings in HotkeyP can stay the same.

 

SEE ALSO

wintoolsintro(1), appstart.cfg(4), hotkeyp(1), icongrabber(1), lpath(3), pstart(1), qsel(1), run(1), run.cfg(4), softwarelist(1)

 

NOTES

-

 

BUGS

-

 

AUTHOR

appstart was developed by Christian Walther. Send suggestions and bug reports to wa2l@users.sourceforge.net .

 

COPYRIGHT

Copyright © 2020 Christian Walther

This is free software; see WA2LWinTools/man/COPYING for copying conditions. There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


 

Index

NAME
SYNOPSIS
AVAILABILITY
DESCRIPTION
IMPORTANT
MODE: appstart "subdir\executable"
MODE: appstart "label:\dir\executable"
OPTIONS
ENVIRONMENT
EXIT STATUS
FILES
EXAMPLES
SEE ALSO
NOTES
BUGS
AUTHOR
COPYRIGHT

This document was created by man2html using the manual pages.
Time: 16:31:41 GMT, September 14, 2024