PC shutdown without closing Lazarus lazarus / 21-General ---------------------------------------------------------------------- bobby100 · 2023-03-26 17:38 Today, I've left my laptop on, with Lazarus running. When the battery got empty, the Windows 10 did a shutdown, just as expected. After starting the laptop again, the Lazarus installation was messed up to the point that I could not start Lazarus anymore. I got the dialog where it says something about the configuration, and at clicking on Next it just got stuck (tried á couple of times). Installing Lazarus over the existing installation didn't help. Next step, rename the directory c:\Users\{user_name}\AppData\Local\lazarus\ got me to the clean Lazarus without my settings and installed components. Inspecting the old files (before re-installing Lazarus) from that directory - the file environmentoptions.xml was 64kb in size, but full of zeros. Other files in the directory seems to be OK. I wish that Lazarus could be more resistant to such forced shutdowns. ---------------------------------------------------------------------- jamie · 2023-03-26 18:46 I suppose Laz should at least do an auto save at that point, at least if you are working on a ready started project, not something you haven't even saved with a new name yet. ---------------------------------------------------------------------- Martin_fr · 2023-03-26 19:46 A file full of #0 would imho imply that the IDE tried to write the file, but never got to finish it. The file is afaik normally read on start, but not held open. So if Lazarus had just been killed, without writing the file, then the file should be fine. It must have tried to write it (be that because of the shutdown or other). Since it can happen that writing a file fails, maybe it should rename the old file first to a backup. Then something to restore would exist....