Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Javaw: command line parser routine returns full path of a jar file #4770

Closed
nvaccessAuto opened this issue Jan 3, 2015 · 6 comments
Closed
Labels

Comments

@nvaccessAuto
Copy link

Reported by nvdakor on 2015-01-03 03:42
Hi,
Spin off from #4360:
If you run a jar file (jara archive), Javaw app module's command line parsing routine records the full path fo the jar file, not the file name itself.
STR:

  1. Install a program packaged in a jar file (a good example is Braille Blaster).
  2. Once Braille Blaster starts, press NVDA+F1 to bring up dev info for the object. Look for app module property.
    Expected: the actual jar file name should be recorded.
    Actual: full path is recorded.
    Example via Braille Blaster:
Expected: appModule: <brailleblaster(appName 'javaw_brailleblaster', process ID 6332) at address 4dcb670>
Actual: appModule: <'appModuleHandler' (appName 'javaw_C:\\Program Files (x86)\\brailleblaster\\brailleblaster', process ID 6332) at address 4dcb670>

Problem implications:

  • Java apps can be run on both 32-bit and 64-bit systems, and environment variables specify different program paths for 32-bit versus 64-bit Windows.
  • One should not rely on absolute paths - system drive letter can change, program might be installed into different folder(s), etc.
    One way to perhaps fix this is to:
  • See if we're dealing with a jar file (current routine provides this capability).
  • If command line has backslashes, split the command line and take the last part of the executable path (perhaps using split or via os.path).
    For reference, this does not affect wwahost work (Load specific app modules for apps hosted by wwahost.exe #4569), as there is a way to query name of the loaded wwa file without resorting to command line parsing (there is a way to parse the actual wwa file name via command line).
    Thanks.
@nvaccessAuto
Copy link
Author

Comment 1 by jteh on 2015-01-06 07:56
Arrrg. Thanks for catching.

There should be an os.path.basename around the os.path.splitext:

return os.path.basename(os.path.splitext(next(cmd)))[0]

Do you feel like volunteering to fix and test? :)

@nvaccessAuto
Copy link
Author

Comment 2 by nvdakor on 2015-01-06 08:09
Hi,
I'll try.

@nvaccessAuto
Copy link
Author

Comment 3 by Joseph Lee <joseph.lee22590@... on 2015-01-06 08:16
In [b631ead]:

Javaw: Get the actual name of a java archive rather than the full path for the jar file. re #4770

@LeonarddeR
Copy link
Collaborator

@josephsl: Given #4770 (comment), could we safely assume that this has been fixed?

@josephsl
Copy link
Collaborator

josephsl commented Feb 14, 2018 via email

@ehollig
Copy link
Collaborator

ehollig commented Feb 18, 2018

Closing from #4770 (comment) and #4770 (comment)

@ehollig ehollig closed this as completed Feb 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants