- Improved installation types behaviour

- .onSelChange no longer called when the components page is created
- First section is selected at compile time - changes in .onInit stick
- Added SectionSetSize / SectionGetSize
- Added SetCurInstType / GetCurInstType
- Added InstTypeSetText / InstTypeGetText - ability to change (and add and remove) installation types on runtime
- NSIS_MAX_INST_TYPES is now 32 by default
- InstType texts are now processed ($0, $1, etc. can be used)
- Added /o switch for Section - unselected by default


git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@2563 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2003-05-24 13:50:24 +00:00
parent fe3a6393e5
commit 564ca077d8
21 changed files with 381 additions and 207 deletions

View file

@ -362,7 +362,7 @@ end:
#ifdef NSIS_CONFIG_PLUGIN_SUPPORT
// Clean up after plug-ins
if (plugins_temp_dir[0]) doRMDir(plugins_temp_dir,1);
if (state_plugins_dir[0]) doRMDir(state_plugins_dir,1);
#endif // NSIS_CONFIG_PLUGIN_SUPPORT
if (g_hIcon) DeleteObject(g_hIcon);

View file

@ -47,7 +47,7 @@ int dlg_offset;
int g_quit_flag; // set when Quit has been called (meaning bail out ASAP)
#if NSIS_MAX_INST_TYPES >= 31 || NSIS_MAX_INST_TYPES < 1
#if NSIS_MAX_INST_TYPES > 32 || NSIS_MAX_INST_TYPES < 1
#error invalid value for NSIS_MAX_INST_TYPES
#endif
@ -60,25 +60,6 @@ static char g_tmp[4096];
int num_sections;
// sent to the last child window to tell it that the install thread is done
#define WM_NOTIFY_INSTPROC_DONE (WM_USER+0x4)
// sent to every child window to tell it it can start executing NSIS code
#define WM_NOTIFY_START (WM_USER+0x5)
// sent to the outer window to tell it to go to the next inner window
#define WM_NOTIFY_OUTER_NEXT (WM_USER+0x8)
// sent to every child window to tell it it is closing soon
#define WM_NOTIFY_INIGO_MONTOYA (WM_USER+0xb)
// update message used by DirProc and SelProc for space display
#define WM_IN_UPDATEMSG (WM_USER+0xf)
#define WM_NOTIFY_CUSTOM_READY (WM_USER+0xd)
#define WM_TREEVIEW_KEYHACK (WM_USER+0x13)
static int m_page=-1,m_retcode,m_delta=1;
#define NOTIFY_BYE_BYE 'x'
@ -112,7 +93,6 @@ section *g_inst_section;
entry *g_inst_entry;
static HWND m_curwnd, m_bgwnd, m_hwndOK, m_hwndCancel;
static int m_whichcfg;
static BOOL NSISCALL SetDlgItemTextFromLang_(HWND dlg, int id, int lid) {
return my_SetDialogItemText(dlg,id+1000,LANG_STR(lid));
@ -967,10 +947,10 @@ static DWORD WINAPI newTreeWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM l
lParam = tvItem.lParam;
}
uMsg = WM_USER+0x19;
uMsg = WM_NOTIFY_SELCHANGE;
}
}
if (uMsg == WM_USER+0x19) {
if (uMsg == WM_NOTIFY_SELCHANGE) {
if (last_item != lParam)
{
last_item = lParam;
@ -988,8 +968,6 @@ static DWORD WINAPI newTreeWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM l
return CallWindowProc((WNDPROC)oldTreeWndProc,hwnd,uMsg,wParam,lParam);
}
int m_num_insttypes;
static BOOL CALLBACK SelProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
static HTREEITEM *hTreeItems;
@ -1002,7 +980,7 @@ static BOOL CALLBACK SelProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
int doLines=0;
HTREEITEM Par;
HBITMAP hBMcheck1;
int x, lastGoodX;
int x, lastGoodX, i, doCombo=0;
g_SectionHack=hwndDlg;
@ -1011,8 +989,6 @@ static BOOL CALLBACK SelProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
hBMcheck1=LoadBitmap(g_hInstance, MAKEINTRESOURCE(IDB_BITMAP1));
SetUITextFromLang(IDC_INTROTEXT,LANG_COMP_TEXT);
SetUITextFromLang(IDC_TEXT1,LANG_COMP_SUBTEXT(0));
SetUITextFromLang(IDC_TEXT2,LANG_COMP_SUBTEXT(1));
oldTreeWndProc=SetWindowLong(hwndTree1,GWL_WNDPROC,(DWORD)newTreeWndProc);
@ -1025,20 +1001,33 @@ static BOOL CALLBACK SelProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
DeleteObject(hBMcheck1);
if (!g_inst_header->install_types_ptr[0])
for (i = 0; i < NSIS_MAX_INST_TYPES; i++)
{
ShowWindow(hwndCombo1,SW_HIDE);
if (g_inst_header->install_types[i])
{
int j;
doCombo++;
process_string_fromtab(g_tmp,g_inst_header->install_types[i]);
j=SendMessage(hwndCombo1,CB_ADDSTRING,0,(LPARAM)ps_tmpbuf);
SendMessage(hwndCombo1,CB_SETITEMDATA,j,i);
}
}
if (!(inst_flags&CH_FLAGS_NO_CUSTOM))
{
int j=SendMessage(hwndCombo1,CB_ADDSTRING,0,(LPARAM)LANG_STR(LANG_COMP_CUSTOM));
SendMessage(hwndCombo1,CB_SETITEMDATA,j,NSIS_MAX_INST_TYPES);
}
if (doCombo)
{
ShowWindow(hwndCombo1,SW_SHOW);
SetUITextFromLang(IDC_TEXT1,LANG_COMP_SUBTEXT(0));
SetUITextFromLang(IDC_TEXT2,LANG_COMP_SUBTEXT(1));
}
else
{
for (m_num_insttypes = 0; m_num_insttypes < NSIS_MAX_INST_TYPES &&
g_inst_header->install_types_ptr[m_num_insttypes]; m_num_insttypes ++)
{
SendMessage(hwndCombo1,CB_ADDSTRING,0,(LPARAM)GetStringFromStringTab(g_inst_header->install_types_ptr[m_num_insttypes]));
}
if (!(inst_flags&CH_FLAGS_NO_CUSTOM))
SendMessage(hwndCombo1,CB_ADDSTRING,0,(LPARAM)LANG_STR(LANG_COMP_CUSTOM));
SendMessage(hwndCombo1,CB_SETCURSEL,m_whichcfg,0);
SetUITextFromLang(IDC_TEXT1,LANG_COMP_SUBTEXT(2));
SetUITextFromLang(IDC_TEXT2,LANG_COMP_SUBTEXT(3));
}
Par=NULL;
@ -1047,14 +1036,6 @@ static BOOL CALLBACK SelProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
{
section *sec=g_inst_section+x;
if (m_num_insttypes && m_whichcfg != m_num_insttypes)
{
if ((sec->install_types>>m_whichcfg) & 1)
sec->flags|=SF_SELECTED;
else
sec->flags&=~SF_SELECTED;
}
if (sec->name_ptr)
{
TVINSERTSTRUCT tv;
@ -1107,9 +1088,9 @@ static BOOL CALLBACK SelProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
}
SendMessage(hwndTree1,WM_VSCROLL,SB_TOP,0);
uMsg=WM_IN_UPDATEMSG;
uMsg = g_flags.insttype_changed ? WM_NOTIFY_INSTTYPE_CHANGE : WM_IN_UPDATEMSG;
}
if (uMsg == WM_USER+0x17) // update text
if (uMsg == WM_NOTIFY_SECTEXT) // update text
{
int x=wParam;
int ns=lParam;
@ -1123,7 +1104,7 @@ static BOOL CALLBACK SelProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
TreeView_SetItem(hwndTree1,&tv);
}
}
if (uMsg == WM_USER+0x18) // change flags
if (uMsg == WM_NOTIFY_SECFLAGS) // change flags
{
int flags = g_inst_section[wParam].flags;
TVITEM tvItem;
@ -1179,6 +1160,10 @@ static BOOL CALLBACK SelProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
}
lParam = 0;
uMsg = WM_IN_UPDATEMSG;
#if defined(NSIS_SUPPORT_CODECALLBACKS) && defined(NSIS_CONFIG_COMPONENTPAGE)
ExecuteCodeSegment(g_inst_header->code_onSelChange,NULL);
#endif//NSIS_SUPPORT_CODECALLBACKS && NSIS_CONFIG_COMPONENTPAGE
} // not ro
} // was valid click
} // was click or hack
@ -1186,7 +1171,7 @@ static BOOL CALLBACK SelProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
if (lpnmh)
{
if (lpnmh->code == TVN_SELCHANGED)
SendMessage(hwndTree1, WM_USER+0x19, 0, ((LPNMTREEVIEW)lpnmh)->itemNew.lParam);
SendMessage(hwndTree1, WM_NOTIFY_SELCHANGE, 0, ((LPNMTREEVIEW)lpnmh)->itemNew.lParam);
if (lpnmh->code == TVN_ITEMEXPANDED)
{
LPNMTREEVIEW pnmtv = (LPNMTREEVIEW) lpnmh;
@ -1203,50 +1188,59 @@ static BOOL CALLBACK SelProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
{
SendMessage(hwndTree1, WM_MOUSEMOVE, 0, 0);
}
if (uMsg == WM_COMMAND)
if (uMsg == WM_NOTIFY_INSTTYPE_CHANGE ||
(uMsg == WM_COMMAND && LOWORD(wParam)==IDC_COMBO1 && HIWORD(wParam)==CBN_SELCHANGE))
{
int id=LOWORD(wParam),code=HIWORD(wParam);
if (id == IDC_COMBO1 && code==CBN_SELCHANGE)
int t=SendMessage(hwndCombo1,CB_GETCURSEL,0,0);
if (uMsg == WM_NOTIFY_INSTTYPE_CHANGE || t != CB_ERR)
{
int t=SendMessage(hwndCombo1,CB_GETCURSEL,0,0);
if (t != CB_ERR)
int whichcfg=SendMessage(hwndCombo1,CB_GETITEMDATA,t,0);
if (uMsg == WM_NOTIFY_INSTTYPE_CHANGE)
{
m_whichcfg=t;
if (m_whichcfg != m_num_insttypes) // not custom
{
int x=num_sections;
section *t=g_inst_section;
HTREEITEM *ht=hTreeItems;
while (x--)
{
TVITEM tv;
int l=1;
if (t->install_types & (1<<m_whichcfg))
{
l++;
t->flags|=SF_SELECTED;
}
else t->flags&=~SF_SELECTED;
if (t->flags&SF_RO) l+=3;
if (tv.hItem=*ht) {
tv.mask=TVIF_STATE;
tv.state=INDEXTOSTATEIMAGEMASK(l);
tv.stateMask=TVIS_STATEIMAGEMASK;
TreeView_SetItem(hwndTree1,&tv);
SetParentState(hwndTree1,tv.hItem);
}
t++;
ht++;
}
SendMessage(hwndTree1,WM_VSCROLL,SB_TOP,0);
}
lParam = 1;
uMsg = WM_IN_UPDATEMSG;
whichcfg = g_flags.cur_insttype;
g_flags.insttype_changed = 0;
}
else lParam = 1;
if (whichcfg == CB_ERR || !(g_inst_header->install_types[whichcfg]))
whichcfg = NSIS_MAX_INST_TYPES;
if (whichcfg != NSIS_MAX_INST_TYPES) // not custom
{
int x=num_sections;
section *t=g_inst_section;
HTREEITEM *ht=hTreeItems;
while (x--)
{
TVITEM tv;
int l=1;
if (t->install_types & (1<<whichcfg))
{
l++;
t->flags|=SF_SELECTED;
}
else t->flags&=~SF_SELECTED;
if (t->flags&SF_RO) l+=3;
if (tv.hItem=*ht) {
tv.mask=TVIF_STATE;
tv.state=INDEXTOSTATEIMAGEMASK(l);
tv.stateMask=TVIS_STATEIMAGEMASK;
TreeView_SetItem(hwndTree1,&tv);
SetParentState(hwndTree1,tv.hItem);
}
t++;
ht++;
}
SendMessage(hwndTree1,WM_VSCROLL,SB_TOP,0);
}
g_flags.cur_insttype=whichcfg;
uMsg = WM_IN_UPDATEMSG;
}
}
if (uMsg == WM_NOTIFY_INIGO_MONTOYA)
@ -1258,24 +1252,24 @@ static BOOL CALLBACK SelProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
}
if (uMsg == WM_IN_UPDATEMSG)
{
#if defined(NSIS_SUPPORT_CODECALLBACKS) && defined(NSIS_CONFIG_COMPONENTPAGE)
ExecuteCodeSegment(g_inst_header->code_onSelChange,NULL);
#endif//NSIS_SUPPORT_CODECALLBACKS && NSIS_CONFIG_COMPONENTPAGE
if (inst_flags&CH_FLAGS_COMP_ONLY_ON_CUSTOM)
{
int c=(m_whichcfg == m_num_insttypes && m_num_insttypes)<<3;// SW_SHOWNA=8, SW_HIDE=0
int c=(g_flags.cur_insttype == NSIS_MAX_INST_TYPES)<<3;// SW_SHOWNA=8, SW_HIDE=0
ShowWindow(hwndTree1,c);
ShowWindow(GetUIItem(IDC_TEXT2),c);
}
else if (!lParam)
{
int r,x;
int r,x,cbi;
// check to see which install type we are
for (r = 0; r < m_num_insttypes; r ++)
for (r = 0, cbi = 0; r < NSIS_MAX_INST_TYPES; r ++)
{
HTREEITEM *ht=hTreeItems;
section *t=g_inst_section;
x=num_sections;
if (!g_inst_header->install_types[r]) continue;
while (x--)
{
if (*ht && !(t->flags&(SF_SUBSEC|SF_SUBSECEND)))
@ -1290,10 +1284,12 @@ static BOOL CALLBACK SelProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
ht++;
}
if (x < 0) break;
cbi++;
}
m_whichcfg=r;
SendMessage(hwndCombo1,CB_SETCURSEL,m_whichcfg,0);
g_flags.cur_insttype=r;
SendMessage(hwndCombo1,CB_SETCURSEL,cbi,0);
} // end of typecheckshit
if (LANG_STR_TAB(LANG_SPACE_REQ)) {
@ -1476,7 +1472,7 @@ static BOOL CALLBACK InstProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
DWORD pos = GetMessagePos();
HMENU menu = CreatePopupMenu();
AppendMenu(menu,MF_STRING,1,LANG_STR(LANG_COPYDETAILS));
if (1==TrackPopupMenu(
if (1==TrackPopupMenu(
menu,
TPM_NONOTIFY|TPM_RETURNCMD,
GET_X_LPARAM(pos),

View file

@ -28,8 +28,8 @@
// NSIS_MAX_INST_TYPES specified the maximum install types.
// note that this should not exceed 30, ever.
#define NSIS_MAX_INST_TYPES 8
// note that this should not exceed 32, ever.
#define NSIS_MAX_INST_TYPES 32
// NSIS_CONFIG_UNINSTALL_SUPPORT enables the uninstaller
// support. Comment it out if your installers don't need
@ -329,8 +329,8 @@
#endif
#endif
#if NSIS_MAX_INST_TYPES > 30
#error NSIS_MAX_INST_TYPES > 30
#if NSIS_MAX_INST_TYPES > 32
#error NSIS_MAX_INST_TYPES > 32
#endif
#endif//!APSTUDIO_INVOKED

View file

@ -26,10 +26,6 @@ static stack_t *g_st;
union installer_flags g_flags;
#ifdef NSIS_CONFIG_PLUGIN_SUPPORT
char plugins_temp_dir[NSIS_MAX_STRLEN]="";
#endif
static WIN32_FIND_DATA * NSISCALL file_exists(char *buf)
{
HANDLE h;
@ -73,11 +69,7 @@ static LONG NSISCALL myRegDeleteKeyEx(HKEY thiskey, LPCTSTR lpSubKey, int onlyif
static int NSISCALL ExecuteEntry(entry *entry_);
static int NSISCALL resolveaddr(int v)
{
if (v<0) return myatoi(g_usrvars[-(v+1)]); // if <0, that means we
return v;
}
#define resolveaddr(v) ((v<0) ? myatoi(g_usrvars[-(v+1)]) : v)
int NSISCALL ExecuteCodeSegment(int pos, HWND hwndProgress)
{
@ -156,6 +148,8 @@ static int NSISCALL ExecuteEntry(entry *entry_)
// Saves 8 bytes
// HWND mainHwnd = g_hwnd;
// #define g_hwnd mainHwnd
HWND hwSectionHack = g_SectionHack;
parms = entry_->offsets;
@ -209,7 +203,7 @@ static int NSISCALL ExecuteEntry(entry *entry_)
SetForegroundWindow(g_hwnd);
break;
case EW_SETFLAG:
g_flags.flags[parm0]=parm1;
g_flags.flags[parm0]=process_string_fromparm_toint(1);
break;
case EW_IFFLAG:
{
@ -217,6 +211,9 @@ static int NSISCALL ExecuteEntry(entry *entry_)
g_flags.flags[parm2]&=parm3;
return f;
}
case EW_GETFLAG:
myitoa(var0,g_flags.flags[parm1]);
break;
case EW_CHDETAILSVIEW:
if (insthwndbutton) ShowWindow(insthwndbutton,parm1);
if (insthwnd) ShowWindow(insthwnd,parm0);
@ -980,7 +977,8 @@ static int NSISCALL ExecuteEntry(entry *entry_)
break;
#endif
#ifdef NSIS_SUPPORT_CREATESHORTCUT
case EW_CREATESHORTCUT: {
case EW_CREATESHORTCUT:
{
char *buf2=process_string_fromparm_tobuf(-0x20);
char *buf1=process_string_fromparm_tobuf(0x11);
char *buf0=process_string_fromparm_tobuf(0x02);
@ -1494,13 +1492,6 @@ static int NSISCALL ExecuteEntry(entry *entry_)
}
break;
#endif//NSIS_CONFIG_LOG
#ifdef NSIS_CONFIG_PLUGIN_SUPPORT
// Added by Ximon Eighteen 5th August 2002
case EW_PLUGINCOMMANDPREP:
// $0 temp plug-ins dir
if (!*plugins_temp_dir) mystrcpy(plugins_temp_dir,g_usrvars[0]);
break;
#endif // NSIS_CONFIG_PLUGIN_SUPPORT
#ifdef NSIS_CONFIG_COMPONENTPAGE
case EW_SECTIONSET:
{
@ -1533,19 +1524,42 @@ static int NSISCALL ExecuteEntry(entry *entry_)
else
{
// setting text, send the message to do it
SendMessage(g_SectionHack,WM_USER+0x17,x,parm2);
SendMessage(hwSectionHack,WM_NOTIFY_SECTEXT,x,parm2);
}
((int*)sec)[parm1]=parm2;
if (parm1)
{
// update tree view
SendMessage(g_SectionHack,WM_USER+0x18,x,0);
SendMessage(hwSectionHack,WM_NOTIFY_SECFLAGS,x,0);
}
}
}
else g_flags.exec_error++;
}
break;
case EW_INSTTYPESET:
{
int x=process_string_fromparm_toint(0);
if (parm3)
{
g_flags.insttype_changed++;
SendMessage(hwSectionHack,WM_NOTIFY_INSTTYPE_CHANGE,0,0);
}
else if ((unsigned int)x < (unsigned int)NSIS_MAX_INST_TYPES)
{
if (parm2) // set text
{
g_inst_header->install_types[x] = parm1;
}
else // get text
{
process_string_fromtab(var1,g_inst_header->install_types[x]);
}
}
else g_flags.exec_error++;
}
break;
#endif//NSIS_CONFIG_COMPONENTPAGE
}
return 0;

View file

@ -30,8 +30,8 @@
enum
{
EW_INVALID_OPCODE, // zero is invalid. useful for catching errors. (otherwise an all zeroes instruction does nothing, which is
// easily ignored but means something is wrong.
EW_INVALID_OPCODE, // zero is invalid. useful for catching errors. (otherwise an all zeroes instruction
// does nothing, which is easily ignored but means something is wrong.
EW_RET, // return from function call
EW_NOP, // Nop/Jump, do nothing: 1, [?new address+1:advance one]
EW_ABORT, // Abort: 1 [status]
@ -39,7 +39,6 @@ enum
EW_CALL, // Call: 1 [new address+1]
EW_UPDATETEXT, // Update status text: 2 [update str, ui_st_updateflag=?ui_st_updateflag:this]
EW_SLEEP, // Sleep: 1 [sleep time in milliseconds]
EW_HIDEWINDOW, // HideWindow: 0
EW_BRINGTOFRONT, // BringToFront: 0
EW_CHDETAILSVIEW, // SetDetailsView: 2 [listaction,buttonaction]
EW_SETFILEATTRIBUTES, // SetFileAttributes: 2 [filename, attributes]
@ -47,6 +46,7 @@ enum
EW_IFFILEEXISTS, // IfFileExists: 3, [file name, jump amount if exists, jump amount if not exists]
EW_SETFLAG, // Sets a flag: 2 [id, data]
EW_IFFLAG, // If a flag: 4 [on, off, id, new value mask]
EW_GETFLAG, // Gets a flag: 2 [output, id]
#ifdef NSIS_SUPPORT_RENAME
EW_RENAME, // Rename: 3 [old, new, rebootok]
#endif
@ -129,7 +129,6 @@ enum
#ifdef NSIS_SUPPORT_REBOOT
EW_REBOOT, // Reboot: 0
EW_IFREBOOTFLAG, // IfRebootFlag: 2 [if reboot flag set, if not reboot flag]
#endif
#ifdef NSIS_SUPPORT_INIFILES
@ -172,21 +171,13 @@ enum
// SectionGetText: 3: [idx, 1, output]
// SectionSetFlags: 3: [idx, 2, flags]
// SectionGetFlags: 3: [idx, 3, output]
EW_INSTTYPESET, // InstTypeSetFlags: 3: [idx, 0, flags]
// InstTypeGetFlags: 3: [idx, 1, output]
#endif
// instructions not actually implemented in exehead, but used in compiler.
EW_GETLABELADDR, // both of these get converted to EW_ASSIGNVAR
EW_GETFUNCTIONADDR,
// Saves 56 bytes, don't ask me how
// Hmm... now it doesn't =/
/*EW_DUMMY,
EW_DUMMY2,
EW_DUMMY3,
EW_DUMMY4,
EW_DUMMY5,*/
EW_PLUGINCOMMANDPREP,
};
#define FH_FLAGS_MASK 15
@ -371,7 +362,7 @@ typedef struct
int dirsubtext; // directory text2
#ifdef NSIS_CONFIG_COMPONENTPAGE
int componenttext; // component page text
int componentsubtext[2];
int componentsubtext[4];
#endif
#ifdef NSIS_CONFIG_LICENSEPAGE
int licensetext; // license page text
@ -394,7 +385,7 @@ typedef struct
int install_reg_rootkey, install_reg_key_ptr, install_reg_value_ptr;
#ifdef NSIS_CONFIG_COMPONENTPAGE
int install_types_ptr[NSIS_MAX_INST_TYPES]; // -1 if not used. can describe as lite, normal, full, etc.
int install_types[NSIS_MAX_INST_TYPES];
#endif
#ifdef NSIS_CONFIG_LICENSEPAGE
@ -535,6 +526,8 @@ union installer_flags {
#ifdef NSIS_SUPPORT_REBOOT
int exec_reboot;
#endif
int cur_insttype;
int insttype_changed;
};
int flags[1];
};

View file

@ -74,7 +74,7 @@ STYLE DS_CONTROL | DS_SHELLFONT | WS_CHILD
FONT 8, "MS Shell Dlg"
BEGIN
COMBOBOX IDC_COMBO1,114,25,152,102,CBS_DROPDOWNLIST | WS_VSCROLL |
WS_TABSTOP
WS_TABSTOP | NOT WS_VISIBLE
ICON IDI_ICON2,IDC_ULICON,0,0,21,20
LTEXT "",IDC_TEXT2,0,40,108,65
CONTROL "",IDC_TEXT1,"Static",SS_LEFTNOWORDWRAP,0,27,108,8

View file

@ -1,14 +1,14 @@
#ifdef NSIS_CONFIG_PLUGIN_SUPPORT
extern char plugins_temp_dir[NSIS_MAX_STRLEN];
#endif
extern char temp_directory[NSIS_MAX_STRLEN];
extern char g_usrvars[25][NSIS_MAX_STRLEN];
extern char g_usrvars[26][NSIS_MAX_STRLEN];
extern char *state_command_line;
extern char *state_install_directory;
extern char *state_output_directory;
extern char *state_exe_directory;
extern char *state_language;
#ifdef NSIS_CONFIG_PLUGIN_SUPPORT
extern char *state_plugins_dir;
#endif
extern char g_caption[NSIS_MAX_STRLEN*2];
extern HWND g_hwnd;

View file

@ -29,4 +29,37 @@ extern int g_is_uninstaller;
void NSISCALL build_g_logfile(void);
#endif
// sent to the last child window to tell it that the install thread is done
#define WM_NOTIFY_INSTPROC_DONE (WM_USER+0x4)
// sent to every child window to tell it it can start executing NSIS code
#define WM_NOTIFY_START (WM_USER+0x5)
// sent to the outer window to tell it to go to the next inner window
#define WM_NOTIFY_OUTER_NEXT (WM_USER+0x8)
// sent to every child window to tell it it is closing soon
#define WM_NOTIFY_INIGO_MONTOYA (WM_USER+0xb)
// update message used by DirProc and SelProc for space display
#define WM_IN_UPDATEMSG (WM_USER+0xf)
// the selected insttype has changed
#define WM_NOTIFY_INSTTYPE_CHANGE (WM_USER+0x32)
// custom pages should send this message to let NSIS know they're ready
#define WM_NOTIFY_CUSTOM_READY (WM_USER+0xd)
// simulates clicking on the tree
#define WM_TREEVIEW_KEYHACK (WM_USER+0x13)
// section text changed
#define WM_NOTIFY_SECTEXT WM_USER+0x17
// section flags changed
#define WM_NOTIFY_SECFLAGS WM_USER+0x18
// notifies a component selection change (.onMouseOverSection)
#define WM_NOTIFY_SELCHANGE WM_USER+0x19
#endif//_UI_H_

View file

@ -16,12 +16,15 @@ char g_log_file[1024];
char temp_directory[NSIS_MAX_STRLEN];
char g_usrvars[25][NSIS_MAX_STRLEN];
char g_usrvars[26][NSIS_MAX_STRLEN];
char *state_command_line=g_usrvars[20];
char *state_install_directory=g_usrvars[21];
char *state_output_directory=g_usrvars[22];
char *state_exe_directory=g_usrvars[23];
char *state_language=g_usrvars[24];
#ifdef NSIS_CONFIG_PLUGIN_SUPPORT
char *state_plugins_dir=g_usrvars[25];
#endif
HANDLE g_hInstance;
@ -433,21 +436,22 @@ char * NSISCALL process_string(const char *in)
case VAR_CODES_START + 23: // OUTDIR
case VAR_CODES_START + 24: // EXEDIR
case VAR_CODES_START + 25: // LANGUAGE
case VAR_CODES_START + 26: // PLUGINSDIR
mystrcpy(out, g_usrvars[nVarIdx - (VAR_CODES_START + 1)]);
break;
case VAR_CODES_START + 26: // PROGRAMFILES
case VAR_CODES_START + 27: // PROGRAMFILES
smwcvesf[41]=0;
myRegGetStr(HKEY_LOCAL_MACHINE, smwcvesf, "ProgramFilesDir", out);
if (!*out)
mystrcpy(out, "C:\\Program Files");
break;
case VAR_CODES_START + 27: // SMPROGRAMS
case VAR_CODES_START + 28: // SMSTARTUP
case VAR_CODES_START + 29: // DESKTOP
case VAR_CODES_START + 30: // STARTMENU
case VAR_CODES_START + 31: // QUICKLAUNCH
case VAR_CODES_START + 28: // SMPROGRAMS
case VAR_CODES_START + 29: // SMSTARTUP
case VAR_CODES_START + 30: // DESKTOP
case VAR_CODES_START + 31: // STARTMENU
case VAR_CODES_START + 32: // QUICKLAUNCH
{
static const char *tab[]={
"Programs",
@ -485,31 +489,21 @@ char * NSISCALL process_string(const char *in)
else break;
}
case VAR_CODES_START + 32: // TEMP
case VAR_CODES_START + 33: // TEMP
mystrcpy(out,temp_directory);
break;
case VAR_CODES_START + 33: // WINDIR
case VAR_CODES_START + 34: // WINDIR
GetWindowsDirectory(out, NSIS_MAX_STRLEN);
break;
case VAR_CODES_START + 34: // SYSDIR
case VAR_CODES_START + 35: // SYSDIR
GetSystemDirectory(out, NSIS_MAX_STRLEN);
break;
#ifdef NSIS_CONFIG_PLUGIN_SUPPORT
case VAR_CODES_START + 35: // PLUGINSDIR
mystrcpy(out, plugins_temp_dir);
break;
#if VAR_CODES_START + 35 >= 255
#error "Too many variables! Extend VAR_CODES_START!"
#endif
#else
#if VAR_CODES_START + 34 >= 255
#error "Too many variables! Extend VAR_CODES_START!"
#endif
#endif //NSIS_CONFIG_PLUGIN_SUPPORT
} // switch
// validate the directory name
if (nVarIdx > 21+VAR_CODES_START) { // only if not $0 to $R9, $CMDLINE, or $HWNDPARENT
@ -521,7 +515,6 @@ char * NSISCALL process_string(const char *in)
} // while
*out = 0;
return ps_tmpbuf;
;
}
char * NSISCALL validate_filename(char *in) {