Revision: 1584
http://rigsofrods.svn.sourceforge.net/rigsofrods/?rev=1584&view=rev
Author: rorthomas
Date: 2011-01-18 13:24:21 +0000 (Tue, 18 Jan 2011)
Log Message:
-----------
installer to updater changes
fixed thread count
Modified Paths:
--------------
trunk/source/configurator/configurator.cpp
trunk/source/installer/ConfigManager.cpp
trunk/source/installer/threadpool.cpp
trunk/source/installer/wizard.cpp
trunk/source/installer/wizard.h
Modified: trunk/source/configurator/configurator.cpp
===================================================================
--- trunk/source/configurator/configurator.cpp 2011-01-18 13:23:32 UTC (rev
1583)
+++ trunk/source/configurator/configurator.cpp 2011-01-18 13:24:21 UTC (rev
1584)
@@ -3360,8 +3360,8 @@
// get paths to update.exe
char path[2048];
getcwd(path, 2048);
- strcat(path, "\\installer.exe");
- wxLogStatus(wxT("using installer: ") + wxString(path));
+ strcat(path, "\\updater.exe");
+ wxLogStatus(wxT("using updater: ") + wxString(path));
int buffSize = (int)strlen(path) + 1;
LPWSTR wpath = new wchar_t[buffSize];
Modified: trunk/source/installer/ConfigManager.cpp
===================================================================
--- trunk/source/installer/ConfigManager.cpp 2011-01-18 13:23:32 UTC (rev
1583)
+++ trunk/source/installer/ConfigManager.cpp 2011-01-18 13:24:21 UTC (rev
1584)
@@ -383,20 +383,27 @@
} else if(list[0][0] == std::string("update") && list[0].size()
> 2)
{
// yay, an update
+ LOG("new update available: %s %s\n",
list[0][1].c_str(), list[0][2]);
wsdl->setDownloadMessage(_T("downloading installer
update"));
// rename ourself, so we can replace ourself
+ LOG("renaming self...\n");
std::string myPath = conv(getExecutablePath());
boost::filesystem::rename(myPath,
myPath+std::string(".old"));
+ LOG("downloading update...\n");
int res = wsdl->downloadFile(0, myPath, list[0][1],
list[0][2], 0, 0, true);
if(!res)
{
wxMessageBox(_T("Installer was updated, will
restart the installer now!"));
// now start the new installer and quit ourselfs
+ LOG("update downloaded, starting now...\n");
executeBinary(conv(myPath), wxT("runas"),
wxT(""), wxT("cwd"), false);
exit(1);
+ } else
+ {
+ LOG("update download failed with error %d\n",
res);
}
}
}
Modified: trunk/source/installer/threadpool.cpp
===================================================================
--- trunk/source/installer/threadpool.cpp 2011-01-18 13:23:32 UTC (rev
1583)
+++ trunk/source/installer/threadpool.cpp 2011-01-18 13:24:21 UTC (rev
1584)
@@ -220,7 +220,7 @@
void WsyncDownloadManager::startThreads()
{
- int num_threads = 1;
+ int num_threads = 6;
for(int i=0;i<num_threads;i++)
{
int id = m_Threads.empty()?1:m_Threads.back() + 1;
Modified: trunk/source/installer/wizard.cpp
===================================================================
--- trunk/source/installer/wizard.cpp 2011-01-18 13:23:32 UTC (rev 1583)
+++ trunk/source/installer/wizard.cpp 2011-01-18 13:24:21 UTC (rev 1584)
@@ -218,7 +218,7 @@
CONFIG->checkForNewUpdater();
PresentationPage *presentation = new PresentationPage(this);
- ConfirmationPage *confirm = new ConfirmationPage(this);
+ //ConfirmationPage *confirm = new ConfirmationPage(this);
DownloadPage *download = new DownloadPage(this);
LastPage *last = new LastPage(this);
@@ -344,6 +344,7 @@
}
//// ConfirmationPage
+/*
ConfirmationPage::ConfirmationPage(wxWizard *parent) :
wxWizardPageSimple(parent)
{
// TBD!
@@ -400,6 +401,7 @@
SetSizer(mainSizer);
mainSizer->Fit(this);
}
+*/
//// DownloadPage
DownloadPage::DownloadPage(wxWizard *parent) : wxWizardPageSimple(parent),
wizard(parent)
@@ -699,36 +701,10 @@
mainSizer->Add(tst=new wxStaticText(this, wxID_ANY, _T("Thank you for
downloading Rigs of Rods.\nWhat do you want to do now?")), 0, wxALL, 5);
tst->Wrap(TXTWRAP);
-
- chk_runtime = new wxCheckBox(this, wxID_ANY, _T("Install required
runtime libraries now"));
- mainSizer->Add(chk_runtime, 0, wxALL|wxALIGN_LEFT, 5);
- chk_runtime->SetValue(false);
-
- chk_upgrade_configs = new wxCheckBox(this, wxID_ANY, _T("Update User
Configurations (important)"));
- mainSizer->Add(chk_upgrade_configs, 0, wxALL|wxALIGN_LEFT, 5);
-
- // always enable this box, thus force the users to update always
- chk_upgrade_configs->SetValue(true);
- chk_upgrade_configs->Enable();
-
- chk_desktop = new wxCheckBox(this, wxID_ANY, _T("Create Desktop
shortcuts"));
- mainSizer->Add(chk_desktop, 0, wxALL|wxALIGN_LEFT, 5);
-
- chk_startmenu = new wxCheckBox(this, wxID_ANY, _T("Create Start menu
shortcuts"));
- mainSizer->Add(chk_startmenu, 0, wxALL|wxALIGN_LEFT, 5);
-
- chk_viewmanual = new wxCheckBox(this, wxID_ANY, _T("View manual"));
- mainSizer->Add(chk_viewmanual, 0, wxALL|wxALIGN_LEFT, 5);
-
chk_configurator = new wxCheckBox(this, wxID_ANY, _T("Run the
Configurator"));
mainSizer->Add(chk_configurator, 0, wxALL|wxALIGN_LEFT, 5);
-
chk_changelog = new wxCheckBox(this, wxID_ANY, _T("View the
Changelog"));
mainSizer->Add(chk_changelog, 0, wxALL|wxALIGN_LEFT, 5);
-
- chk_filetypes = new wxCheckBox(this, wxID_ANY, _T("Associate file
types"));
- mainSizer->Add(chk_filetypes, 0, wxALL|wxALIGN_LEFT, 5);
-
#else
// TODO: add linux options
mainSizer->Add(tst=new wxStaticText(this, wxID_ANY, _T("Thank you for
downloading Rigs of Rods.\n")), 0, wxALL, 5);
@@ -743,17 +719,6 @@
setControlEnable(wizard, wxID_BACKWARD, false);
setControlEnable(wizard, wxID_CANCEL, false);
#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
-
- chk_desktop->SetValue(true);
-
if(CONFIG->getPersistentConfig(wxT("installer.create_desktop_shortcuts")) ==
wxT("no"))
- chk_desktop->SetValue(false);
-
- chk_startmenu->SetValue(true);
-
if(CONFIG->getPersistentConfig(wxT("installer.create_start_menu_shortcuts")) ==
wxT("no"))
- chk_startmenu->SetValue(false);
-
- chk_viewmanual->SetValue(false);
-
chk_configurator->SetValue(true);
if(CONFIG->getPersistentConfig(wxT("installer.run_configurator")) ==
wxT("no"))
chk_configurator->SetValue(false);
@@ -762,11 +727,6 @@
if(CONFIG->getPersistentConfig(wxT("installer.view_changelog")) ==
wxT("no"))
chk_changelog->SetValue(false);
- chk_filetypes->SetValue(true);
- if(CONFIG->getPersistentConfig(wxT("installer.associate_filetypes")) ==
wxT("no"))
- chk_filetypes->SetValue(false);
-
-
#endif // OGRE_PLATFORM
return true;
}
@@ -776,33 +736,17 @@
if(!forward) return false;
#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
// do last things
- CONFIG->setPersistentConfig(wxT("installer.create_desktop_shortcuts"),
chk_desktop->IsChecked()?wxT("yes"):wxT("no"));
-
CONFIG->setPersistentConfig(wxT("installer.create_start_menu_shortcuts"),
chk_startmenu->IsChecked()?wxT("yes"):wxT("no"));
CONFIG->setPersistentConfig(wxT("installer.run_configurator"),
chk_configurator->IsChecked()?wxT("yes"):wxT("no"));
CONFIG->setPersistentConfig(wxT("installer.view_changelog"),
chk_changelog->IsChecked()?wxT("yes"):wxT("no"));
- CONFIG->setPersistentConfig(wxT("installer.associate_filetypes"),
chk_filetypes->IsChecked()?wxT("yes"):wxT("no"));
-
- if(chk_desktop->IsChecked() || chk_startmenu->IsChecked())
- CONFIG->createProgramLinks(chk_desktop->IsChecked(),
chk_startmenu->IsChecked());
+ CONFIG->updateUserConfigs();
+ CONFIG->associateFileTypes();
- if(chk_runtime->IsChecked())
- CONFIG->installRuntime();
-
- if(chk_upgrade_configs->IsChecked())
- CONFIG->updateUserConfigs();
-
if(chk_configurator->IsChecked())
CONFIG->startConfigurator();
-
- if(chk_viewmanual->IsChecked())
- CONFIG->viewManual();
-
if(chk_changelog->IsChecked())
CONFIG->viewChangelog();
- if(chk_filetypes->IsChecked())
- CONFIG->associateFileTypes();
#endif // OGRE_PLATFORM
return true;
Modified: trunk/source/installer/wizard.h
===================================================================
--- trunk/source/installer/wizard.h 2011-01-18 13:23:32 UTC (rev 1583)
+++ trunk/source/installer/wizard.h 2011-01-18 13:24:21 UTC (rev 1584)
@@ -100,11 +100,13 @@
PresentationPage(wxWizard *parent);
};
+/*
class ConfirmationPage : public wxWizardPageSimple, public EnterLeavePage
{
public:
ConfirmationPage(wxWizard *parent);
};
+*/
class DownloadPage : public wxWizardPageSimple, public EnterLeavePage
{
@@ -138,7 +140,7 @@
{
protected:
wxWizard *wizard;
- wxCheckBox *chk_runtime, *chk_configurator, *chk_desktop,
*chk_startmenu, *chk_viewmanual, *chk_upgrade_configs, *chk_changelog,
*chk_filetypes;
+ wxCheckBox *chk_configurator, *chk_changelog;
public:
LastPage(wxWizard *parent);
bool OnEnter(bool forward);
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand
malware threats, the impact they can have on your business, and how you
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Rigsofrods-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rigsofrods-devel