0

We're upgrading a old Windows app which used .NET Framework to a new app which does not (an Electron app). We need to migrate each user's settings from the old app into the new version. The settings are stored in a User.config file using the System.Configuration package in .NET Framework.

How can we reliably get the path of the User.config file created by the prior version of the app from our new app? The path has a long hash or GUID in it (and I assume the path and hash vary in each install and version of windows).

This method works from .NET, but our new app doesn't have .NET: ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.PerUserRoaming).FilePath

scosman
  • 2,343
  • 18
  • 34
  • It is in the project folder for the Net application along with the source files. – jdweng May 20 '17 at 10:02
  • @jdweng that's the config file, not the user specific settings file. I'm looking for the User.config on the user's machine with their personal settings value. – scosman May 20 '17 at 10:04
  • For there to be a local config the application would of been published and installed in the Program Files Folder. – jdweng May 20 '17 at 10:14
  • @jdweng exactly. We have hundreds of thousands of users, and we they update we don't want to lose those settings. – scosman May 20 '17 at 10:16
  • You need to find where the application was installed. The GUID is the location in the registry where giving the path where the application was installed. See if this posting helps : http://stackoverflow.com/questions/837488/how-can-i-get-the-applications-path-in-a-net-console-application – jdweng May 20 '17 at 10:21

0 Answers0