Re: Forcing a VB6 application to run with administrative privileges

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance




"Sarah M. Weinberger" <mweinberger@xxxxxxxxxxx> wrote in message
news:uVBjMolRIHA.2208@xxxxxxxxxxxxxxxxxxxxxxx
Hi,

Has anyone figured out how to have a VB6 application forced to run with
administrative privileges yet? Microsoft talks about adding a manifest, a
small piece of code, but that is for .Net based applications built with
Visual Studio.Net and involves adding code to the web.config file and the
resource table. VB6 applications do not have that, so it is not possible
to add in a manifest to my knowledge to VB6 based applications.

InstallShield does have the ability to force the setup.exe to run in
administrative mode, but that does nothing for the actual executable. I
checked the shortcut on my Vista installation and saw that there is a tab
that has a "Privilege Level" option, but that is grayed out for whatever
reason. Why? Even if there is a way to have the shortcut force the
application to run in admistrative mode that does not solve the problem
for the application, when a user double clicks on the actual executable or
types in the executable name in the run dialog off of the start menu. A
"manifest" solution seems like the ideal method, but as I mentioned above
that does not work for VB6 applications, only Visual Studio.Net
applications supporting manfests.

Thoughts?

Sarah M. Weinberger

I use manifest files with VB6. But first let me state that I do not install
into Program Files directory etc.

Please don't yell at me for creating a folder on the C drive that has the
Company name as the name of the folder. It's not my idea !!

Sub-folders are created with the name of the program being installed. There
could be up to five of these folders.

Also a common sub-folder named "Data" is created. All files that are written
to by the various programs are in this Data folder.

As part of my install there is an AutoInstall program that takes up to six
arguments. These arguments are the names of the actual install programs.
Generally I have to install USB drivers, common ocx's etc, the programs,
etc.

So it would look like this: "AutoInstall USBdrvr.exe VB6common.exe
CDS74.exe".
The cd also contains AutoInstall.exe.manifest, USBdrvr.exe.manifest,
VB6common.exe.manifest and CDS74.exe.manifest.

A typical manifest file looks like this:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity version="1.0.0.0"
processorArchitecture="X86"
name="CDS74"
type="win32"/>
<description>elevate execution level</description>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="requireAdministrator"
uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>


For what it's worth, I don't use a fancy installer like InstallShield. I use
a simple INF file installer called INF-Tools.

Galen


.



Relevant Pages

  • Re: Forcing a VB6 application to run with administrative privileges
    ... Basically it says you need a manifest file. ... Has anyone figured out how to have a VB6 application forced to run ... applications built with Visual Studio.Net and involves adding code to ... As part of my install there is an AutoInstall program that takes up to ...
    (microsoft.public.vb.general.discussion)
  • Re: Forcing a VB6 application to run with administrative privileges
    ... I find manifest files work fine for my VB6 apps. ... Has anyone figured out how to have a VB6 application forced to run with administrative privileges yet? ... Microsoft talks about adding a manifest, a small piece of code, but that is for .Net based applications built with Visual Studio.Net and involves adding code to the web.config file and the resource table. ... As part of my install there is an AutoInstall program that takes up to six arguments. ...
    (microsoft.public.vb.general.discussion)
  • Re: Forcing a VB6 application to run with administrative privileges
    ... Not in VB6 from my experience. ... VB6 applications do not have that, ... possible to add in a manifest to my knowledge to VB6 based applications. ... As part of my install there is an AutoInstall program that takes up to ...
    (microsoft.public.vb.general.discussion)
  • Re: Forcing a VB6 application to run with administrative privileges
    ... Has anyone figured out how to have a VB6 application forced to run with administrative privileges yet? ... Microsoft talks about adding a manifest, a small piece of code, but that is for .Net based applications ... As part of my install there is an AutoInstall program that takes up to six arguments. ...
    (microsoft.public.vb.general.discussion)
  • Re: Forcing a VB6 application to run with administrative privileges
    ... the manifest "Must" be embedded in a resource file. ... Has anyone figured out how to have a VB6 application forced to run with administrative privileges yet? ... Microsoft talks about adding a manifest, a small piece of code, but that is for .Net based applications ... As part of my install there is an AutoInstall program that takes up to six arguments. ...
    (microsoft.public.vb.general.discussion)