Skip to content

AccessDeniedException #6

@adakitesystems

Description

@adakitesystems
  • Check read/write access to the StarCraft directory and warn user if DropLauncher requires elevated privileges

DropLauncher copies and modifies BWAPI-related files in the StarCraft directory. So, if StarCraft is installed to C:\Program Files\StarCraft or any write-protected directory, the user will see the following AccessDeniedException error message when attempting to start a bot:

java.nio.file.AccessDeniedException: C:\Program Files\StarCraft\bwapi-data
	at sun.nio.fs.WindowsException.translateToIOException(Unknown Source)
	at sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
	at sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
	at sun.nio.fs.WindowsFileSystemProvider.createDirectory(Unknown Source)
	at java.nio.file.Files.createDirectory(Unknown Source)
	at java.nio.file.Files.createAndCheckIsDirectory(Unknown Source)
	at java.nio.file.Files.createDirectories(Unknown Source)
	at adakite.util.AdakiteUtils.createDirectory(AdakiteUtils.java:261)
	at droplauncher.bwheadless.BWHeadless.configureBwapi(BWHeadless.java:473)
	at droplauncher.bwheadless.BWHeadless.start(BWHeadless.java:358)
	at droplauncher.mvc.controller.Controller.startBWHeadless(Controller.java:138)
	at droplauncher.mvc.controller.Controller.lambda$btnStartClicked$14(Controller.java:488)
	at java.lang.Thread.run(Unknown Source)

A temporary workaround for this is to start DropLauncher with administrative privileges. However, running DropLauncher with administrative privileges disables the drag-and-drop feature because a user with user privileges will be attempting to drop files into a program running with administrative privileges. I would like to come up with a more elegant solution.

Metadata

Metadata

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions