Compile to run as administrator
Compile to run as administrator
Compile to run as administrator
Compile to run as administrator
Compile to run as administrator
Compile to run as administrator Compile to run as administrator Compile to run as administrator Compile to run as administrator Compile to run as administrator Compile to run as administrator Compile to run as administrator Compile to run as administrator
Compile to run as administrator Compile to run as administrator
Compile to run as administrator
Go Back  Xtreme Visual Basic Talk > > > Compile to run as administrator


Reply
 
Thread Tools Display Modes
  #1  
Old 12-10-2014, 07:54 AM
Mike Mike is offline
Contributor
 
Join Date: Apr 2001
Location: Montreal, Canada
Posts: 462
Default Compile to run as administrator


Very stupid question I'm sure but I'm drawing a blank: how do I compile a VB2008 application to automatically run as administrator. I have already set my manifest as follows:

Code:
<?xml version="1.0" encoding="utf-8"?>
<asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
    <security>
      <requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
      <requestedExecutionLevel level="requireAdministrator" uiAccess="false">
      </requestedPrivileges>
    </security>
  </trustInfo>
</asmv1:assembly>
However, when I compile the project, the application doesn't run as administrator and does not display the Windows blue/yellow checkered shield on the application icon.

What am I missing?

Thanks!
Reply With Quote
  #2  
Old 12-10-2014, 09:32 AM
PlausiblyDamp's Avatar
PlausiblyDampCompile to run as administrator PlausiblyDamp is offline
Ultimate Contributor

Forum Leader
* Expert *
 
Join Date: Nov 2003
Location: Newport, Wales
Posts: 2,058
Default

Are you sure the manifest is being embedded in your application correctly? One way to check is by using sigcheck.exe (http://technet.microsoft.com/en-us/s.../bb897441.aspx) if you run this with the -m switch it will show any manifests embedded.

If there isn't an embedded manifest then that is possibly the problem.
__________________
Intellectuals solve problems; geniuses prevent them.
-- Albert Einstein

Posting Guidelines Forum Rules Use the code tags
Reply With Quote
  #3  
Old 12-10-2014, 10:33 AM
Mike Mike is offline
Contributor
 
Join Date: Apr 2001
Location: Montreal, Canada
Posts: 462
Default

Bingo. I ran SigCheck and it says that no file was found with the -m switch. So, second stupid question is: I have a manifest in the project but how do I embed it in the compilation?
Reply With Quote
  #4  
Old 12-10-2014, 11:36 AM
PlausiblyDamp's Avatar
PlausiblyDampCompile to run as administrator PlausiblyDamp is offline
Ultimate Contributor

Forum Leader
* Expert *
 
Join Date: Nov 2003
Location: Newport, Wales
Posts: 2,058
Default

I know in more recent versions of VB.Net you can do this direct from the project's property pages, unfortunately after a bit of googling it would appear that 2008 is new enough to get this feature.

It looks like you will need to go through the steps outlines in http://blogs.msdn.com/b/shawnfa/arch...06/568563.aspx, or something similar anyway.
__________________
Intellectuals solve problems; geniuses prevent them.
-- Albert Einstein

Posting Guidelines Forum Rules Use the code tags
Reply With Quote
  #5  
Old 01-16-2015, 09:02 AM
xlZ3r0 xlZ3r0 is offline
Newcomer
 
Join Date: Jan 2015
Posts: 8
Default

Couldn't you select the Manifest file in your Solution Explorer, and then change it's "Build Action" (from the properties pane) to Embedded Resource?

Wouldn't this cause the file to automatically embed itself to the project on Compile?
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Compile to run as administrator
Compile to run as administrator
Compile to run as administrator Compile to run as administrator
Compile to run as administrator
Compile to run as administrator
Compile to run as administrator Compile to run as administrator Compile to run as administrator Compile to run as administrator Compile to run as administrator Compile to run as administrator Compile to run as administrator
Compile to run as administrator
Compile to run as administrator
 
Compile to run as administrator
Compile to run as administrator
 
-->