HandheldCompanion icon indicating copy to clipboard operation
HandheldCompanion copied to clipboard

Installing newer version over existing one resets user settings

Open CasperH2O opened this issue 3 years ago • 1 comments

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.

CasperH2O avatar Feb 10 '22 11:02 CasperH2O

Should be fixed with the new configuration save implementation, requires testing.

CasperH2O avatar Apr 27 '22 06:04 CasperH2O

Recently users, have still reported this to be an issue, for example, not keeping the dark theme setting.

CasperH2O avatar Nov 05 '22 05:11 CasperH2O

0.12.4.0 still has this issue.

zomgugoff avatar Nov 12 '22 22:11 zomgugoff

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.

CasperH2O avatar Jun 05 '23 08:06 CasperH2O

Still the same issue with the yesterday's release.

shanoor avatar Jun 30 '23 15:06 shanoor

@shanoor yes, nothing was changed recently to improve or fix this one.

CasperH2O avatar Jun 30 '23 15:06 CasperH2O

This is fixed with release 0.18.0.2 (woohoooo!!!!), however it won't take effect until the install after that.

CasperH2O avatar Sep 06 '23 08:09 CasperH2O

Closing, this has been fixed. 😄

CasperH2O avatar Nov 12 '23 11:11 CasperH2O