From 5fdb97f3cba1dd41644162b91c01e43544d9d243 Mon Sep 17 00:00:00 2001 From: luca Date: Tue, 20 Jan 2009 11:16:02 +0000 Subject: [PATCH] Patch level : Files correlati : Ricompilazione Demo : [ ] Commento : git-svn-id: svn://10.65.10.50/trunk@18051 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- setup/Setup.cpp | 45 +++++++++++++++++++++++++-------------------- setup/wizard.cpp | 2 +- 2 files changed, 26 insertions(+), 21 deletions(-) diff --git a/setup/Setup.cpp b/setup/Setup.cpp index b99287372..029d418c7 100755 --- a/setup/Setup.cpp +++ b/setup/Setup.cpp @@ -107,7 +107,7 @@ protected: void InternetUpdate(); void ClientUpdate(); void NormalSetup(); - bool SystemRunning(const wxString& strAppName, const wxString& strMsg) const; + bool SystemRunning(const wxString& strAppName, wxString strMsg) const; bool LurchRunning() const; bool CampoRunning() const; @@ -229,10 +229,10 @@ void CampoSetup::AssociateExtension(const wxFileName& strExeFile, const wxString WriteRootRegistryKey(strExt, APPNAME); wxString str = strExeFile.GetFullPath(); str += wxT(",0"); - WriteRootRegistryKey(wxT("Campo\\DefaultIcon"), str); + WriteRootRegistryKey(APPNAME + wxT("\\DefaultIcon"), str); str = strExeFile.GetFullPath(); str += wxT(" \"%1\""); - WriteRootRegistryKey(wxT("Campo\\shell\\open\\command"), str); + WriteRootRegistryKey(APPNAME + wxT("\\shell\\open\\command"), str); } bool CampoSetup::CreateIcon(unsigned int csidl, const wxFileName& strExeFile, const wxString& strLinkName) const @@ -1004,7 +1004,7 @@ void CampoSetup::NormalSetup() wxFileName strSourcePath(m_strSetupPath, "*.*"); strSourcePath.AppendDir(".."); strSourcePath.AppendDir(".."); - strSourcePath.AppendDir("campo"); + strSourcePath.AppendDir("campo"); // NOME fisso della cartella del CD, non mettere APPNAME strSourcePath.MakeAbsolute(); //stringa inutile al programma ma decisiva per il programmatore const wxString strSrc = strSourcePath.GetPath(); @@ -1230,21 +1230,16 @@ void CampoSetup::NormalSetup() if (bDesktopShortcut) { const wxFileName strExe(strPrgLocPath, wxT("ba0.exe")); - wxString strLnk; CampoIniFile CampoIniMain(strPrgLocPath + "/campo.ini", "Main"); InstallationType nInstType = CampoIniMain.GetInstallationType(); + + wxString strLnk = Product(); switch (nInstType) { - case it_server: - strLnk = "Campo Enterprise (Server)"; - break; - case it_client: - strLnk = "Campo Enterprise (Client)"; - break; - default: - strLnk = "Campo Enterprise"; - break; + case it_server: strLnk += " (Server)"; break; + case it_client: strLnk += " (Client)"; break; + default: break; } //crea comunque l'icona @@ -1290,10 +1285,12 @@ void CampoSetup::NormalSetup() //////////////////////////////////////////////////////////////////////////////////// // Metodi per il controllo preventivo di eventuali cazzate in procinto di accadere //////////////////////////////////////////////////////////////////////////////////// -bool CampoSetup::SystemRunning(const wxString& strAppName, const wxString& strMsg) const +bool CampoSetup::SystemRunning(const wxString& strAppName, wxString strMsg) const { wxSingleInstanceChecker sicProgram(strAppName); + strMsg.Replace(wxT("PRODUCT"), PRODUCT); + int i; for (i = 10; i > 0 && sicProgram.IsAnotherRunning(); i--) wxSleep(1); @@ -1385,8 +1382,13 @@ void CampoSetup::OnTimer(wxTimerEvent& WXUNUSED(e)) //controllo di eventuali Campo o servers attivi e conseguente interruzione dell'installazione if (LurchRunning()) { - if (YesNoBox("Per poter aggiornare/installare il programma CAMPO deve temporaneamente essere disattivato il gestore delle licenze!\nPrima di disattivare il gestore delle licenze accertarsi che tutti gli utenti spengano il programma CAMPO!!\nProseguire con la disattivazione?")) - const long lStop = StopLurch(); + wxString msg; + msg << "Per poter aggiornare/installare il programma " << PRODUCT + << " deve temporaneamente essere disattivato il gestore delle licenze!\n" + << "Prima di disattivare il gestore delle licenze accertarsi che tutti gli utenti spengano il programma!!\n" + << "Proseguire con la disattivazione?"; + if (YesNoBox(msg)) + StopLurch(); else { m_pMainFrame->Destroy(); @@ -1394,8 +1396,8 @@ void CampoSetup::OnTimer(wxTimerEvent& WXUNUSED(e)) } } - if (SystemRunning("ba0", "Uscire dal programma CAMPO prima di procedere con l'aggiornamento/installazione!") || - SystemRunning("ba1", "Uscire dal programma di manutenzione di CAMPO\n prima di procedere con l'aggiornamento/installazione!")) + if (SystemRunning("ba0", "Uscire dal programma PRODUCT prima di procedere con l'aggiornamento/installazione!") || + SystemRunning("ba1", "Uscire dal programma di manutenzione di PRODUCT\n prima di procedere con l'aggiornamento/installazione!")) { m_pMainFrame->Destroy(); return; @@ -1403,7 +1405,10 @@ void CampoSetup::OnTimer(wxTimerEvent& WXUNUSED(e)) if (CampoRunning()) { - ErrorBox("Un applicativo di CAMPO č ancora in esecuzione!\nL'installazione sarā interrotta immediatamente"); + wxString msg; + msg << "Un applicativo di " << PRODUCT << " č ancora in esecuzione!\n" + << "L'installazione sarā interrotta immediatamente"; + ErrorBox(msg); m_pMainFrame->Destroy(); return; } diff --git a/setup/wizard.cpp b/setup/wizard.cpp index 2ccff1883..c0170fd84 100755 --- a/setup/wizard.cpp +++ b/setup/wizard.cpp @@ -1287,7 +1287,7 @@ bool CampoWizardPage8::ForwardValidate() UINT nPrgNetDriveType = ::GetDriveType(strPrgNetPath.Left(3)); if (nPrgNetDriveType != DRIVE_REMOTE) return ErrorBox("Il server deve essere su un disco di rete!"); - //il server deve contenere i programmi di Campo giaā installati correttamente + //il server deve contenere i programmi di Campo giā installati correttamente if (!CheckPrgDir(strPrgNetPath)) return ErrorBox("La cartella selezionata come origine dei programmi NON e' valida!");