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.
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.
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.
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
Last edited: