delphi应用程序有权限问题.为什么?

delphi应用程序有权限问题.为什么?,第1张

概述Delphi 2010 Windows 7 – 64位. 我有一个相当微不足道的应用程序.这是一个数据库应用程序.它启动,找到它的当前目录,查找数据库文件IN THAT DIRECTORY,打开它,并显示一些数据.它在我的开发计算机上工作正常.我把它带到另一台计算机,也是Windows 7,64位,我收到一个错误. (具体来自数据库库 – 组件Ace – 表示列不存在).我不得不相信这是一个通用的 Delphi 2010

Windows 7 – 64位.

我有一个相当微不足道的应用程序.这是一个数据库应用程序.它启动,找到它的当前目录,查找数据库文件IN THAT DIRECTORY,打开它,并显示一些数据.它在我的开发计算机上工作正常.我把它带到另一台计算机,也是windows 7,64位,我收到一个错误. (具体来自数据库库 – 组件Ace – 表示列不存在).我不得不相信这是一个通用的访问错误.当我右键单击桌面图标,然后选择RUN AS adminISTRATOR时,它运行正常.我没有明确地锁定任何东西.我作为管理员用户在计算机上.管理员已安装该应用.我正在尝试将此应用分发给多个人.我正在使用的安装例程是InnoSetup.遇到什么类型的权限问题?

为了完整起见,我包含了INNO SETUP.iss文件.
谢谢
GS

; Script generated by the Inno Setup Script Wizard.; SEE THE documentATION FOR DETAILS ON CREATING INNO SETUP SCRIPT fileS!#define MyAppname "DocAssist"#define MyAppVername "DocAssist 3.2"#define MyAppPublisher "GS"#define MyAppExename "DocAssist.exe"[Setup]; NOTE: The value of AppID uniquely IDentifIEs this application.; Do not use the same AppID value in installers for other applications.; (To generate a new GUID,click Tools | Generate GUID insIDe the IDE.)AppID={{6F34D198-14A0-4398-8E82-34232956CC5B}Appname={#MyAppname}AppVername={#MyAppVername}AppPublisher={#MyAppPublisher}DefaultDirname={pf}\{#MyAppname}DefaultGroupname={#MyAppname}AllowNoIcons=yesOutputDir=D:\Projects\DocAssist\disTROutputBasefilename=DocAssistV3SetupCompression=lzmaSolIDCompression=yesAppcopyright=GSVersionInfoVersion=3.2[Languages]name: english; Messagesfile: compiler:Default.isl[Tasks]; name: desktopicon; Description: {cm:CreateDesktopIcon}; GroupDescription: {cm:Additionalicons}; Flags: uncheckedname: desktopicon; Description: {cm:CreateDesktopIcon}; GroupDescription: {cm:Additionalicons};[files]Source: D:\Projects\DocAssist\disTR\DocAssist.exe; DestDir: {app}; Flags: ignoreversionSource: D:\Projects\DocAssist\disTR\DocAssist.ABS; DestDir: {app}; Flags: ignoreversionSource: D:\Projects\DocAssist\disTR\StopWords.txt; DestDir: {app}; Flags: ignoreversion; NOTE: Don't use "Flags: ignoreversion" on any shared system filesSource: DocAssist Version 3_2.pdf; DestDir: {app}; Flags: isreadme; Add-in dllSource: D:\Projects\DocAssist\disTR\DocAssistCom.dll; DestDir: {app}; Flags: regserverSource: D:\Projects\DocAssist\disTR\gdiplus.dll;      DestDir: {app}; Flags: ignoreversion[Icons]name: {group}\{#MyAppname}; filename: {app}\{#MyAppExename}name: {group}\{cm:UninstallProgram,{#MyAppname}}; filename: {uninstallexe}name: {commondesktop}\{#MyAppname}; filename: {app}\{#MyAppExename}; Tasks: desktopicon[Run]filename: {app}\{#MyAppExename}; Description: {cm:LaunchProgram,{#MyAppname}}; Flags: Nowait postinstall skipifsilent[Registry]Root: HKLM; Subkey: SOFTWARE\DocAssist; ValueType: none; Permissions: admins-full; Flags: uninsdeletekey createvalueifdoesntexist;Root: HKLM; Subkey: SOFTWARE\DocAssist; ValueType: string; Valuename: InstallDir; ValueData: {app}; Permissions: admins-full; Flags: uninsdeletekey createvalueifdoesntexist
解决方法 您不应该写入程序文件目录中的文件.自windows 95以来,这已被弃用,但从windows Vista开始,它变得更加严格,默认情况下不允许写入,除非您是管理员.

您可以写入许多其他地方,App Data是常用文件夹,My documents也是如此.您可以使用SHGetSpecialFolderLocation api查找这些特殊文件夹的确切位置(因为它因安装而异).

B.t.w.如果必须使用应用程序目录,请使用Application.Exename或ParamStr(0)而不是当前目录.

总结

以上是内存溢出为你收集整理的delphi应用程序有权限问题.为什么?全部内容,希望文章能够帮你解决delphi应用程序有权限问题.为什么?所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/langs/1223631.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-05
下一篇 2022-06-05

发表评论

登录后才能评论

评论列表(0条)

保存