From 981f67ee0187f571f027f4f0177cefede8f8867f Mon Sep 17 00:00:00 2001 From: "avihal@gmail.com" Date: Fri, 25 Mar 2011 07:21:59 +0000 Subject: [PATCH] Portable mode: standard install can now be converted to portable. Note: All files outside of pcsx2.exe folder (e.g. snapshots, memcards, bios, saved states, etc at "my documents" folder) are NOT copied automatically to the pcsx2 relative folders. So, if converting from standard install to portable and you want to keep those files, you have to copy them manually. Bottom line: if portable mode is preferred/required, it's best to start in portable. This way no files are ever written outside of pcsx2.exe main folder (at least, that's how it should work). git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4489 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/gui/AppConfig.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/pcsx2/gui/AppConfig.cpp b/pcsx2/gui/AppConfig.cpp index 7b72094846..e968196235 100644 --- a/pcsx2/gui/AppConfig.cpp +++ b/pcsx2/gui/AppConfig.cpp @@ -629,16 +629,17 @@ void AppConfig::FolderOptions::LoadSave( IniInterface& ini ) IniBitBool( UseDefaultLangs ); IniBitBool( UseDefaultPluginsFolder ); - if( !ini.IsSaving() || !(InstallationMode==InstallMode_Portable) ) - {//when saving in portable mode, we skip these entries, as they cannot be modified anyway. + //when saving in portable mode, we save empty strings // --> on load they'll be initialized to default (relative) paths - IniEntry( Bios ); - IniEntry( Snapshots ); - IniEntry( Savestates ); - IniEntry( MemoryCards ); - IniEntry( Logs ); - IniEntry( Langs ); - } + bool rel = ( ini.IsSaving() && (InstallationMode==InstallMode_Portable) ); + wxDirName e(L""); + + ini.Entry( L"Bios", rel?e:Bios, Bios ); + ini.Entry( L"Snapshots", rel?e:Snapshots, Snapshots ); + ini.Entry( L"Savestates", rel?e:Savestates, Savestates ); + ini.Entry( L"MemoryCards", rel?e:MemoryCards, MemoryCards ); + ini.Entry( L"Logs", rel?e:Logs, Logs ); + ini.Entry( L"Langs", rel?e:Langs, Langs ); IniEntry( RunIso ); IniEntry( RunELF ); @@ -667,6 +668,7 @@ void AppConfig::FilenameOptions::LoadSave( IniInterface& ini ) //when saving in portable mode, we just save the non-full-path filename // --> on load they'll be initialized with default (relative) paths (works both for plugins and bios) + //note: this will break if converting from install to portable, and custom folders are used. We can live with that. bool needRelativeName = ini.IsSaving() && (InstallationMode==InstallMode_Portable); for( int i=0; i