Page 1 of 2 12 LastLast
Results 1 to 5 of 10

Thread: How to set an executable property to 'Run as Administrator'?

  1. #1
    Join Date
    Nov 2006
    Posts
    81

    Question How to set an executable property to 'Run as Administrator'?

    I have an InstallScript MSI project.

    On Windows Server 2008, there is a check box in the executable properties dialog to run it as an administrator.

    Is there a way to do this from Install Script so that the user does not have to do this?

    Thanks!

  2. #2
    Join Date
    Jan 2002
    Location
    Windsor, CT 06095 USA
    Posts
    735
    I don't know of a way to do this in InstallShield. We create a manifest file and name it the same as the exe file we are trying to force Run as Admin on. For example for a file named APP.EXE the manifest would be named APP.EXE.MANIFEST. This file is placed in the same folder as the EXE and contains the following XML code that instructs Windows how to handle the file.

    Code:
    <?xml version="1.0" encoding="utf-8" ?>
    <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
    	<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
    		<security>
    			<requestedPrivileges>
    				<requestedExecutionLevel level="requireAdministrator" />
    			</requestedPrivileges>
    		</security>
    	</trustInfo>
    </assembly>
    Eric Siemiatkaska
    SS&C Technologies, Inc.

  3. #3
    Join Date
    Jan 2008
    Posts
    47

    Calling .dll File Function

    We can use the manifest file for exe, but how about if I want to call a function from dll? In Vista, it is required to run as administrator as the function need to access the registry.

  4. #4
    Join Date
    Jul 2003
    Location
    North Kingstown, RI, USA
    Posts
    948
    Is this a DLL that you compile in house? IF so why not have Visual Studio create and embed the manifest file for you? In VS2005 I just open the project, right click on the project in the Solution Explorer view, choose properties and then modify the manifest properties.
    Regards,
    Dan Lee

    Release Engineer

  5. #5
    Join Date
    Nov 2006
    Posts
    81
    I did update the manifests (wherever I could) of all our executables.

    But for some, the build server won't let me do it. So, I was wondering for such exes, if I could do it from the install.

    Any suggestions will be much appreciated.

    Thanks!

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •