Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

HI All

 

:confused: I have got myself quite confused about manifest files and how to use and insert them into my VB.NET application. I have read lots about them but some of the information on the web is quite old.

 

I want to do the right thing and send out a manifest file if thats what is required. I have tested my VB.NET programs on the Vista OS and without using a manifest file when I click on one of my programs that do require admin rights the UAC does appear as is should. My other program that does not require admin rights works with no prompt. Does this mean that a manifest file is been used somewhere in my application that I do not know about or has the code first been checked before loading and it has found that admin rights would be required?

 

Could somebody please also give me some links to using manifests in my VB.NET application that are simple to understand or even step by step instructions.

 

VS2005 SP1

VB.NET Programming

Windows XP SP2

 

Regards

-Paul

  • Administrators
Posted (edited)

http://msdn2.microsoft.com/en-us/security/aa480150.aspx gives a broad outline of what you need to do.

 

Taken from that link is a sample minfest


 
      processorArchitecture="X86"
    name="IsUserAdmin"
    type="win32"/> 

 Description of your application 
 
 
   
     
                 level="requireAdministrator"
         uiAccess="false"/>
       
      
 

this should get you started on generating your own manifest. As an example for an executable called WindowsApplication1.exe you would create a file called WindowsApplication1.exe.manifest that would contain


 
      processorArchitecture="X86"
    name="WindowsApplication1"
    type="win32"/> 

 Description of your application 
 
 
   
     
                 level="requireAdministrator"
         uiAccess="false"/>
       
      
 

 

After building your application if the .exe and the .exe.manifest are in the same folder run the following command

mt -nologo -manifest windowsApplication1.exe.manifest -outputresource:WindowsApplication1.exe;1

If you are building a dll rather than an exe replace the 1 at the end with a 2. Try running the app and you should get the prompt to elevate to admin, also in explorer you should see the icon overlay as well.

Edited by PlausiblyDamp

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...