Patch level :AGA2.0 362

Files correlati     :installa.exe,ba1.exe
Ricompilazione Demo : [ ]
Commento            :sistemata installazione Eurocampo32 (schermata iniziale)


git-svn-id: svn://10.65.10.50/trunk@10676 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
luca 2002-12-16 09:42:49 +00:00
parent 9eb34c21f0
commit 77a380e56a
2 changed files with 32 additions and 61 deletions

View File

@ -1,3 +1,5 @@
#define WIN32_LEAN_AND_MEAN
#define STRICT
#include <windows.h>
#include <shellapi.h>
@ -12,29 +14,6 @@ extern "C"
#include "../include/skeytsr.h"
}
typedef unsigned char bool;
/*
void DrawBitMap (HDC hdc, HBITMAP hb, int x, int y)
{
BITMAP bm;
HDC hdcmem;
POINT ptsize, ptorg;
hdcmem = CreateCompatibleDC(hdc);
SelectObject(hdcmem, hb);
SetMapMode(hdcmem, GetMapMode(hdc));
GetObject(hb, sizeof(BITMAP), (LPSTR)&bm);
ptsize.x = bm.bmWidth;
ptsize.y = bm.bmHeight;
ptorg.x = ptorg.y = 0;
DPtoLP(hdc, &ptorg, 1);
BitBlt(hdc, x, y, ptsize.x, ptsize.y, hdcmem, ptorg.x, ptorg.y, SRCCOPY);
DeleteDC(hdcmem);
}
*/
void ErrorBox(LPCSTR str)
{
MessageBox(GetFocus(), str, "Installazione", MB_ICONSTOP|MB_OK);
@ -51,19 +30,19 @@ void WarningBox(LPCSTR str)
bool HardlockGarble(unsigned int* data)
{
HL_CODE(EYECAST data, 1);
HL_CODE(data, 1);
return TRUE;
}
unsigned int HardlockLogin(int& year)
{
unsigned int serno = 0xFFFF;
char REFKEY[16] = "CAMPOKEY";
char VERKEY[16] = "ìpÙˆ¬cê<";
unsigned char REFKEY[16] = "CAMPOKEY";
unsigned char VERKEY[16] = "ìpÙˆ¬cê<";
if (HL_LOGIN(26952, LOCAL_DEVICE, REFKEY, VERKEY) == STATUS_OK)
{
unsigned int eprom[64]; memset(eprom, 0, sizeof(eprom));
HL_READBL(EYECAST eprom);
HL_READBL((unsigned char*)eprom);
unsigned int data[4];
memcpy(data, eprom, sizeof(data));
HardlockGarble(data);
@ -73,7 +52,7 @@ unsigned int HardlockLogin(int& year)
serno = 0;
memcpy(data, &eprom[60], sizeof(data));
if (HardlockGarble(data));
if (HardlockGarble(data))
year = (int)data[0];
}
return serno;
@ -93,17 +72,6 @@ void EncodeEutronPassword(char* str)
strcpy(str, tmp);
}
/*
bool EutronGarble(KEY_NET& eutron_key, unsigned int* data)
{
eutron_key.net_command = NET_KEY_ACCESS;
eutron_key.command = SCRAMBLING_MODE;
memcpy(eutron_key.data, data, 8);
smartlink(&eutron_key);
return eutron_key.status == ST_OK;
}
*/
unsigned int EutronLogin(int& year)
{
unsigned int serno = 0xFFFF;
@ -183,7 +151,7 @@ int ThisYear()
int VersionYear()
{
char ver[32];
GetPrivateProfileString("ba", "Versione", "", ver, sizeof(ver), "./eurocamp/zip/install.ini");
GetPrivateProfileString("ba", "Versione", "", ver, sizeof(ver), "./eurocampo/zip/install.ini");
ver[4] = '\0';
return atoi(ver);
}
@ -204,7 +172,7 @@ bool DongleTest()
return TRUE;
bool ok = FALSE;
ifstream keys("./eurocamp/zip/dninst.zip", ios::in | ios::nocreate);
ifstream keys("./eurocampo/zip/dninst.zip", ios::in | ios::nocreate);
if (keys.good())
{
char line[256];
@ -243,9 +211,9 @@ bool DongleTest()
return ok;
}
HINSTANCE Run(LPCSTR app)
unsigned int Run(LPCSTR app)
{
HINSTANCE ret = WinExec(app, SW_SHOWNORMAL);
unsigned int ret = WinExec(app, SW_SHOWNORMAL);
if (ret <= 32)
{
char s[128];
@ -270,15 +238,24 @@ LRESULT CALLBACK MainWndProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
/* Repaint lo sfondo quando necessario*/
HDC hdc = (HDC) wParam;
HPEN hpenOld = SelectObject(hdc, GetStockObject(NULL_PEN));
HPEN hpenOld = (HPEN)SelectObject(hdc, GetStockObject(NULL_PEN));
RECT rect; GetClientRect(hwnd,&rect);
COLORREF cStart = GetSysColor(COLOR_ACTIVECAPTION);
COLORREF cStop = GetSysColor(27 /*COLOR_GRADIENTACTIVECAPTION*/);
int deltaR = GetRValue(cStop) - GetRValue(cStart);
int deltaG = GetGValue(cStop) - GetGValue(cStart);
int deltaB = GetBValue(cStop) - GetBValue(cStart);
const int ysize=rect.bottom-rect.top;
const int step = 4;
for (int y=rect.bottom; y>=rect.top-step; y-=step)
{
const int blu=192-int(long(y)*192/ysize);
HBRUSH hbrush = CreateSolidBrush(RGB(0,0,blu));
HBRUSH hbrushOld = SelectObject(hdc, hbrush);
int r = GetRValue(cStart) + deltaR * y / rect.bottom;
int g = GetGValue(cStart) + deltaG * y / rect.bottom;
int b = GetBValue(cStart) + deltaB * y / rect.bottom;
HBRUSH hbrush = CreateSolidBrush(RGB(r,g,b));
HBRUSH hbrushOld = (HBRUSH)SelectObject(hdc, hbrush);
Rectangle(hdc, rect.left, y, rect.right, y+step+1);
SelectObject(hdc, hbrushOld);
DeleteObject(hbrush);
@ -292,7 +269,6 @@ LRESULT CALLBACK MainWndProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
RECT rct;
const char* s1 = "Installa EUROCAMPO in versione commerciale protetta. E' necessario disporre di una chiave di protezione hardware.";
const char* s2 = "Installa EUROCAMPO in versione Demo. La versione Demo è priva di protezione hardware ma soggetta ad alcune limitazioni.";
const char* s3 = "Installazione pacchetto \"Cespiti\". E' necessario avere installato EUROCAMPO con il pacchetto \"Base\".";
const char* s4 = "Termina installazione";
const char* s5 = "Scelta installazione";
@ -308,23 +284,21 @@ LRESULT CALLBACK MainWndProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
rct.right = rct.left+350;
rct.bottom = offy+60;
SetTextColor(hdc, RGB(255,255,255));
SetTextColor(hdc, GetSysColor(COLOR_CAPTIONTEXT));
DrawText(hdc, s1, strlen(s1), &rct, DT_LEFT|DT_WORDBREAK);
rct.top += 80; rct.bottom += 80;
DrawText(hdc, s2, strlen(s2), &rct, DT_LEFT|DT_WORDBREAK);
rct.top += 80; rct.bottom += 80;
DrawText(hdc, s3, strlen(s3), &rct, DT_LEFT|DT_WORDBREAK);
rct.top += 80; rct.bottom += 80;
DrawText(hdc, s4, strlen(s4), &rct, DT_LEFT|DT_WORDBREAK);
/* Titolo con ombreggiatura */
HFONT hfont = CreateFont(64, 0, 0, 0, FW_BOLD, TRUE, FALSE, FALSE, ANSI_CHARSET, OUT_TT_PRECIS, CLIP_TT_ALWAYS, PROOF_QUALITY, VARIABLE_PITCH | FF_SWISS, "Arial");
HFONT hfontOld = SelectObject(hdc, hfont);
HFONT hfontOld = (HFONT)SelectObject(hdc, hfont);
SetTextColor(hdc, RGB(0,0,0));
TextOut(hdc, 20, 20, s5, strlen(s5));
SetTextColor(hdc, RGB(255,255,255));
SetTextColor(hdc, GetSysColor(COLOR_CAPTIONTEXT));
TextOut(hdc, 16, 16, s5, strlen(s5));
SelectObject(hdc, hfontOld);
@ -337,7 +311,7 @@ LRESULT CALLBACK MainWndProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
if (wParam == 1000)
{
if (DongleTest())
Run("eurocamp\\disk1\\setup.exe");
Run("eurocampo\\disk1\\setup.exe");
}
else if (wParam == 1001)
{
@ -425,16 +399,13 @@ int PASCAL WinMain (HINSTANCE hInst, HINSTANCE hinstPrev, LPSTR pCmdLine, int nC
/* Disegna i pulsanti */
CreateWindow("BUTTON","Installazione EUROCAMPO",
WS_CHILD| WS_VISIBLE ,offx ,offy,256,32, hwndDlg ,1000,hInst,NULL );
WS_CHILD| WS_VISIBLE ,offx ,offy,256,32, hwndDlg ,(HMENU)1000,hInst,NULL );
CreateWindow("BUTTON","Installazione EUROCAMPO Demo",
WS_CHILD| WS_VISIBLE ,offx ,offy+80,256,32, hwndDlg ,1001,hInst,NULL );
CreateWindow("BUTTON","Installazione Cespiti",
WS_CHILD| WS_VISIBLE,offx ,offy+160,256,32, hwndDlg ,1002,hInst,NULL );
WS_CHILD| WS_VISIBLE ,offx ,offy+80,256,32, hwndDlg ,(HMENU)1001,hInst,NULL );
CreateWindow("BUTTON","Uscita",
WS_CHILD| WS_VISIBLE,offx,offy+240,256,32, hwndDlg ,2,hInst,NULL );
WS_CHILD| WS_VISIBLE,offx,offy+160,256,32, hwndDlg ,(HMENU)2,hInst,NULL );
while (GetMessage(&msg, NULL, 0, 0))
{

View File

@ -570,7 +570,7 @@ void TSet_user_passwd::enable_aut()
{
const int module = _im->get_module_by_order(i+uns);
TToken_string& riga = sf.row(i);
if (module == BAAUT || module == MUAUT)
if (module == BAAUT || module == SRAUT)
{
sf.disable_cell(i,1);
riga.add("X",1);