RickStrahl / MarkdownMonster

An extensible Markdown Editor, Viewer and Weblog Publisher for Windows
https://markdownmonster.west-wind.com
Other
1.59k stars 235 forks source link

It is very frustrating that every time you start `MM` and exit `MM`, `MM` initializes the settings file causing user settings to be lost. #1129

Closed zhouxinghong closed 4 days ago

zhouxinghong commented 3 months ago

It is very frustrating that every time you start MM and exit MM, MM initializes the settings file causing user settings to be lost.

Hi friend! It is very frustrating that MM initializes the MarkdownMonster-KeyBindings.json and MarkdownMonster.json files every time you start MM and exit MM resulting in a loss of user settings.

https://github.com/user-attachments/assets/9ff1032c-7018-47d9-a206-2ed39ca42b39

Windows 10 19044 MM 3.4.0 File Path F:\tool\MarkdownMonsterPortable\PortableSettings

RickStrahl commented 2 months ago

I can't duplicate what you describe.

Since you're using the portable version, you need to have permissions to write files in the folder if you use the Portable version. If you can't figure that out, use the full version instead and it'll put it into a location that is writable.

Markdown Monster Portable Version Documentation

zhouxinghong commented 2 months ago

The same thing happens even if you install the full version of Markdown Monster.exe... You can try...

RickStrahl commented 2 months ago

Well I don't know - look at the file dates. If they are not updating after exiting then there's a problem writing out the configuration.

I have no issues with saved settings and I've not seen anybody complaining that the settings are not updating

Look where the settings are actually going to in your Settings:

image

This will point at the actual location that is being used when MM is running and this is the folder that has to have permissions for your account to be writing.

zhouxinghong commented 2 months ago

Thank you very much for your answer! Or I will re-download Markdown Monster.exe to see if the situation will improve. . .

zhouxinghong commented 2 months ago

There is another problem that you need to fix. https://github.com/RickStrahl/MarkdownMonster/issues/1130

zhouxinghong commented 2 months ago

I re-installed Markdown Monster.exe. image

image

zhouxinghong commented 2 months ago

This is the latest problem reproduction process.

https://github.com/user-attachments/assets/a5b2cc75-fb7a-4e7e-bea0-d03e86af3a9d

When I started the Markdown Monster program, the MarkdownMonster-KeyBindings.json file was reset.

When I closed the Markdown Monster program, the MarkdownMonster.json file was reset.

RickStrahl commented 1 month ago

Don't know what to tell you.

I can't duplicate any of that. Perhaps you have Anti-Virus keeping you from writing out updates to files in that folder.

I've not heard this from anybody else, and it certainly isn't happening on my end. MarkdownMonster.json gets re-written with current settings when MM is shut down. The keybindings file is written after loading keys. If the keybindings file has invalid data in it it will re-write as default. Same with the main configuration file. But once it's been re-written any changes you make should be written and that should be valid.

If that's not working I don't know what would cause that from MM's end unless there's something else interfering on your system. If old files are being re-written I would suspect anti-virus.

zhouxinghong commented 1 month ago

You just need to change the write mode of program startup, program shutdown, and program exit to read-only mode only, and all problems are solved.

zhouxinghong commented 1 month ago

You just need to change the write mode of the MarkdownMonster-KeyBindings.json and MarkdownMonster.json files at program startup, program shutdown, and program exit to read-only mode, and all problems will be solved.

RickStrahl commented 1 month ago

No - those locations should be writable in the system. If you files are not writable or read-only for some crazy reason in your configuration that's up for you to fix.

Those folders are explicitly designed to support writable user data per Windows specs.

pa-0 commented 5 days ago

This may help. Open a command prompt. (You might need to run as administrator). Use the following command to reset the permissions for the "Markdown Monster" folder in the Roaming folder:

icacls "%AppData%\Markdown Monster" /reset /t /c /l

I would run the command in a regular command prompt first (unelevated) before running as admin.

RickStrahl commented 4 days ago

@pa-0 Wonder what would reset the permissions in those folders in the first place.

If I had to guess I'd say it's some sort of Anti-Virus screwery that's doing this.

Regardless, that's not something that MM can or should fix - that's a system configuration issue, so closing.