The delphi app has permission issues. What for?

Delphi 2010

Windows 7 - 64 bit.

I have an application that is fairly trivial. This is a database application. It starts up, finds the current directory, looks for the IN THAT DIRECTORY database file, opens it and displays some data. It works great on my development computer. I take it to another computer, also Windows 7, 64 bit and I get an error. (Specifically from the Database Library - Component Ace - saying the column doesn't exist). I have to believe that this is a common access error. When I right click on the desktop icon and select RUN AS ADMINISTRATOR, it works fine. I have not explicitly blocked anything. I am on the computer as an Admin user. This is the Admin who installed the app. I am trying to distribute this application to multiple users. The installation routine I am using is- InnoSetup. What's the startup permission issue?

For completeness, I include the INNO SETUP.iss file. thanks to 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=yes
OutputDir=D:\Projects\DocAssist\DISTR
OutputBaseFilename=DocAssistV3Setup
Compression=lzma
SolidCompression=yes
AppCopyright=GS
VersionInfoVersion=3.2

[Languages]
Name: english; MessagesFile: compiler:Default.isl

[Tasks]
; Name: desktopicon; Description: {cm:CreateDesktopIcon}; GroupDescription: {cm:AdditionalIcons}; Flags: unchecked
Name: desktopicon; Description: {cm:CreateDesktopIcon}; GroupDescription: {cm:AdditionalIcons};

[Files]
Source: D:\Projects\DocAssist\DISTR\DocAssist.exe; DestDir: {app}; Flags: ignoreversion
Source: D:\Projects\DocAssist\DISTR\DocAssist.ABS; DestDir: {app}; Flags: ignoreversion
Source: D:\Projects\DocAssist\DISTR\StopWords.txt; DestDir: {app}; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
Source: DocAssist Version 3_2.pdf; DestDir: {app}; Flags: isreadme
; Add-in dll
Source: D:\Projects\DocAssist\DISTR\DocAssistCom.dll; DestDir: {app}; Flags: regserver
Source: 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

      

+3


source to share


1 answer


Do not write files to the program files directory. This has been deprecated since Windows 95, but since Windows Vista it has become stricter and writing is not allowed by default, unless you are an administrator.

There are many other places you can write to, and App Data is a commonly used folder just like My Documents. You can use the SHGetSpecialFolderLocation api to find the exact location of these special folders (because it depends on each installation).



Btw if you need to use the application directory, resort to Application.ExeName or ParamStr (0), not the current directory.

+13


source







All Articles