Patch level :4.0 setup
Files correlati : Ricompilazione Demo : [ ] Commento :il programma si ferma se trova campo o authoriz in funzione git-svn-id: svn://10.65.10.50/trunk@15645 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
d77551ab78
commit
dec44e6fc2
@ -7,6 +7,8 @@
|
||||
#include <shlobj.h>
|
||||
#endif
|
||||
|
||||
#include <wx/snglinst.h>
|
||||
|
||||
#include "key.h"
|
||||
#include "wizard.h"
|
||||
#include "utils.h"
|
||||
@ -94,6 +96,7 @@ protected:
|
||||
void OnTimer(wxTimerEvent& e);
|
||||
void ClientUpdate();
|
||||
void NormalSetup();
|
||||
bool CampoRunning(const wxString& strAppName, const wxString& strMsg) const;
|
||||
|
||||
bool CreateIcon(unsigned int csidl, const wxFileName& strExeFile, const wxString& strLinkName) const;
|
||||
bool CreateAutostartMode(const int iSrvAutostartMode, const wxString& strPath);
|
||||
@ -518,28 +521,9 @@ int CampoSetup::UpdateModule(const wxString& strLocalPath, const wxString& strRe
|
||||
}
|
||||
|
||||
|
||||
//metodo principale che sceglie la modalita' di lancio del programma
|
||||
void CampoSetup::OnTimer(wxTimerEvent& WXUNUSED(e))
|
||||
{
|
||||
wxFileName strPath = argv[0];
|
||||
strPath.SetCwd();
|
||||
//path del programma setup.exe in esecuzione; serve in seguito in quanto alcuni metodi (tipo la GetAllFiles)..
|
||||
//..fanno perdere questo path
|
||||
m_strSetupPath = strPath.GetPath();
|
||||
|
||||
wxString strCommand = argv[1];
|
||||
if (strCommand.IsEmpty())
|
||||
NormalSetup();
|
||||
else
|
||||
ClientUpdate();
|
||||
|
||||
//finestrina x chiudere a mano il programma (sconsigliata causa lancio ba1.exe)
|
||||
// ::wxMessageBox(wxT("Installazione terminata"), APPNAME, wxOK | wxICON_INFORMATION);
|
||||
m_pMainFrame->Destroy();
|
||||
}
|
||||
|
||||
|
||||
//---------------------------------------------
|
||||
//metodo per l'aggiornamento dei client di rete
|
||||
//---------------------------------------------
|
||||
void CampoSetup::ClientUpdate()
|
||||
{
|
||||
wxFileName fn(m_strSetupPath, "install.ini");
|
||||
@ -559,7 +543,9 @@ void CampoSetup::ClientUpdate()
|
||||
wxExecute("ba1 -6 /uADMIN");
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------
|
||||
//metodo per tutte le installazioni e gli aggiornamenti in locale
|
||||
//---------------------------------------------------------------
|
||||
void CampoSetup::NormalSetup()
|
||||
{
|
||||
m_pWizard = new CampoWizard(m_pMainFrame);
|
||||
@ -854,9 +840,71 @@ void CampoSetup::NormalSetup()
|
||||
|
||||
} //if (m_pWizard->Run())...
|
||||
m_pWizard->Destroy();
|
||||
|
||||
}
|
||||
|
||||
bool CampoSetup::CampoRunning(const wxString& strAppName, const wxString& strMsg) const
|
||||
{
|
||||
bool ok = false;
|
||||
wxSingleInstanceChecker sicProgram(strAppName);
|
||||
if (sicProgram.IsAnotherRunning())
|
||||
{
|
||||
ErrorBox(strMsg);
|
||||
ok = true;
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
||||
|
||||
//metodo principale che sceglie la modalita' di lancio del programma
|
||||
void CampoSetup::OnTimer(wxTimerEvent& WXUNUSED(e))
|
||||
{
|
||||
//controllo di eventuali Campo o servers attivi e conseguente interruzione dell'installazione
|
||||
if (CampoRunning("ba0", "Uscire dal programma CAMPO prima di procedere con l'aggiornamento/installazione!") ||
|
||||
CampoRunning("ba1", "Uscire dal programma di manutenzione di CAMPO\n prima di procedere con l'aggiornamento/installazione!") ||
|
||||
CampoRunning("Authorization", "Spegnere il server di autorizzazioni per poter aggiornare/installare il programma CAMPO!"))
|
||||
{
|
||||
m_pMainFrame->Destroy();
|
||||
return;
|
||||
}
|
||||
|
||||
//panegirico all'apparenza inutile ma in realta' decisivo per reperire i veri path assoluti dove funzionano...
|
||||
//..setup, ba0, ba1. NON cancellare!!!
|
||||
wxString strIni = "install.ini";
|
||||
wxFileName strPath;
|
||||
if (wxFileName::FileExists(strIni))
|
||||
{
|
||||
strPath = "setup";
|
||||
}
|
||||
else
|
||||
{
|
||||
strIni.insert(0, "../");
|
||||
if (wxFileName::FileExists(strIni))
|
||||
strPath = ".";
|
||||
else
|
||||
{
|
||||
m_pMainFrame->Destroy();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
strPath.MakeAbsolute();
|
||||
strPath.SetCwd();
|
||||
//path del programma setup.exe in esecuzione; serve in seguito in quanto alcuni metodi (tipo la GetAllFiles)..
|
||||
//..fanno perdere questo path
|
||||
m_strSetupPath = strPath.GetPath();
|
||||
|
||||
wxString strCommand = argv[1];
|
||||
if (strCommand.IsEmpty())
|
||||
NormalSetup();
|
||||
else
|
||||
ClientUpdate();
|
||||
|
||||
//finestrina x chiudere a mano il programma (sconsigliata causa lancio ba1.exe)
|
||||
// ::wxMessageBox(wxT("Installazione terminata"), APPNAME, wxOK | wxICON_INFORMATION);
|
||||
m_pMainFrame->Destroy();
|
||||
}
|
||||
|
||||
|
||||
bool CampoSetup::OnInit()
|
||||
{
|
||||
wxInitAllImageHandlers();
|
||||
|
Loading…
x
Reference in New Issue
Block a user