分享

Delphi 2006

 npkaida 2015-03-21

I am getting an error after installing Delphi 2007 (Edit: This problem occurs in all Delphi versions from 2006 to 2010) that I can not figure out and have never seen before. After restarting I can launch the program without any problems, but if I were to close out of the program and start again it will give me the following error:

"Cannot create file C:\Users\Admin\AppData\Local\Temp\EditorLineEnds.ttr". The process cannont access the file because it is being use by another process."

"System" has a handle on this file that cannot be cleared unless I reboot. I can also correct the problem by renaming the file before I launch the program.

I have tried reinstalling the program with no luck.

Version installed: CodeGear? Delphi? 2007 for Win32? R2 Version 11.0.2902.10471. Operation System: Windows 7 Pro 64bit

Update 08/14 13:35 EDT Tried the following solutions, but still having the same file lock issue:

  1. Renamed Temp Directory to a directory I know had full security rights. Files would be created in this directory when launching Delphi, but EditorLineEnds.ttr would still get locked by SYSTEM and prevent me from relaunching.
  2. Uninstalled the following security updates KB2982791 and KB2976897, but this did not solve the problem. I have suppressed windows updates for now and will try uninstalling all security patches for 8/13.
  3. Uninstalled Delphi completely and re-installed. Problem still occurs after re-installing everything.

I will try reinstalling Windows from scratch and install Delphi before Windows updates to see if updates are truly the cause. My workaround for now is just renaming EditorLineEnds.ttr before launch Delphi.

asked Aug 13 '14 at 20:56
M Schenkel
2,68052760
    
How are you running the program? Running as admin. Elevated? Are you logged in as a user named "Admin"? That seems odd. –  David Heffernan Aug 13 '14 at 21:04
    
Info provided by Jeroen suggests (follow the links to the QC) you may have an additional BDS process running. –  Sertac Akyuz Aug 13 '14 at 21:23
    
I had the same problem. See in Microsoft support support.microsoft.com/kb/2982791 –  user3939195 Aug 13 '14 at 21:39
    
@SertacAkyuz - we made sure using taskmanager there were no other instances of the BDS running. –  M Schenkel Aug 13 '14 at 22:48
6  
Have you tried the IDEFixPack for Delphi 2007? (tinyurl.com/p9rt9ta) It has a patch (since version 2.7) that prevents the IDE from loading the font-file. The IDE still creates the temp file but doesn't lock it. - You have to reboot if the file is already locked before trying the IDEFixPack. –  Andreas Hausladen Aug 14 '14 at 22:07

9 Answers

up vote 28 down vote accepted

There are three solutions to this that I am aware of:

  1. Try uninstalling the Windows security update KB2982791 which was already mentioned by Francisco Caffagni. This solved the issue for me (Windows 8.1 + Delphi 2007) but it might not be such a good idea to uninstall a Windows security update.
  2. Rename the file every time you start Delphi. See below for a simple program that does it for you.
  3. Use Andreas Hausladen's IdeFixpack (Delphi 2007 version, beware that version 4.4 does not work under Windows 8, version 4.3 seems to work), (for later Delphi versions) Note that the editor option Show Lineends will use a different character if you use this fix because the IDE won't load the EditorLineEnds.ttr font any more. (Solution 1 and 2 don't have this drawback, but who uses that option anyway?)

Note: Microsoft withdrew this fix a few days later and issued a new one KB2984615 on 2014-08-27. Unfortunately this did not fix the issue for me. Maybe uninstalling KB2982791 first and then installing KB2984615 might work, but I haven't tried it.

I wrote a simple program, that solves the issue for me:

It uses FindFirstChangeNotification / FindNextChangeNotification and checks whether that file exists and if yes, moves it to a unique subdirectory in %temp%.

Binary download

The source code is available from sourceforge.

answered Aug 14 '14 at 14:39
dummzeuch
5,15211759
1  
The IdeFixPack corrects it. –  M Schenkel Aug 27 '14 at 19:21
1  
There is now a KB2993651 which replaces KB2982791. If anyone knows whether this also causes the issue, please update this answer. –  Jan Doggen Aug 28 '14 at 10:58
    
@JanDoggen Yes.That update KB2993651 triggers the problem again. I've got the same issue now with Delphi 2007 on Windows 7 (for the first time, by the way). IdeFixPack did not fix the issue for me, but uninstalling KB2993651 did. –  GolezTrol Oct 9 '14 at 8:22
    
Okay, that's weird. I de-installed the update after which the problem was gone. Then re-installed it to test if @dummzeuch's tool would also solve the issue, but after I re-installed the update, the problem still didn't occur anymore. So, conclusion for now: de-installing and re-installing the update solves the issue? :-S –  GolezTrol Oct 9 '14 at 8:39
    
Same issue for me, but I have to reboot computer to then delete file (logoff nor Unlocker application do not work). –  kokbira Nov 28 '14 at 19:30

This is my bds_start.bat script running Delphi2006 on Win7-64bit system. I customized GabeMeister answer and similar script found in one of the links. I now can restart DelphiIDE without reboot. All ttr temp files are still locked by system so del command may not work. They are deletable once system is rebooted.

It's however impossible to restart Delphi double clicking myproject.dpr project files. I was afraid to install IDEFixPack for D2006 because one of comments did not promise it to work.

bds_start.bat

@REM http://www./blog/index.php/2014/08/windows-update-disable-delphi-2007-2010/
@REM http:///questions/25295980/delphi-2007-error-cannot-create-file-c-users-admin-appdata-local-temp-editorl
@REM http://docs./products/rad_studio/delphiAndcpp2009/HelpUpdate2/EN/html/devcommon/idecommandline_xml.html

@REM del files created by DelphiIDE, may not able to delete but
@REM moving to a new name is possible. Use unique name by timestamp.
del "%temp%\EditorLineEnds*.ttr"
set dt=%date%_%time:~3,2%-%time:~6,2%
rename "%temp%\EditorLineEnds.ttr" "EditorLineEnds_%dt%.ttr"
start "" "C:\Borland\BDS\4.0\Bin\bds.exe" -pDelphi

Running CBuilder change argument to -pCBuilder. Maybe best fix would be to create bds.exe replacement tool, del/move *.ttr file, run and passthrough cmd arguments to the original bds_original.exe file. This should enable *.dpr double click restarts. Or use BdsLauncher.exe which I think is regedit linked to *.dpr extension. Then process list had bds.exe name.

answered Aug 25 '14 at 15:05
Whome
3,11121517
    
It seems be working for now. After I completed my project without issue I'll write here to use it as simple and good working solution. And one maybe stupid question: are you sure this issue hadn't any disadvantages in final published project? Thanks. –  QMaster Jan 17 at 9:38

Here is another workaround from http://www./blog/index.php/2014/08/windows-update-disable-delphi-2007-2010/

Quote:

you can rollback easy in two ways

1: create a batch file with following lines
wusa /uninstall /kb:2982791
wusa /uninstall /kb:2970228
this batch file you run on start up of windows. but with auto update both updates installs every time

2: disable the KB's from autoupdate
after update goto WindowsUpdatesin your system. disable both KB's so on new updates it will be not installed again

answered Aug 15 '14 at 7:13
Erik Virtel
5362621
    
Uninstalling and permanently disabling a Windows security update might not be the best option. But it's better than not being able to work at all. –  dummzeuch Aug 15 '14 at 7:21
1  
This solution also works for C++ Builder 2006 on Windows 7. –  Eelke Aug 15 '14 at 9:31
2  
The new update 2993651 causes the same issue –  Eelke Aug 29 '14 at 8:46

Just to point out that the KB2982791 update has been withdrawn by Microsoft. The reasons cited appear to be problems with font rendering and system crashes and not this specific issue which, on the face of it, does appear to be the fault of Delphi and is merely exacerbated by the update.

The KB article on the Microsoft site has been updated: http://support.microsoft.com/kb/2982791

Specifically these sections are of interest:

Known issue 2
Microsoft is investigating behavior in which fonts do not render correctly after any of the following updates are installed:
2982791 MS14-045: Description of the security update for kernel-mode drivers: August 12, 2014
2970228 Update to support the new currency symbol for the Russian ruble in Windows
2975719 August 2014 update rollup for Windows RT 8.1, Windows 8.1, and Windows Server 2012 R2
2975331 August 2014 update rollup for Windows RT, Windows 8, and Windows Server 2012

Status
Microsoft has removed the download links to these updates while these issues are being investigated.

Known issue 3
Microsoft is investigating behavior in which systems may crash with a 0x50 Stop error message (bugcheck) after any of the following updates are installed:
2982791 MS14-045: Description of the security update for kernel-mode drivers: August 12, 2014
2970228 Update to support the new currency symbol for the Russian ruble in Windows
2975719 August 2014 update rollup for Windows RT 8.1, Windows 8.1, and Windows Server 2012 R2
2975331 August 2014 update rollup for Windows RT, Windows 8, and Windows Server 2012

This condition may be persistent and may prevent the system from starting correctly.

Status
Microsoft has removed the download links to these updates while these issues are being investigated.

answered Aug 18 '14 at 12:36
    
It appears that a more recent update - KB2993651 - is now causing the same problem: support.microsoft.com/kb/2993651 –  Toby Groves Sep 8 '14 at 8:19

The problem seems to be with Windows Updates installed on 13th August. I tried uninstalling KB2982791 as suggested by the previous poster, but that did not fix the problem. Uninstalling all Windows updates from 13th August did cure the problem however.

answered Aug 14 '14 at 10:09
2  
see update in original post. –  M Schenkel Aug 14 '14 at 17:39

If you are on windows, I made a batch file shortcut for starting Delphi. Basically it is a batch file that changes the name of EditorLineEnds.ttr to the current date time, moves it to a different sub folder, and then starts Delphi.

Here are the contents of my batch script:

SET HOUR=%time:~0,2%
SET dtStamp9=%date:~-4%%date:~4,2%%date:~7,2%_0%time:~1,1%%time:~3,2%%time:~6,2% 
SET dtStamp24=%date:~-4%%date:~4,2%%date:~7,2%_%time:~0,2%%time:~3,2%%time:~6,2%

if "%HOUR:~0,1%" == " " (SET dtStamp=%dtStamp9%) else (SET dtStamp=%dtStamp24%)

if exist "C:\Users\<username here>\AppData\Local\Temp\EditorLineEnds.ttr" (
  echo "Moving EditorLineEnds.ttr"
  MOVE "C:\Users\<username here>\AppData\Local\Temp\EditorLineEnds.ttr" "C:\Users\<username here>\AppData\Local\Temp\ExtraEditorLineEnds\%dtStamp%.ttr"
) else (
  echo "EditorLineEnds.ttr was not found."
)
start "C:\Program Files (x86)\CodeGear\RAD Studio\6.0\bin\bds.exe"
answered Aug 15 '14 at 23:20
    
Deserved 1 point, But for better edited solution check the @Whome answer. –  QMaster Jan 17 at 9:39

The same for CodeGear Delphi 2009 on Windows 7

Uninstalling following windows update 2982791 2970228 wont help.

Using IDE Fix Pack after that will help.

answered Aug 22 '14 at 21:55
Zam
47229

For Delphi 2007, install IDEFixPack 4.4 and add add the following environment variable to the system settings:

IDEFixPack.DisabledPatches=DotNet.GlobalizationSearch

Reboot and it should work. I have 2 desktops with Win 8.1 Pro and its working like a charm!

answered Dec 9 '14 at 19:38

dzEditorLineEndsFix - Cannot create file %Temp%\EditorLineEnd.ttr

This is a small program that fixes the problem introduced by the Windows update KB2982791 with Delphi 2006 to 2010 that causes the error "Cannot create file %Temp%\EditorLineEnds.ttr". It works by moving the file to its own unique subdirectory whenever it is being created.

answered Sep 29 '14 at 8:14
onerkaya
8111

protected by Community? Aug 14 '14 at 11:29

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多