Patch level :
Files correlati : Ricompilazione Demo : [ ] Commento : Aggiornameto programmi via Internet git-svn-id: svn://10.65.10.50/trunk@6972 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
d2856aefe3
commit
d6c69c7f57
296
ba/ba1700.cpp
296
ba/ba1700.cpp
@ -1,11 +1,13 @@
|
|||||||
#include <applicat.h>
|
#include <applicat.h>
|
||||||
#include <colors.h>
|
#include <colors.h>
|
||||||
|
#include <defmask.h>
|
||||||
#include <execp.h>
|
#include <execp.h>
|
||||||
|
#include <isamrpc.h>
|
||||||
#include <os_dep.h>
|
#include <os_dep.h>
|
||||||
#include <progind.h>
|
#include <progind.h>
|
||||||
#include <sheet.h>
|
#include <sheet.h>
|
||||||
#include <utility.h>
|
#include <utility.h>
|
||||||
#include <defmask.h>
|
|
||||||
|
|
||||||
#include "ba1.h"
|
#include "ba1.h"
|
||||||
#include "ba1500.h"
|
#include "ba1500.h"
|
||||||
@ -23,6 +25,7 @@
|
|||||||
#define C_CURRDATAREL 8
|
#define C_CURRDATAREL 8
|
||||||
#define C_ISPATCH 9
|
#define C_ISPATCH 9
|
||||||
|
|
||||||
|
const char* const http_default_path = "/aga/campo/";
|
||||||
|
|
||||||
HIDDEN int compare_version(const char* v1, int p1, const char* v2, int p2)
|
HIDDEN int compare_version(const char* v1, int p1, const char* v2, int p2)
|
||||||
{
|
{
|
||||||
@ -63,6 +66,7 @@ class TInstaller_mask : public TArray_sheet
|
|||||||
protected: // TSheet
|
protected: // TSheet
|
||||||
virtual bool on_key(KEY key);
|
virtual bool on_key(KEY key);
|
||||||
static bool tutti_handler(TMask_field& f, KEY k);
|
static bool tutti_handler(TMask_field& f, KEY k);
|
||||||
|
static bool update_handler(TMask_field& f, KEY k);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
static bool path_handler(TMask_field& fld, KEY key);
|
static bool path_handler(TMask_field& fld, KEY key);
|
||||||
@ -205,22 +209,91 @@ void TInstaller_mask::update_version()
|
|||||||
force_update();
|
force_update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool is_internet_path(const TString& addr)
|
||||||
|
{
|
||||||
|
if (addr.compare("www.", 4, TRUE) == 0)
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
|
if (addr.compare("http:", 5, TRUE) == 0)
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
|
int a1, a2, a3, a4;
|
||||||
|
if (sscanf(addr, "%d.%d.%d.%d", &a1, &a2, &a3, &a4) == 4)
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
// Cerca nel percorso specificato sulla maschera tutti i possibili files .ini
|
// Cerca nel percorso specificato sulla maschera tutti i possibili files .ini
|
||||||
// utilizzabili per un'installazione e li inserisce nello spreadsheet
|
// utilizzabili per un'installazione e li inserisce nello spreadsheet
|
||||||
bool TInstaller_mask::autoload()
|
bool TInstaller_mask::autoload()
|
||||||
{
|
{
|
||||||
TString_array& mask_rows = rows_array();
|
TString_array& mask_rows = rows_array();
|
||||||
const TString& path = get(F_PATH);
|
TFilename path = get(F_PATH);
|
||||||
if (!fexist(path))
|
|
||||||
|
TString http_server;
|
||||||
|
TFilename http_path;
|
||||||
|
|
||||||
|
TFilename ininame;
|
||||||
|
|
||||||
|
const bool internet = is_internet_path(path);
|
||||||
|
|
||||||
|
if (internet)
|
||||||
|
{
|
||||||
|
http_server = path;
|
||||||
|
if (http_server.compare("http://", 7, TRUE) == 0)
|
||||||
|
http_server.ltrim(7);
|
||||||
|
|
||||||
|
const int slash = http_server.find('/');
|
||||||
|
if (slash > 0)
|
||||||
|
{
|
||||||
|
http_path = http_server.mid(slash);
|
||||||
|
if (http_path.right(1) != "/")
|
||||||
|
http_path << '/';
|
||||||
|
http_server.cut(slash);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
http_path = http_default_path;
|
||||||
|
|
||||||
|
path.tempdir();
|
||||||
|
path.add("www");
|
||||||
|
make_dir(path);
|
||||||
|
|
||||||
|
ininame = path;
|
||||||
|
ininame.add(TInstall_ini::default_name());
|
||||||
|
|
||||||
|
if (ininame.exist() && yesno_box("Si desidera svuotare la cache dei files scaricati dal sito?"))
|
||||||
|
{
|
||||||
|
TString_array list;
|
||||||
|
TFilename name = path; name.add("*.*");
|
||||||
|
::list_files(name, list);
|
||||||
|
|
||||||
|
FOR_EACH_ARRAY_ROW(list, i, row)
|
||||||
|
::remove(*row);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!ininame.exist())
|
||||||
|
{
|
||||||
|
TFilename remote_ini = http_path;
|
||||||
|
remote_ini << TInstall_ini::default_name();
|
||||||
|
|
||||||
|
if (!http_get(http_server, remote_ini, ininame))
|
||||||
|
return error_box("Impossibile trasferire %s da %s",
|
||||||
|
(const char*)remote_ini, (const char*)http_server);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (fexist(path))
|
||||||
|
{
|
||||||
|
ininame = path;
|
||||||
|
ininame.add(TInstall_ini::default_name());
|
||||||
|
}
|
||||||
|
else
|
||||||
return error_box("Specificare un percorso valido");
|
return error_box("Specificare un percorso valido");
|
||||||
|
|
||||||
TWait_cursor hourglass;
|
TWait_cursor hourglass;
|
||||||
destroy();
|
destroy();
|
||||||
|
|
||||||
TFilename ininame;
|
|
||||||
ininame = path;
|
|
||||||
ininame.add(TInstall_ini::default_name());
|
|
||||||
|
|
||||||
TString_array modules;
|
TString_array modules;
|
||||||
|
|
||||||
if (fexist(ininame))
|
if (fexist(ininame))
|
||||||
@ -256,14 +329,46 @@ bool TInstaller_mask::autoload()
|
|||||||
TConfig ini(ininame, module);
|
TConfig ini(ininame, module);
|
||||||
add_module(ini, module, FALSE);
|
add_module(ini, module, FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// add patches
|
// add patches
|
||||||
ininame = path;
|
|
||||||
ininame.add("??0???a.ini");
|
|
||||||
modules.destroy();
|
modules.destroy();
|
||||||
list_files(ininame, modules);
|
if (internet)
|
||||||
|
{
|
||||||
|
http_dir(http_server, http_path, modules);
|
||||||
|
for (int i = modules.last(); i >= 0; i--)
|
||||||
|
{
|
||||||
|
TString& str = modules.row(i);
|
||||||
|
if (str.match("??0???A.INI") || str.match("??0???a.ini"))
|
||||||
|
{
|
||||||
|
TFilename remote = http_path;
|
||||||
|
remote << str;
|
||||||
|
|
||||||
|
ininame = path;
|
||||||
|
ininame.add(str);
|
||||||
|
|
||||||
|
if (!ininame.exist() && !http_get(http_server, remote, ininame))
|
||||||
|
{
|
||||||
|
error_box("Errore di trasferimento del file %s", (const char*)remote);
|
||||||
|
modules.destroy(i);
|
||||||
|
}
|
||||||
|
|
||||||
|
str = ininame;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
modules.destroy(i);
|
||||||
|
}
|
||||||
|
modules.pack();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ininame = path;
|
||||||
|
ininame.add("??0???a.ini");
|
||||||
|
list_files(ininame, modules);
|
||||||
|
}
|
||||||
|
|
||||||
modules.sort(); // sort to have patches in patchlevel order
|
modules.sort(); // sort to have patches in patchlevel order
|
||||||
|
|
||||||
FOR_EACH_ARRAY_ROW(modules, am, arow)
|
FOR_EACH_ARRAY_ROW(modules, am, arow)
|
||||||
{
|
{
|
||||||
TString& ininame = *arow;
|
TString& ininame = *arow;
|
||||||
@ -286,7 +391,8 @@ bool TInstaller_mask::autoload()
|
|||||||
mask_rows.row(r+1).add(patchlevel, C_PATCH); // aggiorna il patchlevel mostrato per il modulo
|
mask_rows.row(r+1).add(patchlevel, C_PATCH); // aggiorna il patchlevel mostrato per il modulo
|
||||||
force_update(r+1);
|
force_update(r+1);
|
||||||
}
|
}
|
||||||
} else
|
}
|
||||||
|
else
|
||||||
add_module(ini, module, TRUE);
|
add_module(ini, module, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -417,19 +523,23 @@ bool TInstaller_mask::move_file(const TFilename& from, const TFilename& file, co
|
|||||||
disk = 'A' - letter + 1;
|
disk = 'A' - letter + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
space_ok = ::os_test_disk_free_space(dest, filesize);
|
space_ok = ::os_test_disk_free_space(todir, filesize);
|
||||||
if (!space_ok)
|
if (!space_ok)
|
||||||
{
|
{
|
||||||
TString msg;
|
TString msg;
|
||||||
msg << "Lo spazio sull'unita' e' insufficiente";
|
msg << "Lo spazio su disco e' insufficiente:\n";
|
||||||
if (::os_is_removable_drive(dest))
|
if (::os_is_removable_drive(todir))
|
||||||
{
|
{
|
||||||
msg << ":\nInserire un nuovo disco e ritentare?";
|
msg << "Inserire un nuovo disco e ritentare?";
|
||||||
if (!yesno_box(msg))
|
if (!yesno_box(msg))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return error_box(msg);
|
{
|
||||||
|
msg << "Si desidera proseguire ugualmente?";
|
||||||
|
if (!noyes_box(msg))
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -454,6 +564,7 @@ bool TInstaller_mask::move_module(const TString& module, TInstall_ini& ini, bool
|
|||||||
|
|
||||||
TFilename src; src.tempdir();
|
TFilename src; src.tempdir();
|
||||||
const TFilename tempdir(src);
|
const TFilename tempdir(src);
|
||||||
|
const TString& dst = get(F_CURPATH);
|
||||||
|
|
||||||
TString_array list;
|
TString_array list;
|
||||||
ini.build_list(module, list);
|
ini.build_list(module, list);
|
||||||
@ -463,7 +574,7 @@ bool TInstaller_mask::move_module(const TString& module, TInstall_ini& ini, bool
|
|||||||
src.add(file->get(0));
|
src.add(file->get(0));
|
||||||
if (update)
|
if (update)
|
||||||
{
|
{
|
||||||
const bool move_ok = move_file(tempdir, src, ".");
|
const bool move_ok = move_file(tempdir, src, dst);
|
||||||
if (!move_ok)
|
if (!move_ok)
|
||||||
ok = update = FALSE;
|
ok = update = FALSE;
|
||||||
}
|
}
|
||||||
@ -479,12 +590,37 @@ bool TInstaller_mask::move_module(const TString& module, TInstall_ini& ini, bool
|
|||||||
|
|
||||||
bool TInstaller_mask::install(const TString& module, int patchlevel)
|
bool TInstaller_mask::install(const TString& module, int patchlevel)
|
||||||
{
|
{
|
||||||
TInstall_ini *ini;
|
TInstall_ini* ini = NULL;
|
||||||
bool ok = FALSE;
|
bool ok = FALSE;
|
||||||
TString16 lastrelease; // release che sto installando
|
TString16 lastrelease; // release che sto installando
|
||||||
int lastpatch=patchlevel; // patchlevel che sto installando
|
int lastpatch=patchlevel; // patchlevel che sto installando
|
||||||
|
|
||||||
const TString& path = get(F_PATH);
|
TFilename path = get(F_PATH);
|
||||||
|
TString http_server;
|
||||||
|
TFilename http_path;
|
||||||
|
|
||||||
|
const bool internet = is_internet_path(path);
|
||||||
|
if (internet)
|
||||||
|
{
|
||||||
|
http_server = path;
|
||||||
|
if (http_server.compare("http://", 7, TRUE) == 0)
|
||||||
|
http_server.ltrim(7);
|
||||||
|
|
||||||
|
const int slash = http_server.find('/');
|
||||||
|
if (slash > 0)
|
||||||
|
{
|
||||||
|
http_path = http_server.mid(slash);
|
||||||
|
if (http_path.right(1) != "/")
|
||||||
|
http_path << '/';
|
||||||
|
http_server.cut(slash);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
http_path = http_default_path;
|
||||||
|
|
||||||
|
path.tempdir();
|
||||||
|
path.add("www");
|
||||||
|
}
|
||||||
|
|
||||||
TFilename ininame = path;
|
TFilename ininame = path;
|
||||||
ininame.add(module);
|
ininame.add(module);
|
||||||
|
|
||||||
@ -497,7 +633,14 @@ bool TInstaller_mask::install(const TString& module, int patchlevel)
|
|||||||
else
|
else
|
||||||
ininame << "inst.ini";
|
ininame << "inst.ini";
|
||||||
|
|
||||||
if (fexist(ininame))
|
if (internet && !ininame.exist())
|
||||||
|
{
|
||||||
|
TFilename remote = ininame.name();
|
||||||
|
remote.insert(http_path, 0);
|
||||||
|
http_get(http_server, remote, ininame);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ininame.exist())
|
||||||
{
|
{
|
||||||
ini = new TInstall_ini (ininame);
|
ini = new TInstall_ini (ininame);
|
||||||
ini->write_protect();
|
ini->write_protect();
|
||||||
@ -519,10 +662,12 @@ bool TInstaller_mask::install(const TString& module, int patchlevel)
|
|||||||
if (!ok) return FALSE;
|
if (!ok) return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
TString msg("Decompressione");
|
TString msg;
|
||||||
|
msg << "Decompressione";
|
||||||
if (patchlevel > 0 )
|
if (patchlevel > 0 )
|
||||||
msg << " della patch " << patchlevel ;
|
msg << " della patch " << patchlevel ;
|
||||||
msg << " del modulo '" << module << "' in corso...";
|
msg << " del modulo '" << module << "' in corso...";
|
||||||
|
|
||||||
TProgind pi(dischi, msg, FALSE, TRUE);
|
TProgind pi(dischi, msg, FALSE, TRUE);
|
||||||
TFilename tempdir; tempdir.tempdir();
|
TFilename tempdir; tempdir.tempdir();
|
||||||
|
|
||||||
@ -541,12 +686,19 @@ bool TInstaller_mask::install(const TString& module, int patchlevel)
|
|||||||
cmdline << "inst";
|
cmdline << "inst";
|
||||||
cmdline << d << ".zip";
|
cmdline << d << ".zip";
|
||||||
|
|
||||||
|
if (internet && !cmdline.exist())
|
||||||
|
{
|
||||||
|
TFilename remote = cmdline.name();
|
||||||
|
remote.insert(http_path, 0);
|
||||||
|
http_get(http_server, remote, cmdline);
|
||||||
|
}
|
||||||
|
|
||||||
ok = cmdline.exist();
|
ok = cmdline.exist();
|
||||||
while (!ok)
|
while (!ok)
|
||||||
{
|
{
|
||||||
message_box("Inserire il disco %d di %d del modulo\n'%s'",
|
message_box("Inserire il disco %d di %d del modulo\n'%s'",
|
||||||
d, dischi, (const char*)ini->get("Descrizione"));
|
d, dischi, (const char*)ini->get("Descrizione"));
|
||||||
ok = fexist(cmdline);
|
ok = cmdline.exist();
|
||||||
if (!ok)
|
if (!ok)
|
||||||
{
|
{
|
||||||
if (!yesno_box("Impossibile trovare %s\nSi desidera riprovare?",
|
if (!yesno_box("Impossibile trovare %s\nSi desidera riprovare?",
|
||||||
@ -558,7 +710,8 @@ bool TInstaller_mask::install(const TString& module, int patchlevel)
|
|||||||
if (ok)
|
if (ok)
|
||||||
{
|
{
|
||||||
const long required = fsize(cmdline) * (dischi-d+1) * 4;
|
const long required = fsize(cmdline) * (dischi-d+1) * 4;
|
||||||
if (::os_test_disk_free_space("", required))
|
const TString& dest = get(F_CURPATH);
|
||||||
|
if (!::os_test_disk_free_space(dest, required))
|
||||||
{
|
{
|
||||||
ok = yesno_box("Lo spazio su disco potrebbe essere insufficiente:\n"
|
ok = yesno_box("Lo spazio su disco potrebbe essere insufficiente:\n"
|
||||||
"Si desidera continuare ugualmente?");
|
"Si desidera continuare ugualmente?");
|
||||||
@ -659,10 +812,10 @@ bool TInstaller_mask::install(const TString& module, int patchlevel)
|
|||||||
if (ok)
|
if (ok)
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
ini = new TInstall_ini();
|
TInstall_ini ini;
|
||||||
ini->set("DiskPath", path);
|
ini.set("DiskPath", get(F_PATH));
|
||||||
ini->set("Data", TDate(TODAY), module);
|
ini.set("Data", TDate(TODAY), module);
|
||||||
ini->update_prices(ininame);
|
ini.update_prices(ininame);
|
||||||
}
|
}
|
||||||
// Non togliere le parentesi graffe soprastanti per permettere l'aggiornamento fisico del .ini (CON LA CHIAMATA DEL DISTRUTTORE)
|
// Non togliere le parentesi graffe soprastanti per permettere l'aggiornamento fisico del .ini (CON LA CHIAMATA DEL DISTRUTTORE)
|
||||||
update_version();
|
update_version();
|
||||||
@ -685,6 +838,12 @@ bool TInstaller_mask::install_patches(const TString& module, const TString& last
|
|||||||
bool ok = FALSE;
|
bool ok = FALSE;
|
||||||
TString_array modules;
|
TString_array modules;
|
||||||
TFilename ininame = get(F_PATH);
|
TFilename ininame = get(F_PATH);
|
||||||
|
if (is_internet_path(ininame))
|
||||||
|
{
|
||||||
|
ininame.tempdir();
|
||||||
|
ininame.add("www");
|
||||||
|
}
|
||||||
|
|
||||||
ininame.add(module);
|
ininame.add(module);
|
||||||
ininame << "0???a.ini";
|
ininame << "0???a.ini";
|
||||||
modules.destroy();
|
modules.destroy();
|
||||||
@ -713,26 +872,27 @@ bool TInstaller_mask::path_handler(TMask_field& fld, KEY key)
|
|||||||
if (key == K_TAB && fld.focusdirty())
|
if (key == K_TAB && fld.focusdirty())
|
||||||
{
|
{
|
||||||
TFilename path = fld.get();
|
TFilename path = fld.get();
|
||||||
if (path.len() == 2 && isalpha(path[0]) && path[1] == ':')
|
if (path.not_empty())
|
||||||
{
|
{
|
||||||
path << SLASH;
|
if (path.len() == 2 && isalpha(path[0]) && path[1] == ':')
|
||||||
fld.set(path);
|
{
|
||||||
|
path << SLASH;
|
||||||
|
fld.set(path);
|
||||||
|
}
|
||||||
|
if (path.exist() || ::is_internet_path(path))
|
||||||
|
_curr_mask->autoload();
|
||||||
|
else
|
||||||
|
ok = fld.error_box("Specificare un percorso valido");
|
||||||
}
|
}
|
||||||
if (path.exist())
|
|
||||||
_curr_mask->autoload();
|
|
||||||
else
|
|
||||||
ok = fld.error_box("Specificare un percorso valido");
|
|
||||||
}
|
}
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void TInstaller_mask::install_selection()
|
void TInstaller_mask::install_selection()
|
||||||
{
|
{
|
||||||
TString_array& arr = rows_array();
|
TString_array& arr = rows_array();
|
||||||
FOR_EACH_ARRAY_ROW(arr, r, row) if (checked(r))
|
FOR_EACH_ARRAY_ROW(arr, r, row) if (checked(r))
|
||||||
{
|
{
|
||||||
|
|
||||||
const TString newver = row->get(C_RELEASE);
|
const TString newver = row->get(C_RELEASE);
|
||||||
|
|
||||||
if (newver.blank())
|
if (newver.blank())
|
||||||
@ -755,7 +915,7 @@ void TInstaller_mask::install_selection()
|
|||||||
bool ok = TRUE;
|
bool ok = TRUE;
|
||||||
const int cmp = compare_version(oldver, oldpatch, newver, newpatch);
|
const int cmp = compare_version(oldver, oldpatch, newver, newpatch);
|
||||||
if (cmp == 0)
|
if (cmp == 0)
|
||||||
ok = yesno_box("Si desidera reinstallare la versione %s.%d del modulo '%s' ?", (const char*)newver, newpatch, (const char*)modulo);
|
ok = noyes_box("Si desidera reinstallare la versione %s.%d del modulo '%s' ?", (const char*)newver, newpatch, (const char*)modulo);
|
||||||
if (cmp > 0)
|
if (cmp > 0)
|
||||||
{
|
{
|
||||||
TString256 msg;
|
TString256 msg;
|
||||||
@ -764,7 +924,8 @@ void TInstaller_mask::install_selection()
|
|||||||
"funzionamento di tutti i programmi!", (const char*)newver, newpatch, (const char*)modulo);
|
"funzionamento di tutti i programmi!", (const char*)newver, newpatch, (const char*)modulo);
|
||||||
ok = noyes_box(msg);
|
ok = noyes_box(msg);
|
||||||
}
|
}
|
||||||
const bool is_patch = row->get_char(C_ISPATCH) > ' ';
|
|
||||||
|
bool is_patch = row->get_char(C_ISPATCH) > ' ';
|
||||||
if (is_patch)
|
if (is_patch)
|
||||||
{
|
{
|
||||||
// installo le patch solo se esiste già un modulo installato della stessa versione
|
// installo le patch solo se esiste già un modulo installato della stessa versione
|
||||||
@ -772,8 +933,18 @@ void TInstaller_mask::install_selection()
|
|||||||
if (oldver != newver)
|
if (oldver != newver)
|
||||||
ok =error_box("Impossibile installare le patch della versione %s \nperché il modulo '%s' installato ha versione %s ",(const char *)newver,(const char *)modulo,(const char *)oldver);
|
ok =error_box("Impossibile installare le patch della versione %s \nperché il modulo '%s' installato ha versione %s ",(const char *)newver,(const char *)modulo,(const char *)oldver);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ok)
|
if (ok)
|
||||||
{
|
{
|
||||||
|
if (!is_patch)
|
||||||
|
{
|
||||||
|
if (newver == oldver && newpatch != oldpatch &&
|
||||||
|
!noyes_box("Si desidera reinstallare l'intero modulo?\n"
|
||||||
|
"Rispondendo NO verranno installate le sole patch"))
|
||||||
|
{
|
||||||
|
is_patch = TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (is_patch)
|
if (is_patch)
|
||||||
{
|
{
|
||||||
@ -782,7 +953,11 @@ void TInstaller_mask::install_selection()
|
|||||||
ok = install(modulo, newpatch); // re-installa l'ultima per sicurezza ()
|
ok = install(modulo, newpatch); // re-installa l'ultima per sicurezza ()
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
ok = install(modulo, 0); // installa il modulo
|
ok = install(modulo, 0); // installa il modulo
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (ok)
|
if (ok)
|
||||||
_installed = TRUE; // Setta il flag di almeno un modulo installato
|
_installed = TRUE; // Setta il flag di almeno un modulo installato
|
||||||
if (ok)
|
if (ok)
|
||||||
@ -832,26 +1007,25 @@ bool TInstaller_mask::tutti_handler(TMask_field& f, KEY k)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool TInstaller_mask::update_handler(TMask_field& f, KEY k)
|
||||||
|
{
|
||||||
|
if (k == K_SPACE)
|
||||||
|
{
|
||||||
|
TInstaller_mask& m = (TInstaller_mask&)f.mask();
|
||||||
|
m.autoload();
|
||||||
|
}
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
bool TInstaller_mask::on_key(KEY key)
|
bool TInstaller_mask::on_key(KEY key)
|
||||||
{
|
{
|
||||||
bool ok = TRUE;
|
bool ok = TRUE;
|
||||||
if (key == K_CTRL+'N')
|
switch(key)
|
||||||
autoload();
|
{
|
||||||
else
|
case K_F7: autoload(); break;
|
||||||
if (key == K_F8)
|
case K_F8: field(DLG_USER).on_hit(); break;
|
||||||
{
|
default : ok = TArray_sheet::on_key(key); break;
|
||||||
for (long i = items()-1; i >= 0; i--)
|
}
|
||||||
{
|
|
||||||
TToken_string r = row(i);
|
|
||||||
const TString16 newver = r.get(C_RELEASE);
|
|
||||||
const int newpatch = r.get_int(C_PATCH);
|
|
||||||
const TString16 curver = r.get(C_CURRRELEASE);
|
|
||||||
const int curpatch = r.get_int(C_CURRPATCH);
|
|
||||||
check(i, compare_version(newver, newpatch, curver, curpatch) > 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
ok = TArray_sheet::on_key(key);
|
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -863,13 +1037,15 @@ TInstaller_mask::TInstaller_mask()
|
|||||||
_curr_mask = this;
|
_curr_mask = this;
|
||||||
_installed = FALSE;
|
_installed = FALSE;
|
||||||
|
|
||||||
add_string(F_PATH, 0, "Percorso da cui installare ", 1, 1, 50);
|
add_string(F_PATH, 0, "Installa da ", 1, 1, 50);
|
||||||
add_string(F_CURPATH, 0, "Percorso in cui installare ", 1, 2, 50, "D");
|
add_string(F_CURPATH, 0, "Installa in ", 1, 2, 50, "D");
|
||||||
|
add_button(F_UPDATE, "Lista", '\0');
|
||||||
add_button(F_INSTALL, "Installa", '\0'); // NON mettere 'I'
|
add_button(F_INSTALL, "Installa", '\0'); // NON mettere 'I'
|
||||||
|
|
||||||
set_handler(F_PATH, path_handler);
|
set_handler(F_PATH, path_handler);
|
||||||
set_handler(F_INSTALL, install_handler);
|
set_handler(F_INSTALL, install_handler);
|
||||||
set_handler(DLG_USER, tutti_handler);
|
set_handler(DLG_USER, tutti_handler);
|
||||||
|
set_handler(F_UPDATE, update_handler);
|
||||||
|
|
||||||
TDongle dongle; dongle.login(); dongle.logout();
|
TDongle dongle; dongle.login(); dongle.logout();
|
||||||
_year_assist = dongle.year_assist();
|
_year_assist = dongle.year_assist();
|
||||||
@ -878,9 +1054,8 @@ TInstaller_mask::TInstaller_mask()
|
|||||||
TFilename path = ini.get("DiskPath");
|
TFilename path = ini.get("DiskPath");
|
||||||
set(F_PATH, path);
|
set(F_PATH, path);
|
||||||
|
|
||||||
const char lettera = toupper(path[0]);
|
|
||||||
const bool floppy = ::os_is_removable_drive(path);
|
const bool floppy = ::os_is_removable_drive(path);
|
||||||
if (path.not_empty() && !floppy)
|
if (path.not_empty() && !floppy && !is_internet_path(path))
|
||||||
autoload();
|
autoload();
|
||||||
|
|
||||||
DIRECTORY dir;
|
DIRECTORY dir;
|
||||||
@ -908,7 +1083,6 @@ protected:
|
|||||||
void TInstaller::main_loop()
|
void TInstaller::main_loop()
|
||||||
{
|
{
|
||||||
TInstaller_mask m;
|
TInstaller_mask m;
|
||||||
m.load();
|
|
||||||
m.run();
|
m.run();
|
||||||
if (m.installed()) // Almeno 1 modulo installato ?
|
if (m.installed()) // Almeno 1 modulo installato ?
|
||||||
{
|
{
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
#define F_PATH 201
|
#define F_PATH 201
|
||||||
#define F_CURPATH 202
|
#define F_CURPATH 202
|
||||||
#define F_INSTALL 203
|
#define F_INSTALL 203
|
||||||
|
#define F_SELECT 204
|
||||||
|
#define F_UPDATE 205
|
||||||
|
Loading…
x
Reference in New Issue
Block a user