Problem launching application when path contains blanks (Windows)

58 views
Skip to first unread message

Elvis Dominguez

unread,
May 31, 2019, 12:59:20 PM5/31/19
to OOO Libs
Hi,

we created an MSI that installs our application in C:\Program Files\MyApp.

Our getdown.txt is as follows:
# The URL from which the client is downloaded

# Java local dir
java_local_dir = jre

# Application jar files
code = startup.jar
uresource = plugins.jar

# The main entry point for the application
class = manifest

After downloading the application, GetDown tries to launch our app using the following command:
C:\Program Files\MyApp\jre\bin\javaw.exe -jar C:\Program Files\MyApp\startup.jar

Windows raises an error like No main class found, because the -jar parameter takes only the C:\Program as argument and passes the Files\MyApp\startup.jar as application argument.

Is there any way to tell GetDown to escape the space character in the Path?
Is possible to tell GetDown to use relative paths instead absolute?

The desktop shortcut has, as target directory, the C:\Program Files\MyApp set, so relative paths should be ok.

Thank you for some tip...
Kindly elvisd

Michael Bayne

unread,
May 31, 2019, 1:07:51 PM5/31/19
to ooo-...@googlegroups.com
Getdown launches the app using Runtime.exec, specifically the version that takes individual command line arguments separately, with the expectation that it is not necessary to escape them. The command line arguments should never be combined back into a single string and then reparsed by a shell, so I don't understand why this issue would be happening. That said, there was another bug report recently that seemed to indicate that a similar issue was happening.

As far as I know, it is not possible to further escape spaces in the arguments passed to Runtime.exec when the separate argument version is used, and indeed in the other bug report the argument with a space was already enclosed in quotes, but that didn't help.

Maybe this is some recent change to Windows or some breaking change to Java on Windows, but both of those explanations seem extremely unlikely given that such a change would cause widespread problems for hundreds or thousands of existing programs.

So maybe something else is going on. I don't have a Windows machine handy to test things on at the moment, so if anyone else can investigate what might be going on, I would greatly appreciate it. Otherwise I'll try to set up some environment in which I can reproduce this issue. It doesn't happen on macOS or Linux as far as I know.


--
You received this message because you are subscribed to the Google Groups "OOO Libs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ooo-libs+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ooo-libs/564b067f-228b-4894-8555-8c0ca883a9f3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--

Elvis Dominguez

unread,
Jun 3, 2019, 5:53:09 AM6/3/19
to OOO Libs
Hi Micheal,

thank you for your answer.
I'd like to do some tests on getdown about this problem.

I've cloned the git repository but when running maven deploy I have the following error, caused by nexus missing auth.
[INFO] Reactor Summary for getdown 1.8.6-SNAPSHOT:
[INFO] 
[INFO] getdown ............................................ FAILURE [  2.185 s]
[INFO] Getdown Core ....................................... SKIPPED
[INFO] Getdown Launcher ................................... SKIPPED
[INFO] Getdown Ant Task ................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  3.924 s
[INFO] Finished at: 2019-06-03T11:46:57+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.sonatype.plugins:nexus-staging-maven-plugin:1.6.8:deploy (injected-nexus-deploy) on project getdown: Failed to deploy artifacts: Could not transfer artifact com.threerings.getdown:getdown:pom:1.8.6-20190603.094656-1 from/to sonatype-nexus-snapshots (https://oss.sonatype.org/content/repositories/snapshots/): Failed to transfer file https://oss.sonatype.org/content/repositories/snapshots/com/threerings/getdown/getdown/1.8.6-SNAPSHOT/getdown-1.8.6-20190603.094656-1.pom with status code 401 -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:


Is it possible to build ignoring the nexus upload part?
To unsubscribe from this group and stop receiving emails from it, send an email to ooo-...@googlegroups.com.

Michael Bayne

unread,
Jun 5, 2019, 8:35:54 PM6/5/19
to ooo-...@googlegroups.com
It's not necessary to run 'mvn deploy'. That attempts to upload the build to the Maven staging servers, which you do not have the credentials for. Just run 'mvn test' to run the tests, or 'mvn install' if you want to install your local build into your local Maven repository.

To unsubscribe from this group and stop receiving emails from it, send an email to ooo-libs+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ooo-libs/4b551034-6a4c-4f06-aa92-31260f8ab1fb%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


--
Reply all
Reply to author
Forward
0 new messages