Advantage Developer Zone

 
 
 

Advantage Knowledgebase Item




Ref No:
090422-2170
Last Modified:
Thursday, April 23, 2009
Product:
Advantage Clients ( General )
Category:
Integration
Title:
Error Creating Output File *.DCU in the Program Files Directory on Vista
Problem Description:
After installing the Advantage TDataSet or Advantage Delphi Components along with Delphi on Windows Vista an error similar to the following is returned when compiling a project.

[DCC Fatal Error] ace.pas(3339): F2039 Could not create output file 'C:\Program Files\Advantage 9.10\TDataSet\Delphi2009\WIN32\ace.dcu'
Solution:
This error is due to Vista's UAC (User Account Control) model.

When Vista's UAC is enabled the "Program Files" directory is marked as read only when running applications even if the Administrator is logged in. (This is also good to keep in mind if the program being written uses INI or Configuration files that normally reside in the "Program Files" directory).

There are a few options that can be used to address this error.

1) Run Delphi as an Administrator.
Please note that being logged in as Administrator and running an application as Administrator are two different things. By default when an application is executed it does not use Administrative privileges even though the user executing the application has Administrative privileges.
To run Delphi as an Administrator you can do the following:
A) Right Click on the Icon
B) Choose the menu option "Run as administrator".
At this point it will prompt for permission to continue. Now that the application is running with administrative privileges it will be able to compile and write the DCUs to the "Program Files" directory.

To set this program to always run as administrator.
A) Right click the shortcut and choose the menu option "Properties".
B) Click the tab "Shortcut" (Should be selected by default)
C) Choose the button "Advanced...".
D) Check the "run as administrator" check box.
Now each time the shortcut is executed it will prompt for permission to continue and then run as administrator.

2) Change the project options in Delphi
A) In Delphi, save the current project.
B) Open the Project Options
C) Change the "Unit Output Directory" to a path that is writable (i.e. My Documents\Folder).
Now, when the project is built the DCUs will be written to this writable directory. Please note however that this will need to be done for each project.

3) Disable Vista's UAC.
This may not be the appropriate option as all User Account Control is disabled, however it is an option.
A) Open the "Control Panel".
B) Under "User Accounts and Family Safety" click on "Add or remove user accounts".
C) At the bottom of the new folder / page that opens choose the last item "Go to the main User Accounts page".
D) At the bottom of the new folder / page that opens choose the last item " Turn User Account Control on or off".
E) In the new folder / page that opens un-check the "Use User Account Control (UAC) to help protect your computer" and click OK to save the changes.
F) At this time the computer will prompt to be re-booted.
Was This Item Helpful?