delphi7 VISTA UAC的问题

billyguo9 2009-04-24 11:26:26
我在XP下使用DELPHI7 因应用程序需要读取注册表,并要能在VISTA下使用,因为UAC的问题,在VISTA下不能读取注册表,以管理员身份运行就可以,我想让应用程序在VISTA下能自动提示用管理员身份运行,在网上看到以下文章,照做之后,还是不行,有那位照以下方法成功的请介绍一下经验,谢谢!

在程序目录下建立如下文件,命名为 程序名.exe.manifest.用Windows记事本保存为UTF8编码格式.

在Delphi2007下编译时,需要购选Project--Options--Application--Enabled Runtime themes.

否则,编译不起作用.D7不需要.修改下面Project1.exe.manifest为程序名.

<?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="Project1.exe.manifest"
type="win32"
/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="requireAdministrator" uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>

上面的是98,2000风格,下面的是XP,vista风格:

<?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="*"
name="Project1"
type="win32"
/>
<description>Project1</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
<ms_asmv3:trustInfo xmlns:ms_asmv3="urn:schemas-microsoft-com:asm.v3">
<ms_asmv3:security>
<ms_asmv3:requestedPrivileges>
<ms_asmv3:requestedExecutionLevel level="requireAdministrator" uiAccess="false">
</ms_asmv3:requestedExecutionLevel>
</ms_asmv3:requestedPrivileges>
</ms_asmv3:security>
</ms_asmv3:trustInfo>
</assembly>
...全文
274 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
good_cyg 2010-05-18
  • 打赏
  • 举报
回复
编译成uac.res 文件在 工程文件中加入 {R uac.res} 就可以了。详细操作在网上搜一下,介绍的有。
ESBPCS(TM) for VCL v6.2.0 Released: 29 April 2013 ESB Professional Computation Suite for Embarcadero (formerly CodeGear/Borland) Delphi & C++ Builder. For use in VCL Applications Developed by ESB Consultancy mailto:support@esbconsult.com Copyright (c)1999-2013 ESB Consultancy PO Box 2259 Boulder WA 6432 AUSTRALIA http://www.esbconsult.com/ ESBPCS for VCL Web Page: http://www.esbconsult.com/esbpcs Support mailto:support@esbconsult.com NewsServer: news://esb.newsgrouphosting.com Online Forums: http://esb.newsgrouphosting.com Secure Online Registration at http://www.esbconsult.com/esbpcs/purchase.htm ESBPCS now on Facebook: http://www.facebook.com/esbpcs Follow us on Twitter at http://twitter.com/esbglenn Install: ======== WARNING - It is always wise to have current Backups. Run Setup.exe. Includes Uninstaller. Setup will also run the ESBPCS Installer. If you wish to do things manually then exit out of it. If you have problems, try removing all trace of ESBPCS, especially previous versions and trials, and running Setup.exe again. Requires about 30MB of Disk Space. See WhatsNew.Txt in the Source directory for new features. For Installing with Turbo Delphi Professional or Turbo C++ Professional, you need to grab the DCC32.EXE (command line compiler) that is available for free download from the Registered User Area at Borland. Note: Running ESBPCS Installer as Administrator or Supervisor may be required. Possible Vista/Windows 7/Windows 8 Install Problem ======================================== Windows Vista introduces new security that if your have UAC on and install ESBPCS under your "Program Files" then it won't let the ESBPCS Installer work properly. Personally when I was using Vista, I always turned UAC off as I found too many of my development tools wouldn't work properly including older versions of Delphi. The following may be useful: http://www.tweak-uac.com/home/ By default with ESBPCS 6 and later, the setup.exe chooses c:\ESBPCS6 as the install directory to try and get around the 搒ecurity improvements?of Vista and above, where the UAC prevents things editing in Program Files, though this is overriden if you have a previous install. So you may want to run the setup again and try install to say c:\ESBPCS6 and see if that works? Purpose: ======== Making Data Entry and Manipulation Easier for Developers and their Customers. ESB Professional Computation Suite (ESBPCS) is a collection of over 6000 routines/methods and over 235 classes/components in over 140 units for Embarcadero (formerly CodeGear / Borland) Delphi 7, 2005/Win32, 2006/Win32, 2007, 2009, and 2010 and C++ Builder 2006, 2007, 2009 and 2010, Borland Turbo Delphi Professional for Win32 and Borland Turbo C++ for Win32, CodeGear RAD Studio 2007 (Win32 Personalities), CodeGear RAD Studio 2009, Embarcadero RAD Studio 2010, Embarcadero Delphi XE, Embarcadero C++ Builder XE, Embarcadero RAD Studio XE, Embarcadero Delphi XE2, Embarcadero C++ Builder XE2, Embarcadero RAD Studio XE2, Embarcadero Delphi XE3, Embarcadero C++ Builder XE3, Embarcadero RAD Studio XE3, Embarcadero Delphi XE4, Embarcadero C++ Builder XE4, Embarcadero RAD Studio XE4 which are aimed at making "data entry and manipulation easier" for Developers and their Customers. Components included cover Integer Edits, Float Edits, Hex Edits, IP Address Edits, Percentage Edits, Date Edits, Time Edits, Date/Time Edits, Month Edits, Time Edits, Complex Edits, Fraction Edits, Currency Edits, Calculator Edits, Calendar Edits, Button Edits, Comboboxes, Month Comboboxes, Day of Week Comboboxes, Time Zone Comboboxes, Country Comboboxes, Duration Comboboxes, SpinEdits, Month SpinEdit, DOW SpinEdits, Duration SpinEdits, Currency SpinEdits, Vector Edits, Matrix Edits, Calculators, Calendars, Statistical Analysis, Labels, URL Labels, Math Labels, CheckBoxes, RadioGroups, CheckGroups, Memos, RichEdits and much more. As well, there are Data Aware versions of most of them. Routines included cover Mathematics, Probability, Statistics, Complex Numbers, Fractions, Physics, Geometry, Astronomy, Longitude/Latitude, Unit Conversions, Strings, File IO, Registry, Financials, Country Lists, Holidays, Time Zones, Dates and Times, and much more. Unfortunately, people with Standard/Personal Versions of Delphi 7 cannot use the Data Aware Components but they can use everything else! Note: Trial Versions of Borland IDE may not work with the ESBPCS Installer. Note: When doing 64-bit Development Extended = Double, so there is loss of "decimal places" and "exponent range". If these are important to you stick with Win32 development. Note: FireMonkey support is under development, however this will be a new product - ESBPCS for FireMonkey - with the components and many of the routines done from scratch to better take advantage of the new approach. Requirements: ============= This package was designed for use with EEmbarcadero (formerly CodeGear / Borland) Delphi 7, 2005/Win32, 2006/Win32, 2007, 2009, and 2010 and C++ Builder 2006, 2007, 2009 and 2010, Borland Turbo Delphi Professional for Win32 and Borland Turbo C++ for Win32, CodeGear RAD Studio 2007 (Win32 Personalities), CodeGear RAD Studio 2009, Embarcadero RAD Studio 2010, Embarcadero Delphi XE, Embarcadero C++ Builder XE, Embarcadero RAD Studio XE, Embarcadero Delphi XE2, Embarcadero C++ Builder XE2, Embarcadero RAD Studio XE2, Embarcadero Delphi XE3, Embarcadero C++ Builder XE3, Embarcadero RAD Studio XE3 Embarcadero Delphi XE4, Embarcadero C++ Builder XE4, Embarcadero RAD Studio XE4 and has been tested on Microsoft Windows 2000, Microsoft Windows XP, Microsoft Windows 2003, Microsoft Windows Vista, Microsof Windows 7 and Microsoft Windows 8. The Data Aware Components require Professional or higher Editions of Delphi and C++ Builder. Support: ======== Send Email to support@esbconsult.com Please let us know of any problems and especially let us know of things you would like to see added. Trial Version: ============== Trial Version differs from the registered version in several ways: a) When running Applications compiled with the Trial Version and the D7/BDS2005/BDS2006/CRS2007/CRS2009/CRS2010/RSXE/RSXE2 IDE is not running, you will get an "Error Msg". b) No Source included with Trial Version. c) Enhanced Installer for re-building the Packages and installing them as well as the Help files comes with Registered version. d) No Source to Utilities with Trial Version. Plus on registering you also get: Benefits of Registering ======================= 1. 30-Day Money Back Guarantee 2. Full Delphi Source. No DLLs or OCXs. 3. More comprehensive Help Files. 4. Full Royalty Free rights to include ESBPCS in your Applications (see License.txt for more info) 5. More Frequent Updates - not all minor versions are released as Trial Versions, but updated source is always available to registered users. 7. Access to Registered Users only site. You will be supplied a password to access the Registered Users Site. 8. Notification of Bugs & Fixes - even before we release an update we will notify registered users via the Mailing List of any verified bug, and the fix when available. 9. Discounts on related Products from ESB and from other Developers. We will also endeavour to see if we can develop relationships with other companies to offer cross-discounting, i.e. Registered Users of ESBPCS will get the other companies products at a discount, and similarly we will give their users a discount. 10. Pre-release versions. If you wish to test out new features before they become available - Registered Users get not only "inside information" but an opportunity to be involved in shaping the product. (Note: Beta versions are not made available to "LITE" owners). Version History: See WHATSNEW.TXT For more info see ESBPCSOverview.exe To get a printed version of the above, use ESBPCSOverview.pdf OTHER PRODUCTS ============== See esbproducts.pdf - list of Freeware & Shareware available from ESB Consultancy. You may need the Free Adobe Acrobat Reader: http://get.adobe.com/reader/ Follow our blog at http://www.esbdevlib.com/wordpress/ mailto:support@esbconsult.com http://www.esbconsult.com/

5,388

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧