Recent

Author Topic: LHelp causes error on exit  (Read 983 times)

johnmc

  • New Member
  • *
  • Posts: 47
LHelp causes error on exit
« on: August 30, 2022, 03:14:38 pm »
I am getting a error message when exiting LHelp (CHM File Viewer) it is unable to write to a file ...\AppData\local\lhelp\lhelp-lazhelp.co.... Access is denied.

Why would it even need to access this file or directory if it existed which it doesn't.

John

dsiders

  • Hero Member
  • *****
  • Posts: 726
Re: LHelp causes error on exit
« Reply #1 on: August 30, 2022, 05:38:41 pm »
I am getting a error message when exiting LHelp (CHM File Viewer) it is unable to write to a file ...\AppData\local\lhelp\lhelp-lazhelp.co.... Access is denied.

Why would it even need to access this file or directory if it existed which it doesn't.

John

It is trying to write its configuration file: lhelp-lazhelp.conf.

Which Lazarus version?
Which Windows version?
Did you install Lazarus using a user account different than the one receiving the error?
Have you tried disabling virus protection to see if the error goes away?



Preview Lazarus 2.3.0 documentation at: https://dsiders.gitlab.io/lazdocsnext

johnmc

  • New Member
  • *
  • Posts: 47
Re: LHelp causes error on exit
« Reply #2 on: August 30, 2022, 06:13:27 pm »
A sorry should have included that info.
Lazarus 2.2.2 (rev lazarus_2_2_2) FPC 3.2.2 x86_64-win64-win32/win64
Windows 7 Pro.


wp

  • Hero Member
  • *****
  • Posts: 10298
Re: LHelp causes error on exit
« Reply #3 on: August 30, 2022, 10:29:05 pm »
What did you do when this error happened? I opened LHelp by clicking into the "classes" in the uses clause of the default empty project and pressing Ctrl+F1. The help file opened, and I navigated a bit in the help file. Then I closed LHelp and did not experience any error. I used the same Lazarus/LHelp version as you, only on Win 11.

P.S.
I wonder why LHelp writes is configuration into the system's config folder, rather than into the Lazarus config folder. This causes a problem when multiple Lazarus installations are on a system as secondary installations, and all these installations access the same LHelp config which, for example, contains a list of the recently opened help files stored as full paths. Therefore, I guess it could happen that I unknowingly open the chm files of other installations...

There are two types of conf files in the %appdata% config folder: a lhelp-standalone.conf written when LHelp is used as a stand-alone application, and a lhelp-lazhelp.conf written when LHelp is opened by Lazarus. I think the latter one should be written to the Lazarus configuration of the version which opened LHelp.

johnmc

  • New Member
  • *
  • Posts: 47
Re: LHelp causes error on exit
« Reply #4 on: August 31, 2022, 12:13:29 pm »
I open LHelp by clicking into the "classes" in the uses section of my program, the press F1, Ctl+F1 does nothing. I can navigate around the various sections of the LHelp. Selecting either Menu File>Exit or Alt+F4 , or selecting the x in the top right and then yes to really exit all result in a the error.

I have only one installation of Lazarus and I was was the installer ( not installed as administrator). the installation is in the default location c:\Lazarus.

wp

  • Hero Member
  • *****
  • Posts: 10298
Re: LHelp causes error on exit
« Reply #5 on: August 31, 2022, 12:39:28 pm »
This is the same that I am doing (except for the F1/Ctrl+F1 difference which is because I use the classic keyboard layout).

Does the lhelp-lazhelp.conf file already exist in c:\users\<your name>\appdata\local\lhelp? If yes is it write-protected (check in the Explorer)? Can you create some arbitrary file in this folder from the Explorer?

What happens when you run LHelp separately from the IDE? It is in folder components/chmhelp/lhelp of your Lazarus installation. You can also load the lhelp project from this folder in the IDE and debug it to find out where exactly the issue happens.

johnmc

  • New Member
  • *
  • Posts: 47
Re: LHelp causes error on exit
« Reply #6 on: September 01, 2022, 12:55:29 pm »
There is no file or directory  "c:\users\<your name>\appdata\local\lhelp"!

Outside of the IDE LHelp opens but has no contents but does not create the error on closing.

wp

  • Hero Member
  • *****
  • Posts: 10298
Re: LHelp causes error on exit
« Reply #7 on: September 01, 2022, 01:48:45 pm »
There is no file or directory  "c:\users\<your name>\appdata\local\lhelp"!
This directory is created automatically with the config file when LHelp closes. Just to make sure: you did replace the "<your name>" in the path by your user name in Windows? Do the parent directories appdata and appdata\local of lhelp exist in the c:\users\<your name>? Or did you reconfigure Windows to point the user config directory (c:\users\<your name>) to somewhere else?

Outside of the IDE LHelp opens but has no contents but does not create the error on closing.
You can navigate to the Lazarus help directory ( folder docs\chm in your Lazarus installation) and open one of the chm files manually. When you close LHelp it should create the folder c:\users\<your name>\appdata\local\lehlp (if it does not exist) and write the lhelp-standalone.conf file to it.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 10402
  • FPC developer.
Re: LHelp causes error on exit
« Reply #8 on: September 01, 2022, 02:22:03 pm »
It might be some complicated setup for e.g. educational (lab) PCs that only allow to store on the net (roaming).

But this will break more programs than just lazarus lhelp. Maybe best would be to check if local writing succeeds and try roaming otherwise.

johnmc

  • New Member
  • *
  • Posts: 47
Re: LHelp causes error on exit
« Reply #9 on: September 01, 2022, 02:41:18 pm »
You can navigate to the Lazarus help directory ( folder docs\chm in your Lazarus installation) and open one of the chm files manually. When you close LHelp it should create the folder c:\users\<your name>\appdata\local\lehlp (if it does not exist) and write the lhelp-standalone.conf file to it.
Not present and not created with standalone LHelp. But no errors on exit.


It might be some complicated setup for e.g. educational (lab) PCs that only allow to store on the net (roaming).

No just my personal laptop.



marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 10402
  • FPC developer.
Re: LHelp causes error on exit
« Reply #10 on: September 01, 2022, 03:51:48 pm »
It might be some complicated setup for e.g. educational (lab) PCs that only allow to store on the net (roaming).

No just my personal laptop.

If it is a standard install then it is weird and not normal. Probably the old bogeyman antivirus or multiple lhelp instances (does lhelp have a single instance policy?)

johnmc

  • New Member
  • *
  • Posts: 47
Re: LHelp causes error on exit
« Reply #11 on: September 01, 2022, 08:42:52 pm »
I have found the problem. Somehow the directory and files in it were hidden and read only.

Now fixed, I hope.

MarkMLl

  • Hero Member
  • *****
  • Posts: 5596
Re: LHelp causes error on exit
« Reply #12 on: September 01, 2022, 09:51:20 pm »
I have found the problem. Somehow the directory and files in it were hidden and read only.

I wonder why that was a problem?

I've certainly seen alignment issues in lhelp but I'd have thought that provided the relevant files existed it should have worked.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

johnmc

  • New Member
  • *
  • Posts: 47
Re: LHelp causes error on exit
« Reply #13 on: September 02, 2022, 02:45:51 pm »
I have found the problem. Somehow the directory and files in it were hidden and read only.

I wonder why that was a problem?

I've certainly seen alignment issues in lhelp but I'd have thought that provided the relevant files existed it should have worked.

MarkMLl

If its trying to write to a readonly files then that should be a problem.

My concern is why were they set as readonly, I don't think that its lhelp because there were a lot of other directories set as readonly, anyway now they are visible and read/write. I will keep an eye on them.

John

Arioch

  • Sr. Member
  • ****
  • Posts: 415
Re: LHelp causes error on exit
« Reply #14 on: October 01, 2022, 04:07:24 pm »
I wonder why that was a problem?

just a blind shot:  LHelp was first run out of the installer, so it was running "with root privileges" (UAC elevated user in Vista+ terms, admin user in XP- terms), and all the files created by it in the session inherited this admin-only credentials. Then regular user program indeed can not touch it.

Was hits when making a trial box program, the installer had a checkbox to immediately run the program, but then it no more could be executed by restricted users ever again


Quote
I've certainly seen alignment issues in lhelp but I'd have thought that provided the relevant files existed it should have worked.

My AppData\Local\lhelp\lhelp-lazhelp.conf is writeable, yet i see broken layouts too. Not related.

My guess is different though, but it is a blind guess too, i did not looked into details.
I think they use bleeding edge HTML/JS/CSS generated for recent Chrome, yet LHelp itself uses some old limited rendered, like THTMLFrame with its HTML 3.x internals. Just a guess though.
« Last Edit: October 01, 2022, 04:11:23 pm by Arioch »

 

TinyPortal © 2005-2018