You are here

Figuring out CommandLineArguments for shortcuts.

3 posts / 0 new
Last post
wolfshaven
Offline
Last seen: 9 years 3 weeks ago
Joined: 2006-07-20 21:03
Figuring out CommandLineArguments for shortcuts.

I've spent the last three days going through documentation, official apps, and forum threads... A search of “command line arguments” brings up 13 pages alone, “CommandLineArguments” is 7 only pages but most of that can be found in the first search.

solanus' Folderz and QuickStart examples are great starters, however they don't cover CommandLineArguments. That said I haven't found enough information to help me figure out what I'm doing wrong. Anyway this is my latest failed attempt..


[Format]
Type=PortableAppsFormat
Version=3.0

[Details]
Name=OBS
Description=Open Broadcaster Software

[Control]
Icons=1
Start=..\..\OBS\OBS.exe

[Launch]
ProgramExecutable=%PAL:Drive%\OBS\OBS.exe
CommandLineArguments='-multi -portable -profile%"Profile%Name" -scenecollection%"Scene%Name"'
WaitForProgram=false
DirectoryMoveOK=yes
SupportsUNC=yes

I can't figure out where I'm messing it up. I've tried with and without variables, with and without the placeholders for white-space, and in various places. I've tried placing the OBS folder in the Portable Apps folder, in the root directory, and in my “OtherApps” folder that I usually use for portable apps that aren't either official PortableApps.com apps or at least wrapped in PAF installer.

I can get OBS to run from the menu without the command line arguments just fine, although that does not put it in portable mode, so it leaves bits in the registry and possibly other places. I can also link to a batch file and it works just fine but I'd rather do it the right way.

The the command prompt to run the program is...
x:\OBS\OBS.exe -multi -portable -profile "Profile Name" -scenecollection "Scene Name"

I don't believe that the -profile and -scenecollection options are calls to directories since they work “as is” in the CLI, without entering directory name and file extention. None the less, the full paths would be x:\OBS\profiles\Profile Name.ini and x:\OBS\scenecollection\Scene Name.ini

As a side note, even though I added a Description line in the Details section, when I hover over the app in the Menu it displays... “x:\PortableApps\OBSPortable\..\..\OBS\OBS.exe”, rather then the description. I don't know if that's due to my mistakes, by design for non-PAF links, or a bug in the menu but I thought I should mention it in case.

Thanks in advance for any help.

I believe that this will not only solve my problems, but it will provide a "real world" example for anyone that needs to use CommandLineArguments in their own personal shortcuts and those needing to add other non-PAF apps in other directories, to the menu.

John T. Haller
John T. Haller's picture
Online
Last seen: 30 min 2 sec ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
App Itself

First, that's only for variables for the app itself to use to point it to its data or run in portable mode. You're not supposed to be passing in its normal command line. The launcher will pass that through (example: Feeding a document on the command line to LibreOfficePortable.exe is passed right through to soffice.exe without being altered).

Second, your variables are all typed wrong. They should be "%scene%" if in quotes, not %"scene%".

Third, those variables don't mean anything unless they are defined as environment variables. Unless you defined them in custom code and compiled that into your launcher, they're all meaningless. You'd want something like -profile "%PAL:DataDir%"

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

wolfshaven
Offline
Last seen: 9 years 3 weeks ago
Joined: 2006-07-20 21:03
Thanks for the quick reply.

The app is Open Broadcaster a free, open source software for live streaming and recording https://obsproject.com/.

There is a very old request on this site asking to make it an official PAF app with only a couple of plus ones added to it. Apparently there isn't enough interest for that and since I'm so far off in this little bit of code, I'm not even close to qualified to try and package it myself. Not that I was looking for it to be packaged anyway.

All I was trying to do is make what would be a simple Windows shortcut run from the PAM. In a perfect world I would just be able to use Start=..\..\OBS\OBS.exe -multi -portable -profile "Profile Name" -scenecollection "Scene Name" or even just Start=..\..\OBS\OBS.exe -multi -portable to save me from having to run the app from the CLI or changing Windows shortcuts every time I plug into a different machine or USB port.

Heck, in a perfect world all programs would be portable and Microsoft would have native support for relative paths. Yeah I know, keep dreaming. Smile

I love your program and respect all the hard work you have put into it but the one thing it's lacking and has been requested by many, for years, is a simple way for the end users add shortcuts for "application -option -option "argument" -option argument". That way non programmer types could use the menu for non-supported apps or even run supported apps with different sets of native supported options easily.

I'm sure it not that easy from your perspective. I have enough experience with coding know that its rarely as simple as it seems from the end user perspective. I know enough HTML to tweak Word Press or a simple forum software to look different. I even use to know some Basic back in the 80's before they went and changed it all. I'm also sure what I'm looking to accomplish is simple from your perspective, but when I look at this stuff my brain just melts.

Thanks again for taking a look and the fast reply. At least I know I'm way off. I'll putz around with it some more and if I cant figure it out Ill just go back to editing Windows shortcuts.

Log in or register to post comments