1

This is for Window 7 and Window 10

We have requirement to generate jar inside c:program file only. Installer can easily install our jar into c:\\ProgramFile\\testapp. After that we have the requirement to download the zip file from third party server inside c:\\ProgramFile\\testappp and here we are getting the access denied.

After lot of research, we come to know, we can run our jar under administrator privileges using super-user-application-0.0.5.jar.

Now the problem is We are getting the "User account control popup" with message "Do you want to allow the following program to make changes to this computer"

We don't want this popup so anyone know how to bypass this popup?

The important code from super-user-application-0.0.5.jar is

Shell32X.SHELLEXECUTEINFO execInfo = new Shell32X.SHELLEXECUTEINFO()
execInfo.lpParameters = args
execInfo.lpDirectory = lpDirectory
execInfo.fMask = Shell32X.SEE_MASK_NOCLOSEPROCESS
execInfo.lpVerb = "runas"
boolean result = Shell32X.INSTANCE.ShellExecuteEx(execInfo)

execInfo.lpVerb = "runas" is actually opening the popup. Is there any way, just bypass the popup and further processing should be similar to the saying OK to the popup.

Any chance to java programatically provide admin rights to the testapp folder created inside c:\ProgramFile\testapp

Laur Ivan
  • 4,117
  • 3
  • 38
  • 62
  • Just disable the UAC....check this wiorkaround http://stackoverflow.com/questions/682182/disabling-uac-programmatically – Hackerman Jan 04 '17 at 14:23
  • Any reason you are not using Java WebStart for this? – Thorbjørn Ravn Andersen Jan 04 '17 at 14:38
  • @ThorbjørnRavnAndersen There was a time, not too long ago, when I would agree that Web Start is the best way to install Java applications. However, it now requires a code signing certificate (or users willing and able to add exceptions in their Java control panel), even for sandboxed applications. Ideally, companies should just get such a certificate, but it’s not a trivial process. – VGR Jan 04 '17 at 14:54
  • @VGR I did not know that this had tightened so much. For sandbox applications this should not be needed, but I think that Oracle has been so burnt by security issues that such measures have been found necessary. – Thorbjørn Ravn Andersen Jan 04 '17 at 15:11
  • @ThorbjørnRavnAndersen I think you’re exactly right. But it’s still frustrating. – VGR Jan 04 '17 at 17:11

0 Answers0