* PageEx - every page can be used everywhere and as many times as needed
* DirVar - easy way to add another dir page * default strings in the language file (Page directory is enough, no need for DirText) * strings from the language file are now LangStrings that can be used in the script * no more /LANG - one string for all languages * any lang strings can be used everywhere, installer or uninstaller (no un.) * no more unprocessed strings - variables can be used almost everywhere (except in licenseData and InstallDirRegKey) * DirText parm for browse dialog text * SetBkColor -> SetCtlColors - can now set text color too * fixed SetOutPath and File /r bug * fixed File /a /oname bug * added $_CLICK for pages * added quotes support in lang files (patch #752620) * extraction progress * separate RTL dialogs for RTL langs (improved RTL too) * InstallOptions RTL * StartMenu RTL * fixed RegDLL? * added IfSilent and SetSilent (SetSilent only works from .onInit) * fixed verify window (it never showed) (bug #792494) * fixed ifnewer readonly file problem (patch #783782) * fixed wininit.ini manipulation when there is another section after [rename] * fixed some ClearType issues * fixed a minor bug in the resource editor * fixed !ifdef/!endif stuff, rewritten * lots of code and comments clean ups * got rid of some useless exceptions handling and STL classes (still much more to go) * lots of optimizations, of course ;) * updated system.dll with support for GUID, WCHAR, and fast VTable calling (i.e. COM ready) * minor bug fixes git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@2823 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
bb8879b7ae
commit
74ea2dc585
91 changed files with 5180 additions and 4101 deletions
|
@ -2,7 +2,7 @@ StartMenu.dll shows a custom page that lets the user select a start menu program
|
|||
folder to put shortcuts in.
|
||||
|
||||
To show the dialog use the Select function. This function has one required parameter
|
||||
which is the program group default name, and some more optional parameters:
|
||||
which is the program group default name, and some more optional switches:
|
||||
/autoadd - automatically adds the program name to the selected folder
|
||||
/noicon - doesn't show the icon in the top left corner
|
||||
/text [please select...] - sets the top text to something else than
|
||||
|
@ -14,13 +14,20 @@ which is the program group default name, and some more optional parameters:
|
|||
the user checks this box, the return value
|
||||
will have > as its first character and you
|
||||
should not create the program group.
|
||||
/rtl - sets the direction of every control on the selection dialog
|
||||
to RTL. This means every text shown on the page will be
|
||||
justified to the right.
|
||||
|
||||
The order of the switches doesn't matter but the required parameter must come after
|
||||
all of them. Every switch after the required parameter will be ignored and left
|
||||
on the stack.
|
||||
|
||||
The function pushes "success", "cancel" or an error to the stack. If there was no
|
||||
error and the user didn't press on cancel it will push the selected folder name
|
||||
after "success". If the user checked the no shortcuts checkbox the '>' will be
|
||||
appended to the folder name. The function does not push the full path but only the
|
||||
selected sub-folder. It's up to you to decide if to put it in the current user or
|
||||
all users start menu.
|
||||
after "success". If the user checked the no shortcuts checkbox the result will be
|
||||
prefixed with '>'. The function does not push the full path but only the selected
|
||||
sub-folder. It's up to you to decide if to put it in the current user or all
|
||||
users start menu.
|
||||
|
||||
Look at Example.nsi for an example.
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@ char checkbox[1024];
|
|||
int autoadd = 0;
|
||||
int g_done = 0;
|
||||
int noicon = 0;
|
||||
int rtl = 0;
|
||||
|
||||
void *lpWndProcOld;
|
||||
|
||||
|
@ -54,6 +55,10 @@ void __declspec(dllexport) Select(HWND hwndParent, int string_size, char *variab
|
|||
{
|
||||
noicon = 1;
|
||||
}
|
||||
else if (!lstrcmpi(buf+1, "rtl"))
|
||||
{
|
||||
rtl = 1;
|
||||
}
|
||||
else if (!lstrcmpi(buf+1, "text"))
|
||||
{
|
||||
popstring(text);
|
||||
|
@ -73,7 +78,8 @@ void __declspec(dllexport) Select(HWND hwndParent, int string_size, char *variab
|
|||
if (popstring(buf))
|
||||
*buf = 0;
|
||||
}
|
||||
if (*buf) lstrcpy(progname, buf);
|
||||
if (*buf)
|
||||
lstrcpy(progname, buf);
|
||||
else
|
||||
{
|
||||
pushstring("error reading parameters");
|
||||
|
@ -145,16 +151,22 @@ BOOL CALLBACK dlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||
|
||||
int y_offset = 0;
|
||||
|
||||
int width, height;
|
||||
|
||||
GetWindowRect(hwChild, &dialog_r);
|
||||
ScreenToClient(hwParent, (LPPOINT) &dialog_r);
|
||||
ScreenToClient(hwParent, ((LPPOINT) &dialog_r)+1);
|
||||
|
||||
width = dialog_r.right - dialog_r.left;
|
||||
height = dialog_r.bottom - dialog_r.top;
|
||||
|
||||
SetWindowPos(
|
||||
hwndDlg,
|
||||
0,
|
||||
dialog_r.left,
|
||||
dialog_r.top,
|
||||
dialog_r.right - dialog_r.left,
|
||||
dialog_r.bottom - dialog_r.top,
|
||||
width,
|
||||
height,
|
||||
SWP_NOZORDER | SWP_NOACTIVATE
|
||||
);
|
||||
|
||||
|
@ -171,6 +183,19 @@ BOOL CALLBACK dlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||
SendMessage(hwDirList, WM_SETFONT, (WPARAM) hFont, TRUE);
|
||||
SendMessage(hwCheckBox, WM_SETFONT, (WPARAM) hFont, TRUE);
|
||||
|
||||
if (rtl)
|
||||
{
|
||||
long s;
|
||||
s = GetWindowLong(hwText, GWL_STYLE);
|
||||
SetWindowLong(hwText, GWL_STYLE, (s & ~SS_LEFT) | SS_RIGHT);
|
||||
s = GetWindowLong(hwLocation, GWL_STYLE);
|
||||
SetWindowLong(hwLocation, GWL_STYLE, (s & ~ES_LEFT) | ES_RIGHT);
|
||||
s = GetWindowLong(hwDirList, GWL_EXSTYLE);
|
||||
SetWindowLong(hwDirList, GWL_EXSTYLE, s | WS_EX_RIGHT | WS_EX_RTLREADING);
|
||||
s = GetWindowLong(hwCheckBox, GWL_STYLE);
|
||||
SetWindowLong(hwCheckBox, GWL_STYLE, s | BS_RIGHT | BS_LEFTTEXT);
|
||||
}
|
||||
|
||||
if (!noicon)
|
||||
{
|
||||
SendMessage(
|
||||
|
@ -180,39 +205,50 @@ BOOL CALLBACK dlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||
(LPARAM)LoadIcon(GetModuleHandle(0), MAKEINTRESOURCE(103))
|
||||
);
|
||||
}
|
||||
|
||||
GetClientRect(hwIcon, &temp_r);
|
||||
|
||||
SetWindowPos(
|
||||
hwIcon,
|
||||
0,
|
||||
rtl ? width - temp_r.right : 0,
|
||||
0,
|
||||
0,
|
||||
32,
|
||||
32,
|
||||
temp_r.right,
|
||||
temp_r.bottom,
|
||||
SWP_NOACTIVATE | (noicon ? SWP_HIDEWINDOW : 0)
|
||||
);
|
||||
|
||||
if (!*text)
|
||||
lstrcpy(text, "Select the Start Menu folder in which you would like to create the program's shortcuts:");
|
||||
//GetWindowRect(hwIcon, &temp_r);
|
||||
//ScreenToClient(hwndDlg, ((LPPOINT) &temp_r));
|
||||
//ScreenToClient(hwndDlg, ((LPPOINT) &temp_r) + 1);
|
||||
|
||||
GetWindowRect(hwIcon, &temp_r);
|
||||
temp_r.right += 5;
|
||||
temp_r.bottom += 5;
|
||||
ScreenToClient(hwndDlg, ((LPPOINT) &temp_r) + 1);
|
||||
if (rtl)
|
||||
{
|
||||
ProgressiveSetWindowPos(
|
||||
hwText,
|
||||
0,
|
||||
width - (noicon ? 0 : temp_r.right + 5),
|
||||
temp_r.bottom + 2
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
ProgressiveSetWindowPos(
|
||||
hwText,
|
||||
noicon ? 0 : temp_r.right + 5,
|
||||
width - (noicon ? 0 : temp_r.right + 5),
|
||||
temp_r.bottom + 2
|
||||
);
|
||||
}
|
||||
|
||||
ProgressiveSetWindowPos(
|
||||
hwText,
|
||||
noicon ? 0 : temp_r.right,
|
||||
dialog_r.right - dialog_r.left - (noicon ? 0 : temp_r.right),
|
||||
temp_r.bottom + 2
|
||||
);
|
||||
|
||||
SetWindowText(hwText, text);
|
||||
SetWindowText(hwText, *text ? text : "Select the Start Menu folder in which you would like to create the program's shortcuts:");
|
||||
|
||||
GetWindowRect(hwLocation, &temp_r);
|
||||
|
||||
ProgressiveSetWindowPos(
|
||||
hwLocation,
|
||||
0,
|
||||
dialog_r.right - dialog_r.left,
|
||||
width,
|
||||
temp_r.bottom - temp_r.top
|
||||
);
|
||||
|
||||
|
@ -233,14 +269,14 @@ BOOL CALLBACK dlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||
ProgressiveSetWindowPos(
|
||||
hwDirList,
|
||||
0,
|
||||
dialog_r.right - dialog_r.left,
|
||||
dialog_r.bottom - dialog_r.top - y_offset - (*checkbox ? temp_r.bottom - temp_r.top + 5 : 0)
|
||||
width,
|
||||
height - y_offset - (*checkbox ? temp_r.bottom - temp_r.top + 5 : 0)
|
||||
);
|
||||
|
||||
ProgressiveSetWindowPos(
|
||||
hwCheckBox,
|
||||
0,
|
||||
dialog_r.right - dialog_r.left,
|
||||
width,
|
||||
temp_r.bottom - temp_r.top
|
||||
);
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ BSC32=bscmake.exe
|
|||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /entry:"_DllMainCRTStartup" /dll /machine:I386 /nodefaultlib /out:"../../Plugins/StartMenu.dll" /opt:nowin98
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /entry:"_DllMainCRTStartup" /dll /map /machine:I386 /nodefaultlib /out:"../../Plugins/StartMenu.dll" /opt:nowin98
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
|
||||
!ELSEIF "$(CFG)" == "StartMenu - Win32 Debug"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue