I have developed some classes to auto-update my program. The main program (program.jar) will check for updates, then download the new files, and prepare the list of what should be replaced, created or deleted.
I have another jar (updater.jar) that will take care of replacing the files. The issue is that the program is installed into Program Files
and thus this second jar needs to have administration rights in order to move the files.
I don't want my main program to need administration rights. I just need to ask the administrator permission before copying the files.
I made an .exe wrapper (updater.exe) with a manifest to request for administration rights. But when I call it with ProcessBuilder(jarFolder+"Updater.exe")
, I get something like "need elevated privileges"...
I guess that it is not the good approach. What should I do ?
This is the manifest :
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="highestAvailable" uiAccess="False" />
</requestedPrivileges>
</security>
</trustInfo>
</assembly>