HandheldCompanion
HandheldCompanion copied to clipboard
Installing newer version over existing one resets user settings
As title installing newer version over existing one resets user settings like run at startup and enable notification i.e. existing settings are not respected. Did not check this for profiles, could be also relevant there.
Should be fixed with the new configuration save implementation, requires testing.
Recently users, have still reported this to be an issue, for example, not keeping the dark theme setting.
0.12.4.0 still has this issue.
I checked this a bit, it seems more of a problem with Inno setup @Valkirie . ChatGPT offered the following suggestion:
To prevent a new app.settings file from being created every time your C# WPF application is installed using Inno Setup, you can modify the Inno Setup script to preserve the existing app.settings file if it already exists. Here's an example:
Open your Inno Setup script and locate the [Files] section.
Add the following line to the [Files] section:
Source: "app.settings"; DestDir: "{app}"; Flags: onlyifdoesntexist
This line specifies that the app.settings file should only be copied if it doesn't already exist in the installation directory.
Locate the [Code] section in your Inno Setup script.
Add the following code to the [Code] section:
function InitializeSetup(): Boolean;
var
SettingsFile: string;
begin
Result := True;
SettingsFile := ExpandConstant('{app}\app.settings');
if FileExists(SettingsFile) then
begin
Log('Existing app.settings file found, preserving it.');
Result := False;
end;
end;
This code defines the InitializeSetup function, which checks if the app.settings file already exists in the installation directory. If the file exists, it logs a message and cancels the installation process to preserve the existing file.
With these modifications, the Inno Setup script will only copy the app.settings file if it doesn't already exist in the installation directory. If an app.settings file is found during installation, it will be preserved, preventing the creation of a new file.
Still the same issue with the yesterday's release.
@shanoor yes, nothing was changed recently to improve or fix this one.
This is fixed with release 0.18.0.2 (woohoooo!!!!), however it won't take effect until the install after that.
Closing, this has been fixed. 😄