--- AE/Installer/trunk/source/main_window.cpp 2009/07/06 00:59:40 385 +++ AE/Installer/trunk/source/main_window.cpp 2009/07/06 19:18:00 396 @@ -1,3 +1,15 @@ +#ifndef NTDDI_VERSION +#define NTDDI_VERSION NTDDI_WIN7 +#endif +#ifdef WIN32 + #include +#include +HWND Handle; + +ITaskbarList *pTaskbarList; +ITaskbarList3 *pTaskbarList3; +#endif + /* AE/Mod Installer by Gumby and Iritscen @@ -58,6 +70,17 @@ using namespace std; #include "boost/date_time/date_parsing.hpp" #include "boost/date_time/posix_time/posix_time.hpp" +string escapePath(string input) { + + string output; + string escape_me = "& ;()|<>\"'\\#*?$"; + for(int i = 0; i < input.size(); i++) { + for(int j = 0; j < escape_me.size(); j++) if (input[i] == escape_me[j]) output += '//'; + output += input[i]; + } + return output; +} + int globalizeData(void) { busy = 1; @@ -148,7 +171,6 @@ int globalizeData(void) if (exists("packages/VanillaDats")) remove_all("packages/VanillaDats"); create_directory( "packages/VanillaDats" ); - create_directory( "packages/VanillaDats/level0_Final/" ); //blah blah finish this. //logfile << "packages/VanillaDats/level0_Final/ created"; @@ -261,6 +283,12 @@ int globalizeData(void) if(!exists( Archive / dir_itr->filename())) rename(dir_itr->path(), Archive / dir_itr->filename()); else remove(dir_itr->path()); } + else if (dir_itr->path().filename().substr(0,4) == "ONWC") { //fix for buggy ONWC overriding + cout <path().filename() << "\n"; + + if(!exists( "packages/VanillaDats/level" + levels[i] + "_Final/level" + levels[i] + "_Final/" + dir_itr->filename())) rename(dir_itr->path(), "packages/VanillaDats/level" + levels[i] + "_Final/level" + levels[i] + "_Final/" + dir_itr->filename()); + else remove(dir_itr->path()); + } if (exists(dir_itr->path())) { } @@ -290,7 +318,7 @@ int globalizeData(void) logfile << (strOniSplit + " " + strImportOption + " ../GameDataFolder/level" + levels[i] + "_Final packages/VanillaDats/level" + levels[i] + "_Final/level" + levels[i] + "_Final/level" + levels[i] + "_Final.oni >> Globalize.log").c_str() << '\n'; string sys_str = (strOniSplit + " " + strImportOption + " ../GameDataFolder/level" + levels[i] + "_Final packages/VanillaDats/level" + levels[i] + "_Final/level" - + levels[i] + "_Final/level" + levels[i] + "_Final.oni >> Globalize2.log"); + + levels[i] + "_Final/level" + levels[i] + "_Final.oni >> Globalize.log"); system(sys_str.c_str() ); setProgressBar( (int)(1000 * (float)(parts_done) / (float)(total_steps) )); parts_done++; @@ -330,9 +358,10 @@ int globalizeData(void) setProgressBar( 1000 ); // CIP:last of all, set up the edition folder as a playable Oni installation by placing the latest application (+ Daodan DLL on Windows) in edition/ - - // CIP:then copy persist.dat and keyconfig.txt into edition/ as well - + // or we could just include it in the zip in the proper place already. + + copy("../../persist.dat","../persist.dat"); + copy("../../keyconfig.txt","../keyconfig.txt"); #ifndef WIN32 /* On Mac only, set the current GDF to the AE GDF by writing to Oni's global preferences file (thankfully a standard OS X ".plist" XML file). If there are no Oni prefs (only possible if Oni has not been run even once), then the above line will fail silently, no harm done, @@ -345,6 +374,7 @@ int globalizeData(void) #endif + setStatusArea((string)"Done! Now select your mod packages and click install."); // while(1) Sleep(-1); @@ -974,8 +1004,13 @@ void MainWindow::CreateControls() itemMenu42->Append(wxID_OPTIONS, _("Show Advanced Options..."), wxEmptyString, wxITEM_CHECK); menuBar->Append(itemMenu42, _("Options")); wxMenu* itemMenu44 = new wxMenu; - itemMenu44->Append(wxID_ABOUT, _("About"), wxEmptyString, wxITEM_NORMAL); - menuBar->Append(itemMenu44, _("Help")); +#ifdef WIN32 + itemMenu44->Append(wxID_ABOUT, _("About"), wxEmptyString, wxITEM_NORMAL); + menuBar->Append(itemMenu44, _("Help")); +#else + itemMenu37->Append(wxID_ABOUT, _("About"), wxEmptyString, wxITEM_NORMAL); +#endif + itemFrame1->SetMenuBar(menuBar); wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL); @@ -1108,6 +1143,10 @@ void MainWindow::CreateControls() Mods_CheckboxList->Connect(Mods_CheckboxList1, wxEVT_CREATE, wxWindowCreateEventHandler(MainWindow::ModList_OnCreate), NULL, this); ////@end MainWindow content construction + Handle = (HWND)GetHWND(); + ::CoCreateInstance(CLSID_TaskbarList, NULL, CLSCTX_INPROC_SERVER, IID_ITaskbarList, (void **)&pTaskbarList); + + if ( exists( "../../GameDataFolder/level0_Final.sep" ) ) { strImportOption = "-import:sep"; splitInstances = NOT_SPLIT; @@ -1116,7 +1155,7 @@ void MainWindow::CreateControls() strImportOption = "-import:nosep"; splitInstances = SPLIT; } - + globalPackages = getPackages(); globalInstalledMods = getInstallString(); for (int i = 0; i < globalPackages.size(); i++) { @@ -1128,11 +1167,14 @@ void MainWindow::CreateControls() TheInstallButton = InstallButton; TheProgressBar = ProgressBar; OptionsPanel->Hide(); + +//#ifndef WIN32 +// itemMenu37->Append(wxID_ABOUT, _("About"), wxEmptyString, wxITEM_NORMAL); + +//#endif + if(splitInstances == SPLIT) SeperatedRadio->SetValue(true); else CompleteRadio->SetValue(true); - - - if(strImportOption == "-import:nosep") NoSepRadio->SetValue(true); else SepRadio->SetValue(true); @@ -1373,7 +1415,22 @@ void MainWindow::OnInstallButtonClick( w void setProgressBar( int i ) { //TheProgressBar->SetValue( +#ifdef WIN32 + + + +if (SUCCEEDED(pTaskbarList->QueryInterface(IID_ITaskbarList3, (void **)&pTaskbarList3))) +{ + + pTaskbarList3->SetProgressValue(Handle,i, 1000); + if ( i == 0 ) { + pTaskbarList3->SetProgressState(Handle,TBPF_NOPROGRESS); + } +} + + +#endif TheProgressBar->SetValue(i); }