From f9ddfb219e9ca87564631833dc2d25f2fb2cfec7 Mon Sep 17 00:00:00 2001 From: kichik Date: Wed, 21 Aug 2002 19:05:14 +0000 Subject: [PATCH] Added a dialog that shows up if compress whole is used and initial uncompressing lasts longer than a second. git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@706 212acab6-be3b-0410-9dea-997c60f758d6 --- Source/exehead/Main.c | 22 +++++++++++++++------- Source/exehead/lang.h | 2 ++ 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/Source/exehead/Main.c b/Source/exehead/Main.c index ec5c77fd..a666807b 100644 --- a/Source/exehead/Main.c +++ b/Source/exehead/Main.c @@ -55,26 +55,28 @@ char g_caption[NSIS_MAX_STRLEN*2]; int g_filehdrsize; HWND g_hwnd; -static int m_length; -static int m_pos; - #ifdef NSIS_CONFIG_PLUGIN_SUPPORT extern char plugins_temp_dir[NSIS_MAX_STRLEN]; #endif +int m_length; +int m_pos; + #ifdef NSIS_CONFIG_VISIBLE_SUPPORT -#ifdef NSIS_CONFIG_CRC_SUPPORT -static BOOL CALLBACK verProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) +#if defined(NSIS_CONFIG_CRC_SUPPORT) || defined(NSIS_COMPRESS_WHOLE) +BOOL CALLBACK verProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { + static char *msg; if (uMsg == WM_INITDIALOG) { SetTimer(hwndDlg,1,250,NULL); + msg = (char*)lParam; uMsg = WM_TIMER; } if (uMsg == WM_TIMER) { static char bt[64]; - wsprintf(bt,_LANG_VERIFYINGINST,MulDiv(m_pos,100,m_length)); + wsprintf(bt,msg,MulDiv(m_pos,100,m_length)); SetWindowText(hwndDlg,bt); SetDlgItemText(hwndDlg,IDC_STR,bt); @@ -236,7 +238,13 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInst,LPSTR lpszCmdParam, while (PeekMessage(&msg,NULL,0,0,PM_REMOVE)) DispatchMessage(&msg); } else if (GetTickCount() > verify_time) - hwnd=CreateDialog(g_hInstance,MAKEINTRESOURCE(IDD_VERIFY),GetDesktopWindow(),verProc); + hwnd=CreateDialogParam( + g_hInstance, + MAKEINTRESOURCE(IDD_VERIFY), + GetDesktopWindow(), + verProc, + (LPARAM)_LANG_VERIFYINGINST + ); } #endif//NSIS_CONFIG_VISIBLE_SUPPORT diff --git a/Source/exehead/lang.h b/Source/exehead/lang.h index b7c25be9..66c3863d 100644 --- a/Source/exehead/lang.h +++ b/Source/exehead/lang.h @@ -16,6 +16,8 @@ #define _LANG_VERIFYINGINST "verifying installer: %d%%" +#define _LANG_UNPACKING "unpacking data: %d%%" + #define _LANG_CANTOPENSELF "Can't open self" #define _LANG_GENERIC_ERROR "NSIS ERROR"