Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > General > VB6 Manifest for UAC Vista 64 Bit


Reply
 
Thread Tools Display Modes
  #1  
Old 07-16-2009, 09:06 AM
rex64 rex64 is offline
Senior Contributor
 
Join Date: Jul 2003
Posts: 1,171
Default VB6 Manifest for UAC Vista 64 Bit


I want my VB6 program to run as administrator. I tried Inno setup to create a key, and it created the registry key under the Wow6432Node location.

I was hoping you could help me with my manifest. It does not seem to be working either. I tried true and false and neither would pop up and and ask to run as administrator.

study.exe.manifest
Code:
<?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="ExeName"
	type="win32"/> 
<description>elevate execution level</description> 
   <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
      <security>
         <requestedPrivileges>
            <requestedExecutionLevel level="requireAdministrator" uiAccess="true"/>
         </requestedPrivileges>
      </security>
   </trustInfo>
</assembly>
I am just not sure what to do about it Wow6432Node:
http://msdn.microsoft.com/en-us/libr...8VS.85%29.aspx
Inno setup:
Code:
;run as admin:
Root: HKLM; Subkey: "SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers"; ValueType: string; ValueName: "{app}\Study.EXE"; ValueData: "RUNASADMIN"

Last edited by rex64; 07-16-2009 at 01:09 PM.
Reply With Quote
  #2  
Old 07-22-2009, 09:32 AM
rex64 rex64 is offline
Senior Contributor
 
Join Date: Jul 2003
Posts: 1,171
Default

I tried this as well. Any ideas what is wrong? My app is 32 bit running on a 64 bit vista, so I did not know if X86 and win32 were correct?
Code:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> 
    <assemblyIdentity version="2.1.0.20"
	processorArchitecture="X86"
	name="study"
	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>
Reply With Quote
  #3  
Old 07-22-2009, 03:56 PM
some1uk03's Avatar
some1uk03 some1uk03 is offline
Regular
 
Join Date: Jul 2006
Location: London
Posts: 76
Default

processorArchitecture="X86"


That should be processorArchitecture="*"

X86 only supports 32Bit OSs whilst "*" appeals to all of em 32bit & 64bit
Reply With Quote
  #4  
Old 07-23-2009, 09:01 AM
rex64 rex64 is offline
Senior Contributor
 
Join Date: Jul 2003
Posts: 1,171
Default

It is still not popping up with UAC. Is this part correct:
type="win32"/>
Reply With Quote
  #5  
Old 07-23-2009, 09:49 PM
dilettante's Avatar
dilettante dilettante is offline
Underclocked lifestyle

Forum Leader
* Guru *
 
Join Date: Feb 2005
Location: Michigan, USA
Posts: 4,345
Default

Using processorArchitecture="X86" should be correct. This is stating what your application is compiled and linked for, not what the current platform you're running on is. I'm almost 100% sure of this, because the other way around makes no sense (programs would need a different manifest for Vista32 and Vista64).

Using type="win32" is correct.

The version attribute should exactly match your program's compiled version but I'm not sure that it is currently validated by any Windows version. You are also missing the name attribute but I'm not sure this is critical either.

MMM generates a trustInfo section that works and it looks like:
Code:
  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
    <security>
        <requestedPrivileges>
          <requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
        </requestedPrivileges>
    </security>
  </trustInfo>
Note the use of the v3 namespace - instead of the v2 one which is known to have problems in certain versions of Windows (XP SP2?).
Reply With Quote
  #6  
Old 08-02-2009, 09:47 AM
rex64 rex64 is offline
Senior Contributor
 
Join Date: Jul 2003
Posts: 1,171
Default

What is MMM? Also, how did you generate this XML? And is this the complete manifest file? It looks a lot different from mine.
Quote:
Originally Posted by dilettante View Post
MMM generates a trustInfo section that works and it looks like:
Code:
  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
    <security>
        <requestedPrivileges>
          <requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
        </requestedPrivileges>
    </security>
  </trustInfo>
Note the use of the v3 namespace - instead of the v2 one which is known to have problems in certain versions of Windows (XP SP2?).
Reply With Quote
  #7  
Old 08-02-2009, 07:01 PM
dilettante's Avatar
dilettante dilettante is offline
Underclocked lifestyle

Forum Leader
* Guru *
 
Join Date: Feb 2005
Location: Michigan, USA
Posts: 4,345
Default

MMM is a manifest generator for VB6 programs. It is primarily intended to handle registration-free COM but it also adds Vista Trust when selected and a few other things like the CC6 section.

That snippet isn't complete, just a trustInfo section.
Reply With Quote
  #8  
Old 08-25-2009, 11:27 AM
rex64 rex64 is offline
Senior Contributor
 
Join Date: Jul 2003
Posts: 1,171
Default

I tried using MMM and generated this, but it still does not run as administrator:
Code:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
  <!-- Make My Manifest 0.7.300 -->
  <assemblyIdentity name="Jeff.Computers.StudyX" processorArchitecture="X86" type="win32" version="3.8.0.3" />
  <description>StudyX Study Software</description>
  <file name="mscomct2.ocx">
    <typelib tlbid="{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}" version="2.0" flags="control" helpdir="" />
    <comClass clsid="{B09DE715-87C1-11D1-8BE3-0000F8754DA1}" tlbid="{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}" threadingModel="Apartment" progid="MSComCtl2.Animation.2" description="Animation Control" />
    <comClass clsid="{603C7E80-87C2-11D1-8BE3-0000F8754DA1}" tlbid="{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}" threadingModel="Apartment" progid="MSComCtl2.UpDown.2" description="UpDown Control" />
    <comClass clsid="{232E456A-87C3-11D1-8BE3-0000F8754DA1}" tlbid="{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}" threadingModel="Apartment" progid="MSComCtl2.MonthView.2" description="Microsoft MonthView Control" />
    <comClass clsid="{20DD1B9E-87C4-11D1-8BE3-0000F8754DA1}" tlbid="{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}" threadingModel="Apartment" progid="MSComCtl2.DTPicker.2" description="Microsoft Date and Time Picker Control" />
    <comClass clsid="{FE38753A-44A3-11D1-B5B7-0000C09000C4}" tlbid="{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}" threadingModel="Apartment" progid="MSComCtl2.FlatScrollBar.2" description="Microsoft Flat Scrollbar Control" />
  </file>
  <file name="mswinsck.ocx">
    <typelib tlbid="{248DD890-BB45-11CF-9ABC-0080C7E7B78D}" version="1.0" flags="control" helpdir="" />
    <comClass clsid="{248DD896-BB45-11CF-9ABC-0080C7E7B78D}" tlbid="{248DD890-BB45-11CF-9ABC-0080C7E7B78D}" threadingModel="Apartment" progid="MSWinsock.Winsock.1" description="Microsoft Winsock Control" />
  </file>
  <file name="COMCT332.OCX">
    <typelib tlbid="{38911DA0-E448-11D0-84A3-00DD01104159}" version="1.1" flags="control" helpdir="" />
    <comClass clsid="{38911D92-E448-11D0-84A3-00DD01104159}" tlbid="{38911DA0-E448-11D0-84A3-00DD01104159}" threadingModel="Apartment" progid="ComCtl3.CoolBar" description="Microsoft Coolbar Control, version 6.0" />
    <comClass clsid="{38911D90-E448-11D0-84A3-00DD01104159}" tlbid="{38911DA0-E448-11D0-84A3-00DD01104159}" threadingModel="Apartment" description="" />
    <comClass clsid="{38911D8E-E448-11D0-84A3-00DD01104159}" tlbid="{38911DA0-E448-11D0-84A3-00DD01104159}" threadingModel="Apartment" description="" />
  </file>
  <file name="richtx32.ocx">
    <typelib tlbid="{3B7C8863-D78F-101B-B9B5-04021C009402}" version="1.2" flags="control" helpdir="" />
    <comClass clsid="{3B7C8860-D78F-101B-B9B5-04021C009402}" tlbid="{3B7C8863-D78F-101B-B9B5-04021C009402}" threadingModel="Apartment" progid="RICHTEXT.RichtextCtrl.1" description="Microsoft Rich Textbox Control 6.0 (SP6)" />
  </file>
  <file name="TABCTL32.OCX">
    <typelib tlbid="{BDC217C8-ED16-11CD-956C-0000C04E4C0A}" version="1.1" flags="control" helpdir="" />
    <comClass clsid="{BDC217C5-ED16-11CD-956C-0000C04E4C0A}" tlbid="{BDC217C8-ED16-11CD-956C-0000C04E4C0A}" threadingModel="Apartment" progid="TabDlg.SSTab.1" description="A Tabbed Dialog control that can be used to group controls on separate tabs." />
  </file>
  <file name="DBGRID32.OCX">
    <typelib tlbid="{00028C01-0000-0000-0000-000000000046}" version="1.0" flags="control" helpdir="" />
    <comClass clsid="{00028C00-0000-0000-0000-000000000046}" tlbid="{00028C01-0000-0000-0000-000000000046}" progid="MSDBGrid.DBGrid" description="The main grid object" />
  </file>
  <file name="MSFLXGRD.OCX">
    <typelib tlbid="{5E9E78A0-531B-11CF-91F6-C2863C385E30}" version="1.0" flags="control" helpdir="" />
    <comClass clsid="{6262D3A0-531B-11CF-91F6-C2863C385E30}" tlbid="{5E9E78A0-531B-11CF-91F6-C2863C385E30}" threadingModel="Apartment" progid="MSFlexGridLib.MSFlexGrid.1" description="Microsoft FlexGrid Control 6.0 (SP6)" />
  </file>
  <file name="MSDATGRD.OCX">
    <typelib tlbid="{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}" version="1.0" flags="control" helpdir="" />
    <comClass clsid="{CDE57A43-8B86-11D0-B3C6-00A0C90AEA82}" tlbid="{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}" threadingModel="Apartment" progid="MSDataGridLib.DataGrid.1" description="Microsoft DataGrid Control 6.0 (OLEDB)" />
  </file>
  <file name="MSStdFmt.dll">
    <typelib tlbid="{6B263850-900B-11D0-9484-00A0C91110ED}" version="1.0" flags="" helpdir="" />
    <comClass clsid="{2B11E9B0-9F09-11D0-9484-00A0C91110ED}" tlbid="{6B263850-900B-11D0-9484-00A0C91110ED}" threadingModel="Apartment" progid="MSSTDFMT.StdDataValue.1" description="StdDataValue Object" />
    <comClass clsid="{6D835690-900B-11D0-9484-00A0C91110ED}" tlbid="{6B263850-900B-11D0-9484-00A0C91110ED}" threadingModel="Apartment" progid="MSSTDFMT.StdDataFormat.1" description="StdDataFormat Object" />
    <comClass clsid="{99FF4677-FFC3-11D0-BD02-00C04FC2FB86}" tlbid="{6B263850-900B-11D0-9484-00A0C91110ED}" threadingModel="Apartment" progid="MSSTDFMT.StdDataFormats.1" description="StdDataFormats Object" />
  </file>
  <file name="MSDATLST.OCX">
    <typelib tlbid="{F0D2F211-CCB0-11D0-A316-00AA00688B10}" version="1.0" flags="control" helpdir="" />
    <comClass clsid="{F0D2F219-CCB0-11D0-A316-00AA00688B10}" tlbid="{F0D2F211-CCB0-11D0-A316-00AA00688B10}" threadingModel="Apartment" progid="MSDataListLib.DataList.1" description="DataList control" />
    <comClass clsid="{F0D2F21C-CCB0-11D0-A316-00AA00688B10}" tlbid="{F0D2F211-CCB0-11D0-A316-00AA00688B10}" threadingModel="Apartment" progid="MSDataListLib.DataCombo.1" description="DataCombo control" />
  </file>
  <file name="CSWSK32.OCX">
    <typelib tlbid="{33101C00-75C3-11CF-A8A0-444553540000}" version="1.0" flags="control" helpdir="" />
    <comClass clsid="{33101C03-75C3-11CF-A8A0-444553540000}" tlbid="{33101C00-75C3-11CF-A8A0-444553540000}" threadingModel="Apartment" progid="Catalyst.SocketCtrl.1" description="Catalyst SocketWrench Control" />
  </file>
  <file name="clsGlassButton.ocx">
    <typelib tlbid="{F2230F8E-4D36-48DA-AC97-2928D9B34865}" version="86.0" flags="control" helpdir="" />
    <comClass clsid="{53C9A4A1-6FBA-489D-AC02-869CD17FE422}" tlbid="{F2230F8E-4D36-48DA-AC97-2928D9B34865}" threadingModel="Apartment" progid="GlassButton.btnGlassButton" description="" />
  </file>
  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
    <security>
        <requestedPrivileges>
          <requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
        </requestedPrivileges>
    </security>
  </trustInfo>
</assembly>
Reply With Quote
  #9  
Old 08-25-2009, 02:18 PM
dilettante's Avatar
dilettante dilettante is offline
Underclocked lifestyle

Forum Leader
* Guru *
 
Join Date: Feb 2005
Location: Michigan, USA
Posts: 4,345
Default

Are you saying you do not get the UAC elevation prompt when you run the program? You haven't disabled UAC have you? What happens when you right-click and choose Run as administrator?

Since you are using that Inno-thing you probably don't want to create an isolation manifest for these components. In such a case I'd probably "exclude" them in MMM so their type iformation isn't written into the manifest. That won't have anything to do with your elevation problems of course.
Reply With Quote
  #10  
Old 08-25-2009, 02:51 PM
rex64 rex64 is offline
Senior Contributor
 
Join Date: Jul 2003
Posts: 1,171
Default

Correct, I do NOT get the prompt. And yes, I get the prompt if I right click. Does this seem strange? Have you gotten this to work before?
Quote:
Originally Posted by dilettante View Post
Are you saying you do not get the UAC elevation prompt when you run the program? .
So, you would recommend something like this:
Code:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
  <!-- Make My Manifest 0.7.300 -->
  <assemblyIdentity name="Jeff.Computers.StudyX" processorArchitecture="X86" type="win32" version="3.8.0.3" />
  <description>StudyX Study Software</description>
  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
    <security>
        <requestedPrivileges>
          <requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
        </requestedPrivileges>
    </security>
  </trustInfo>
</assembly>
Thanks!
Reply With Quote
  #11  
Old 08-25-2009, 03:28 PM
dilettante's Avatar
dilettante dilettante is offline
Underclocked lifestyle

Forum Leader
* Guru *
 
Join Date: Feb 2005
Location: Michigan, USA
Posts: 4,345
Default

The shorter manifest is better if you are using an installer package that is going to register the components. I can't imagine why this would change anything regarding elevtion though.

Yes, it always works for me. You must have something else going on in your environment.
Reply With Quote
  #12  
Old 08-26-2009, 08:56 AM
rex64 rex64 is offline
Senior Contributor
 
Join Date: Jul 2003
Posts: 1,171
Default

I tried the * on the type as well:
Code:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
  <!-- Make My Manifest 0.7.300 -->
  <assemblyIdentity name="Jeff.Computers.StudyX" processorArchitecture="*" type="win32" version="3.8.0.3" />
  <description>StudyX Study Software</description>
  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
    <security>
        <requestedPrivileges>
          <requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
        </requestedPrivileges>
    </security>
  </trustInfo>
</assembly>
Reply With Quote
  #13  
Old 08-26-2009, 09:35 AM
dilettante's Avatar
dilettante dilettante is offline
Underclocked lifestyle

Forum Leader
* Guru *
 
Join Date: Feb 2005
Location: Michigan, USA
Posts: 4,345
Default

I'm out of ideas unless you can think of something else you have going on here. Did you try it with the manifest embedded?

Also see http://blogs.msdn.com/vistacompattea...ion-cache.aspx
Reply With Quote
  #14  
Old 08-26-2009, 09:54 AM
rex64 rex64 is offline
Senior Contributor
 
Join Date: Jul 2003
Posts: 1,171
Default

That fixed it. Wish there was an easy way to refresh the cache. Not that big of a deal though. Thanks!
Quote:
Originally Posted by dilettante View Post
I'm out of ideas unless you can think of something else you have going on here. Did you try it with the manifest embedded?

Also see http://blogs.msdn.com/vistacompattea...ion-cache.aspx
Reply With Quote
  #15  
Old 08-26-2009, 09:58 AM
dilettante's Avatar
dilettante dilettante is offline
Underclocked lifestyle

Forum Leader
* Guru *
 
Join Date: Feb 2005
Location: Michigan, USA
Posts: 4,345
Default

Whew! At least we solved one mystery.
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
 
 
-->