Dear monks,
I have a perl standalone executable (myscript.exe) which I have generated via the pp option of PAR::Packer. This runs fine in Windows Vista (Home Premium) when I have logged in as Administrator.
Because, of course, I can not rely on a user running my app as an administrator, I want to ensure that right after the user double clicks my exe, the latter will ask for elevated administrator privileges and Window's UAC will handle it from that point on (hopefully :-) ).
After googling, I found the following posts that present some solutions:
http://blogs.msdn.com/cheller/archive/2006/08/24/718757.aspx
Re: (OT) Windows Vista UAC
but none of them worked for me.
To be more precise, I created the following manifest file, called myscript.exe.manifest and placed it in the same directory as myscript.exe:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.
+0">
<assemblyIdentity
name="myscript.exe"
processorArchitecture="X86"
version="1.0.0"
type="win32"/>
<description>My Vista compatible application</description>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel
level="requireAdministrator"
uiAccess="False"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>
I then tried running my executable, but an error occurred, 'The application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem'. I saw a similar issue being reported a year and a half ago in
How can I integrate within the PDK perlapp the manifest assembly workaround for Vista UAC?
but there did not seem to be a solution for it back then.
As a last resort, I followed the instructions here:
http://xenomorph.net/files-section/programming/embed-manifest-into-exe/
i.e. downloaded MSDN Software Developer kit (for mt.exe) and executed the command
mt.exe -manifest myscript.exe.manifest -outputresource:myscript.exe;#1
but no luck again (perhaps cos all these posts imply VB and not Perl ?). The command mt.exe seems to be executed without warnings or errors, however, the size of the exe is significantly reduced and when I run my exe, I get the same error message!
Hopefully, some of you have run into this issue and have some useful suggestions to offer :-)
Regards,
Athanasia
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.