Вопрос

Let's say I made a program that is without installer (only exe file) and its save some data on settings. What will happen if i delete that exe file? Will the settings delete automatically? If no can you give me some suggestions?

Это было полезно?

Решение

Application settings are stored in a file name <exename>.exe.config near the executable file. For example if your executable is MyApp.exe, the configuration file is MyApp.exe.config. So they are stored in different files.

If you change a user-level setting (application-level settings are read-only) and save the settings (Settings.Default.Save()), the changed values are stored in a file named user.config in a subfolder in %LOCALAPPDATA% folder (see this answer for more information). So if you delete the application folder, the changed settings are not deleted.

Другие советы

No, settings won't be removed if you just delete the EXE. Settings also will not be removed by an MSI if they have been modified since the program was installed. A custom action would allow you to remove the file during uninstallation however.

No, it won't.

The settings are stored in a separate file.
The best way is to make an installer/uninstaller.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top