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
This commit is contained in:
avihal@gmail.com 2011-03-25 07:21:59 +00:00
parent 22c1b30ed6
commit 981f67ee01
1 changed files with 11 additions and 9 deletions

View File

@ -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<PluginId_Count; ++i )