PDK: how can I integrate the manifest assembly workaround for Vista UAC?
Hi,
Summarised. I need to workaround Vista's UAC on a perlapp executable.
On a win32 c++ compiled executable, I can "workaround" Vista UAC by inheriting the current user security context through applying with mt.exe the following manifest settings.
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges><requestedExecutionLevel level="asInvoker" uiA
+ccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
More info about this at
"How to embed a manifest in an assembly: let me count the ways...
Windows Vista - Demand UAC elevation for an application by adding a manifest using mt.exe
pdk RE: Win32::Msg
This works fine for the c++compiled executables thus far encountered. When applying this with mt.exe to a perlapp created exe this does not work unfortunately. When binding this file in pdk 6|7 and running it again, no solution either. Hmm. Interesting challenge...
Finally I ended up opening the exe file in a hex editor.
Herein I found the following manifest information.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion=
+"1.0">
<assemblyIdentity version="0.0.0.0" processorArchitecture="X86" nam
+e="Perl" type="win32" />
<description>Perl</description>
<dependency><dependentAssembly>
<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Contr
+ols" version="6.0.0.0"
processorArchitecture="X86" publicKeyToken="6595b64144ccf1df" langu
+age="*" />
</dependentAssembly></dependency>
</assembly>
Aha a manifest xml section. So let's insert the required data as shown below.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion=
+"1.0">
<assemblyIdentity version="0.0.0.0" processorArchitecture="X86" nam
+e="Perl" type="win32" />
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="asInvoker"/>
</requestedPrivileges>
</security>
</trustInfo>
<description>Perl</description>
<dependency><dependentAssembly>
<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Contr
+ols" version="6.0.0.0"
processorArchitecture="X86" publicKeyToken="6595b64144ccf1df" langu
+age="*" />
</dependentAssembly></dependency>
</assembly>
This returns:
'The application has failed to start because its side-by-side configuration is incorrect. Activation context generation failed for "executable". Error in manifest or policy file "executable" on lineXX. Invalid XML Syntax.'
The XML syntax is fine however.
The only delta I could notice is that my proven samples refer to assemblyIdentity version="1.0.0.0" and pdk to assemblyIdentity version="0.0.0.0".
So the assemblyIdentity version="0.0.0.0" changed to assemblyIdentity version="1.0.0.0" as shown below.
<assemblyIdentity version="1.0.0.0" processorArchitecture="X86" na
+me="Perl" type="win32" />
This returns:
'This program cannot be run in DOS mode.'
Aha no XML syntax errors.
So the issue seems to reside in the assembly version.
Here I'm facing a wall.
Anyone having a clue for this kind of assembly configuration issues?
How can I workaround or what is the reason for the no run in DOS mode?
Many thanks in advance.
With kind regards.
ddn123456