You are here

How do I start portable apps, in the portableapps environment, from the command line?

6 posts / 0 new
Last post
Jason404
Jason404's picture
Offline
Last seen: 4 months 4 days ago
Joined: 2009-03-08 04:13
How do I start portable apps, in the portableapps environment, from the command line?

BACKGROUND:
I started using PortableApps around 2006/2007, when I got my first USB flash drive, but I never got around to using them much, as I don't really carry a flash drive around with me. Instead, I have my own ultracompact ThinkPad wherever I go.

But I have recently rediscovered PortableApps and realised that they work very well with my system of syncing my 'command' directory on all my machines. This contains all my scripts and command line programs, Cygwin, and now also having a lot of portable applications in there is proving very useful indeed.

QUESTION:
I want to know how I can start the PortableApps from CMD and/or PowerShell, just as thought they were started using the PA menu, using the same environment.

With this knowledge , I can go on to make a script which also adds shortcuts to the Start Menu of all my own computers (and virtual ones), so that I can easily start them from there, and without having to make duplicate local installations.

I'd really appreciate any advice from people who understand how the PA packaging system works.

Thanks.

Chris Morgan
Chris Morgan's picture
Offline
Last seen: 9 years 6 months ago
Joined: 2007-04-15 21:08
Can't entirely

You can start the Platform with StartPortableApps.exe, but that's not what you're asking. For the individual apps, PortableApps\AppNamePortable\AppNamePortable.exe is what you need to launch. However, this doesn't replicate the environment set up by the Platform; the Platform adds some environment variables; currently, just language ones, but in the 2.0 release it will also do a bit more, involving clearing TEMP and setting environment variables for Documents, Pictures, etc.

Provided you're using English, you can just run the app launcher.

I am a Christian and a developer and moderator here.

“A soft answer turns away wrath, but a harsh word stirs up anger.” – Proverbs 15:1

Jason404
Jason404's picture
Offline
Last seen: 4 months 4 days ago
Joined: 2009-03-08 04:13
It doesn't seem to be as simple as that

I wish you were right, but this is not what I have found to be the case. If it was just a matter of setting a few variables to get the same environment, that would be easily done with scripts.

When I SET from Console in PortableApps, I get a whole load of new environmental variables, shown here: http://pastebin.com/9su0Zk7X

None of those are shown when Comsole is from a local installation.

Also, when I run program directly from PortableApps launcher, the program's .xml and .ini files move around in the directory structure. The is easily seen by using `tree /f` from CMD.

And when I try running Notepad++ directly from the .exe (and Notepad has a lot of files that move about), it takes a long time to start, and once it does, it is using the default settings, with all my settings having been wiped out.

It seems that is a bad idea to run the .exe files directly, but I would like to know a way of launching the programs from the command line, which simulates them having been launched by the PortableApps launcher.

I suppose I could do it using AutoIT scripts, but I would rather find a neater solution.

Chris Morgan
Chris Morgan's picture
Offline
Last seen: 9 years 6 months ago
Joined: 2007-04-15 21:08
Launcher

Make sure you're running the launcher executable - ConsolePortable.exe, Notepad++Portable.exe, etc. Do not run App\Notepad++\Notepad++.exe (or whatever it is), as that is not portable.

I am a Christian and a developer and moderator here.

“A soft answer turns away wrath, but a harsh word stirs up anger.” – Proverbs 15:1

Jason404
Jason404's picture
Offline
Last seen: 4 months 4 days ago
Joined: 2009-03-08 04:13
Thanks

Thanks, and excuse me for not reading your previous reply closely enough.

Have you got a list of the environmental variables that are set, so I could add it to my startup scripts that the Start Menu shortcuts would be pointing to?

Are the new environmental variables set by the new v2.0 launcher known yet, as well?

Also, why do the settings files for apps move around like that when they are run?

Chris Morgan
Chris Morgan's picture
Offline
Last seen: 9 years 6 months ago
Joined: 2007-04-15 21:08
Don't worry

The Launcher will set all environment variables needed. The only case where you may want to set another variable is if you want to use it not in English and the app doesn't preserve its language.

Various apps need to move settings from Data to App or somewhere on the local machine while running because there's no mechanism in the base app to specify where it should get its settings from. Often there will be a command line argument or an environment variable which can be set to change the data/settings path, but not always.

I am a Christian and a developer and moderator here.

“A soft answer turns away wrath, but a harsh word stirs up anger.” – Proverbs 15:1

Log in or register to post comments