I want my program to simply request elevation privileges when it launches, and to do this I'm adding a Manifest file to the Delphi source code as a resource. This is the XML files content:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity version="1.1.1.1"
processorArchitecture="X86"
name="YourApplicationExeName"
type="win32"/>
<description>elevate execution level</description>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="requireAdministrator" uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>
I need to modify the file where it says "YourApplicationExeName" and add the current .exe name as the user can rename the .exe file anytime.
What I want to know is: when a user opens the executable file, how do I add the new filename of the executable to the manifest file stored as a resource? I know how to get the new filename, I just want to know how do I update the resource file with the new filename?