Announcement

Collapse
No announcement yet.

Installing FONT on VISTA from my program fails

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Installing FONT on VISTA from my program fails

    On VISTA, i would like to install a new font from my program.

    But wathever i am doing, i always get an "access denied" error...
    (administrator privileges)

    I have used both AddFontResource and AddFontResourceEx, with no luck.

    I did several search on Google, showing me that this is a common VISTA's issue, however no solution found yet.

    Do you have one?

    ...
    Patrice Terrier
    www.zapsolution.com
    www.objreader.com
    Addons: GDImage.DLL 32/64-bit (Graphic library), WinLIFT.DLL 32/64-bit (Skin Engine).

  • #2
    Hi Patrice,

    Have you created a manifest file with the following section in it?

    Code:
        <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
            <security>
                <requestedPrivileges>
                    <requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
                </requestedPrivileges>
            </security>
        </trustInfo>
    If the program has "admin" access in general then it can do things like install fonts, write in restricted folders etc.
    Scott Slater
    Summit Computer Networks, Inc.
    www.summitcn.com

    Comment


    • #3
      You can also directly embed the manifest into the rc file this way.
      Code:
      #include "resource.h"
      #define IDR_MANIFEST 1 // 2 for a DLL
      #define RT_MANIFEST 24
       
      // Other rc entries here......
       
       
       
      // Manifest data.
      IDR_MANIFEST RT_MANIFEST MOVEABLE PURE
      {
          "<assembly xmlns=""urn:schemas-microsoft-com:asm.v1"" manifestVersion=""1.0"">
             <assemblyIdentity
               name=""Microsoft.Windows.Shell.shell32""
               processorArchitecture=""x86""
               version=""1.50.00.01""
               type=""win32""/>
             <description>Windows Shell</description>
             <dependency>
               <dependentAssembly>
                 <assemblyIdentity
                   type=""win32""
                   name=""Microsoft.Windows.Common-Controls""
                   version=""6.0.0.0""
                   processorArchitecture=""x86""
                   publicKeyToken=""6595b64144ccf1df""
                   language=""*""
                 />
               </dependentAssembly>
             </dependency>
             <asmv3:trustInfo xmlns:asmv3=""urn:schemas-microsoft-com:asm.v3"">
               <asmv3:security>
                 <asmv3:requestedPrivileges>
                   <asmv3:requestedExecutionLevel
                     level=""asInvoker""
                     uiAccess=""false"" />
                 </asmv3:requestedPrivileges>
               </asmv3:security>
             </asmv3:trustInfo>
           </assembly>"
      }
      Scott Slater
      Summit Computer Networks, Inc.
      www.summitcn.com

      Comment


      • #4
        Scott,

        I want to do it in "silent" mode!

        Using "elevated privilege" when UAC is enabled, pops up the infamous UAC notification each time the user starts the program.

        Moreover it doesn't install the font! (i am using VISTA 64-bit)


        PS: I don't want to reboot the system either.
        Patrice Terrier
        www.zapsolution.com
        www.objreader.com
        Addons: GDImage.DLL 32/64-bit (Graphic library), WinLIFT.DLL 32/64-bit (Skin Engine).

        Comment

        Working...
        X