Patch level :
Files correlati : Ricompilazione Demo : [ ] Commento : git-svn-id: svn://10.65.10.50/trunk@15575 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
0c889d778e
commit
28cba83155
125
setup/Setup.cpp
125
setup/Setup.cpp
@ -154,19 +154,18 @@ class CampoWizard : public wxWizard
|
||||
CampoWizardPage* m_pPage[m_nPages];
|
||||
|
||||
wxString _strDestinationPath; //path di aggiornamento/installazione
|
||||
unsigned int _uInstallationType; //tipo di installazione selezionata (standard,server,client...)
|
||||
unsigned int _uInstallationType; //tipo di installazione selezionata (standard,server,client,aggiornamento)
|
||||
unsigned int _uDongleType; //tipo di chiave di protezione (hardlock,eutron,server)
|
||||
|
||||
wxString _strPrgLocPath; //path programmi in locale
|
||||
wxString _strPrgNetPath; //path programmi in remoto (server prg dir per client)
|
||||
wxString _strDataPath; //path dati
|
||||
wxString _strAuthSrv; //nome server authoriz
|
||||
wxString _strDictSrv; //nome server diction
|
||||
wxString _strPrgNetPath; //path programmi in remoto (server programmi directory per client)
|
||||
wxString _strDataPath; //path dati (creare o usare)
|
||||
|
||||
bool _bInstDemoData; //installa dati dimostrativi
|
||||
bool _bInstUseAuth; //installa/usa server authoriz
|
||||
wxString _strSrvAuth; //server authoriz
|
||||
wxString _strSrvAuth; //nome server authoriz
|
||||
bool _bInstUseDict; //installa/usa server diction
|
||||
wxString _strSrvDict; //server diction
|
||||
wxString _strSrvDict; //nome server diction
|
||||
|
||||
unsigned int _iSrvAutostartMode; //tipologia di esecuzione dei server
|
||||
bool _bDesktopShortcut; //crea il link sul desktop
|
||||
@ -184,10 +183,12 @@ public:
|
||||
bool GetBool(wxWindowID id) const;
|
||||
|
||||
//metodi per il passaggio tra le finestre dei parametri di installazione!
|
||||
void SetDestinationPath(const wxString& path);
|
||||
void SetDestinationPath(const wxString& strPath);
|
||||
const wxString& GetDestinationPath() const;
|
||||
void SetInstallationType(const unsigned int type);
|
||||
void SetInstallationType(const unsigned int uType);
|
||||
const unsigned int GetInstallationType() const;
|
||||
void SetDongleType(const unsigned int uType);
|
||||
const unsigned int GetDongleType() const;
|
||||
|
||||
void SetPrgLocPath(const wxString& strPrgLocPath);
|
||||
const wxString& GetPrgLocPath() const;
|
||||
@ -226,7 +227,10 @@ protected:
|
||||
public:
|
||||
wxString Get(const wxString strVariable) const;
|
||||
bool GetBool(const wxString strVariable) const;
|
||||
CampoIniFile(const wxString strIniPath, const wxString strParagraph);
|
||||
bool Set(const wxString strVariable, const wxString strValue);//, const wxString strParagraph) const;
|
||||
bool Set(const wxString strVariable, const int uValue);
|
||||
|
||||
CampoIniFile(const wxString strIniPath, wxString strValue);
|
||||
};
|
||||
|
||||
CampoIniFile::CampoIniFile(const wxString strIniPath, const wxString strParagraph)
|
||||
@ -248,6 +252,15 @@ bool CampoIniFile::GetBool(const wxString strVariable) const
|
||||
return strBool == "X" || strBool == "Y";
|
||||
}
|
||||
|
||||
bool CampoIniFile::Set(const wxString strVariable, const wxString strValue)//, const wxString strParagraph) const
|
||||
{
|
||||
return Write(strVariable, strValue);
|
||||
}
|
||||
|
||||
bool CampoIniFile::Set(const wxString strVariable, const int uValue)//, const wxString strParagraph) const
|
||||
{
|
||||
return Write(strVariable, uValue);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//Campo wizard page (pagina generica del programma, di cui saranno figlie le singole pagine)
|
||||
@ -472,7 +485,6 @@ bool CampoWizardPage2::ForwardValidate()
|
||||
GetWizard().SetDesktopShortcut(true);
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -579,11 +591,10 @@ CampoWizardPage3::CampoWizardPage3(wxWizard* parent) : CampoWizardPage(parent)
|
||||
asAccRef.Add("Accetta");
|
||||
asAccRef.Add("Rifiuta");
|
||||
wxRadioBox* radio_box = new wxRadioBox(this, 301, "Selezionare 'Accetta' per proseguire con l'installazione, 'Rifiuta' per terminare l'installazione", wxDefaultPosition,
|
||||
wxDefaultSize, asAccRef, 0, wxRA_SPECIFY_COLS);
|
||||
wxDefaultSize, asAccRef, 0, wxRA_SPECIFY_COLS);
|
||||
|
||||
radio_box->SetSelection(1);
|
||||
GetSizer()->Add(radio_box);
|
||||
|
||||
}
|
||||
|
||||
/**********************************************************************************************************/
|
||||
@ -770,7 +781,7 @@ wxString CampoWizardPage4::DecodeString(const wxString& data)
|
||||
int CampoWizardPage4::VersionYear()
|
||||
{
|
||||
char ver[32];
|
||||
GetPrivateProfileString("ba", "Versione", "", ver, sizeof(ver), "./program/zip/install.ini");
|
||||
GetPrivateProfileString("ba", "Versione", "", ver, sizeof(ver), "./program/install.ini");
|
||||
ver[4] = '\0';
|
||||
return atoi(ver);
|
||||
}
|
||||
@ -799,7 +810,7 @@ int CampoWizardPage4::DongleTest()
|
||||
if (yearKey < verYear) // Chiave già programmata con assistenza pagata
|
||||
{
|
||||
bool ok = false;
|
||||
wxFileInputStream file("./program/zip/dninst.zip");
|
||||
wxFileInputStream file("./program/dninst.zip");
|
||||
if (file.IsOk())
|
||||
{
|
||||
wxTextInputStream keys(file);
|
||||
@ -892,6 +903,8 @@ CampoWizardPage4::CampoWizardPage4(wxWizard* parent) : CampoWizardPage(parent)
|
||||
}
|
||||
|
||||
SetHTMLText(strTitle, strBody);
|
||||
//aggiorna il tipo di chiave per poterlo scrivere sul campo.ini
|
||||
GetWizard().SetDongleType(_dongle_type);
|
||||
}
|
||||
|
||||
/**********************************************************************************************************/
|
||||
@ -1704,6 +1717,16 @@ void CampoWizard::SetPrgLocPath(const wxString& strPrgLocPath)
|
||||
_strPrgLocPath = strPrgLocPath;
|
||||
}
|
||||
|
||||
const unsigned int CampoWizard::GetDongleType() const
|
||||
{
|
||||
return _uDongleType;
|
||||
}
|
||||
|
||||
void CampoWizard::SetDongleType(const unsigned int uType)
|
||||
{
|
||||
_uDongleType = uType;
|
||||
}
|
||||
|
||||
const wxString& CampoWizard::GetPrgLocPath() const
|
||||
{
|
||||
return _strPrgLocPath;
|
||||
@ -2034,16 +2057,12 @@ bool CampoSetup::CreateAutostartMode(const int iSrvAutostartMode, const wxString
|
||||
|
||||
//elimina un eventuale servizio precedente (senno' col cavolo che lo riesce a modificare!)
|
||||
//utilizza il programma instsrv.exe dentro la cartella servers installata
|
||||
// wxString strRemove = "instsrv Lurch REMOVE";
|
||||
// const long lRemove = wxExecute(strRemove, wxEXEC_SYNC);
|
||||
wxString strRemove = strSrvPath + "\\instsrv Lurch REMOVE";
|
||||
const long lRemove = wxExecute(strRemove, wxEXEC_SYNC);
|
||||
wxString strRemove = strSrvPath + "\\instsrv Lurch REMOVE";
|
||||
const long lRemove = wxExecute(strRemove, wxEXEC_SYNC);
|
||||
|
||||
//aggiunge la voce ai servizi di windows (dentro strumenti di amministrazione)
|
||||
//utilizza i programmi instrv.exe e srvany.exe dentro la cartella servers installata
|
||||
wxString strCreateService = strSrvPath + "\\instsrv Lurch ";
|
||||
// strCreateService += wxGetCwd();
|
||||
// strCreateService += "\\srvany.exe";
|
||||
strCreateService += strSrvPath;
|
||||
strCreateService += "\\srvany.exe";
|
||||
//esegue il programma di installazione servizi di Windows creando la voce
|
||||
@ -2073,8 +2092,6 @@ bool CampoSetup::CreateAutostartMode(const int iSrvAutostartMode, const wxString
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -2124,7 +2141,6 @@ bool CampoSetup::CreateIcon(unsigned int csidl, const wxFileName& strExeFile) co
|
||||
}
|
||||
CoUninitialize();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -2160,6 +2176,7 @@ void CampoSetup::CheckAndMakeDir(const wxString& strDir, const wxString& strMsg)
|
||||
}
|
||||
}
|
||||
|
||||
//metodo principale dell'applicazione che gestisce l'ordine degli eventi nella installazione vera e propria
|
||||
void CampoSetup::OnTimer(wxTimerEvent& WXUNUSED(e))
|
||||
{
|
||||
CampoWizard* pWizard = new CampoWizard(m_pMainFrame);
|
||||
@ -2172,7 +2189,7 @@ void CampoSetup::OnTimer(wxTimerEvent& WXUNUSED(e))
|
||||
//tipo di installazione/aggiornamento
|
||||
const unsigned int uInstallationType = pWizard->GetInstallationType();
|
||||
const bool bNewInstallation = uInstallationType < 3;
|
||||
//installazione server?
|
||||
//installazione servers?
|
||||
const bool bInstallLurch = uInstallationType == 1 && (pWizard->GetInstUseAuth() | pWizard->GetInstUseDict());
|
||||
//cartelle selezionate dall'utente
|
||||
const wxString& strPrgLocPath = pWizard->GetPrgLocPath();
|
||||
@ -2183,7 +2200,6 @@ void CampoSetup::OnTimer(wxTimerEvent& WXUNUSED(e))
|
||||
{
|
||||
//creazione della directory dei programmi (compreso l'intero albero directory)
|
||||
CheckAndMakeDir(strPrgLocPath, "programmi");
|
||||
|
||||
//creazione della directory dei dati (compreso l'intero albero directory)
|
||||
CheckAndMakeDir(strDataPath, "dati");
|
||||
}
|
||||
@ -2226,7 +2242,7 @@ void CampoSetup::OnTimer(wxTimerEvent& WXUNUSED(e))
|
||||
}
|
||||
|
||||
//copia i files nella cartella di destinazione (programmi,dati,cazzi e mazzi);se il nome del file..
|
||||
//..di destinazione e' vuoto significa che non lo deve copiare!!
|
||||
//..di destinazione e' vuoto significa che non lo deve copiare!! (es. dati in aggiornamento)
|
||||
if (!strFileCurr.IsEmpty())
|
||||
{
|
||||
strFileCurr.MakeLower(); //minuscolizzazione di sicurezza
|
||||
@ -2236,7 +2252,7 @@ void CampoSetup::OnTimer(wxTimerEvent& WXUNUSED(e))
|
||||
if (strFileName.GetExt() == ".ini")
|
||||
{
|
||||
const wxString strName = strFileName.GetName();
|
||||
//campo.ini e install.ini vanno lasciati stare se aggiornamento!!!
|
||||
//campo.ini e install.ini vanno lasciati stare se esistono (aggiornamento)!!!
|
||||
if ((strName == "campo" || strName == "install") && strFileName.FileExists())
|
||||
continue;
|
||||
}
|
||||
@ -2261,8 +2277,46 @@ void CampoSetup::OnTimer(wxTimerEvent& WXUNUSED(e))
|
||||
//adesso deve compilare il campo.ini se nuova installazione..
|
||||
if (bNewInstallation)
|
||||
{
|
||||
//paragrafo [Main]
|
||||
CampoIniFile CampoIniMain(strPrgLocPath + "/campo.ini", "Main");
|
||||
const unsigned int uDongleType = pWizard->GetDongleType();
|
||||
CampoIniMain.Set("Dongle", uDongleType);
|
||||
CampoIniMain.Set("Study", strDataPath);
|
||||
CampoIniMain.Set("Firm", "com");
|
||||
//client o non client?
|
||||
if (uInstallationType == 2) //client
|
||||
{
|
||||
CampoIniMain.Set("TestDatabase", "N");
|
||||
CampoIniMain.Set("TestPrograms", "X");
|
||||
}
|
||||
else //altri (standard,server)
|
||||
{
|
||||
CampoIniMain.Set("TestDatabase", "X");
|
||||
CampoIniMain.Set("TestPrograms", "N");
|
||||
}
|
||||
//paragrafo [Server]
|
||||
if (bInstallLurch)
|
||||
{
|
||||
CampoIniFile CampoIniSrv(strPrgLocPath + "/campo.ini", "Server");
|
||||
if (pWizard->GetInstUseAuth())
|
||||
CampoIniSrv.Set("Authoriz", pWizard->GetSrvAuth());
|
||||
if (pWizard->GetInstUseDict())
|
||||
CampoIniSrv.Set("Dictionary", pWizard->GetSrvDict());
|
||||
}
|
||||
}
|
||||
//..e modificare comunque l'install.ini aggiornando eventualmente l'origine dei programmi
|
||||
CampoIniFile CampoInstall(strPrgLocPath + "/install.ini", "Main");
|
||||
if (uInstallationType == 2) //client: directory origine sul server
|
||||
CampoInstall.Set("DiskPath", pWizard->GetPrgNetPath());
|
||||
else //e' il path assoluto dell'install.ini che sta in 'program' (es. D:\program)
|
||||
{
|
||||
wxFileName strSourcePath(wxGetCwd());
|
||||
strSourcePath.AppendDir("..");
|
||||
strSourcePath.AppendDir("program");
|
||||
strSourcePath.MakeAbsolute();
|
||||
const wxString strSrc = strSourcePath.GetPath();
|
||||
CampoInstall.Set("DiskPath", strSrc);
|
||||
}
|
||||
//..e modificare comunque l'install.ini
|
||||
|
||||
//solo se sta installando campo in postazione server e deve installare un gestore di servizi..
|
||||
//..avvia la procedura della creazione dell'autostart(un casino)
|
||||
@ -2278,7 +2332,18 @@ void CampoSetup::OnTimer(wxTimerEvent& WXUNUSED(e))
|
||||
if (bDesktopShortcut)
|
||||
CreateIcon(CSIDL_COMMON_DESKTOPDIRECTORY, strExe);
|
||||
|
||||
//terminato il tutto scrive/aggiorna/lascia stare il campo.stp
|
||||
// 1) terminato il tutto scrive/aggiorna/lascia stare il campo.stp
|
||||
if (bNewInstallation)
|
||||
{
|
||||
CampoIniFile CampoStp("C:\\campo.stp", "");
|
||||
}
|
||||
|
||||
// 2) procede poi al caricamento delle patch eventuali di sistema all'interno della dir 'program'
|
||||
//la procedura di unzippamento dovrebbe essere quella di ba1.exe
|
||||
|
||||
// 3) riaggiorna eventualmente il livello versione/patch del SY in install.ini
|
||||
|
||||
// 4) lanciare ba1.exe -6 in uscita (non va qui! e' solo per ricordarsi di farlo!)
|
||||
|
||||
//questo e' un esempio di associazione automatica di estensione file
|
||||
//if (pWizard->GetBool(bAssocExtension))
|
||||
|
Loading…
x
Reference in New Issue
Block a user