Closed gbakeman closed 7 months ago
same for me , i installed new version on 2.3.8800 where was setting backup and moved , but now again its asking for setting to backup and move ...
@masterwishx Looks like this may be fixed now, go ahead and update WinNUT and your settings should carry over now. Let me know in here if the issues persist.
@masterwishx Looks like this may be fixed now, go ahead and update WinNUT and your settings should carry over now. Let me know in here if the issues persist.
Working Fine now
The default form of Application Settings (File) will only automatically upgrade when using a pure ClickOnce installation. In order to have a smooth user experience, we need to manually call the
Upgrade
method to carry over the old version of Settings.Todo
Notes
Data directory and application versions
It seems that this copy operation is not happening. Most likely because we are still using the MSI for deployment rather than true ClickOnce.
In the meantime, figure out how to do this custom data migration work.
ClickOnce and application settings
Even though we are using the standard application settings class, we may need to either call or modify the Upgrade method.
According to the Upgrade method of the LocalFileSettingsProvider...
Each version of a ClickOnce application is stored in its own isolated installation directory. After a new version of a ClickOnce application is installed, and when the new version is first run, internal logic will automatically call Upgrade to migrate all common application settings to the new version. For more information, see ClickOnce and Application Settings.
Standard Windows Forms and console applications must manually call Upgrade, because there is not a general, automatic way to determine when such an application is first run. The two common ways to do this are either from the installation program or using from the application itself, using a persisted property, often named something like IsFirstRun.
As long as we deploy the Setup Project MSI type, we'll need to manually run the Upgrade method with Default settings to try and detect a previous version, unless the Setup project is modified to run this procedure manually.
Alternate solution - trigger settings upgrade from MSI upgrade
It seems that detecting an upgrade installation from the MSI its self is difficult and requires modifying the MSI post-build. May be best to stick to the previous suggestion from Microsoft - use a persisted property in the Settings.