2

I have a Java Swing application (EXE file created using Launch4J) with a feature to click a Browse button to select some font files, copy them inside the program's fonts folder found in the "C:\Program Files (x86)" folder if i am using Windows 7. When doing this for one of my customers the files failed to be copied, nothing happened, and to debug this i tried to copy those files manually to his fonts folder, but i have got this warning:

enter image description here

So now it's clear that making any modifications to the C-Drive requires Administrator privileges. How can i run my EXE Java program with such Admin privileges or at least show a similar warning for the user like this one above to gain privileges?

Brad
  • 4,457
  • 10
  • 56
  • 93
  • Applications cannot elevate during runtime afaik. You'll need to launch a new process requesting admin rights. – CollinD May 10 '17 at 04:25
  • @CollinD ... That's really helpful. If i have 2 Jars in my program, a small Jar that runs the main Jar program, i think i can request in the small Jar to launch the main Jar process with admin rights, right? – Brad May 10 '17 at 07:03
  • 1
    If anybody has faced the same situation i was able to fix this with the help of this question: http://stackoverflow.com/questions/23083363/java-executing-exe-with-admin-rights – Brad May 14 '17 at 15:29

0 Answers0