Patch level :
Files correlati : Ricompilazione Demo : [ ] Commento : git-svn-id: svn://10.65.10.50/trunk@15633 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
65fcf2bc09
commit
db128e1983
1816
setup/Setup.cpp
1816
setup/Setup.cpp
File diff suppressed because it is too large
Load Diff
@ -1,7 +1,8 @@
|
||||
#include "wxinc.h"
|
||||
#include <wx/socket.h>
|
||||
|
||||
#include "setupkey.h"
|
||||
#include "key.h"
|
||||
#include "utils.h"
|
||||
|
||||
extern "C"
|
||||
{
|
||||
@ -12,18 +13,6 @@ extern "C"
|
||||
///////////////////////////////
|
||||
// Utilities //
|
||||
///////////////////////////////
|
||||
bool ErrorBox(const wxString str)
|
||||
{
|
||||
wxMessageBox(str, APPNAME, wxOK | wxICON_ERROR);
|
||||
return false;
|
||||
}
|
||||
|
||||
bool WarningBox(const wxString str)
|
||||
{
|
||||
wxMessageBox(str, APPNAME, wxOK | wxICON_EXCLAMATION);
|
||||
return false;
|
||||
}
|
||||
|
||||
static int ThisYear()
|
||||
{
|
||||
int anno = 2006;
|
@ -1,8 +1,5 @@
|
||||
#ifndef __SETUPKEY_H
|
||||
#define __SETUPKEY_H
|
||||
|
||||
bool ErrorBox(const wxString str);
|
||||
bool WarningBox(const wxString str);
|
||||
#ifndef __KEY_H
|
||||
#define __KEY_H
|
||||
|
||||
bool HardlockGarble(unsigned short* data);
|
||||
unsigned short HardlockLogin(int& year);
|
75
setup/utils.cpp
Executable file
75
setup/utils.cpp
Executable file
@ -0,0 +1,75 @@
|
||||
#include "wxinc.h"
|
||||
#include "utils.h"
|
||||
|
||||
#ifdef WIN32
|
||||
#include <shlobj.h>
|
||||
#endif
|
||||
|
||||
wxString GetDefaultDestination()
|
||||
{
|
||||
wxString strDest;
|
||||
//scelta della directory di installazione di default
|
||||
#ifdef WIN32
|
||||
TCHAR strFolder[MAX_PATH];
|
||||
::SHGetFolderPath(NULL, CSIDL_PROGRAM_FILES, NULL, SHGFP_TYPE_CURRENT, strFolder);
|
||||
strDest = strFolder;
|
||||
#endif
|
||||
|
||||
if (strDest.IsEmpty())
|
||||
{
|
||||
// Forse è la cartella base dove è installato Word?
|
||||
wxFileType* pDoc = wxTheMimeTypesManager->GetFileTypeFromExtension(wxT("doc"));
|
||||
if (pDoc != NULL)
|
||||
{
|
||||
wxFileName strFilename = pDoc->GetOpenCommand(wxT("pippo.doc"));
|
||||
while (strFilename.GetDirCount() > 1)
|
||||
strFilename.RemoveLastDir();
|
||||
strDest = strFilename.GetPath().After('"');
|
||||
if (strDest.StartsWith(wxT("C\\")))
|
||||
strDest = wxT("C:") + strDest.Mid(1);
|
||||
}
|
||||
}
|
||||
|
||||
return strDest;
|
||||
}
|
||||
|
||||
bool ErrorBox(const wxString str)
|
||||
{
|
||||
wxMessageBox(str, APPNAME, wxOK | wxICON_ERROR);
|
||||
return false;
|
||||
}
|
||||
|
||||
bool WarningBox(const wxString str)
|
||||
{
|
||||
wxMessageBox(str, APPNAME, wxOK | wxICON_EXCLAMATION);
|
||||
return false;
|
||||
}
|
||||
|
||||
CampoIniFile::CampoIniFile(const wxString strIniPath, const wxString strParagraph)
|
||||
: wxFileConfig (wxEmptyString, wxEmptyString, strIniPath, wxEmptyString,
|
||||
wxCONFIG_USE_LOCAL_FILE|wxCONFIG_USE_NO_ESCAPE_CHARACTERS)
|
||||
{
|
||||
if (!strParagraph.IsEmpty())
|
||||
SetPath(strParagraph);
|
||||
}
|
||||
|
||||
wxString CampoIniFile::Get(const wxString strVariable) const
|
||||
{
|
||||
return Read(strVariable);
|
||||
}
|
||||
|
||||
bool CampoIniFile::GetBool(const wxString strVariable) const
|
||||
{
|
||||
wxString strBool = Get(strVariable);
|
||||
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);
|
||||
}
|
21
setup/utils.h
Executable file
21
setup/utils.h
Executable file
@ -0,0 +1,21 @@
|
||||
#ifndef __UTILS_H
|
||||
#define __UTILS_H
|
||||
|
||||
bool ErrorBox(const wxString str);
|
||||
bool WarningBox(const wxString str);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//Classe per la gestione dei files di configurazione tipo campo.ini
|
||||
class CampoIniFile : public wxFileConfig
|
||||
{
|
||||
protected:
|
||||
public:
|
||||
wxString Get(const wxString strVariable) const;
|
||||
bool GetBool(const wxString strVariable) const;
|
||||
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);
|
||||
};
|
||||
|
||||
#endif
|
1648
setup/wizard.cpp
Executable file
1648
setup/wizard.cpp
Executable file
File diff suppressed because it is too large
Load Diff
85
setup/wizard.h
Executable file
85
setup/wizard.h
Executable file
@ -0,0 +1,85 @@
|
||||
#ifndef __WIZARD_H
|
||||
#define __WIZARD_H
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// CampoWizardPage
|
||||
///////////////////////////////////////////////////////////
|
||||
class CampoWizardPage; //predefinizione di CampoWizardPage (magia nera!!)
|
||||
//predefinizione pure della CampoWizard con tutti i suoi metodi per poterlo usare nel metodo GetWizard (magia nerissima!!)
|
||||
class CampoWizard : public wxWizard
|
||||
{
|
||||
enum { m_nPages = 10 };
|
||||
CampoWizardPage* m_pPage[m_nPages];
|
||||
|
||||
wxString _strDestinationPath; //path di aggiornamento/installazione
|
||||
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 programmi directory per client)
|
||||
wxString _strDataPath; //path dati (creare o usare)
|
||||
|
||||
bool _bInstDemoData; //installa dati dimostrativi
|
||||
bool _bInstDemoVersion; //installa versione demo
|
||||
bool _bInstUseAuth; //installa/usa server authoriz
|
||||
wxString _strSrvAuth; //nome server authoriz
|
||||
bool _bInstUseDict; //installa/usa server diction
|
||||
wxString _strSrvDict; //nome server diction
|
||||
|
||||
unsigned int _iSrvAutostartMode; //tipologia di esecuzione dei server
|
||||
bool _bDesktopShortcut; //crea il link sul desktop
|
||||
|
||||
protected:
|
||||
DECLARE_EVENT_TABLE();
|
||||
void OnNext(wxCommandEvent& e);
|
||||
|
||||
int Pages() const { return m_nPages; }
|
||||
CampoWizardPage& Page(int p) const { wxASSERT(p >= 0 && p < m_nPages); return *m_pPage[p]; }
|
||||
|
||||
public:
|
||||
bool Run();
|
||||
wxString Get(wxWindowID id) const;
|
||||
int GetSelection(wxWindowID id) const;
|
||||
bool GetBool(wxWindowID id) const;
|
||||
void Set(wxWindowID id, const wxString str);
|
||||
|
||||
//metodi per il passaggio tra le finestre dei parametri di installazione!
|
||||
void SetDestinationPath(const wxString& strPath);
|
||||
const wxString& GetDestinationPath() const;
|
||||
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;
|
||||
void SetPrgNetPath(const wxString& strPrgNetPath);
|
||||
const wxString& GetPrgNetPath() const;
|
||||
void SetDataPath(const wxString& strDataPath);
|
||||
const wxString& GetDataPath() const;
|
||||
|
||||
void SetInstDemoData(const bool bInstDemoData);
|
||||
const bool GetInstDemoData() const;
|
||||
void SetInstDemoVersion(const bool bInstDemoVersion);
|
||||
const bool GetInstDemoVersion() const;
|
||||
|
||||
void SetInstUseAuth(const bool bInstUseAuth);
|
||||
const bool GetInstUseAuth() const;
|
||||
void SetSrvAuth(const wxString& strSrvAuth);
|
||||
const wxString& GetSrvAuth() const;
|
||||
|
||||
void SetInstUseDict(const bool bInstUseDict);
|
||||
const bool GetInstUseDict() const;
|
||||
void SetSrvDict(const wxString& strSrvDict);
|
||||
const wxString& GetSrvDict() const;
|
||||
|
||||
void SetSrvAutostartMode(const int iSrvAutostartMode);
|
||||
const int GetSrvAutostartMode() const;
|
||||
|
||||
void SetDesktopShortcut(const bool bDesktopShortcut);
|
||||
const bool GetDesktopShortcut() const;
|
||||
|
||||
CampoWizard(wxWindow* pParent);
|
||||
};
|
||||
|
||||
#endif
|
@ -21,5 +21,18 @@
|
||||
|
||||
#include <wx/wxprec.h>
|
||||
|
||||
#include <wx/dir.h>
|
||||
#include <wx/fileconf.h>
|
||||
#include <wx/filepicker.h>
|
||||
#include <wx/gbsizer.h>
|
||||
#include <wx/html/htmlwin.h>
|
||||
#include <wx/mimetype.h>
|
||||
#include <wx/progdlg.h>
|
||||
#include <wx/radiobox.h>
|
||||
#include <wx/txtstrm.h>
|
||||
#include <wx/wfstream.h>
|
||||
#include <wx/wizard.h>
|
||||
#include <wx/zipstrm.h>
|
||||
|
||||
#define APPNAME wxT("Campo")
|
||||
#define APPVERSION wxT("4.0")
|
Loading…
x
Reference in New Issue
Block a user