Wish Request B4J to package a standalone UI apps with administrator permissions

byz

Active Member
Licensed User
package a standalone UI apps with administrator permissions.
I've tested it successfully in the command line.
You only need to add the contents of admin.manifest, and then add /win32manifest:admin.manifest to the parameter when calling the command line in the BuildRunner function in B4JPackager11.
1735466112425.png

1735465392692.png


1735465906921.png

admin.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="requireAdministrator" uiAccess="false" />
      </requestedPrivileges>
    </security>
  </trustInfo>
</assembly>
TestBuldEXE.bat:
@echo off
C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe ^
    /target:winexe ^
    /win32icon:icon.ico ^
    /win32manifest:admin.manifest ^
    /out:build\MyApplication.exe ^
    runner.cs

echo okk!
pause

Above is my test code. I've packed it into a zip package for easy testing.Hopefully, the next release will provide a custom admin privilege attribute in the IDE.
 

Attachments

  • TestBuldEXE.zip
    613 bytes · Views: 10
Last edited:
Top