- Fixed uninstaller not showing anything when installer is silent
- Improved CResourceEditor - should be more tolerant now - Removed legacy code from InstallOptions and StartMenu git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@2882 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
148c9a1b86
commit
896ba172d5
7 changed files with 77 additions and 117 deletions
|
@ -826,16 +826,7 @@ int WINAPI StaticLINKWindowProc(HWND hWin, UINT uMsg, LPARAM wParam, WPARAM lPar
|
|||
}
|
||||
#endif
|
||||
|
||||
int nIdx;
|
||||
HWND childwnd;
|
||||
int cw_vis;
|
||||
int was_ok_enabled;
|
||||
char old_cancel[256];
|
||||
char old_ok[256];
|
||||
char old_back[256];
|
||||
int old_cancel_enabled;
|
||||
int old_cancel_visible;
|
||||
char old_title[1024];
|
||||
|
||||
int createCfgDlg()
|
||||
{
|
||||
|
@ -858,8 +849,7 @@ int createCfgDlg()
|
|||
return 1;
|
||||
}
|
||||
|
||||
childwnd=FindWindowEx(hMainWindow,NULL,"#32770",NULL); // find window to replace
|
||||
if (!childwnd || nRectId != DEFAULT_RECT) childwnd=GetDlgItem(hMainWindow,nRectId);
|
||||
HWND childwnd=GetDlgItem(hMainWindow,nRectId);
|
||||
if (!childwnd)
|
||||
{
|
||||
popstring(NULL);
|
||||
|
@ -867,23 +857,16 @@ int createCfgDlg()
|
|||
return 1;
|
||||
}
|
||||
|
||||
cw_vis=IsWindowVisible(childwnd);
|
||||
if (cw_vis) ShowWindow(childwnd,SW_HIDE);
|
||||
|
||||
hCancelButton = GetDlgItem(hMainWindow,IDCANCEL);
|
||||
hNextButton = GetDlgItem(hMainWindow,IDOK);
|
||||
hBackButton = GetDlgItem(hMainWindow,3);
|
||||
|
||||
was_ok_enabled=EnableWindow(hNextButton,1);
|
||||
GetWindowText(hCancelButton,old_cancel,sizeof(old_cancel));
|
||||
if (pszCancelButtonText) SetWindowText(hCancelButton,pszCancelButtonText);
|
||||
GetWindowText(hNextButton,old_ok,sizeof(old_ok));
|
||||
if (pszNextButtonText) SetWindowText(hNextButton,pszNextButtonText);
|
||||
GetWindowText(hBackButton,old_back,sizeof(old_back));
|
||||
if (pszBackButtonText) SetWindowText(hBackButton,pszBackButtonText);
|
||||
|
||||
if (bBackEnabled!=0xFFFF0000) EnableWindow(hBackButton,bBackEnabled);
|
||||
if (bCancelEnabled!=0xFFFF0000) old_cancel_enabled=!EnableWindow(hCancelButton,bCancelEnabled);
|
||||
if (bCancelEnabled!=0xFFFF0000) EnableWindow(hCancelButton,bCancelEnabled);
|
||||
if (bCancelShow!=0xFFFF0000) old_cancel_visible=ShowWindow(hCancelButton,bCancelShow?SW_SHOWNA:SW_HIDE);
|
||||
|
||||
HFONT hFont = (HFONT)SendMessage(hMainWindow, WM_GETFONT, 0, 0);
|
||||
|
@ -933,7 +916,7 @@ int createCfgDlg()
|
|||
|
||||
#define DEFAULT_STYLES (WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS)
|
||||
|
||||
for (nIdx = 0; nIdx < nNumFields; nIdx++) {
|
||||
for (int nIdx = 0; nIdx < nNumFields; nIdx++) {
|
||||
static struct {
|
||||
char* pszClass;
|
||||
DWORD dwStyle;
|
||||
|
@ -1217,10 +1200,7 @@ int createCfgDlg()
|
|||
}
|
||||
|
||||
if (pszTitle)
|
||||
{
|
||||
GetWindowText(hMainWindow,old_title,sizeof(old_title));
|
||||
SetWindowText(hMainWindow,pszTitle);
|
||||
}
|
||||
pFilenameStackEntry = *g_stacktop;
|
||||
*g_stacktop = (*g_stacktop)->next;
|
||||
char tmp[32];
|
||||
|
@ -1254,19 +1234,10 @@ void showCfgDlg()
|
|||
if (lpWndProcOld)
|
||||
SetWindowLong(hMainWindow,DWL_DLGPROC,(long)lpWndProcOld);
|
||||
DestroyWindow(hConfigWindow);
|
||||
if (was_ok_enabled) EnableWindow(hNextButton,0);
|
||||
SetWindowText(hCancelButton,old_cancel);
|
||||
SetWindowText(hNextButton,old_ok);
|
||||
SetWindowText(hBackButton,old_back);
|
||||
|
||||
// by ORTIM: 13-August-2002
|
||||
if (bCancelEnabled!=0xFFFF0000) EnableWindow(hCancelButton,old_cancel_enabled);
|
||||
if (bCancelShow!=0xFFFF0000) ShowWindow(hCancelButton,old_cancel_visible?SW_SHOWNA:SW_HIDE);
|
||||
|
||||
if (pszTitle) SetWindowText(hMainWindow,old_title);
|
||||
|
||||
if (cw_vis) ShowWindow(childwnd,SW_SHOWNA);
|
||||
|
||||
FREE(pFilenameStackEntry);
|
||||
FREE(pszTitle);
|
||||
FREE(pszCancelButtonText);
|
||||
|
|
|
@ -6,12 +6,8 @@ HINSTANCE g_hInstance;
|
|||
|
||||
HWND hwParent;
|
||||
HWND hwChild;
|
||||
HWND hwStartMenuSelect;
|
||||
HWND hwIcon;
|
||||
HWND hwText;
|
||||
HWND hwLocation;
|
||||
HWND hwDirList;
|
||||
HWND hwCheckBox;
|
||||
HWND g_hwStartMenuSelect;
|
||||
HWND g_hwDirList;
|
||||
|
||||
char buf[MAX_PATH];
|
||||
char text[1024];
|
||||
|
@ -32,15 +28,14 @@ void AddFolderFromReg(HKEY rootKey);
|
|||
|
||||
void __declspec(dllexport) Select(HWND hwndParent, int string_size, char *variables, stack_t **stacktop)
|
||||
{
|
||||
HWND hwStartMenuSelect;
|
||||
|
||||
hwParent = hwndParent;
|
||||
|
||||
EXDLL_INIT();
|
||||
|
||||
{
|
||||
int cw_vis;
|
||||
|
||||
hwChild = FindWindowEx(hwndParent, NULL, "#32770", NULL); // find window to replace
|
||||
if (!hwChild) hwChild = GetDlgItem(hwndParent, 1018);
|
||||
hwChild = GetDlgItem(hwndParent, 1018);
|
||||
if (!hwChild)
|
||||
{
|
||||
pushstring("error finding childwnd");
|
||||
|
@ -86,10 +81,8 @@ void __declspec(dllexport) Select(HWND hwndParent, int string_size, char *variab
|
|||
return;
|
||||
}
|
||||
|
||||
cw_vis = IsWindowVisible(hwChild);
|
||||
if (cw_vis) ShowWindow(hwChild, SW_HIDE);
|
||||
|
||||
hwStartMenuSelect = CreateDialog(g_hInstance, MAKEINTRESOURCE(IDD_DIALOG), hwndParent, dlgProc);
|
||||
g_hwStartMenuSelect = hwStartMenuSelect;
|
||||
if (!hwStartMenuSelect)
|
||||
{
|
||||
pushstring("error creating dialog");
|
||||
|
@ -110,8 +103,6 @@ void __declspec(dllexport) Select(HWND hwndParent, int string_size, char *variab
|
|||
DestroyWindow(hwStartMenuSelect);
|
||||
|
||||
SetWindowLong(hwndParent, DWL_DLGPROC, (long) lpWndProcOld);
|
||||
|
||||
if (cw_vis) ShowWindow(hwChild, SW_SHOW);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -121,7 +112,7 @@ static BOOL CALLBACK ParentWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARA
|
|||
if (message == WM_NOTIFY_OUTER_NEXT && !bRes)
|
||||
{
|
||||
// if leave function didn't abort (lRes != 0 in that case)
|
||||
PostMessage(hwStartMenuSelect,WM_USER+666,wParam,0);
|
||||
PostMessage(g_hwStartMenuSelect,WM_USER+666,wParam,0);
|
||||
}
|
||||
return bRes;
|
||||
}
|
||||
|
@ -141,10 +132,17 @@ static BOOL CALLBACK ParentWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARA
|
|||
|
||||
BOOL CALLBACK dlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
HWND hwLocation = GetDlgItem(hwndDlg, IDC_LOCATION);
|
||||
HWND hwDirList = GetDlgItem(hwndDlg, IDC_DIRLIST);
|
||||
HWND hwCheckBox = GetDlgItem(hwndDlg, IDC_CHECK);
|
||||
|
||||
switch (uMsg)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
{
|
||||
HWND hwIcon;
|
||||
HWND hwText;
|
||||
|
||||
RECT dialog_r, temp_r;
|
||||
|
||||
HFONT hFont = (HFONT)SendMessage(hwParent, WM_GETFONT, 0, 0);
|
||||
|
@ -172,9 +170,7 @@ BOOL CALLBACK dlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||
|
||||
hwIcon = GetDlgItem(hwndDlg, IDC_NSISICON);
|
||||
hwText = GetDlgItem(hwndDlg, IDC_TEXT);
|
||||
hwLocation = GetDlgItem(hwndDlg, IDC_LOCATION);
|
||||
hwDirList = GetDlgItem(hwndDlg, IDC_DIRLIST);
|
||||
hwCheckBox = GetDlgItem(hwndDlg, IDC_CHECK);
|
||||
g_hwDirList = hwDirList;
|
||||
|
||||
SendMessage(hwndDlg, WM_SETFONT, (WPARAM) hFont, TRUE);
|
||||
SendMessage(hwIcon, WM_SETFONT, (WPARAM) hFont, TRUE);
|
||||
|
@ -218,10 +214,6 @@ BOOL CALLBACK dlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||
SWP_NOACTIVATE | (noicon ? SWP_HIDEWINDOW : 0)
|
||||
);
|
||||
|
||||
//GetWindowRect(hwIcon, &temp_r);
|
||||
//ScreenToClient(hwndDlg, ((LPPOINT) &temp_r));
|
||||
//ScreenToClient(hwndDlg, ((LPPOINT) &temp_r) + 1);
|
||||
|
||||
if (rtl)
|
||||
{
|
||||
ProgressiveSetWindowPos(
|
||||
|
@ -305,7 +297,7 @@ BOOL CALLBACK dlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||
}
|
||||
else if (LOWORD(wParam) == IDC_CHECK && HIWORD(wParam) == BN_CLICKED)
|
||||
{
|
||||
BOOL bEnable = IsDlgButtonChecked(hwStartMenuSelect, IDC_CHECK) != BST_CHECKED;
|
||||
BOOL bEnable = IsDlgButtonChecked(hwndDlg, IDC_CHECK) != BST_CHECKED;
|
||||
EnableWindow(hwDirList, bEnable);
|
||||
EnableWindow(hwLocation, bEnable);
|
||||
}
|
||||
|
@ -316,7 +308,7 @@ BOOL CALLBACK dlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||
pushstring("cancel");
|
||||
else
|
||||
{
|
||||
if (IsDlgButtonChecked(hwStartMenuSelect, IDC_CHECK) == BST_CHECKED)
|
||||
if (IsDlgButtonChecked(hwndDlg, IDC_CHECK) == BST_CHECKED)
|
||||
{
|
||||
short *sbuf = (short *) buf;
|
||||
*sbuf = *(short *) ">";
|
||||
|
@ -383,8 +375,8 @@ void AddFolderFromReg(HKEY rootKey)
|
|||
{
|
||||
if (*(WORD*)FileData.cFileName != *(WORD*)".." || FileData.cFileName[2])
|
||||
{
|
||||
if (SendMessage(hwDirList, LB_FINDSTRINGEXACT, -1, (LPARAM)FileData.cFileName) == LB_ERR)
|
||||
SendMessage(hwDirList, LB_ADDSTRING, 0, (LPARAM)FileData.cFileName);
|
||||
if (SendMessage(g_hwDirList, LB_FINDSTRINGEXACT, -1, (LPARAM)FileData.cFileName) == LB_ERR)
|
||||
SendMessage(g_hwDirList, LB_ADDSTRING, 0, (LPARAM)FileData.cFileName);
|
||||
/*idx = */
|
||||
/*SendMessage(hwDirList, LB_SETITEMDATA, (WPARAM)idx,
|
||||
(LPARAM)ExtractAssociatedIcon(g_hInstance, FileData.cFileName, (WORD*)&idx));*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue