You are here

Adding run-time options to an application launch

10 posts / 0 new
Last post
gahamt
Offline
Last seen: 13 years 5 months ago
Joined: 2008-12-12 11:12
Adding run-time options to an application launch

I have a mixture of applications packaged for PortableApps and applications which are portable but have not been packaged for the PortableApps platform. When installing the stand-alone applications I followed the instructions here about creating a folder below the PortableApps folder and installing all of the run-time files there.

This seems all to work, except for certain situations. I have one application that requires to be launched with parameters but I can see no way of enabling this with PortableApps. I tried installing an application shortcut (.lnk file) with the launch command and parameters in the Target and then the actual application folder below this but the PortableApps menu refresh ignores it.

It seems that the PortableApps Menu build looks only for .exe files, which is a problem with another application as it has several .exe files all in the same directory and the menu build inserts menu items for all of them, even though I am interested in only the main executable. Once again, a shortcut launch fails to resolve the problem.

Does anyone have any ideas how to do this, other than drop PortableApps and use SmithTech Portable Menu instead?

solanus
solanus's picture
Offline
Last seen: 10 years 2 months ago
Joined: 2006-01-21 19:12
Can you use a batch file?

It is possible, by tweaking the appinfo.ini file, to launch using a batch file.
If you give details on the parameters and app you are having problems with, I might be able to help.

I made this half-pony, half-monkey monster to please you.

gahamt
Offline
Last seen: 13 years 5 months ago
Joined: 2008-12-12 11:12
Run-time parameters

Thanks for suggestion but the application in question isn't one packaged for PortableApps and so doesn't have an AppInfo folder or appinfo.ini file. However, see below, John is working on including the ability to specify run-time parameters so it looks like a solution is on the horizon.

solanus
solanus's picture
Offline
Last seen: 10 years 2 months ago
Joined: 2006-01-21 19:12
Doesn't matter, you can fake it!

I've made my own folders and appinfo.ini to open batch files that have nothing to do with official PA apps, and also to create shortcuts to folders:
https://portableapps.com/node/20498

So if, for example, your app is called "Franistat" and you have it here:

X:\PortableApps\Franistat\franistat.exe

You can add the following:

X:
|-\PortableApps\
     |-\Franistat\
         |-\App\
             |-\AppInfo\
                 |-appinfo.ini
                 |-appicon.ico

You can make your own appicon.ico, or copy the one from the app and rename it.
Put your batch file (franistat.bat) in your Franistat folder next to the exe.

Put the following into your appinfo.ini:
[Format]
Type=PortableAppsFormat
Version=0.91

[Details]
Name=Franistat

[Control]
Icons=1
Start=franistat.bat

That will make a PA Menu shortcut to franistat.bat.

I made this half-pony, half-monkey monster to please you.

gahamt
Offline
Last seen: 13 years 5 months ago
Joined: 2008-12-12 11:12
Run-time parameters resolved

Many thanks for your help. I've now got this to work.

I downloaded and installed IconsExtract to extract the icon from the .exe file and saved it into the AppInfo folder.

For the .bat file I had to use the Start command to launch the .exe as otherwise the .bat file stays open even after the application has been launched. So, the .bat command looks like this:

Start .\application.exe parameter .\parameterfile

It's a bit clunky as the command window flashes on the screen as the application is launched but otherwise everything works perfectly.

For you information, the actual application I wanted to add to the PortableApps menu is Bitmeter2. The actual command looks like this:

Start .\BitMeter2.exe -D .\Profile

Bitmeter2 was modified when Windows Vista was introduced so as to store its application data in the AppData folder of Documents and Settings. This stopped it being naturally portable, which it was before this change. The run-time parameter reverses this change so as to save the application data into a folder of the user's choosing, so restoring portability.

gahamt
Offline
Last seen: 13 years 5 months ago
Joined: 2008-12-12 11:12
Adding parameters to the Start= line in Control of AppInfo

Just wondering if there's been any progress on this? I have compiled a batch command file as a .exe with Bat2Exe and set it up in the AppInfo file as:
.
.
.
[Control]
Start=batchfile.exe
.
.
.
I would like to be able to issue something like:

Start=batchfile.exe parm1 parm2

I understand that this isn't currently possible. When will it be, or something that enables the functionality?

John T. Haller
John T. Haller's picture
Offline
Last seen: 2 hours 48 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Not in PAF

It is not possible in PAf itself nor will it be. If something being packaged as portable requires parameters, you should use the PortableApps.com Launcher to launch it.

Sometimes, the impossible can become possible, if you're awesome!

John T. Haller
John T. Haller's picture
Offline
Last seen: 2 hours 48 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Hide

You can hide easily in the current beta here:
https://portableapps.com/node/20013

Command line arguments will be coming.

Sometimes, the impossible can become possible, if you're awesome!

gahamt
Offline
Last seen: 13 years 5 months ago
Joined: 2008-12-12 11:12
Run-time parameters

John, just downloaded and installed the latest Beta. Can confirm that the Hide for unrequired menu items works perfectly. Really looking forward to the ability to be able to specify run-time parameters. Hope you will be able to make that available not just for applications packaged for PortableApps but also those that can be installed simply by installing the application directory below the PortableApps one.

dragonmage
Offline
Last seen: 1 year 11 months ago
Joined: 2007-01-15 02:25
Parameters changeable from menu?

Not sure how you are planning to implement this John, but I think it would be nice to have a context menu item to open a window to enter parms in. The menu would keep the parms you enter and use them when you launch, that way if you ever need to alter the parms it's just a couple clicks away.

Log in or register to post comments