no message
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@638 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
6a7319e566
commit
4c1780d9f0
11 changed files with 987 additions and 333 deletions
|
@ -33,10 +33,17 @@
|
|||
#include "util.h"
|
||||
#include "ui.h"
|
||||
#include "exec.h"
|
||||
#include "lang.h"
|
||||
|
||||
#define LB_ICONWIDTH 20
|
||||
#define LB_ICONHEIGHT 20
|
||||
|
||||
// Added by Amir Szekely 3rd August 2002
|
||||
installer_strings *install_strings_tables;
|
||||
common_strings *common_strings_tables;
|
||||
uninstall_strings *uninstall_strings_tables;
|
||||
int current_lang;
|
||||
|
||||
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
|
||||
|
@ -204,6 +211,7 @@ static void CheckTreeItem(HWND hWnd, TV_ITEM *pItem, int checked) {
|
|||
|
||||
int ui_doinstall(void)
|
||||
{
|
||||
int size;
|
||||
g_autoclose=g_inst_cmnheader->misc_flags&1;
|
||||
#ifdef NSIS_CONFIG_UNINSTALL_SUPPORT
|
||||
if (!g_is_uninstaller)
|
||||
|
@ -258,6 +266,22 @@ int ui_doinstall(void)
|
|||
process_string_fromtab(state_install_directory,g_inst_header->install_directory_ptr);
|
||||
}
|
||||
|
||||
// Added by Amir Szekely 3rd August 2002
|
||||
// Multilingual support
|
||||
size=g_inst_header->common.str_tables_num*sizeof(common_strings);
|
||||
common_strings_tables=(common_strings*)GlobalAlloc(GPTR,size);
|
||||
GetCompressedDataFromDataBlockToMemory(g_inst_header->common.str_tables,(char*)common_strings_tables,size);
|
||||
if (!g_is_uninstaller) {
|
||||
size=g_inst_header->str_tables_num*sizeof(installer_strings);
|
||||
install_strings_tables=(installer_strings*)GlobalAlloc(GPTR,size);
|
||||
GetCompressedDataFromDataBlockToMemory(g_inst_header->str_tables,(char*)install_strings_tables,size);
|
||||
}
|
||||
else {
|
||||
size=g_inst_header->str_tables_num*sizeof(uninstall_strings);
|
||||
uninstall_strings_tables=(uninstall_strings*)GlobalAlloc(GPTR,size);
|
||||
GetCompressedDataFromDataBlockToMemory(g_inst_header->str_tables,(char*)uninstall_strings_tables,size);
|
||||
}
|
||||
|
||||
#ifdef NSIS_CONFIG_LOG
|
||||
if (g_inst_cmnheader->silent_install==2)
|
||||
{
|
||||
|
@ -267,7 +291,7 @@ int ui_doinstall(void)
|
|||
#endif
|
||||
}
|
||||
|
||||
process_string_fromtab(g_caption,g_inst_cmnheader->caption_ptr);
|
||||
process_string_fromtab(g_caption,COMMON_STR(caption));
|
||||
|
||||
#ifdef NSIS_CONFIG_VISIBLE_SUPPORT
|
||||
#ifdef NSIS_CONFIG_SILENT_SUPPORT
|
||||
|
@ -362,33 +386,33 @@ static BOOL CALLBACK DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
|
|||
if (uMsg == WM_INITDIALOG)
|
||||
{
|
||||
g_hwnd=hwndDlg;
|
||||
SetDlgItemText(hwndDlg,IDC_VERSTR,GetStringFromStringTab(g_inst_cmnheader->branding_ptr));
|
||||
SetDlgItemText(hwndDlg,IDC_VERSTR,LANG_BRANDING);
|
||||
hIcon=LoadIcon(g_hInstance,MAKEINTRESOURCE(IDI_ICON2));
|
||||
SetClassLong(hwndDlg,GCL_HICON,(long)hIcon);
|
||||
SetDlgItemText(hwndDlg,IDCANCEL,GetStringFromStringTab(g_inst_cmnheader->cancelbutton_ptr));
|
||||
SetDlgItemText(hwndDlg,IDCANCEL,LANG_BTN_CANCEL);
|
||||
#ifdef NSIS_CONFIG_UNINSTALL_SUPPORT
|
||||
if (!g_is_uninstaller)
|
||||
#endif
|
||||
SetDlgItemText(hwndDlg,IDC_BACK,GetStringFromStringTab(g_inst_header->backbutton_ptr));
|
||||
SetDlgItemText(hwndDlg,IDC_BACK,LANG_BTN_BACK);
|
||||
ShowWindow(hwndDlg,SW_SHOW);
|
||||
}
|
||||
|
||||
#ifdef NSIS_CONFIG_UNINSTALL_SUPPORT
|
||||
if (g_is_uninstaller)
|
||||
{
|
||||
islp=(g_inst_uninstheader->uninstalltext_ptr>=0);
|
||||
islp=UNINSTALL_STR(uninstalltext)>=0;
|
||||
iscp++;
|
||||
}
|
||||
else
|
||||
#endif//NSIS_CONFIG_UNINSTALL_SUPPORT
|
||||
{
|
||||
#ifdef NSIS_CONFIG_LICENSEPAGE
|
||||
if (g_inst_header->licensedata_ptr>=0) islp++;
|
||||
if (INSTALL_STR(licensedata)>=0) islp++;
|
||||
#endif//NSIS_CONFIG_LICENSEPAGE
|
||||
#ifdef NSIS_CONFIG_COMPONENTPAGE
|
||||
if (g_inst_header->componenttext_ptr>=0) iscp++;
|
||||
if (INSTALL_STR(componenttext)>=0) iscp++;
|
||||
#endif//NSIS_CONFIG_COMPONENTPAGE
|
||||
if (g_inst_header->text_ptr>=0) ispotentiallydp++;
|
||||
if (INSTALL_STR(text)>=0) ispotentiallydp++;
|
||||
if (ispotentiallydp &&
|
||||
!((g_inst_cmnheader->misc_flags&2) &&
|
||||
is_valid_instpath(state_install_directory)
|
||||
|
@ -436,19 +460,19 @@ static BOOL CALLBACK DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
|
|||
else if (!m_curwnd)
|
||||
{
|
||||
HWND hwndtmp;
|
||||
SetDlgItemText(hwndDlg,IDOK,GetStringFromStringTab(
|
||||
(m_page == g_max_page) ? g_inst_cmnheader->closebutton_ptr :
|
||||
SetDlgItemText(hwndDlg,IDOK,
|
||||
(m_page == g_max_page) ? LANG_BTN_CLOSE :
|
||||
#ifdef NSIS_CONFIG_UNINSTALL_SUPPORT
|
||||
g_is_uninstaller ? g_inst_uninstheader->uninstbutton_ptr :
|
||||
g_is_uninstaller ? LANG_BTN_UNINST :
|
||||
#endif
|
||||
#ifdef NSIS_CONFIG_LICENSEPAGE
|
||||
(m_page == 0) ? g_inst_header->licensebutton_ptr :
|
||||
(m_page == 0) ? LANG_BTN_LICENSE :
|
||||
#endif
|
||||
(m_page == 2 || (m_page == 1 && !isdp)) ? g_inst_header->installbutton_ptr :
|
||||
g_inst_header->nextbutton_ptr
|
||||
));
|
||||
(m_page == 2 || (m_page == 1 && !isdp)) ? LANG_BTN_INSTALL :
|
||||
LANG_BTN_NEXT
|
||||
);
|
||||
lstrcpy(g_tmp,g_caption);
|
||||
process_string_fromtab(g_tmp+lstrlen(g_tmp),g_inst_cmnheader->subcaption_ptrs[m_page]);
|
||||
process_string_fromtab(g_tmp+lstrlen(g_tmp),COMMON_STR(subcaptions[m_page]));
|
||||
|
||||
SetWindowText(hwndDlg,g_tmp);
|
||||
|
||||
|
@ -534,8 +558,8 @@ static BOOL CALLBACK LicenseProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
|
|||
SendMessage(hwLicense,EM_AUTOURLDETECT,TRUE,0);
|
||||
SendMessage(hwLicense,EM_SETBKGNDCOLOR,0,g_inst_header->license_bg);
|
||||
SendMessage(hwLicense,EM_SETEVENTMASK,0,ENM_LINK);
|
||||
SetWindowText(hwLicense,GetStringFromStringTab(g_inst_header->licensedata_ptr));
|
||||
SetDlgItemText(hwndDlg,IDC_INTROTEXT,GetStringFromStringTab(g_inst_header->licensetext_ptr));
|
||||
SetWindowText(hwLicense,LANG_LICENSE_DATA);
|
||||
SetDlgItemText(hwndDlg,IDC_INTROTEXT,LANG_LICENSE_TEXT);
|
||||
}
|
||||
else if (uMsg == WM_NOTIFY) {
|
||||
ENLINK *enlink=(ENLINK *)lParam;
|
||||
|
@ -571,8 +595,8 @@ static BOOL CALLBACK UninstProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
|
|||
{
|
||||
if (uMsg == WM_INITDIALOG)
|
||||
{
|
||||
SetDlgItemText(hwndDlg,IDC_UNINSTFROM,GetStringFromStringTab(g_inst_uninstheader->uninstalltext2_ptr));
|
||||
SetDlgItemText(hwndDlg,IDC_INTROTEXT,GetStringFromStringTab(g_inst_uninstheader->uninstalltext_ptr));
|
||||
SetDlgItemText(hwndDlg,IDC_UNINSTFROM,LANG_UNINST_SUBTEXT);
|
||||
SetDlgItemText(hwndDlg,IDC_INTROTEXT,LANG_UNINST_TEXT);
|
||||
SetDlgItemText(hwndDlg,IDC_EDIT1,state_install_directory);
|
||||
}
|
||||
return 0;
|
||||
|
@ -609,9 +633,9 @@ static BOOL CALLBACK DirProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
|
|||
}
|
||||
#endif
|
||||
SetDlgItemText(hwndDlg,IDC_DIR,state_install_directory);
|
||||
SetDlgItemText(hwndDlg,IDC_INTROTEXT,GetStringFromStringTab(g_inst_header->text_ptr));
|
||||
SetDlgItemText(hwndDlg,IDC_BROWSE,GetStringFromStringTab(g_inst_header->browse_ptr));
|
||||
SetDlgItemText(hwndDlg,IDC_SELDIRTEXT,GetStringFromStringTab(g_inst_header->dirsubtext_ptr));
|
||||
SetDlgItemText(hwndDlg,IDC_INTROTEXT,LANG_DIR_TEXT);
|
||||
SetDlgItemText(hwndDlg,IDC_BROWSE,LANG_BTN_BROWSE);
|
||||
SetDlgItemText(hwndDlg,IDC_SELDIRTEXT,LANG_DIR_SUBTEXT);
|
||||
SendMessage(hwndDlg,WM_IN_UPDATEMSG,0,0);
|
||||
}
|
||||
if (uMsg == WM_COMMAND)
|
||||
|
@ -707,13 +731,13 @@ static BOOL CALLBACK DirProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
|
|||
|
||||
// Added by Amir Szekely 24th July 2002
|
||||
// Allows 'SpaceTexts none'
|
||||
if (g_inst_header->spacerequired_ptr != -2) {
|
||||
lstrcpy(s,GetStringFromStringTab(g_inst_header->spacerequired_ptr));
|
||||
if (INSTALL_STR(spacerequired) >= 0) {
|
||||
lstrcpy(s,LANG_SPACE_REQ);
|
||||
inttosizestr(total,s);
|
||||
SetDlgItemText(hwndDlg,IDC_SPACEREQUIRED,s);
|
||||
if (available != -1)
|
||||
{
|
||||
lstrcpy(s,GetStringFromStringTab(g_inst_header->spaceavailable_ptr));
|
||||
lstrcpy(s,LANG_SPACE_AVAIL);
|
||||
inttosizestr(available,s);
|
||||
SetDlgItemText(hwndDlg,IDC_SPACEAVAILABLE,s);
|
||||
}
|
||||
|
@ -762,9 +786,9 @@ static BOOL CALLBACK SelProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
|
|||
hTreeItems=(HTREEITEM*)GlobalAlloc(GPTR,sizeof(HTREEITEM)*g_inst_header->num_sections);
|
||||
|
||||
hBMcheck1=LoadBitmap(g_hInstance, MAKEINTRESOURCE(IDB_BITMAP1));
|
||||
SetDlgItemText(hwndDlg,IDC_INTROTEXT,GetStringFromStringTab(g_inst_header->componenttext_ptr));
|
||||
SetDlgItemText(hwndDlg,IDC_TEXT1,GetStringFromStringTab(g_inst_header->componentsubtext_ptr[0]));
|
||||
SetDlgItemText(hwndDlg,IDC_TEXT2,GetStringFromStringTab(g_inst_header->componentsubtext_ptr[1]));
|
||||
SetDlgItemText(hwndDlg,IDC_INTROTEXT,LANG_COMP_TEXT);
|
||||
SetDlgItemText(hwndDlg,IDC_TEXT1,LANG_COMP_SUBTEXT(0));
|
||||
SetDlgItemText(hwndDlg,IDC_TEXT2,LANG_COMP_SUBTEXT(1));
|
||||
|
||||
oldTreeWndProc=GetWindowLong(hwndTree1,GWL_WNDPROC);
|
||||
SetWindowLong(hwndTree1,GWL_WNDPROC,(DWORD)newTreeWndProc);
|
||||
|
@ -790,7 +814,7 @@ static BOOL CALLBACK SelProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
|
|||
{
|
||||
SendMessage(hwndCombo1,CB_ADDSTRING,0,(LPARAM)GetStringFromStringTab(g_inst_header->install_types_ptr[m_num_insttypes]));
|
||||
}
|
||||
if (g_inst_header->no_custom_instmode_flag!=1) SendMessage(hwndCombo1,CB_ADDSTRING,0,(LPARAM)GetStringFromStringTab(g_inst_header->custom_ptr));
|
||||
if (g_inst_header->no_custom_instmode_flag!=1) SendMessage(hwndCombo1,CB_ADDSTRING,0,(LPARAM)LANG_COMP_CUSTOM);
|
||||
SendMessage(hwndCombo1,CB_SETCURSEL,m_whichcfg,0);
|
||||
}
|
||||
|
||||
|
@ -1051,7 +1075,7 @@ static BOOL CALLBACK SelProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
|
|||
ShowWindow(GetDlgItem(hwndDlg,IDC_TEXT2),c);
|
||||
}
|
||||
|
||||
if (g_inst_header->spacerequired_ptr > 0) {
|
||||
if (INSTALL_STR(spacerequired) >= 0) {
|
||||
int x,total;
|
||||
char s[128];
|
||||
for (total=x=0; x < g_inst_header->num_sections; x ++)
|
||||
|
@ -1059,7 +1083,7 @@ static BOOL CALLBACK SelProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
|
|||
if (g_inst_section[x].default_state&DFS_SET)
|
||||
total+=g_inst_section[x].size_kb;
|
||||
}
|
||||
lstrcpy(s,GetStringFromStringTab(g_inst_header->spacerequired_ptr));
|
||||
lstrcpy(s,LANG_SPACE_REQ);
|
||||
inttosizestr(total,s);
|
||||
SetDlgItemText(hwndDlg,IDC_SPACEREQUIRED,s);
|
||||
}
|
||||
|
@ -1162,7 +1186,7 @@ static BOOL CALLBACK InstProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
|
|||
else
|
||||
#endif
|
||||
{
|
||||
log_printf3("New install of \"%s\" to \"%s\"",GetStringFromStringTab(g_inst_cmnheader->name_ptr),state_install_directory);
|
||||
log_printf3("New install of \"%s\" to \"%s\"",LANG_NAME,state_install_directory);
|
||||
for (; x < g_inst_header->num_sections; x ++)
|
||||
{
|
||||
#ifdef NSIS_CONFIG_COMPONENTPAGE
|
||||
|
@ -1178,7 +1202,7 @@ static BOOL CALLBACK InstProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
|
|||
ListView_SetBkColor(insthwnd, g_inst_cmnheader->lb_bg);
|
||||
ListView_SetTextBkColor(insthwnd, g_inst_cmnheader->lb_bg);
|
||||
ListView_SetTextColor(insthwnd, g_inst_cmnheader->lb_fg);
|
||||
SetWindowText(insthwndbutton,GetStringFromStringTab(g_inst_cmnheader->showdetailsbutton_ptr));
|
||||
SetWindowText(insthwndbutton,LANG_BTN_DETAILS);
|
||||
if (g_inst_cmnheader->show_details)
|
||||
{
|
||||
ShowWindow(insthwndbutton,SW_HIDE);
|
||||
|
@ -1221,8 +1245,8 @@ static BOOL CALLBACK InstProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
|
|||
{
|
||||
ShowWindow(g_hwnd,SW_SHOWNA);
|
||||
lstrcpy(g_tmp,g_caption);
|
||||
process_string_fromtab(g_tmp+lstrlen(g_caption),g_inst_cmnheader->subcaption_ptrs[g_max_page+1]);
|
||||
update_status_text(GetStringFromStringTab(g_inst_cmnheader->completed_ptr),"");
|
||||
process_string_fromtab(g_tmp+lstrlen(g_caption),COMMON_STR(subcaptions[g_max_page+1]));
|
||||
update_status_text(LANG_COMPLETED,"");
|
||||
SetWindowText(h2,g_tmp);
|
||||
SetFocus(h);
|
||||
}
|
||||
|
|
|
@ -15,6 +15,12 @@
|
|||
HWND g_SectionHack;
|
||||
#endif
|
||||
|
||||
// Added by Amir Szekely 3rd August 2002
|
||||
extern installer_strings *install_strings_tables;
|
||||
extern common_strings *common_strings_tables;
|
||||
extern uninstall_strings *uninstall_strings_tables;
|
||||
extern int current_lang;
|
||||
|
||||
#ifdef NSIS_SUPPORT_STACK
|
||||
typedef struct _stack_t {
|
||||
struct _stack_t *next;
|
||||
|
@ -67,7 +73,7 @@ static void doRMDir(char *buf, int recurse)
|
|||
if (fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) doRMDir(buf,recurse);
|
||||
else
|
||||
{
|
||||
update_status_text(LANG_STR(LANG_DELETEFILE),buf);
|
||||
update_status_text(LANG_DELETEFILE,buf);
|
||||
if (fd.dwFileAttributes & FILE_ATTRIBUTE_READONLY)
|
||||
SetFileAttributes(buf,fd.dwFileAttributes^FILE_ATTRIBUTE_READONLY);
|
||||
DeleteFile(buf);
|
||||
|
@ -79,7 +85,7 @@ static void doRMDir(char *buf, int recurse)
|
|||
buf[i]=0; // fix buffer
|
||||
}
|
||||
log_printf2("RMDir: RemoveDirectory(\"%s\")",buf);
|
||||
update_status_text(LANG_STR(LANG_REMOVEDIR),buf);
|
||||
update_status_text(LANG_REMOVEDIR,buf);
|
||||
RemoveDirectory(buf);
|
||||
}
|
||||
#endif//NSIS_SUPPORT_RMDIR
|
||||
|
@ -234,10 +240,10 @@ static int ExecuteEntry(entry *entries, int pos)
|
|||
log_printf3("CreateDirectory: \"%s\" (%d)",buf2,parms[1]);
|
||||
if (parms[1])
|
||||
{
|
||||
update_status_text(LANG_STR(LANG_OUTPUTDIR),buf2);
|
||||
update_status_text(LANG_OUTPUTDIR,buf2);
|
||||
lstrcpy(state_output_directory,buf2);
|
||||
}
|
||||
else update_status_text(LANG_STR(LANG_CREATEDIR),buf2);
|
||||
else update_status_text(LANG_CREATEDIR,buf2);
|
||||
recursive_create_directory(buf2);
|
||||
return 0;
|
||||
case EW_IFFILEEXISTS:
|
||||
|
@ -273,7 +279,7 @@ static int ExecuteEntry(entry *entries, int pos)
|
|||
log_printf2("Rename: %s",buf4);
|
||||
if (MoveFile(buf,buf2))
|
||||
{
|
||||
update_status_text(LANG_STR(LANG_RENAME),buf4);
|
||||
update_status_text(LANG_RENAME,buf4);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -284,7 +290,7 @@ static int ExecuteEntry(entry *entries, int pos)
|
|||
exec_rebootflag++;
|
||||
#endif
|
||||
MoveFileOnReboot(buf,buf2);
|
||||
update_status_text(LANG_STR(LANG_RENAMEONREBOOT),buf4);
|
||||
update_status_text(LANG_RENAMEONREBOOT,buf4);
|
||||
log_printf2("Rename on reboot: %s",buf4);
|
||||
}
|
||||
else
|
||||
|
@ -384,7 +390,7 @@ static int ExecuteEntry(entry *entries, int pos)
|
|||
{
|
||||
if (overwriteflag)
|
||||
{
|
||||
update_status_text(LANG_STR(LANG_SKIPPED),buf4);
|
||||
update_status_text(LANG_SKIPPED,buf4);
|
||||
if (overwriteflag==2) exec_errorflag++;
|
||||
log_printf3("File: skipped: \"%s\" (overwriteflag=%d)",buf,overwriteflag);
|
||||
return 0;
|
||||
|
@ -393,7 +399,7 @@ static int ExecuteEntry(entry *entries, int pos)
|
|||
lstrcpy(buf3,g_usrvars[0]);//save $0
|
||||
lstrcpy(g_usrvars[0],buf);
|
||||
|
||||
process_string_fromtab(buf2,g_inst_cmnheader->fileerrtext_ptr);
|
||||
process_string(buf2,LANG_FILEERR);
|
||||
lstrcpy(g_usrvars[0],buf3); // restore $0
|
||||
|
||||
switch (MessageBox(g_hwnd,buf2,g_caption,MB_ABORTRETRYIGNORE|MB_ICONSTOP))
|
||||
|
@ -407,12 +413,12 @@ static int ExecuteEntry(entry *entries, int pos)
|
|||
return 0;
|
||||
default:
|
||||
log_printf("File: error, user abort");
|
||||
update_status_text(LANG_STR(LANG_CANTWRITE),buf);
|
||||
update_status_text(LANG_CANTWRITE,buf);
|
||||
return EXEC_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
update_status_text(LANG_STR(LANG_EXTRACT),buf4);
|
||||
update_status_text(LANG_EXTRACT,buf4);
|
||||
ret=GetCompressedDataFromDataBlock(parms[2],hOut);
|
||||
|
||||
log_printf3("File: wrote %d to \"%s\"",ret,buf);
|
||||
|
@ -426,12 +432,12 @@ static int ExecuteEntry(entry *entries, int pos)
|
|||
{
|
||||
if (ret == -2)
|
||||
{
|
||||
lstrcpy(buf,LANG_STR(LANG_ERRORWRITING));
|
||||
lstrcpy(buf,LANG_ERRORWRITING);
|
||||
lstrcat(buf,buf4);
|
||||
}
|
||||
else
|
||||
{
|
||||
lstrcpy(buf,LANG_STR(LANG_ERRORDECOMPRESSING));
|
||||
lstrcpy(buf,LANG_ERRORDECOMPRESSING);
|
||||
}
|
||||
log_printf2("%s",buf);
|
||||
MessageBox(g_hwnd,buf,g_caption,MB_OK|MB_ICONSTOP);
|
||||
|
@ -462,7 +468,7 @@ static int ExecuteEntry(entry *entries, int pos)
|
|||
if (DeleteFile(buf2))
|
||||
{
|
||||
log_printf2("Delete: DeleteFile(\"%s\")",buf2);
|
||||
update_status_text(LANG_STR(LANG_DELETEFILE),buf2);
|
||||
update_status_text(LANG_DELETEFILE,buf2);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -473,7 +479,7 @@ static int ExecuteEntry(entry *entries, int pos)
|
|||
exec_rebootflag++;
|
||||
#endif
|
||||
log_printf2("Delete: DeleteFile on Reboot(\"%s\")",buf2);
|
||||
update_status_text(LANG_STR(LANG_DELETEONREBOOT),buf2);
|
||||
update_status_text(LANG_DELETEONREBOOT,buf2);
|
||||
MoveFileOnReboot(buf2,NULL);
|
||||
}
|
||||
else
|
||||
|
@ -708,7 +714,7 @@ static int ExecuteEntry(entry *entries, int pos)
|
|||
lstrcpy(buf4,buf);
|
||||
lstrcat(buf4," ");
|
||||
lstrcat(buf4,buf2);
|
||||
update_status_text(LANG_STR(LANG_EXECSHELL), buf4);
|
||||
update_status_text(LANG_EXECSHELL, buf4);
|
||||
x=(int)ShellExecute(g_hwnd,buf[0]?buf:NULL,buf2,buf3[0]?buf3:NULL,state_output_directory,parms[3]);
|
||||
if (x < 33)
|
||||
{
|
||||
|
@ -728,7 +734,7 @@ static int ExecuteEntry(entry *entries, int pos)
|
|||
HANDLE hProc;
|
||||
process_string_fromtab(buf,parms[0]);
|
||||
log_printf2("Exec: command=\"%s\"",buf);
|
||||
update_status_text(LANG_STR(LANG_EXECUTE),buf);
|
||||
update_status_text(LANG_EXECUTE,buf);
|
||||
|
||||
hProc=myCreateProcess(buf,*state_output_directory?state_output_directory:NULL);
|
||||
|
||||
|
@ -855,21 +861,21 @@ static int ExecuteEntry(entry *entries, int pos)
|
|||
}
|
||||
else
|
||||
{
|
||||
update_status_text(LANG_STR(LANG_CANNOTFINDSYMBOL),buf2);
|
||||
update_status_text(LANG_CANNOTFINDSYMBOL,buf2);
|
||||
log_printf3("Error registering DLL: %s not found in %s",buf2,buf);
|
||||
}
|
||||
FreeLibrary(h);
|
||||
}
|
||||
else
|
||||
{
|
||||
update_status_text(LANG_STR(LANG_COULDNOTLOAD),buf);
|
||||
update_status_text(LANG_COULDNOTLOAD,buf);
|
||||
log_printf2("Error registering DLL: Could not load %s",buf);
|
||||
}
|
||||
OleUninitialize();
|
||||
}
|
||||
else
|
||||
{
|
||||
update_status_text(LANG_STR(LANG_NOOLE),buf);
|
||||
update_status_text(LANG_NOOLE,buf);
|
||||
log_printf("Error registering DLL: Could not initialize OLE");
|
||||
}
|
||||
}
|
||||
|
@ -889,11 +895,11 @@ static int ExecuteEntry(entry *entries, int pos)
|
|||
state_output_directory,(parms[4]&0xff00)>>8,parms[4]>>16))
|
||||
{
|
||||
exec_errorflag++;
|
||||
update_status_text(LANG_STR(LANG_ERRORCREATINGSHORTCUT),buf3);
|
||||
update_status_text(LANG_ERRORCREATINGSHORTCUT,buf3);
|
||||
}
|
||||
else
|
||||
{
|
||||
update_status_text(LANG_STR(LANG_CREATESHORTCUT),buf3);
|
||||
update_status_text(LANG_CREATESHORTCUT,buf3);
|
||||
}
|
||||
return 0;
|
||||
#endif//NSIS_SUPPORT_CREATESHORTCUT
|
||||
|
@ -910,7 +916,7 @@ static int ExecuteEntry(entry *entries, int pos)
|
|||
buf[lstrlen(buf)+1]=0;
|
||||
buf2[lstrlen(buf2)+1]=0;
|
||||
|
||||
lstrcpy(buf3,LANG_STR(LANG_COPYTO));
|
||||
lstrcpy(buf3,LANG_COPYTO);
|
||||
lstrcat(buf3,buf2);
|
||||
|
||||
op.pFrom=buf;
|
||||
|
@ -921,7 +927,7 @@ static int ExecuteEntry(entry *entries, int pos)
|
|||
res=SHFileOperation(&op);
|
||||
if (res)
|
||||
{ // some of these changes were from Edgewise (wiked_edge@yahoo.com)
|
||||
update_status_text(LANG_STR(LANG_COPYFAILED),"");
|
||||
update_status_text(LANG_COPYFAILED,"");
|
||||
exec_errorflag++;
|
||||
}
|
||||
}
|
||||
|
@ -1326,11 +1332,11 @@ static int ExecuteEntry(entry *entries, int pos)
|
|||
log_printf3("created uninstaller: %d, \"%s\"",ret,buf2);
|
||||
if (ret < 0)
|
||||
{
|
||||
update_status_text(LANG_STR(LANG_ERRORCREATING),buf);
|
||||
update_status_text(LANG_ERRORCREATING,buf);
|
||||
DeleteFile(buf2);
|
||||
}
|
||||
else
|
||||
update_status_text(LANG_STR(LANG_CREATEDUNINST),buf);
|
||||
update_status_text(LANG_CREATEDUNINST,buf);
|
||||
}
|
||||
return 0;
|
||||
#endif//NSIS_CONFIG_UNINSTALL_SUPPORT
|
||||
|
@ -1418,6 +1424,6 @@ static int ExecuteEntry(entry *entries, int pos)
|
|||
return 0;
|
||||
#endif //NSIS_CONFIG_VISIBLE_SUPPORT
|
||||
}
|
||||
MessageBox(g_hwnd,LANG_STR(LANG_INSTCORRUPTED),g_caption,MB_OK|MB_ICONSTOP);
|
||||
MessageBox(g_hwnd,LANG_INSTCORRUPTED,g_caption,MB_OK|MB_ICONSTOP);
|
||||
return EXEC_ERROR;
|
||||
}
|
||||
|
|
|
@ -146,24 +146,85 @@ typedef struct
|
|||
int length_of_all_following_data;
|
||||
} firstheader;
|
||||
|
||||
// Strings common to both installers and uninstallers
|
||||
typedef struct
|
||||
{
|
||||
WORD lang_id;
|
||||
|
||||
// unprocessed strings
|
||||
int branding;
|
||||
int cancelbutton;
|
||||
int showdetailsbutton;
|
||||
int completed;
|
||||
int closebutton; // "Close"
|
||||
int name; // name of installer
|
||||
|
||||
// processed strings
|
||||
int caption; // name of installer + " Setup" or whatever.
|
||||
int subcaptions[5];
|
||||
|
||||
#ifdef NSIS_SUPPORT_FILE
|
||||
int fileerrtext;
|
||||
#endif
|
||||
|
||||
#if defined(NSIS_SUPPORT_DELETE) || defined(NSIS_SUPPORT_RMDIR) || defined(NSIS_SUPPORT_FILE)
|
||||
int cant_write;
|
||||
#endif
|
||||
#ifdef NSIS_SUPPORT_RMDIR
|
||||
int remove_dir;
|
||||
#endif
|
||||
#ifdef NSIS_SUPPORT_COPYFILES
|
||||
int copy_failed;
|
||||
int copy_to;
|
||||
#endif
|
||||
#ifdef NSIS_SUPPORT_ACTIVEXREG
|
||||
int symbol_not_found;
|
||||
int could_not_load;
|
||||
int no_ole;
|
||||
// not used anywhere - int err_reg_dll;
|
||||
#endif
|
||||
#ifdef NSIS_SUPPORT_CREATESHORTCUT
|
||||
int create_shortcut;
|
||||
int err_creating_shortcut;
|
||||
#endif
|
||||
#ifdef NSIS_SUPPORT_DELETE
|
||||
int del_file;
|
||||
#ifdef NSIS_SUPPORT_MOVEONREBOOT
|
||||
int del_on_reboot;
|
||||
#endif
|
||||
#endif
|
||||
#ifdef NSIS_CONFIG_UNINSTALL_SUPPORT
|
||||
int created_uninst;
|
||||
int err_creating;
|
||||
#endif
|
||||
#ifdef NSIS_SUPPORT_SHELLEXECUTE
|
||||
int exec_shell;
|
||||
#endif
|
||||
#ifdef NSIS_SUPPORT_EXECUTE
|
||||
int exec;
|
||||
#endif
|
||||
#ifdef NSIS_SUPPORT_MOVEONREBOOT
|
||||
int rename_on_reboot;
|
||||
#endif
|
||||
#ifdef NSIS_SUPPORT_RENAME
|
||||
int rename;
|
||||
#endif
|
||||
#ifdef NSIS_SUPPORT_FILE
|
||||
int extract;
|
||||
int err_writing;
|
||||
int err_decompressing;
|
||||
int skipped;
|
||||
#endif
|
||||
int inst_corrupted;
|
||||
int output_dir;
|
||||
int create_dir;
|
||||
} common_strings;
|
||||
|
||||
// Settings common to both installers and uninstallers
|
||||
typedef struct
|
||||
{
|
||||
// unprocessed strings
|
||||
int branding_ptr;
|
||||
int cancelbutton_ptr;
|
||||
int showdetailsbutton_ptr;
|
||||
int completed_ptr;
|
||||
int closebutton_ptr; // "Close"
|
||||
int name_ptr; // name of installer
|
||||
|
||||
// processed strings
|
||||
int caption_ptr; // name of installer + " Setup" or whatever.
|
||||
int subcaption_ptrs[5];
|
||||
|
||||
#ifdef NSIS_SUPPORT_FILE
|
||||
int fileerrtext_ptr;
|
||||
#endif
|
||||
int str_tables_num; // number of strings tables in array
|
||||
int str_tables; // offset to tables array
|
||||
|
||||
int num_entries; // total number of entries
|
||||
|
||||
|
@ -191,32 +252,40 @@ typedef struct
|
|||
|
||||
} common_header;
|
||||
|
||||
// Strings specific to installers
|
||||
typedef struct
|
||||
{
|
||||
WORD lang_id;
|
||||
|
||||
// these first strings are literals (should not be encoded)
|
||||
int backbutton;
|
||||
int nextbutton;
|
||||
int browse; // "Browse..."
|
||||
int installbutton; // "Install"
|
||||
int spacerequired; // "Space required: "
|
||||
int spaceavailable; // "Space available: "
|
||||
int custom; // Custom
|
||||
int text; // directory page text
|
||||
int dirsubtext; // directory text2
|
||||
#ifdef NSIS_CONFIG_COMPONENTPAGE
|
||||
int componenttext; // component page text
|
||||
int componentsubtext[2];
|
||||
#endif
|
||||
#ifdef NSIS_CONFIG_LICENSEPAGE
|
||||
int licensetext; // license page text
|
||||
int licensedata; // license text
|
||||
int licensebutton; // license button text
|
||||
#endif//NSIS_CONFIG_LICENSEPAGE
|
||||
} installer_strings;
|
||||
|
||||
// Settings specific to installers
|
||||
typedef struct
|
||||
{
|
||||
// common settings
|
||||
common_header common;
|
||||
|
||||
// these first strings are literals (should not be encoded)
|
||||
int backbutton_ptr;
|
||||
int nextbutton_ptr;
|
||||
int browse_ptr; // "Browse..."
|
||||
int installbutton_ptr; // "Install"
|
||||
int spacerequired_ptr; // "Space required: "
|
||||
int spaceavailable_ptr; // "Space available: "
|
||||
int custom_ptr; // Custom
|
||||
int text_ptr; // directory page text
|
||||
int dirsubtext_ptr; // directory text2
|
||||
#ifdef NSIS_CONFIG_COMPONENTPAGE
|
||||
int componenttext_ptr; // component page text
|
||||
int componentsubtext_ptr[2];
|
||||
#endif
|
||||
#ifdef NSIS_CONFIG_LICENSEPAGE
|
||||
int licensetext_ptr; // license page text
|
||||
int licensedata_ptr; // license text
|
||||
int licensebutton_ptr; // license button text
|
||||
int license_bg; // license background color
|
||||
#endif//NSIS_CONFIG_LICENSEPAGE
|
||||
int str_tables_num; // number of strings tables in array
|
||||
int str_tables; // offset to tables array
|
||||
|
||||
int install_reg_rootkey, install_reg_key_ptr, install_reg_value_ptr;
|
||||
|
||||
|
@ -224,6 +293,10 @@ typedef struct
|
|||
int install_types_ptr[NSIS_MAX_INST_TYPES]; // -1 if not used. can describe as lite, normal, full, etc.
|
||||
#endif
|
||||
|
||||
#ifdef NSIS_CONFIG_LICENSEPAGE
|
||||
int license_bg; // license background color
|
||||
#endif//NSIS_CONFIG_LICENSEPAGE
|
||||
|
||||
// below here, the strings are processed (can have variables etc)
|
||||
int install_directory_ptr; // default install dir.
|
||||
|
||||
|
@ -249,16 +322,25 @@ typedef struct
|
|||
|
||||
} header;
|
||||
|
||||
// Strings specific to uninstallers
|
||||
typedef struct
|
||||
{
|
||||
WORD lang_id;
|
||||
|
||||
// unprocessed strings
|
||||
int uninstbutton;
|
||||
int uninstalltext;
|
||||
int uninstalltext2;
|
||||
} uninstall_strings;
|
||||
|
||||
// Settings specific to uninstallers
|
||||
typedef struct
|
||||
{
|
||||
// common settings
|
||||
common_header common;
|
||||
|
||||
// unprocessed strings
|
||||
int uninstbutton_ptr;
|
||||
int uninstalltext_ptr;
|
||||
int uninstalltext2_ptr;
|
||||
int str_tables_num; // number of strings tables in array
|
||||
int str_tables; // offset to tables array
|
||||
|
||||
int code;
|
||||
int code_size;
|
||||
|
|
|
@ -21,37 +21,75 @@
|
|||
#define _LANG_GENERIC_ERROR "NSIS ERROR"
|
||||
|
||||
|
||||
#define LANG_STR(x) (x)
|
||||
// Changed by Amir Szekely 3rd August 2002
|
||||
// Now supports more than one language in each installer
|
||||
|
||||
// instruction strings (these may someday be stored in the datablock or string table, and accessed
|
||||
// via LANG_STR()
|
||||
#define LANG_DELETEFILE "Delete file: "
|
||||
#define LANG_DLLREGERROR "Error registering DLL"
|
||||
#define LANG_REMOVEDIR "Remove directory: "
|
||||
#define LANG_OUTPUTDIR "Output directory: "
|
||||
#define LANG_CREATEDIR "Create directory: "
|
||||
#define LANG_RENAME "Rename: "
|
||||
#define LANG_RENAMEONREBOOT "Rename on reboot: "
|
||||
#define LANG_SKIPPED "Skipped: "
|
||||
#define LANG_CANTWRITE "Can't write: "
|
||||
#define LANG_EXTRACT "Extract: "
|
||||
#define LANG_ERRORWRITING "Extract: error writing to file "
|
||||
#define LANG_ERRORDECOMPRESSING "Error decompressing data! Corrupted installer?"
|
||||
#define LANG_DELETEONREBOOT "Delete on reboot: "
|
||||
#define LANG_EXECSHELL "ExecShell: "
|
||||
#define LANG_EXECUTE "Execute: "
|
||||
#define LANG_CANNOTFINDSYMBOL "Could not find symbol: "
|
||||
#define LANG_COULDNOTLOAD "Could not load: "
|
||||
#define LANG_NOOLE "No OLE for: "
|
||||
#define LANG_ERRORCREATINGSHORTCUT "Error creating shortcut: "
|
||||
#define LANG_CREATESHORTCUT "Create shortcut: "
|
||||
#define LANG_COPYTO "Copy to "
|
||||
#define LANG_COPYFAILED "Copy failed"
|
||||
#define LANG_ERRORCREATING "Error creating: "
|
||||
#define LANG_CREATEDUNINST "Created uninstaller: "
|
||||
#define LANG_INSTCORRUPTED "Install corrupted: invalid opcode"
|
||||
// Please note that all of these define the offset not the string itself.
|
||||
// To get the string it self use process_string_fromtab or GetStringFromStringTab.
|
||||
|
||||
#define INSTALL_STR(x) (install_strings_tables[current_lang].x)
|
||||
|
||||
// Installer specific strings
|
||||
#define LANG_BTN_BACK GetStringFromStringTab(INSTALL_STR(backbutton))
|
||||
#define LANG_BTN_NEXT GetStringFromStringTab(INSTALL_STR(nextbutton))
|
||||
#define LANG_BTN_BROWSE GetStringFromStringTab(INSTALL_STR(browse))
|
||||
#define LANG_BTN_INSTALL GetStringFromStringTab(INSTALL_STR(installbutton))
|
||||
#define LANG_SPACE_REQ GetStringFromStringTab(INSTALL_STR(spacerequired))
|
||||
#define LANG_SPACE_AVAIL GetStringFromStringTab(INSTALL_STR(spaceavailable))
|
||||
#define LANG_COMP_CUSTOM GetStringFromStringTab(INSTALL_STR(custom))
|
||||
#define LANG_DIR_TEXT GetStringFromStringTab(INSTALL_STR(text))
|
||||
#define LANG_DIR_SUBTEXT GetStringFromStringTab(INSTALL_STR(dirsubtext))
|
||||
#define LANG_COMP_TEXT GetStringFromStringTab(INSTALL_STR(componenttext))
|
||||
#define LANG_COMP_SUBTEXT(x) GetStringFromStringTab(INSTALL_STR(componentsubtext[x]))
|
||||
#define LANG_LICENSE_TEXT GetStringFromStringTab(INSTALL_STR(licensetext))
|
||||
#define LANG_LICENSE_DATA GetStringFromStringTab(INSTALL_STR(licensedata))
|
||||
#define LANG_BTN_LICENSE GetStringFromStringTab(INSTALL_STR(licensebutton))
|
||||
|
||||
#define UNINSTALL_STR(x) (uninstall_strings_tables[current_lang].x)
|
||||
|
||||
// Uninstall specific strings
|
||||
#define LANG_BTN_UNINST GetStringFromStringTab(UNINSTALL_STR(uninstbutton))
|
||||
#define LANG_UNINST_TEXT GetStringFromStringTab(UNINSTALL_STR(uninstalltext))
|
||||
#define LANG_UNINST_SUBTEXT GetStringFromStringTab(UNINSTALL_STR(uninstalltext2))
|
||||
|
||||
#define COMMON_STR(x) (common_strings_tables[current_lang].x)
|
||||
|
||||
// Common strings
|
||||
#define LANG_BRANDING GetStringFromStringTab(COMMON_STR(branding))
|
||||
#define LANG_BTN_CANCEL GetStringFromStringTab(COMMON_STR(cancelbutton))
|
||||
#define LANG_BTN_DETAILS GetStringFromStringTab(COMMON_STR(showdetailsbutton))
|
||||
#define LANG_COMPLETED GetStringFromStringTab(COMMON_STR(completed))
|
||||
#define LANG_BTN_CLOSE GetStringFromStringTab(COMMON_STR(closebutton))
|
||||
#define LANG_NAME GetStringFromStringTab(COMMON_STR(name))
|
||||
#define LANG_CAPTION GetStringFromStringTab(COMMON_STR(caption))
|
||||
#define LANG_SUBCAPTION(x) GetStringFromStringTab(COMMON_STR(subcaptions[x]))
|
||||
|
||||
// instruction strings
|
||||
#define LANG_FILEERR GetStringFromStringTab(COMMON_STR(fileerrtext))
|
||||
#define LANG_DELETEFILE GetStringFromStringTab(COMMON_STR(del_file))
|
||||
#define LANG_DLLREGERROR GetStringFromStringTab(COMMON_STR(err_reg_dll))
|
||||
#define LANG_REMOVEDIR GetStringFromStringTab(COMMON_STR(remove_dir))
|
||||
#define LANG_OUTPUTDIR GetStringFromStringTab(COMMON_STR(output_dir))
|
||||
#define LANG_CREATEDIR GetStringFromStringTab(COMMON_STR(create_dir))
|
||||
#define LANG_RENAME GetStringFromStringTab(COMMON_STR(rename))
|
||||
#define LANG_RENAMEONREBOOT GetStringFromStringTab(COMMON_STR(rename_on_reboot))
|
||||
#define LANG_SKIPPED GetStringFromStringTab(COMMON_STR(skipped))
|
||||
#define LANG_CANTWRITE GetStringFromStringTab(COMMON_STR(cant_write))
|
||||
#define LANG_EXTRACT GetStringFromStringTab(COMMON_STR(extract))
|
||||
#define LANG_ERRORWRITING GetStringFromStringTab(COMMON_STR(err_writing))
|
||||
#define LANG_ERRORDECOMPRESSING GetStringFromStringTab(COMMON_STR(err_decompressing))
|
||||
#define LANG_DELETEONREBOOT GetStringFromStringTab(COMMON_STR(del_on_reboot))
|
||||
#define LANG_EXECSHELL GetStringFromStringTab(COMMON_STR(exec_shell))
|
||||
#define LANG_EXECUTE GetStringFromStringTab(COMMON_STR(exec))
|
||||
#define LANG_CANNOTFINDSYMBOL GetStringFromStringTab(COMMON_STR(symbol_not_found))
|
||||
#define LANG_COULDNOTLOAD GetStringFromStringTab(COMMON_STR(could_not_load))
|
||||
#define LANG_NOOLE GetStringFromStringTab(COMMON_STR(no_ole))
|
||||
#define LANG_ERRORCREATINGSHORTCUT GetStringFromStringTab(COMMON_STR(err_creating_shortcut))
|
||||
#define LANG_CREATESHORTCUT GetStringFromStringTab(COMMON_STR(create_shortcut))
|
||||
#define LANG_COPYTO GetStringFromStringTab(COMMON_STR(copy_to))
|
||||
#define LANG_COPYFAILED GetStringFromStringTab(COMMON_STR(copy_failed))
|
||||
#define LANG_ERRORCREATING GetStringFromStringTab(COMMON_STR(err_creating))
|
||||
#define LANG_CREATEDUNINST GetStringFromStringTab(COMMON_STR(created_uninst))
|
||||
#define LANG_INSTCORRUPTED GetStringFromStringTab(COMMON_STR(inst_corrupted))
|
||||
|
||||
#endif//_NSIS_LANG_H_
|
Loading…
Add table
Add a link
Reference in a new issue