PDA

View Full Version : Is this expected behavior for command line arguments



NewsArchive
10-15-2018, 04:58 AM
Take a look at the attached screen captures. Is this expected behavior
for install command line arguments?

/ConfigDir=c:\yada1\yada2\yada3 FAILS

/ConfigDir="c:\yada1\yada2\yada3" WORKS


--
Lee White

RPM Report Viewer.: http://www.cwaddons.com/products/rpm/
Report Faxing.....: http://www.cwaddons.com/products/afe/
---Enroll Today---: http://CWaddons.com

Creative Reporting: http://www.CreativeReporting.com

Product Release & Update Notices
http://twitter.com/DeveloperPLUS

NewsArchive
10-15-2018, 04:58 AM
Hi Lee,

> Take a look at the attached screen captures. Is this expected behavior
> for install command line arguments?
>
> /ConfigDir=c:\yada1\yada2\yada3 FAILS
>
> /ConfigDir="c:\yada1\yada2\yada3" WORKS

Good question. The installer uses the standard Microsoft VC++ GetArgC and
GetArgV functions to process the command line. [there seems to be a
difference between parameter parsing "prior to 2008" and "post 2008"
libraries]. As far as I can see, you have to put double-quotes around the
"values". A string surrounded by double quotation marks ("string") is
interpreted as a single argument, regardless of white space contained
within.

I'll re-check this tomorrow.

Friedrich

NewsArchive
10-15-2018, 04:58 AM
Friedrich,

> I'll re-check this tomorrow.

The reason I asked is that /ConfigDir=C:\yada\yada works for a
shortcut running Clarion and could be what a developer passes in the
command line of a 3rd party install. I don't use quotes in my
shortcuts for Clarion so mine would fail.

And I fully agree that values with spaces do require quotes.

I can add script to parse the results for the lack of " but wanted to
run it by you first.

Lee White

NewsArchive
10-16-2018, 04:28 AM
Hi Lee,

> The reason I asked is that /ConfigDir=C:\yada\yada works for a
> shortcut running Clarion and could be what a developer passes
> in the command line of a 3rd party install. I don't use quotes
> in my shortcuts for Clarion so mine would fail.
>
> And I fully agree that values with spaces do require quotes.
>
> I can add script to parse the results for the lack of " but
> wanted to run it by you first.

Still looking for a solution (e.g. replace the standard parameter parsing
with my own code).

Friedrich

NewsArchive
10-16-2018, 04:29 AM
Friedrich,

> > I can add script to parse the results for the lack of " but
> > wanted to run it by you first.
>
> Still looking for a solution (e.g. replace the standard parameter parsing
> with my own code).

It might be easier, and safer<g>, to simply look for the ". Such as
testing for /ConfigDir=" in the command line using script instead of
changing your runtime which is working.

What say you?<g>

--
Lee White

RPM Report Viewer.: http://www.cwaddons.com/products/rpm/
Report Faxing.....: http://www.cwaddons.com/products/afe/
---Enroll Today---: http://CWaddons.com

Creative Reporting: http://www.CreativeReporting.com

Product Release & Update Notices
http://twitter.com/DeveloperPLUS

NewsArchive
10-16-2018, 04:29 AM
Hi Lee,

> It might be easier, and safer<g>, to simply look for the ". Such as
> testing for /ConfigDir=" in the command line using script instead of
> changing your runtime which is working.
>
> What say you?<g>

If that works for you, then yes do it <bg>

But I still think that you have a valid point here.

Friedrich

NewsArchive
10-16-2018, 04:30 AM
Friedrich,

> > It might be easier, and safer<g>, to simply look for the ". Such as
> > testing for /ConfigDir=" in the command line using script instead of
> > changing your runtime which is working.
>
> If that works for you, then yes do it <bg>

It does, and I will!<g>

> But I still think that you have a valid point here.

You have other things to clutter your mind with and, honestly, I doubt
any Clarion developer goes to the trouble of running a 3rd party
install with command line arguments... it's complicated!<g>

I still believe ConfigDir should be a Clarion install option handled
during the install process and written to the registry. That would
make things SO MUCH EASIER and is easily doable. Or, since the install
no longer defaults to "Program Files", just write the dang thing into
the \bin\settings folder and be done with it. If the developer
installs into "Program Files" they'll need admin rights to run the
program so they'll already have write permissions to that folder, or
have I not had enough coffee yet?!<g>

--
Lee White

RPM Report Viewer.: http://www.cwaddons.com/products/rpm/
Report Faxing.....: http://www.cwaddons.com/products/afe/
---Enroll Today---: http://CWaddons.com

Creative Reporting: http://www.CreativeReporting.com

Product Release & Update Notices
http://twitter.com/DeveloperPLUS