.net - How to move an 'user.config' file from source PC to target PC preserving its settings? -
i have 3rd party application, remove empty directories aka red can downloaded here:
http://sourceforge.net/projects/rem-empty-dir/files/?source=navbar
the user settings of application follows standard .net settings infrastructure, saves settings in directory this:
...\appdata\local\red2\red2.ex_url_ilre4odeu2sx2xsqyulyx2jybty45cd5\2.2.0.0
my problem make ignore_directories
setting perssistent inside user.config file when move application folder pc, mean preserve user settings of source pc when move app , settings file target pc, of course can't copy folder stores user.config file because user.config settings automatically stored in new folder new hash totally different source pc, old user.config file in target pc ignored ...not recognized.
this default content of user.config file:
<?xml version="1.0" encoding="utf-8"?> <configuration> <configsections> <sectiongroup name="usersettings" type="system.configuration.usersettingsgroup, system, version=2.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089" > <section name="red2.properties.settings" type="system.configuration.clientsettingssection, system, version=2.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089" allowexedefinition="machinetolocaluser" requirepermission="false" /> </sectiongroup> </configsections> <usersettings> <red2.properties.settings> <setting name="last_used_directory" serializeas="string"> <value>c:\users\administrador\appdata\local\red2\red2.ex_url_ilre4odeu2sx2xsqyulyx2jybty45cd5\</value> </setting> <setting name="infinite_loop_detection_count" serializeas="string"> <value>10</value> </setting> <setting name="pause_between" serializeas="string"> <value>80</value> </setting> <setting name="max_depth" serializeas="string"> <value>-1</value> </setting> <setting name="ignore_directories" serializeas="string"> <value>system volume information recycler papierkorb recycled ntuninstall $recycle.bin gac_msil</value> </setting> </red2.properties.settings> </usersettings> </configuration>
this content make perssistent/portable:
<?xml version="1.0" encoding="utf-8"?> <configuration> <configsections> <sectiongroup name="usersettings" type="system.configuration.usersettingsgroup, system, version=2.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089" > <section name="red2.properties.settings" type="system.configuration.clientsettingssection, system, version=2.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089" allowexedefinition="machinetolocaluser" requirepermission="false" /> </sectiongroup> </configsections> <usersettings> <red2.properties.settings> <setting name="last_used_directory" serializeas="string"> <value>c:\</value> </setting> <setting name="infinite_loop_detection_count" serializeas="string"> <value>10</value> </setting> <setting name="ignore_0kb_files" serializeas="string"> <value>false</value> </setting> <setting name="pause_between" serializeas="string"> <value>80</value> </setting> <setting name="max_depth" serializeas="string"> <value>-1</value> </setting> <setting name="keep_system_folders" serializeas="string"> <value>false</value> </setting> <setting name="ignore_directories" serializeas="string"> <value>$recycle.bin c:\program files\windowsapps\microsoft.winjs.2.0_1.0.9600.16384_neutral__8wekyb3d8bbwe\microsoft.system.package.metadata c:\programdata\microsoft\crypto c:\programdata\microsoft\device stage c:\programdata\microsoft\drm c:\programdata\microsoft\identitycrl c:\programdata\microsoft\rac\temp c:\programdata\microsoft\windows\drm c:\programdata\microsoft\windows\sqm c:\programdata\microsoft\windows\start menu c:\users\administrador\appdata\local\microsoft\clr_v2.0 c:\users\administrador\appdata\local\microsoft\feeds cache c:\users\administrador\appdata\local\microsoft\windows\appcache c:\users\administrador\appdata\local\microsoft\windows\application shortcuts c:\users\administrador\appdata\local\microsoft\windows\burn c:\users\administrador\appdata\local\microsoft\windows\explorer\thumbcachetodelete c:\users\administrador\appdata\local\microsoft\windows\inetcache\ie c:\users\administrador\appdata\local\microsoft\windows\notifications c:\users\administrador\appdata\roaming\microsoft\crypto c:\users\administrador\appdata\roaming\microsoft\internet explorer\quick launch c:\users\administrador\appdata\roaming\microsoft\systemcertificates c:\users\administrador\appdata\roaming\microsoft\windows\accountpictures c:\users\administrador\appdata\roaming\microsoft\windows\network shortcuts c:\users\administrador\appdata\roaming\microsoft\windows\printer shortcuts c:\users\administrador\appdata\roaming\microsoft\windows\recent c:\users\administrador\appdata\roaming\microsoft\windows\start menu c:\users\default\appdata\local\microsoft\windows c:\users\default\appdata\roaming\microsoft\windows c:\users\public c:\windows\assembly c:\windows\downloaded program files c:\windows\help c:\windows\immersivecontrolpanel c:\windows\installer c:\windows\logs c:\windows\microsoft.net\assembly c:\windows\offline web pages c:\windows\resources\themes\aero c:\windows\serviceprofiles c:\windows\servicing c:\windows\system32\catroot c:\windows\system32\config\systemprofile\appdata\local\microsoft\clr_v4.0 c:\windows\system32\config\systemprofile\appdata\local\microsoft\windows c:\windows\system32\config\systemprofile\appdata\roaming\microsoft\systemcertificates c:\windows\system32\driverstore\temp c:\windows\system32\logfiles c:\windows\system32\microsoft\crypto c:\windows\system32\proximitytoast c:\windows\system32\rastoast c:\windows\syswow64\config\systemprofile\appdata\local\microsoft\clr_v4.0_32 c:\windows\syswow64\config\systemprofile\appdata\locallow\microsoft c:\windows\syswow64\driverstore\filerepository c:\windows\syswow64\proximitytoast c:\windows\syswow64\rastoast c:\windows\temp c:\windows\winsxs\backup c:\windows\winsxs\installtemp c:\windows\winsxs\temp system volume information</value> </setting> <setting name="delete_stats" serializeas="string"> <value>3496</value> </setting> </red2.properties.settings> </usersettings> </configuration>
my question is, can override settings file properties or other workaround make user.config file portable avoiding problem of directory hash?
well, i'm pretty sure possibly because did in past user.config file of .net app, can't remember did because lot of trial , error, think did creating new app.config file in same directory of application folder , copying full content of user.config stored in appdata directory new app.config file in app's working dir, editing @ desire properties inside app.config file preserve custom default value when app creates user.config in appdata directory first time ran, technique didn't worked time application red2.exe.
i tried basic ideas adding user.config in same folder red2.exe stored adding in file configuration like, did same thing creating app.config, worked, maybe did wrong during procedure.
it easier if have access code. red2 code available on github here. may download , tweak bit suit purpose.
this not link-only answer. solution specific problem, access code best solution in case. sharing link publically available codebase know.
Comments
Post a Comment