Subversion Repositories spk

Rev

Rev 133 | Rev 160 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 133 Rev 158
Line 188... Line 188...
188
	if ( File::Exists(mydoc + "\\Egosoft\\pluginmanager_load.dat") )
188
	if ( File::Exists(mydoc + "\\Egosoft\\pluginmanager_load.dat") )
189
		File::Delete(mydoc + "\\Egosoft\\pluginmanager_load.dat");
189
		File::Delete(mydoc + "\\Egosoft\\pluginmanager_load.dat");
190
	if ( File::Exists(tempDir + "\\AutoUpdater_old.exe") )
190
	if ( File::Exists(tempDir + "\\AutoUpdater_old.exe") )
191
		File::Delete(tempDir + "\\AutoUpdater_old.exe");
191
		File::Delete(tempDir + "\\AutoUpdater_old.exe");
192
 
192
 
193
	packages.Startup(".", CyStringFromSystemString(tempDir), CyStringFromSystemString(mydoc), "");
193
	packages.startup(".", _S(tempDir), _S(mydoc), "");
194
	packages.SetRenameText(true);
194
	packages.SetRenameText(true);
195
 
195
 
196
	// Create the main window and run it
196
	// Create the main window and run it
197
	MainGui ^gui = gcnew MainGui(&packages, &dirList, &remDirList, Advanced);
197
	MainGui ^gui = gcnew MainGui(&packages, &dirList, &remDirList, Advanced);
198
	gui->AddGameArgs(gameArgs);
198
	gui->AddGameArgs(gameArgs);
Line 264... Line 264...
264
					gui->SetIgnoreJoy(rest.toInt());
264
					gui->SetIgnoreJoy(rest.toInt());
265
				else if ( cmd == "savegamemanager" )
265
				else if ( cmd == "savegamemanager" )
266
					gui->SetSaveGameManager(rest.toInt());
266
					gui->SetSaveGameManager(rest.toInt());
267
				else if ( cmd == "restoremodified" ) {
267
				else if ( cmd == "restoremodified" ) {
268
					CPackages p;
268
					CPackages p;
269
					p.Startup(".", CyStringFromSystemString(tempDir), CyStringFromSystemString(mydoc), "");
269
					p.startup(".", _S(tempDir), _S(mydoc), "");
270
					if ( p.Read(rest) ) {
270
					if ( p.Read(rest) ) {
271
						p.SetVanilla(false);
271
						p.SetVanilla(false);
272
						p.PrepareEnableFromVanilla();
272
						p.PrepareEnableFromVanilla();
273
						p.EnablePreparedPackages(0, 0, 0);
273
						p.EnablePreparedPackages(0, 0, 0);
274
						p.CloseDir();
274
						p.CloseDir();
Line 328... Line 328...
328
				packages.RemoveUnusedSharedFiles();
328
				packages.RemoveUnusedSharedFiles();
329
		}
329
		}
330
		packages.CloseDir(0, 0, true);
330
		packages.CloseDir(0, 0, true);
331
	}
331
	}
332
 
332
 
333
	CyStringList restoreModified;
333
	Utils::CStringList restoreModified;
334
	if ( gui->GetDownloadFile() )
334
	if ( gui->GetDownloadFile() )
335
	{
335
	{
336
		if ( System::IO::File::Exists(".\\AutoUpdater.exe") )
336
		if ( System::IO::File::Exists(".\\AutoUpdater.exe") )
337
		{
337
		{
338
			// rename the autoupdater
338
			// rename the autoupdater
Line 393... Line 393...
393
				System::Diagnostics::ProcessStartInfo ^info = gcnew System::Diagnostics::ProcessStartInfo(dir + "\\GameLauncher.exe");
393
				System::Diagnostics::ProcessStartInfo ^info = gcnew System::Diagnostics::ProcessStartInfo(dir + "\\GameLauncher.exe");
394
				if ( info )
394
				if ( info )
395
				{
395
				{
396
					if ( packages.GetCurrentGameFlags() & EXEFLAG_ADDON ) {
396
					if ( packages.GetCurrentGameFlags() & EXEFLAG_ADDON ) {
397
						CPackages p;
397
						CPackages p;
398
						p.Startup(".", CyStringFromSystemString(tempDir), CyStringFromSystemString(mydoc), "");
398
						p.startup(".", _S(tempDir), _S(mydoc), "");
399
						CyString baseDir = CFileIO(CyStringFromSystemString(gui->GetRunFile())).dir();
399
						Utils::String baseDir = CFileIO(_S(gui->GetRunFile())).dir();
400
						if ( p.Read(baseDir) ) {
400
						if ( p.Read(baseDir) ) {
401
							if ( !p.IsVanilla() ) {
401
							if ( !p.IsVanilla() ) {
402
								p.SetVanilla(true);
402
								p.SetVanilla(true);
403
								p.PrepareDisableForVanilla();
403
								p.PrepareDisableForVanilla();
404
								p.EnablePreparedPackages(0, 0, 0);
404
								p.EnablePreparedPackages(0, 0, 0);
405
								restoreModified.PushBack(baseDir);
405
								restoreModified.pushBack(baseDir);
406
							}
406
							}
407
							p.CloseDir();							
407
							p.CloseDir();							
408
						}
408
						}
409
					}
409
					}
410
 
410
 
Line 483... Line 483...
483
		if ( tips == -1 )
483
		if ( tips == -1 )
484
			continue;
484
			continue;
485
		writeLines.push_back(Utils::String("Tips: ") + (long)i + " " + (long)tips);
485
		writeLines.push_back(Utils::String("Tips: ") + (long)i + " " + (long)tips);
486
	}
486
	}
487
 
487
 
488
	for ( SStringList *rm = restoreModified.Head(); rm; rm = rm->;next ) {
488
	for (auto rm = restoreModified.begin(); rm != restoreModified.end(); rm++) {
489
		writeLines.push_back("RestoreModified: " + rm->str.ToString());
489
		writeLines.push_back("RestoreModified: " + (*rm)->data);
490
	}
490
	}
491
 
491
 
492
	// write settings
492
	// write settings
493
	configFile.writeFile(&writeLines);
493
	configFile.writeFile(&writeLines);
494
 
494