* 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
|
@ -26,6 +26,7 @@
|
|||
|
||||
#include <windows.h>
|
||||
#include <commctrl.h>
|
||||
#include <shlobj.h>
|
||||
#include "resource.h"
|
||||
#include "util.h"
|
||||
#include "fileform.h"
|
||||
|
@ -58,6 +59,13 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInst,LPSTR lpszCmdParam,
|
|||
|
||||
InitCommonControls();
|
||||
|
||||
#if defined(NSIS_SUPPORT_ACTIVEXREG) || defined(NSIS_SUPPORT_CREATESHORTCUT)
|
||||
{
|
||||
extern HRESULT g_hres;
|
||||
g_hres=OleInitialize(NULL);
|
||||
}
|
||||
#endif
|
||||
|
||||
GetTempPath(sizeof(state_temp_dir), state_temp_dir);
|
||||
validate_filename(state_temp_dir);
|
||||
CreateDirectory(state_temp_dir, NULL);
|
||||
|
@ -127,7 +135,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInst,LPSTR lpszCmdParam,
|
|||
while (*p) p++;
|
||||
|
||||
while (p >= cmdline && (p[0] != '_' || p[1] != '?' || p[2] != '=')) p--;
|
||||
|
||||
|
||||
if (p >= cmdline)
|
||||
{
|
||||
*(p-1)=0; // terminate before the " _?="
|
||||
|
@ -200,6 +208,11 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInst,LPSTR lpszCmdParam,
|
|||
log_write(1);
|
||||
#endif//NSIS_CONFIG_LOG
|
||||
end:
|
||||
|
||||
#if defined(NSIS_SUPPORT_ACTIVEXREG) || defined(NSIS_SUPPORT_CREATESHORTCUT)
|
||||
OleUninitialize();
|
||||
#endif
|
||||
|
||||
if (g_db_hFile != INVALID_HANDLE_VALUE) CloseHandle(g_db_hFile);
|
||||
#ifdef NSIS_COMPRESS_WHOLE
|
||||
if (dbd_hFile != INVALID_HANDLE_VALUE) CloseHandle(dbd_hFile);
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -8,8 +8,8 @@
|
|||
|
||||
#ifdef NSIS_SUPPORT_BGBG
|
||||
|
||||
#define c1 g_inst_cmnheader->bg_color1
|
||||
#define c2 g_inst_cmnheader->bg_color2
|
||||
#define c1 g_header->bg_color1
|
||||
#define c2 g_header->bg_color2
|
||||
|
||||
LRESULT CALLBACK BG_WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
|
@ -49,7 +49,7 @@ LRESULT CALLBACK BG_WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||
r.bottom+=4;
|
||||
}
|
||||
|
||||
if (g_inst_cmnheader->bg_textcolor != -1)
|
||||
if (g_header->bg_textcolor != -1)
|
||||
{
|
||||
HFONT newFont, oldFont;
|
||||
newFont = CreateFont(40,0,0,0,FW_BOLD,TRUE,FALSE,FALSE,DEFAULT_CHARSET,OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,DEFAULT_PITCH,"Garamond");
|
||||
|
@ -60,7 +60,7 @@ LRESULT CALLBACK BG_WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||
r.top=8;
|
||||
my_GetWindowText(hwnd,buf,sizeof(buf));
|
||||
SetBkMode(hdc,TRANSPARENT);
|
||||
SetTextColor(hdc,g_inst_cmnheader->bg_textcolor);
|
||||
SetTextColor(hdc,g_header->bg_textcolor);
|
||||
oldFont = SelectObject(hdc,newFont);
|
||||
DrawText(hdc,buf,-1,&r,DT_TOP|DT_LEFT|DT_SINGLELINE|DT_NOPREFIX);
|
||||
SelectObject(hdc,oldFont);
|
||||
|
|
|
@ -26,14 +26,18 @@
|
|||
// really a big deal, but not usually needed).
|
||||
#define NSIS_MAX_STRLEN 1024
|
||||
|
||||
// NSIS_MAX_INST_TYPES specified the maximum install types.
|
||||
// NSIS_MAX_INST_TYPES define the maximum install types.
|
||||
// note that this should not exceed 32, ever.
|
||||
#define NSIS_MAX_INST_TYPES 32
|
||||
|
||||
// NSIS_DEFAULT_LANG defines the default language id NSIS will use if nothing
|
||||
// else is defined in the script. Default value is 1033 which is English.
|
||||
#define NSIS_DEFAULT_LANG 1033
|
||||
|
||||
// NSIS_CONFIG_UNINSTALL_SUPPORT enables the uninstaller
|
||||
// support. Comment it out if your installers don't need
|
||||
// uninstallers
|
||||
// adds approximately 2kb.
|
||||
// adds less than 1kb.
|
||||
#define NSIS_CONFIG_UNINSTALL_SUPPORT
|
||||
|
||||
// NSIS_CONFIG_LICENSEPAGE enables support for the installer to
|
||||
|
@ -54,7 +58,7 @@
|
|||
#define NSIS_CONFIG_VISIBLE_SUPPORT
|
||||
|
||||
// NSIS_CONFIG_ENHANCEDUI_SUPPORT enables support for CreateFont,
|
||||
// SetBkColor (used by some UIs), SetBrandingImage, .onInitDialog, etc
|
||||
// SetCtlColors (used by some UIs), SetBrandingImage, .onGUIInit, etc
|
||||
#define NSIS_CONFIG_ENHANCEDUI_SUPPORT
|
||||
|
||||
// NSIS_CONFIG_COMPRESSION_SUPPORT enables support for making installers
|
||||
|
@ -103,9 +107,9 @@
|
|||
|
||||
// NSIS_CONFIG_LOG enables the logging facility.
|
||||
// turning this on (by uncommenting it) adds about
|
||||
// 3kb, but can be useful in debugging your installers.
|
||||
// 4kb, but can be useful in debugging your installers.
|
||||
// NOT ENABLED BY DEFAULT.
|
||||
// #define NSIS_CONFIG_LOG
|
||||
//#define NSIS_CONFIG_LOG
|
||||
|
||||
// NSIS_SUPPORT_BGBG enables support for the blue (well, whatever
|
||||
// color you want) gradient background window.
|
||||
|
@ -253,7 +257,7 @@
|
|||
#undef NSIS_SUPPORT_BGBG
|
||||
#endif
|
||||
#ifdef NSIS_CONFIG_ENHANCEDUI_SUPPORT
|
||||
#undef NSIS_CONFIG_ENHANCEDUI_SUPPORT
|
||||
#undef NSIS_CONFIG_ENHANCEDUI_SUPPORT
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
@ -354,18 +358,22 @@
|
|||
#error NSIS_MAX_INST_TYPES > 32
|
||||
#endif
|
||||
|
||||
#ifndef NSIS_DEFAULT_LANG
|
||||
#define NSIS_DEFAULT_LANG 1033
|
||||
#endif
|
||||
|
||||
#ifndef INVALID_FILE_ATTRIBUTES
|
||||
#define INVALID_FILE_ATTRIBUTES ((DWORD)-1)
|
||||
#endif
|
||||
|
||||
// This is the old static var count that occupies memory
|
||||
// From $0 to $PLUGINSDIR
|
||||
#define USER_VARS_COUNT 26
|
||||
// From $0 to $PLUGINSDIR, $_CLICK
|
||||
#define USER_VARS_COUNT 28
|
||||
|
||||
#ifdef NSIS_SUPPORT_NAMED_USERVARS
|
||||
// This is the total number of old static var
|
||||
// From $0 to $HWNDPARENT
|
||||
#define TOTAL_COMPATIBLE_STATIC_VARS_COUNT 36
|
||||
#define TOTAL_COMPATIBLE_STATIC_VARS_COUNT 37
|
||||
|
||||
#define VARS_SECTION_NAME ".ndata"
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,7 +1,7 @@
|
|||
#ifndef _EXEC_H_
|
||||
#define _EXEC_H_
|
||||
|
||||
extern union installer_flags g_flags;
|
||||
extern union exec_flags g_exec_flags;
|
||||
|
||||
int NSISCALL ExecuteCodeSegment(int pos, HWND hwndProgress); // returns 0 on success
|
||||
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
#include "state.h"
|
||||
#include "resource.h"
|
||||
#include "lang.h"
|
||||
#include "ui.h"
|
||||
#include "exec.h"
|
||||
|
||||
#ifdef NSIS_CONFIG_COMPRESSION_SUPPORT
|
||||
#ifdef NSIS_COMPRESS_USE_ZLIB
|
||||
|
@ -23,11 +25,12 @@
|
|||
#endif//NSIS_COMPRESS_USE_BZIP2
|
||||
#endif//NSIS_CONFIG_COMPRESSION_SUPPORT
|
||||
|
||||
#include "ui.h"
|
||||
struct block_header g_blocks[BLOCKS_NUM];
|
||||
header *g_header;
|
||||
int g_flags;
|
||||
int g_filehdrsize;
|
||||
int g_is_uninstaller;
|
||||
|
||||
char *g_db_strtab;
|
||||
|
||||
static int g_db_offset;
|
||||
HANDLE g_db_hFile;
|
||||
|
||||
#if defined(NSIS_CONFIG_COMPRESSION_SUPPORT) && defined(NSIS_COMPRESS_WHOLE)
|
||||
|
@ -46,24 +49,42 @@ BOOL CALLBACK verProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||
if (uMsg == WM_INITDIALOG)
|
||||
{
|
||||
SetTimer(hwndDlg,1,250,NULL);
|
||||
msg = (char*)lParam;
|
||||
msg = (char *) lParam;
|
||||
uMsg = WM_TIMER;
|
||||
}
|
||||
if (uMsg == WM_TIMER)
|
||||
if (uMsg == WM_TIMER
|
||||
#ifdef NSIS_COMPRESS_WHOLE
|
||||
|| uMsg == WM_DESTROY
|
||||
#endif
|
||||
)
|
||||
{
|
||||
static char bt[64];
|
||||
wsprintf(bt,msg,MulDiv(m_pos,100,m_length));
|
||||
int percent=MulDiv(m_pos,100,m_length);
|
||||
#ifdef NSIS_COMPRESS_WHOLE
|
||||
if (msg)
|
||||
#endif
|
||||
{
|
||||
wsprintf(bt,msg,percent);
|
||||
|
||||
my_SetWindowText(hwndDlg,bt);
|
||||
my_SetDialogItemText(hwndDlg,IDC_STR,bt);
|
||||
my_SetWindowText(hwndDlg,bt);
|
||||
my_SetDialogItemText(hwndDlg,IDC_STR,bt);
|
||||
|
||||
ShowWindow(hwndDlg, SW_SHOW);
|
||||
}
|
||||
|
||||
#ifdef NSIS_COMPRESS_WHOLE
|
||||
if (ui_st_updateflag & 1)
|
||||
{
|
||||
wsprintf(bt, "... %d%%", percent);
|
||||
update_status_text(0, bt);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#endif//NSIS_CONFIG_CRC_SUPPORT || NSIS_COMPRESS_WHOLE
|
||||
#endif//NSIS_CONFIG_VISIBLE_SUPPORT
|
||||
|
||||
int inst_flags;
|
||||
|
||||
#ifdef NSIS_CONFIG_COMPRESSION_SUPPORT
|
||||
static z_stream g_inflate_stream;
|
||||
#endif
|
||||
|
@ -84,11 +105,14 @@ const char * NSISCALL loadHeaders(int cl_flags)
|
|||
|
||||
void *data;
|
||||
firstheader h;
|
||||
header *header;
|
||||
|
||||
HANDLE db_hFile;
|
||||
|
||||
GetModuleFileName(g_hInstance, state_exe_directory, NSIS_MAX_STRLEN);
|
||||
|
||||
g_db_hFile = myOpenFile(state_exe_directory, GENERIC_READ, OPEN_EXISTING);
|
||||
if (g_db_hFile == INVALID_HANDLE_VALUE)
|
||||
g_db_hFile = db_hFile = myOpenFile(state_exe_directory, GENERIC_READ, OPEN_EXISTING);
|
||||
if (db_hFile == INVALID_HANDLE_VALUE)
|
||||
{
|
||||
return _LANG_CANTOPENSELF;
|
||||
}
|
||||
|
@ -97,7 +121,7 @@ const char * NSISCALL loadHeaders(int cl_flags)
|
|||
|
||||
trimslashtoend(state_exe_directory);
|
||||
|
||||
left = m_length = GetFileSize(g_db_hFile,NULL);
|
||||
left = m_length = GetFileSize(db_hFile,NULL);
|
||||
while (left > 0)
|
||||
{
|
||||
static char temp[512];
|
||||
|
@ -160,7 +184,7 @@ const char * NSISCALL loadHeaders(int cl_flags)
|
|||
#ifdef NSIS_CONFIG_VISIBLE_SUPPORT
|
||||
|
||||
#ifdef NSIS_CONFIG_SILENT_SUPPORT
|
||||
else if (cl_flags & FH_FLAGS_SILENT == 0)
|
||||
else if ((cl_flags & FH_FLAGS_SILENT) == 0)
|
||||
#endif//NSIS_CONFIG_SILENT_SUPPORT
|
||||
{
|
||||
if (hwnd)
|
||||
|
@ -200,7 +224,7 @@ const char * NSISCALL loadHeaders(int cl_flags)
|
|||
if (do_crc)
|
||||
{
|
||||
int fcrc;
|
||||
SetSelfFilePointer(m_pos, FILE_BEGIN);
|
||||
SetSelfFilePointer(m_pos);
|
||||
if (!ReadSelfFile(&fcrc, sizeof(int)) || crc != fcrc)
|
||||
return _LANG_INVALIDCRC;
|
||||
}
|
||||
|
@ -218,10 +242,10 @@ const char * NSISCALL loadHeaders(int cl_flags)
|
|||
if (dbd_hFile == INVALID_HANDLE_VALUE)
|
||||
return _LANG_ERRORWRITINGTEMP;
|
||||
}
|
||||
dbd_srcpos = SetSelfFilePointer(g_filehdrsize + sizeof(firstheader), FILE_BEGIN);
|
||||
dbd_srcpos = SetSelfFilePointer(g_filehdrsize + sizeof(firstheader));
|
||||
dbd_fulllen = dbd_srcpos - sizeof(h) + h.length_of_all_following_data - ((cl_flags & FH_FLAGS_NO_CRC) ? 0 : sizeof(int));
|
||||
#else
|
||||
SetSelfFilePointer(g_filehdrsize + sizeof(firstheader), FILE_BEGIN);
|
||||
SetSelfFilePointer(g_filehdrsize + sizeof(firstheader));
|
||||
#endif
|
||||
|
||||
if (GetCompressedDataFromDataBlockToMemory(-1, data, h.length_of_header) != h.length_of_header)
|
||||
|
@ -230,40 +254,35 @@ const char * NSISCALL loadHeaders(int cl_flags)
|
|||
return _LANG_INVALIDCRC;
|
||||
}
|
||||
|
||||
#if !defined(NSIS_COMPRESS_WHOLE) || !defined(NSIS_CONFIG_COMPRESSION_SUPPORT)
|
||||
g_db_offset = SetSelfFilePointer(0,FILE_CURRENT);
|
||||
#else
|
||||
g_db_offset = dbd_pos;
|
||||
#endif
|
||||
header = g_header = data;
|
||||
|
||||
g_inst_combinedheader = data;
|
||||
|
||||
inst_flags = g_inst_cmnheader->flags;
|
||||
#ifdef NSIS_CONFIG_SILENT_SUPPORT
|
||||
if (cl_flags & FH_FLAGS_SILENT) inst_flags |= CH_FLAGS_SILENT;
|
||||
if (cl_flags & FH_FLAGS_SILENT)
|
||||
header->flags |= CH_FLAGS_SILENT;
|
||||
|
||||
g_exec_flags.silent = header->flags & (CH_FLAGS_SILENT | CH_FLAGS_SILENT_LOG);
|
||||
#endif
|
||||
|
||||
g_flags = header->flags;
|
||||
|
||||
#ifdef NSIS_CONFIG_UNINSTALL_SUPPORT
|
||||
if (h.flags & FH_FLAGS_UNINSTALL)
|
||||
{
|
||||
g_is_uninstaller++;
|
||||
g_inst_page = (page *) (g_inst_uninstheader + 1);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
g_inst_section=(section *) (g_inst_header + 1);
|
||||
num_sections=g_inst_header->num_sections;
|
||||
g_inst_page=(page *) (g_inst_section + num_sections);
|
||||
}
|
||||
g_inst_entry = (entry *) (g_inst_page + g_inst_cmnheader->num_pages);
|
||||
g_db_strtab = (char *) (g_inst_entry + g_inst_cmnheader->num_entries);
|
||||
return 0;
|
||||
}
|
||||
|
||||
const char * NSISCALL GetStringFromStringTab(int offs)
|
||||
{
|
||||
return g_db_strtab+(offs < 0 ? LANG_STR_TAB(offs) : offs);
|
||||
crc = BLOCKS_NUM;
|
||||
while (crc--)
|
||||
header->blocks[crc].offset += (int)data;
|
||||
|
||||
#ifdef NSIS_COMPRESS_WHOLE
|
||||
header->blocks[NB_DATA].offset = dbd_pos;
|
||||
#else
|
||||
header->blocks[NB_DATA].offset = SetFilePointer(db_hFile,0,NULL,FILE_CURRENT);
|
||||
#endif
|
||||
|
||||
mini_memcpy(&g_blocks, &header->blocks, sizeof(g_blocks));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define IBUFSIZE 16384
|
||||
|
@ -285,16 +304,7 @@ int NSISCALL _dodecomp(int offset, HANDLE hFileOut, char *outbuf, int outbuflen)
|
|||
|
||||
if (offset>=0)
|
||||
{
|
||||
/*
|
||||
int lp=SetSelfFilePointer(0,FILE_CURRENT);
|
||||
if (lp > g_db_offset+offset)
|
||||
{
|
||||
char buf[1023];
|
||||
wsprintf(buf,"going from %d to %d",lp,g_db_offset+offset);
|
||||
MessageBox(NULL,buf,"seeking back",MB_OK);
|
||||
}
|
||||
*/
|
||||
SetSelfFilePointer(g_db_offset+offset,FILE_BEGIN);
|
||||
SetSelfFilePointer(g_blocks[NB_DATA].offset+offset);
|
||||
}
|
||||
|
||||
if (!ReadSelfFile((LPVOID)&input_len,sizeof(int))) return -3;
|
||||
|
@ -302,8 +312,12 @@ int NSISCALL _dodecomp(int offset, HANDLE hFileOut, char *outbuf, int outbuflen)
|
|||
#ifdef NSIS_CONFIG_COMPRESSION_SUPPORT
|
||||
if (input_len & 0x80000000) // compressed
|
||||
{
|
||||
char progress[64];
|
||||
int input_len_total;
|
||||
DWORD ltc = GetTickCount(), tc;
|
||||
|
||||
inflateReset(&g_inflate_stream);
|
||||
input_len &= 0x7fffffff; // take off top bit.
|
||||
input_len_total = input_len &= 0x7fffffff; // take off top bit.
|
||||
|
||||
while (input_len > 0)
|
||||
{
|
||||
|
@ -328,6 +342,14 @@ int NSISCALL _dodecomp(int offset, HANDLE hFileOut, char *outbuf, int outbuflen)
|
|||
|
||||
u=(char*)g_inflate_stream.next_out - outbuffer;
|
||||
|
||||
tc = GetTickCount();
|
||||
if (tc - ltc > 200 || !input_len)
|
||||
{
|
||||
wsprintf(progress, "... %d%%", MulDiv(input_len_total - input_len, 100, input_len_total));
|
||||
update_status_text(0, progress);
|
||||
ltc = tc;
|
||||
}
|
||||
|
||||
if (!u) break;
|
||||
|
||||
if (!outbuf)
|
||||
|
@ -386,7 +408,7 @@ static int NSISCALL __ensuredata(int amount)
|
|||
int needed=amount-(dbd_size-dbd_pos);
|
||||
if (needed>0)
|
||||
{
|
||||
SetSelfFilePointer(dbd_srcpos,FILE_BEGIN);
|
||||
SetSelfFilePointer(dbd_srcpos);
|
||||
SetFilePointer(dbd_hFile,dbd_size,NULL,FILE_BEGIN);
|
||||
m_length=needed;
|
||||
m_pos=0;
|
||||
|
@ -402,9 +424,9 @@ static int NSISCALL __ensuredata(int amount)
|
|||
{
|
||||
DWORD r,t;
|
||||
#ifdef NSIS_CONFIG_VISIBLE_SUPPORT
|
||||
if (g_inst_cmnheader)
|
||||
if (g_header)
|
||||
#ifdef NSIS_CONFIG_SILENT_SUPPORT
|
||||
if (!(inst_flags&(CH_FLAGS_SILENT|CH_FLAGS_SILENT_LOG)))
|
||||
if (!g_exec_flags.silent)
|
||||
#endif
|
||||
{
|
||||
if (hwnd) {
|
||||
|
@ -412,13 +434,13 @@ static int NSISCALL __ensuredata(int amount)
|
|||
m_pos=m_length-(amount-(dbd_size-dbd_pos));
|
||||
while (PeekMessage(&msg,NULL,0,0,PM_REMOVE)) DispatchMessage(&msg);
|
||||
}
|
||||
else if (g_hwnd && GetTickCount() > verify_time)
|
||||
else if (GetTickCount() > verify_time)
|
||||
hwnd = CreateDialogParam(
|
||||
g_hInstance,
|
||||
MAKEINTRESOURCE(IDD_VERIFY),
|
||||
0,
|
||||
verProc,
|
||||
(LPARAM)_LANG_UNPACKING
|
||||
g_hwnd ? 0 : (LPARAM)_LANG_UNPACKING
|
||||
);
|
||||
}
|
||||
#endif//NSIS_CONFIG_VISIBLE_SUPPORT
|
||||
|
@ -458,7 +480,7 @@ int NSISCALL _dodecomp(int offset, HANDLE hFileOut, char *outbuf, int outbuflen)
|
|||
int retval;
|
||||
if (offset>=0)
|
||||
{
|
||||
dbd_pos=g_db_offset+offset;
|
||||
dbd_pos=g_blocks[NB_DATA].offset+offset;
|
||||
SetFilePointer(dbd_hFile,dbd_pos,NULL,FILE_BEGIN);
|
||||
}
|
||||
retval=__ensuredata(sizeof(int));
|
||||
|
@ -499,7 +521,7 @@ BOOL NSISCALL ReadSelfFile(LPVOID lpBuffer, DWORD nNumberOfBytesToRead)
|
|||
return ReadFile(g_db_hFile,lpBuffer,nNumberOfBytesToRead,&rd,NULL) && (rd == nNumberOfBytesToRead);
|
||||
}
|
||||
|
||||
DWORD NSISCALL SetSelfFilePointer(LONG lDistanceToMove, DWORD dwMoveMethod)
|
||||
DWORD NSISCALL SetSelfFilePointer(LONG lDistanceToMove)
|
||||
{
|
||||
return SetFilePointer(g_db_hFile,lDistanceToMove,NULL,dwMoveMethod);
|
||||
return SetFilePointer(g_db_hFile,lDistanceToMove,NULL,FILE_BEGIN);
|
||||
}
|
||||
|
|
|
@ -4,22 +4,23 @@
|
|||
#define _FILEFORM_H_
|
||||
|
||||
|
||||
// stored in file:
|
||||
// exehead (~34k)
|
||||
// firstheader (~28 bytes)
|
||||
// hdrinfo (4 bytes describing length/compression)::
|
||||
// (if install)
|
||||
// header (~228 bytes)
|
||||
// sections (20 bytes each)
|
||||
// (if uninstall)
|
||||
// uninstall_header (~116 bytes)
|
||||
// pages (12 bytes each)
|
||||
// entries (24 bytes each)
|
||||
// string table
|
||||
// language tables
|
||||
// datablock
|
||||
// (hdrinfo+datablock is at least 512 bytes if CRC enabled)
|
||||
// * the installer is compsed of the following parts:
|
||||
// exehead (~34kb)
|
||||
// firstheader (struct firstheader)
|
||||
// * headers (compressed together):
|
||||
// header (struct header)
|
||||
// * nsis blocks (described in header->blocks)
|
||||
// pages (struct page)
|
||||
// section headers (struct section)
|
||||
// entries/instructions (struct entry)
|
||||
// strings (null seperated)
|
||||
// language tables (language id, dialog offset, language strings)
|
||||
// colors (struct color)
|
||||
// data block (files and uninstaller data)
|
||||
// * not compressed
|
||||
// CRC (optional - 4 bytes)
|
||||
//
|
||||
// headers + datablock is at least 512 bytes if CRC enabled
|
||||
|
||||
|
||||
#define MAX_ENTRY_OFFSETS 6
|
||||
|
@ -92,8 +93,7 @@ enum
|
|||
|
||||
#ifdef NSIS_CONFIG_ENHANCEDUI_SUPPORT
|
||||
EW_GETDLGITEM, // GetDlgItem: 3: [outputvar, dialog, item_id]
|
||||
EW_GETWINTEXT, // GetWindowText: 2: [outputvar, hwnd]
|
||||
EW_SETBKCOLOR, // SerBkColor: 2: [hwnd, color]
|
||||
EW_SETCTLCOLORS, // SerCtlColors: 3: [hwnd, pointer to struct colors]
|
||||
EW_SETBRANDINGIMAGE, // SetBrandingImage: 1: [Bitmap file]
|
||||
EW_CREATEFONT, // CreateFont: 5: [handle output, face name, height, weight, flags]
|
||||
EW_SHOWWINDOW, // ShowWindow: 2: [hwnd, show state]
|
||||
|
@ -211,96 +211,6 @@ typedef struct
|
|||
int length_of_all_following_data;
|
||||
} firstheader;
|
||||
|
||||
// Strings common to both installers and uninstallers
|
||||
typedef struct
|
||||
{
|
||||
int name; // name of installer
|
||||
|
||||
// unprocessed strings
|
||||
#ifdef NSIS_CONFIG_VISIBLE_SUPPORT
|
||||
int branding;
|
||||
int backbutton;
|
||||
int nextbutton;
|
||||
int cancelbutton;
|
||||
int showdetailsbutton;
|
||||
int closebutton; // "Close"
|
||||
int completed;
|
||||
|
||||
int copy_details;
|
||||
|
||||
int byte;
|
||||
int kilo;
|
||||
int mega;
|
||||
int giga;
|
||||
|
||||
// processed strings
|
||||
int subcaptions[5];
|
||||
#endif
|
||||
int caption; // name of installer + " Setup" or whatever.
|
||||
|
||||
#ifdef NSIS_SUPPORT_FILE
|
||||
int fileerrtext;
|
||||
int fileerrtext_noignore;
|
||||
#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 registering;
|
||||
int unregistering;
|
||||
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;
|
||||
#ifdef NSIS_CONFIG_LOG
|
||||
int log_install_process;
|
||||
#endif
|
||||
} common_strings;
|
||||
|
||||
// Flags for common_header.flags
|
||||
#define CH_FLAGS_DETAILS_SHOWDETAILS 1
|
||||
#define CH_FLAGS_DETAILS_NEVERSHOW 2
|
||||
|
@ -316,25 +226,54 @@ typedef struct
|
|||
#define CH_FLAGS_COMP_ONLY_ON_CUSTOM 256
|
||||
#define CH_FLAGS_NO_CUSTOM 512
|
||||
#endif
|
||||
#ifdef NSIS_CONFIG_LICENSEPAGE
|
||||
#define CH_FLAGS_LICENSE_FORCE_SELECTION 1024
|
||||
|
||||
// nsis blocks
|
||||
struct block_header {
|
||||
int offset;
|
||||
int num;
|
||||
};
|
||||
|
||||
enum {
|
||||
#ifdef NSIS_CONFIG_VISIBLE_SUPPORT
|
||||
NB_PAGES,
|
||||
#endif
|
||||
NB_SECTIONS,
|
||||
NB_ENTRIES,
|
||||
NB_STRINGS,
|
||||
NB_LANGTABLES,
|
||||
NB_CTLCOLORS,
|
||||
NB_DATA,
|
||||
|
||||
BLOCKS_NUM
|
||||
};
|
||||
|
||||
// Settings common to both installers and uninstallers
|
||||
typedef struct
|
||||
{
|
||||
int language_tables_num; // number of strings tables in array
|
||||
int language_table_size; // size of each language table
|
||||
int flags; // CH_FLAGS_*
|
||||
struct block_header blocks[BLOCKS_NUM];
|
||||
|
||||
int num_entries; // total number of entries
|
||||
int num_string_bytes; // total number of bytes taken by strings
|
||||
|
||||
int num_pages; // number of used pages (including custom pages)
|
||||
// InstallDirRegKey stuff
|
||||
int install_reg_rootkey;
|
||||
// these two are not processed!
|
||||
int install_reg_key_ptr, install_reg_value_ptr;
|
||||
|
||||
#ifdef NSIS_SUPPORT_BGBG
|
||||
int bg_color1, bg_color2, bg_textcolor;
|
||||
#endif
|
||||
int lb_bg, lb_fg, license_bg;
|
||||
|
||||
#ifdef NSIS_CONFIG_VISIBLE_SUPPORT
|
||||
// installation log window colors
|
||||
int lb_bg, lb_fg;
|
||||
#endif
|
||||
|
||||
// langtable size
|
||||
int langtable_size;
|
||||
|
||||
#ifdef NSIS_CONFIG_LICENSEPAGE
|
||||
// license background color
|
||||
int license_bg;
|
||||
#endif//NSIS_CONFIG_LICENSEPAGE
|
||||
|
||||
#ifdef NSIS_SUPPORT_CODECALLBACKS
|
||||
// .on* calls
|
||||
|
@ -346,69 +285,6 @@ typedef struct
|
|||
int code_onGUIInit;
|
||||
int code_onGUIEnd;
|
||||
#endif
|
||||
#endif//NSIS_SUPPORT_CODECALLBACKS
|
||||
|
||||
int flags; // CH_FLAGS_*
|
||||
} common_header;
|
||||
|
||||
// Strings specific to installers
|
||||
typedef struct
|
||||
{
|
||||
// these first strings are literals (should not be encoded)
|
||||
#ifdef NSIS_CONFIG_VISIBLE_SUPPORT
|
||||
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[4];
|
||||
#endif
|
||||
#ifdef NSIS_CONFIG_LICENSEPAGE
|
||||
int licensetext; // license page text
|
||||
int licensedata; // license text
|
||||
int licensebutton; // license button text
|
||||
int licensebuttonagree; // agree check box/radio button
|
||||
int licensebuttondisagree; // disagree check box/radio button
|
||||
#endif//NSIS_CONFIG_LICENSEPAGE
|
||||
#else
|
||||
int foo;
|
||||
#endif
|
||||
} installer_strings;
|
||||
|
||||
// Settings specific to installers
|
||||
typedef struct
|
||||
{
|
||||
// common settings
|
||||
common_header common;
|
||||
|
||||
int install_reg_rootkey;
|
||||
// these two are not processed!
|
||||
int install_reg_key_ptr, install_reg_value_ptr;
|
||||
|
||||
#ifdef NSIS_CONFIG_COMPONENTPAGE
|
||||
int install_types[NSIS_MAX_INST_TYPES+1];
|
||||
#endif
|
||||
|
||||
#ifdef NSIS_CONFIG_LICENSEPAGE
|
||||
int license_bg; // license background color
|
||||
#endif//NSIS_CONFIG_LICENSEPAGE
|
||||
|
||||
int install_directory_ptr; // default install dir.
|
||||
int install_directory_auto_append; // auto append part
|
||||
|
||||
#ifdef NSIS_CONFIG_UNINSTALL_SUPPORT
|
||||
int uninstdata_offset; // -1 if no uninst data.
|
||||
int uninsticon_size;
|
||||
#endif
|
||||
|
||||
int num_sections; // total number of sections
|
||||
|
||||
#ifdef NSIS_SUPPORT_CODECALLBACKS
|
||||
// .on* calls
|
||||
int code_onVerifyInstDir;
|
||||
#ifdef NSIS_CONFIG_ENHANCEDUI_SUPPORT
|
||||
int code_onMouseOverSection;
|
||||
|
@ -417,26 +293,20 @@ typedef struct
|
|||
int code_onSelChange;
|
||||
#endif//NSIS_CONFIG_COMPONENTPAGE
|
||||
#endif//NSIS_SUPPORT_CODECALLBACKS
|
||||
|
||||
#ifdef NSIS_CONFIG_COMPONENTPAGE
|
||||
int install_types[NSIS_MAX_INST_TYPES+1];
|
||||
#endif
|
||||
|
||||
int install_directory_ptr; // default install dir.
|
||||
int install_directory_auto_append; // auto append part
|
||||
|
||||
#ifdef NSIS_CONFIG_UNINSTALL_SUPPORT
|
||||
int uninstdata_offset; // -1 if no uninst data.
|
||||
int uninsticon_size;
|
||||
#endif
|
||||
} header;
|
||||
|
||||
// Strings specific to uninstallers
|
||||
typedef struct
|
||||
{
|
||||
int uninstbutton;
|
||||
int uninstalltext;
|
||||
int uninstalltext2;
|
||||
} uninstall_strings;
|
||||
|
||||
// Settings specific to uninstallers
|
||||
typedef struct
|
||||
{
|
||||
// common settings
|
||||
common_header common;
|
||||
|
||||
int code;
|
||||
int code_size;
|
||||
} uninstall_header;
|
||||
|
||||
// used for section->flags
|
||||
#define SF_SELECTED 1
|
||||
#define SF_SUBSEC 2
|
||||
|
@ -462,36 +332,77 @@ typedef struct
|
|||
int offsets[MAX_ENTRY_OFFSETS]; // count and meaning of offsets depend on 'which'
|
||||
} entry;
|
||||
|
||||
// page window proc
|
||||
enum
|
||||
{
|
||||
NSIS_PAGE_CUSTOM = -1,
|
||||
#ifdef NSIS_CONFIG_LICENSEPAGE
|
||||
NSIS_PAGE_LICENSE,
|
||||
PWP_LICENSE,
|
||||
#endif
|
||||
#ifdef NSIS_CONFIG_COMPONENTPAGE
|
||||
NSIS_PAGE_SELCOM,
|
||||
PWP_SELCOM,
|
||||
#endif
|
||||
NSIS_PAGE_DIR,
|
||||
NSIS_PAGE_INSTFILES,
|
||||
NSIS_PAGE_COMPLETED,
|
||||
PWP_DIR,
|
||||
PWP_INSTFILES,
|
||||
#ifdef NSIS_CONFIG_UNINSTALL_SUPPORT
|
||||
NSIS_PAGE_UNINST
|
||||
PWP_UNINST,
|
||||
#endif
|
||||
PWP_COMPLETED,
|
||||
PWP_CUSTOM
|
||||
};
|
||||
|
||||
// page flags
|
||||
#define PF_BACK_ENABLE 256
|
||||
#define PF_NEXT_ENABLE 2
|
||||
#define PF_CANCEL_ENABLE 4
|
||||
#define PF_BACK_SHOW 8 // must be SW_SHOWNA, don't change
|
||||
#define PF_LICENSE_STREAM 16
|
||||
#define PF_LICENSE_FORCE_SELECTION 32
|
||||
#define PF_LICENSE_NO_FORCE_SELECTION 64
|
||||
#define PF_LICENSE_SELECTED 1 // must be 1
|
||||
#define PF_NO_NEXT_FOCUS 128
|
||||
#define PF_PAGE_EX 512
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int id; // index in the pages array
|
||||
int dlg_id; // dialog resource id
|
||||
int wndproc_id;
|
||||
|
||||
#ifdef NSIS_SUPPORT_CODECALLBACKS
|
||||
int prefunc; // called before the page is created, or if custom to show the it. Allows to skip the page using Abort.
|
||||
int showfunc; // function to do stuff right before page is shown
|
||||
int leavefunc; // function to do stuff after the page is shown
|
||||
// called before the page is created, or if custom to show the page
|
||||
// use Abort to skip the page
|
||||
int prefunc;
|
||||
// called right before page is shown
|
||||
int showfunc;
|
||||
// called when the user leaves to the next page
|
||||
// use Abort to force the user to stay on this page
|
||||
int leavefunc;
|
||||
#endif //NSIS_SUPPORT_CODECALLBACKS
|
||||
int caption; // caption tab
|
||||
|
||||
int flags;
|
||||
|
||||
int caption;
|
||||
int back;
|
||||
int next;
|
||||
int button_states;
|
||||
int clicknext;
|
||||
int cancel;
|
||||
|
||||
int parms[5];
|
||||
} page;
|
||||
|
||||
#define CC_TEXT 1
|
||||
#define CC_TEXT_SYS 2
|
||||
#define CC_BK 4
|
||||
#define CC_BK_SYS 8
|
||||
#define CC_BKB 16
|
||||
|
||||
typedef struct {
|
||||
COLORREF text;
|
||||
LOGBRUSH bk;
|
||||
HBRUSH bkb;
|
||||
int bkmode;
|
||||
int flags;
|
||||
} ctlcolors;
|
||||
|
||||
// the following are only used/implemented in exehead, not makensis.
|
||||
|
||||
int NSISCALL isheader(firstheader *h); // returns 0 on not header, length_of_datablock on success
|
||||
|
@ -510,9 +421,8 @@ int NSISCALL _dodecomp(int offset, HANDLE hFileOut, char *outbuf, int outbuflen)
|
|||
extern HANDLE g_db_hFile;
|
||||
extern int g_quit_flag;
|
||||
|
||||
const char * NSISCALL GetStringFromStringTab(int offs);
|
||||
BOOL NSISCALL ReadSelfFile(LPVOID lpBuffer, DWORD nNumberOfBytesToRead);
|
||||
DWORD NSISCALL SetSelfFilePointer(LONG lDistanceToMove, DWORD dwMoveMethod);
|
||||
DWORD NSISCALL SetSelfFilePointer(LONG lDistanceToMove);
|
||||
|
||||
// $0..$9, $INSTDIR, etc are encoded as ASCII bytes starting from this value.
|
||||
// Added by ramon 3 jun 2003
|
||||
|
@ -539,7 +449,7 @@ DWORD NSISCALL SetSelfFilePointer(LONG lDistanceToMove, DWORD dwMoveMethod);
|
|||
#endif
|
||||
#endif
|
||||
|
||||
union installer_flags {
|
||||
union exec_flags {
|
||||
struct {
|
||||
int autoclose;
|
||||
int all_user_var;
|
||||
|
@ -550,8 +460,39 @@ union installer_flags {
|
|||
#endif
|
||||
int cur_insttype;
|
||||
int insttype_changed;
|
||||
#ifdef NSIS_CONFIG_SILENT_SUPPORT
|
||||
int silent;
|
||||
#endif
|
||||
};
|
||||
int flags[1];
|
||||
};
|
||||
|
||||
#ifdef EXEHEAD
|
||||
extern struct block_header g_blocks[BLOCKS_NUM];
|
||||
extern header *g_header;
|
||||
extern int g_flags;
|
||||
extern int g_filehdrsize;
|
||||
extern int g_is_uninstaller;
|
||||
|
||||
#define g_pages ((page*)g_blocks[NB_PAGES].offset)
|
||||
#define g_sections ((section*)g_blocks[NB_SECTIONS].offset)
|
||||
#define num_sections (g_blocks[NB_SECTIONS].num)
|
||||
#define g_entries ((entry*)g_blocks[NB_ENTRIES].offset)
|
||||
/*extern int num_sections;
|
||||
|
||||
//extern int g_autoclose;
|
||||
extern void *g_inst_combinedheader;
|
||||
extern page *g_inst_page;
|
||||
extern section *g_inst_section;
|
||||
extern entry *g_inst_entry;
|
||||
|
||||
#define g_inst_header ((header *)g_inst_combinedheader)
|
||||
#define g_inst_cmnheader ((common_header *)g_inst_combinedheader)
|
||||
|
||||
#ifdef NSIS_CONFIG_UNINSTALL_SUPPORT
|
||||
#define g_inst_uninstheader ((uninstall_header *)g_inst_combinedheader)
|
||||
extern int g_is_uninstaller;
|
||||
#endif*/
|
||||
#endif
|
||||
|
||||
#endif //_FILEFORM_H_
|
||||
|
|
|
@ -24,99 +24,43 @@
|
|||
|
||||
#define _LANG_GENERIC_ERROR "NSIS ERROR"
|
||||
|
||||
#define LANG_STR_TAB(x) cur_langtable[-((int)x+1)]
|
||||
|
||||
// Changed by Amir Szekely 3rd August 2002
|
||||
// Now supports more than one language in each installer
|
||||
|
||||
// Modified by Dave Laundon 10th August 2002
|
||||
// In many places, these strings are now referenced by an ID (just their offsets
|
||||
// into the (common|installer|uninstall)_strings structures) through *_from_lang
|
||||
// and *FromLang functions - removing code-costly references to the
|
||||
// cur_(common|install|uninstall)_strings_table globals. Common strings are
|
||||
// identified by IDs >=0 and install/uninstall strings by IDs <0. What's more,
|
||||
// these IDs fall between -128 to +127 and compile to tiny 2-byte PUSH <8-bit>
|
||||
// instructions when being passed to the functions.
|
||||
|
||||
// Please note that all LANG_* define the offset not the string itself.
|
||||
// To get the string itself use process_string_fromtab, GetStringFromStringTab or LANG_STR().
|
||||
|
||||
#define LANG_STR(x) GetStringFromStringTab(x)
|
||||
#define LANG_STR_TAB(x) cur_language_table[-((int)x+1)]
|
||||
|
||||
#define INSTALL_STR(x) (~((sizeof(common_strings) + FIELD_OFFSET(installer_strings, x)) / sizeof(int)))
|
||||
|
||||
// Installer specific strings
|
||||
#define LANG_BTN_BROWSE (INSTALL_STR(browse))
|
||||
#define LANG_BTN_INSTALL (INSTALL_STR(installbutton))
|
||||
#define LANG_SPACE_REQ (INSTALL_STR(spacerequired))
|
||||
#define LANG_SPACE_AVAIL (INSTALL_STR(spaceavailable))
|
||||
#define LANG_COMP_CUSTOM (INSTALL_STR(custom))
|
||||
#define LANG_DIR_TEXT (INSTALL_STR(text))
|
||||
#define LANG_DIR_SUBTEXT (INSTALL_STR(dirsubtext))
|
||||
#define LANG_COMP_TEXT (INSTALL_STR(componenttext))
|
||||
#define LANG_COMP_SUBTEXT(x) (INSTALL_STR(componentsubtext[x]))
|
||||
#define LANG_LICENSE_TEXT (INSTALL_STR(licensetext))
|
||||
#define LANG_LICENSE_DATA (INSTALL_STR(licensedata))
|
||||
#define LANG_BTN_LICENSE (INSTALL_STR(licensebutton))
|
||||
#define LANG_BTN_LICENSE_AGREE (INSTALL_STR(licensebuttonagree))
|
||||
#define LANG_BTN_LICENSE_DISAGREE (INSTALL_STR(licensebuttondisagree))
|
||||
|
||||
#define UNINSTALL_STR(x) (~((sizeof(common_strings) + FIELD_OFFSET(uninstall_strings, x)) / sizeof(int)))
|
||||
|
||||
// Uninstall specific strings
|
||||
#define LANG_BTN_UNINST (UNINSTALL_STR(uninstbutton))
|
||||
#define LANG_UNINST_TEXT (UNINSTALL_STR(uninstalltext))
|
||||
#define LANG_UNINST_SUBTEXT (UNINSTALL_STR(uninstalltext2))
|
||||
|
||||
#define COMMON_STR(x) (~(FIELD_OFFSET(common_strings, x) / sizeof(int)))
|
||||
|
||||
// Common strings
|
||||
#define LANG_BTN_NEXT (COMMON_STR(nextbutton))
|
||||
#define LANG_BTN_BACK (COMMON_STR(backbutton))
|
||||
#define LANG_BRANDING (COMMON_STR(branding))
|
||||
#define LANG_BTN_CANCEL (COMMON_STR(cancelbutton))
|
||||
#define LANG_BTN_DETAILS (COMMON_STR(showdetailsbutton))
|
||||
#define LANG_COMPLETED (COMMON_STR(completed))
|
||||
#define LANG_BTN_CLOSE (COMMON_STR(closebutton))
|
||||
#define LANG_NAME (COMMON_STR(name))
|
||||
#define LANG_CAPTION (COMMON_STR(caption))
|
||||
#define LANG_SUBCAPTION(x) (COMMON_STR(subcaptions[x]))
|
||||
#define LANG_INSTCORRUPTED (COMMON_STR(inst_corrupted))
|
||||
#define LANG_COPYDETAILS (COMMON_STR(copy_details))
|
||||
#define LANG_LOG_INSTALL_PROCESS (COMMON_STR(log_install_process))
|
||||
#define LANG_BYTE (COMMON_STR(byte))
|
||||
#define LANG_KILO (COMMON_STR(kilo))
|
||||
#define LANG_MEGA (COMMON_STR(mega))
|
||||
#define LANG_GIGA (COMMON_STR(giga))
|
||||
|
||||
// instruction strings
|
||||
#define LANG_FILEERR (COMMON_STR(fileerrtext))
|
||||
#define LANG_FILEERR_NOIGNORE (COMMON_STR(fileerrtext_noignore))
|
||||
#define LANG_DELETEFILE (COMMON_STR(del_file))
|
||||
#define LANG_DLLREGERROR (COMMON_STR(err_reg_dll))
|
||||
#define LANG_REMOVEDIR (COMMON_STR(remove_dir))
|
||||
#define LANG_OUTPUTDIR (COMMON_STR(output_dir))
|
||||
#define LANG_CREATEDIR (COMMON_STR(create_dir))
|
||||
#define LANG_RENAME (COMMON_STR(rename))
|
||||
#define LANG_RENAMEONREBOOT (COMMON_STR(rename_on_reboot))
|
||||
#define LANG_SKIPPED (COMMON_STR(skipped))
|
||||
#define LANG_CANTWRITE (COMMON_STR(cant_write))
|
||||
#define LANG_EXTRACT (COMMON_STR(extract))
|
||||
#define LANG_ERRORWRITING (COMMON_STR(err_writing))
|
||||
#define LANG_ERRORDECOMPRESSING (COMMON_STR(err_decompressing))
|
||||
#define LANG_DELETEONREBOOT (COMMON_STR(del_on_reboot))
|
||||
#define LANG_EXECSHELL (COMMON_STR(exec_shell))
|
||||
#define LANG_EXECUTE (COMMON_STR(exec))
|
||||
#define LANG_CANNOTFINDSYMBOL (COMMON_STR(symbol_not_found))
|
||||
#define LANG_COULDNOTLOAD (COMMON_STR(could_not_load))
|
||||
#define LANG_NOOLE (COMMON_STR(no_ole))
|
||||
#define LANG_ERRORCREATINGSHORTCUT (COMMON_STR(err_creating_shortcut))
|
||||
#define LANG_CREATESHORTCUT (COMMON_STR(create_shortcut))
|
||||
#define LANG_COPYTO (COMMON_STR(copy_to))
|
||||
#define LANG_COPYFAILED (COMMON_STR(copy_failed))
|
||||
#define LANG_ERRORCREATING (COMMON_STR(err_creating))
|
||||
#define LANG_CREATEDUNINST (COMMON_STR(created_uninst))
|
||||
#define LANG_REGISTERING (COMMON_STR(registering))
|
||||
#define LANG_UNREGISTERING (COMMON_STR(unregistering))
|
||||
#define LANG_BRANDING -1
|
||||
#define LANG_CAPTION -2
|
||||
#define LANG_NAME -3
|
||||
#define LANG_SPACE_AVAIL -4
|
||||
#define LANG_SPACE_REQ -5
|
||||
#define LANG_CANTWRITE -6
|
||||
#define LANG_COPYFAILED -7
|
||||
#define LANG_COPYTO -8
|
||||
#define LANG_CANNOTFINDSYMBOL -9
|
||||
#define LANG_COULDNOTLOAD -10
|
||||
#define LANG_CREATEDIR -11
|
||||
#define LANG_CREATESHORTCUT -12
|
||||
#define LANG_CREATEDUNINST -13
|
||||
#define LANG_DELETEFILE -14
|
||||
#define LANG_DELETEONREBOOT -15
|
||||
#define LANG_ERRORCREATINGSHORTCUT -16
|
||||
#define LANG_ERRORCREATING -17
|
||||
#define LANG_ERRORDECOMPRESSING -18
|
||||
#define LANG_DLLREGERROR -19
|
||||
#define LANG_EXECSHELL -20
|
||||
#define LANG_EXECUTE -21
|
||||
#define LANG_EXTRACT -22
|
||||
#define LANG_ERRORWRITING -23
|
||||
#define LANG_INSTCORRUPTED -24
|
||||
#define LANG_NOOLE -25
|
||||
#define LANG_OUTPUTDIR -26
|
||||
#define LANG_REMOVEDIR -27
|
||||
#define LANG_RENAMEONREBOOT -28
|
||||
#define LANG_RENAME -29
|
||||
#define LANG_SKIPPED -30
|
||||
#define LANG_COPYDETAILS -31
|
||||
#define LANG_LOG_INSTALL_PROCESS -32
|
||||
#define LANG_BYTE -33
|
||||
#define LANG_KILO -34
|
||||
#define LANG_MEGA -35
|
||||
#define LANG_GIGA -36
|
||||
|
||||
#endif//_NSIS_LANG_H_
|
||||
|
|
|
@ -8,6 +8,8 @@
|
|||
|
||||
#define IDC_BACK 3
|
||||
#define IDD_LICENSE 102
|
||||
#define IDD_LICENSE_FSRB 108
|
||||
#define IDD_LICENSE_FSCB 109
|
||||
#define IDI_ICON2 103
|
||||
#define IDD_DIR 103
|
||||
#define IDD_SELCOM 104
|
||||
|
@ -15,7 +17,7 @@
|
|||
#define IDD_INSTFILES 106
|
||||
#define IDD_UNINST 107
|
||||
#define IDD_VERIFY 111
|
||||
#define IDB_BITMAP1 109
|
||||
#define IDB_BITMAP1 110
|
||||
#define IDC_EDIT1 1000
|
||||
#define IDC_BROWSE 1001
|
||||
#define IDC_PROGRESS 1004
|
||||
|
|
|
@ -28,57 +28,97 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
|||
|
||||
#if defined(APSTUDIO_INVOKED) || defined(NSIS_CONFIG_LICENSEPAGE)
|
||||
#if defined(APSTUDIO_INVOKED)
|
||||
IDD_LICENSE$(NSIS_CONFIG_LICENSEPAGE) DIALOGEX DISCARDABLE 0, 0, 266, 130
|
||||
IDD_LICENSE$(NSIS_CONFIG_LICENSEPAGE) DIALOGEX 0, 0, 266, 130
|
||||
#else
|
||||
IDD_LICENSE DIALOGEX DISCARDABLE 0, 0, 266, 130
|
||||
IDD_LICENSE DIALOGEX 0, 0, 266, 130
|
||||
#endif
|
||||
STYLE DS_CONTROL | DS_SHELLFONT | WS_CHILD
|
||||
FONT 8, "MS Shell Dlg"
|
||||
STYLE DS_FIXEDSYS | DS_CONTROL | WS_CHILD
|
||||
FONT 8, "MS Shell Dlg", 0, 0, 0x1
|
||||
BEGIN
|
||||
ICON IDI_ICON2,IDC_ULICON,0,0,20,20
|
||||
ICON IDI_ICON2,IDC_ULICON,0,0,22,20
|
||||
LTEXT "",IDC_INTROTEXT,25,0,241,23
|
||||
CONTROL "",IDC_EDIT1,"RichEdit20A",WS_BORDER | WS_VSCROLL |
|
||||
0x804,0,24,266,105
|
||||
END
|
||||
#endif
|
||||
|
||||
#if defined(APSTUDIO_INVOKED) || defined(NSIS_CONFIG_LICENSEPAGE)
|
||||
#if defined(APSTUDIO_INVOKED)
|
||||
IDD_LICENSE_FSRB$(NSIS_CONFIG_LICENSEPAGE) DIALOG DISCARDABLE 0, 0, 266, 130
|
||||
#else
|
||||
IDD_LICENSE_FSRB DIALOG DISCARDABLE 0, 0, 266, 130
|
||||
#endif
|
||||
STYLE DS_FIXEDSYS | DS_CONTROL | WS_CHILD | WS_CAPTION
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
ICON IDI_ICON2,1031,0,0,22,20
|
||||
LTEXT "",IDC_INTROTEXT,25,0,241,23
|
||||
CONTROL "",IDC_EDIT1,"RichEdit20A",WS_BORDER | WS_VSCROLL |
|
||||
0x804,0,24,266,85
|
||||
CONTROL "",IDC_LICENSEDISAGREE,"Button",BS_AUTORADIOBUTTON |
|
||||
WS_TABSTOP,0,120,266,9
|
||||
CONTROL "",IDC_LICENSEAGREE,"Button",BS_AUTORADIOBUTTON |
|
||||
WS_TABSTOP,0,110,266,9
|
||||
END
|
||||
#endif
|
||||
|
||||
#if defined(APSTUDIO_INVOKED) || defined(NSIS_CONFIG_LICENSEPAGE)
|
||||
#if defined(APSTUDIO_INVOKED)
|
||||
IDD_LICENSE_FSCB$(NSIS_CONFIG_LICENSEPAGE) DIALOG DISCARDABLE 0, 0, 266, 130
|
||||
#else
|
||||
IDD_LICENSE_FSCB DIALOG DISCARDABLE 0, 0, 266, 130
|
||||
#endif
|
||||
STYLE DS_FIXEDSYS | DS_CONTROL | WS_CHILD | WS_CAPTION
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
ICON IDI_ICON2,1031,0,0,22,20
|
||||
LTEXT "",IDC_INTROTEXT,25,0,241,23
|
||||
CONTROL "",IDC_EDIT1,"RichEdit20A",WS_BORDER | WS_VSCROLL |
|
||||
0x804,0,24,266,95
|
||||
CONTROL "",IDC_LICENSEAGREE,"Button",BS_AUTOCHECKBOX |
|
||||
WS_TABSTOP,0,120,266,9
|
||||
END
|
||||
#endif
|
||||
|
||||
#if defined(APSTUDIO_INVOKED) || defined(NSIS_CONFIG_VISIBLE_SUPPORT)
|
||||
#if defined(APSTUDIO_INVOKED)
|
||||
IDD_DIR$(NSIS_CONFIG_VISIBLE_SUPPORT) DIALOGEX DISCARDABLE 0, 0, 266, 130
|
||||
IDD_DIR$(NSIS_CONFIG_VISIBLE_SUPPORT) DIALOGEX 0, 0, 266, 130
|
||||
#else
|
||||
IDD_DIR DIALOGEX DISCARDABLE 0, 0, 266, 130
|
||||
IDD_DIR DIALOGEX 0, 0, 266, 130
|
||||
#endif
|
||||
STYLE DS_CONTROL | DS_SHELLFONT | WS_CHILD
|
||||
FONT 8, "MS Shell Dlg"
|
||||
STYLE DS_FIXEDSYS | DS_CONTROL | WS_CHILD
|
||||
FONT 8, "MS Shell Dlg", 0, 0, 0x1
|
||||
BEGIN
|
||||
EDITTEXT IDC_DIR,8,49,187,12,ES_AUTOHSCROLL
|
||||
PUSHBUTTON "",IDC_BROWSE,202,48,55,14
|
||||
ICON IDI_ICON2,IDC_ULICON,0,0,20,20
|
||||
CONTROL "",IDC_SELDIRTEXT,"Static",SS_LEFTNOWORDWRAP,
|
||||
0,36,265,8
|
||||
CONTROL "",IDC_SPACEAVAILABLE,"Static",SS_LEFTNOWORDWRAP,0,122,265,8
|
||||
ICON IDI_ICON2,IDC_ULICON,0,0,22,20
|
||||
|
||||
CONTROL "",IDC_SPACEAVAILABLE,"Static",SS_LEFTNOWORDWRAP,0,122,
|
||||
265,8
|
||||
CONTROL "",IDC_CHECK1,"Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE |
|
||||
WS_TABSTOP,8,65,118,10
|
||||
CONTROL "",IDC_SPACEREQUIRED,"Static",SS_LEFTNOWORDWRAP,0,111,265,8
|
||||
WS_TABSTOP,8,71,118,10
|
||||
CONTROL "",IDC_SPACEREQUIRED,"Static",SS_LEFTNOWORDWRAP,0,111,
|
||||
265,8
|
||||
LTEXT "",IDC_INTROTEXT,25,0,241,34
|
||||
GROUPBOX "",IDC_SELDIRTEXT,1,38,264,30
|
||||
END
|
||||
#endif
|
||||
|
||||
#if defined(APSTUDIO_INVOKED) || defined(NSIS_CONFIG_COMPONENTPAGE)
|
||||
#if defined(APSTUDIO_INVOKED)
|
||||
IDD_SELCOM$(NSIS_CONFIG_COMPONENTPAGE) DIALOGEX DISCARDABLE 0, 0, 266, 130
|
||||
IDD_SELCOM$(NSIS_CONFIG_COMPONENTPAGE) DIALOGEX 0, 0, 266, 130
|
||||
#else
|
||||
IDD_SELCOM DIALOGEX DISCARDABLE 0, 0, 266, 130
|
||||
IDD_SELCOM DIALOGEX 0, 0, 266, 130
|
||||
#endif
|
||||
STYLE DS_CONTROL | DS_SHELLFONT | WS_CHILD
|
||||
FONT 8, "MS Shell Dlg"
|
||||
STYLE DS_FIXEDSYS | DS_CONTROL | WS_CHILD
|
||||
FONT 8, "MS Shell Dlg", 0, 0, 0x1
|
||||
BEGIN
|
||||
COMBOBOX IDC_COMBO1,114,25,152,102,CBS_DROPDOWNLIST | WS_VSCROLL |
|
||||
WS_TABSTOP | NOT WS_VISIBLE
|
||||
ICON IDI_ICON2,IDC_ULICON,0,0,21,20
|
||||
COMBOBOX IDC_COMBO1,114,25,152,102,CBS_DROPDOWNLIST | NOT
|
||||
WS_VISIBLE | WS_VSCROLL | WS_TABSTOP
|
||||
ICON IDI_ICON2,IDC_ULICON,0,0,22,20
|
||||
LTEXT "",IDC_TEXT2,0,40,108,65
|
||||
CONTROL "",IDC_TEXT1,"Static",SS_LEFTNOWORDWRAP,0,27,108,8
|
||||
CONTROL "",IDC_SPACEREQUIRED,"Static",SS_LEFT,0,111,111,18
|
||||
LTEXT "",IDC_SPACEREQUIRED,0,111,111,18,NOT WS_GROUP
|
||||
LTEXT "",IDC_INTROTEXT,25,0,241,25
|
||||
CONTROL "",IDC_TREE1,"SysTreeView32",TVS_HASBUTTONS |
|
||||
TVS_HASLINES | TVS_LINESATROOT | TVS_DISABLEDRAGDROP |
|
||||
|
@ -88,53 +128,55 @@ END
|
|||
|
||||
#if defined(APSTUDIO_INVOKED) || defined(NSIS_CONFIG_VISIBLE_SUPPORT)
|
||||
#if defined(APSTUDIO_INVOKED)
|
||||
IDD_INST$(NSIS_CONFIG_VISIBLE_SUPPORT) DIALOGEX DISCARDABLE 0, 0, 280, 162
|
||||
IDD_INST$(NSIS_CONFIG_VISIBLE_SUPPORT) DIALOGEX 0, 0, 280, 162
|
||||
#else
|
||||
IDD_INST DIALOGEX DISCARDABLE 0, 0, 280, 162
|
||||
IDD_INST DIALOGEX 0, 0, 280, 162
|
||||
#endif
|
||||
STYLE DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | WS_BORDER
|
||||
FONT 8, "MS Shell Dlg"
|
||||
STYLE DS_FIXEDSYS | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION |
|
||||
WS_SYSMENU
|
||||
FONT 8, "MS Shell Dlg", 0, 0, 0x1
|
||||
BEGIN
|
||||
PUSHBUTTON "",IDC_BACK,171,142,50,14,WS_GROUP | NOT WS_VISIBLE
|
||||
PUSHBUTTON "",IDC_BACK,171,142,50,14,NOT WS_VISIBLE | WS_GROUP
|
||||
PUSHBUTTON "",IDOK,223,142,50,14
|
||||
PUSHBUTTON "",IDCANCEL,7,142,50,14
|
||||
CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ | WS_GROUP,7,138,267,1
|
||||
CONTROL "",IDC_CHILDRECT,"Static",SS_BLACKRECT | NOT WS_VISIBLE | WS_GROUP,
|
||||
7,6,266,130
|
||||
CTEXT "",IDC_VERSTR,59,145,108,8,WS_DISABLED | WS_GROUP
|
||||
CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ | WS_GROUP,7,138,
|
||||
267,1
|
||||
CONTROL "",IDC_CHILDRECT,"Static",SS_BLACKRECT | NOT WS_VISIBLE |
|
||||
WS_GROUP,7,6,266,130
|
||||
CTEXT "",IDC_VERSTR,59,145,108,8,WS_DISABLED
|
||||
END
|
||||
#endif
|
||||
|
||||
#if defined(APSTUDIO_INVOKED) || defined(NSIS_CONFIG_VISIBLE_SUPPORT)
|
||||
#if defined(APSTUDIO_INVOKED)
|
||||
IDD_INSTFILES$(NSIS_CONFIG_VISIBLE_SUPPORT) DIALOGEX DISCARDABLE 0, 0, 266, 130
|
||||
IDD_INSTFILES$(NSIS_CONFIG_VISIBLE_SUPPORT) DIALOGEX 0, 0, 266, 130
|
||||
#else
|
||||
IDD_INSTFILES DIALOGEX DISCARDABLE 0, 0, 266, 130
|
||||
IDD_INSTFILES DIALOGEX 0, 0, 266, 130
|
||||
#endif
|
||||
STYLE DS_CONTROL | DS_SHELLFONT | WS_CHILD
|
||||
FONT 8, "MS Shell Dlg"
|
||||
STYLE DS_FIXEDSYS | DS_CONTROL | WS_CHILD
|
||||
FONT 8, "MS Shell Dlg", 0, 0, 0x1
|
||||
BEGIN
|
||||
CONTROL "",IDC_PROGRESS,"msctls_progress32",WS_BORDER,24,10,241,11
|
||||
CONTROL "",IDC_INTROTEXT,"Static",SS_LEFTNOWORDWRAP,
|
||||
24,0,241,8
|
||||
CONTROL "",IDC_PROGRESS,"msctls_progress32",WS_BORDER,24,10,241,
|
||||
11
|
||||
CONTROL "",IDC_INTROTEXT,"Static",SS_LEFTNOWORDWRAP,24,0,241,8
|
||||
CONTROL "",IDC_LIST1,"SysListView32",LVS_REPORT | LVS_SINGLESEL |
|
||||
LVS_NOCOLUMNHEADER | NOT WS_VISIBLE | WS_BORDER |
|
||||
WS_TABSTOP,0,25,265,104
|
||||
ICON IDI_ICON2,IDC_ULICON,0,0,20,20
|
||||
ICON IDI_ICON2,IDC_ULICON,0,0,22,20
|
||||
PUSHBUTTON "",IDC_SHOWDETAILS,0,28,60,14,NOT WS_TABSTOP
|
||||
END
|
||||
#endif
|
||||
|
||||
#if defined(APSTUDIO_INVOKED) || defined(_NSIS_CONFIG_UNINSTDLG)
|
||||
#if defined(APSTUDIO_INVOKED)
|
||||
IDD_UNINST$(_NSIS_CONFIG_UNINSTDLG) DIALOGEX DISCARDABLE 0, 0, 266, 130
|
||||
IDD_UNINST$(_NSIS_CONFIG_UNINSTDLG) DIALOGEX 0, 0, 266, 130
|
||||
#else
|
||||
IDD_UNINST DIALOGEX DISCARDABLE 0, 0, 266, 130
|
||||
IDD_UNINST DIALOGEX 0, 0, 266, 130
|
||||
#endif
|
||||
STYLE DS_CONTROL | DS_SHELLFONT | WS_CHILD
|
||||
FONT 8, "MS Shell Dlg"
|
||||
STYLE DS_FIXEDSYS | DS_CONTROL | WS_CHILD
|
||||
FONT 8, "MS Shell Dlg", 0, 0, 0x1
|
||||
BEGIN
|
||||
ICON IDI_ICON2,IDC_ULICON,0,1,20,20
|
||||
ICON IDI_ICON2,IDC_ULICON,0,1,22,20
|
||||
LTEXT "",IDC_UNINSTFROM,0,45,55,8
|
||||
EDITTEXT IDC_EDIT1,56,43,209,12,ES_AUTOHSCROLL | ES_READONLY
|
||||
LTEXT "",IDC_INTROTEXT,25,0,241,34
|
||||
|
@ -143,12 +185,12 @@ END
|
|||
|
||||
#if defined(APSTUDIO_INVOKED) || defined(_NSIS_CONFIG_VERIFYDIALOG)
|
||||
#if defined(APSTUDIO_INVOKED)
|
||||
IDD_VERIFY$(_NSIS_CONFIG_VERIFYDIALOG) DIALOGEX DISCARDABLE 0, 0, 162, 22
|
||||
IDD_VERIFY$(_NSIS_CONFIG_VERIFYDIALOG) DIALOGEX 0, 0, 162, 22
|
||||
#else
|
||||
IDD_VERIFY DIALOGEX DISCARDABLE 0, 0, 162, 22
|
||||
IDD_VERIFY DIALOGEX 0, 0, 162, 22
|
||||
#endif
|
||||
STYLE DS_MODALFRAME | DS_SHELLFONT | DS_CENTER | WS_POPUP | WS_VISIBLE
|
||||
FONT 8, "MS Shell Dlg"
|
||||
STYLE DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP
|
||||
FONT 8, "MS Shell Dlg", 0, 0, 0x1
|
||||
BEGIN
|
||||
CTEXT "",IDC_STR,7,7,148,8
|
||||
END
|
||||
|
|
|
@ -1,33 +1,22 @@
|
|||
#ifdef NSIS_SUPPORT_NAMED_USERVARS
|
||||
extern NSIS_STRING g_usrvars[TOTAL_COMPATIBLE_STATIC_VARS_COUNT];
|
||||
#define state_command_line g_usrvars[20]
|
||||
#define state_install_directory g_usrvars[21]
|
||||
#define state_output_directory g_usrvars[22]
|
||||
#define state_exe_directory g_usrvars[23]
|
||||
#define state_language g_usrvars[24]
|
||||
#ifdef NSIS_CONFIG_PLUGIN_SUPPORT
|
||||
#define state_plugins_dir g_usrvars[25]
|
||||
#endif
|
||||
#define state_temp_dir g_usrvars[32]
|
||||
#else
|
||||
extern char temp_directory[NSIS_MAX_STRLEN];
|
||||
extern char g_usrvars[USER_VARS_COUNT][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
|
||||
#define state_temp_dir temp_directory
|
||||
#endif
|
||||
|
||||
#define state_command_line g_usrvars[20]
|
||||
#define state_install_directory g_usrvars[21]
|
||||
#define state_output_directory g_usrvars[22]
|
||||
#define state_exe_directory g_usrvars[23]
|
||||
#define state_language g_usrvars[24]
|
||||
#define state_temp_dir g_usrvars[25]
|
||||
#define state_click_next g_usrvars[26]
|
||||
#ifdef NSIS_CONFIG_PLUGIN_SUPPORT
|
||||
#define state_plugins_dir g_usrvars[27]
|
||||
#endif
|
||||
|
||||
extern char g_caption[NSIS_MAX_STRLEN*2];
|
||||
extern HWND g_hwnd;
|
||||
extern int g_filehdrsize;
|
||||
extern HANDLE g_hInstance;
|
||||
extern HWND insthwnd,insthwndbutton;
|
||||
extern HICON g_hIcon;
|
||||
|
||||
extern int inst_flags;
|
||||
extern HICON g_hIcon;
|
|
@ -1,29 +1,11 @@
|
|||
#ifndef _UI_H_
|
||||
#define _UI_H_
|
||||
|
||||
// Added by Amir Szekely 3rd August 2002
|
||||
extern char *language_tables;
|
||||
extern int *cur_language_table;
|
||||
extern int *cur_langtable;
|
||||
|
||||
int NSISCALL ui_doinstall(void);
|
||||
void NSISCALL update_status_text_from_lang(int id, const char *text2);
|
||||
void NSISCALL update_status_text(const char *text1, const char *text2);
|
||||
void NSISCALL update_status_text(int strtab, const char *text2);
|
||||
extern int ui_st_updateflag;
|
||||
extern int num_sections;
|
||||
|
||||
//extern int g_autoclose;
|
||||
extern void *g_inst_combinedheader;
|
||||
extern page *g_inst_page;
|
||||
extern section *g_inst_section;
|
||||
extern entry *g_inst_entry;
|
||||
|
||||
#define g_inst_header ((header *)g_inst_combinedheader)
|
||||
#define g_inst_cmnheader ((common_header *)g_inst_combinedheader)
|
||||
|
||||
#ifdef NSIS_CONFIG_UNINSTALL_SUPPORT
|
||||
#define g_inst_uninstheader ((uninstall_header *)g_inst_combinedheader)
|
||||
extern int g_is_uninstaller;
|
||||
#endif
|
||||
|
||||
#ifdef NSIS_CONFIG_LOG
|
||||
void NSISCALL build_g_logfile(void);
|
||||
|
|
|
@ -37,6 +37,7 @@ char g_log_file[1024];
|
|||
#ifdef NSIS_CONFIG_PLUGIN_SUPPORT
|
||||
char *state_plugins_dir=g_usrvars[25];
|
||||
#endif
|
||||
char *state_plugins_dir=g_usrvars[36];
|
||||
#endif
|
||||
|
||||
HANDLE g_hInstance;
|
||||
|
@ -109,7 +110,7 @@ void NSISCALL doRMDir(char *buf, int flags) // 1 - recurse, 2 - rebootok
|
|||
else if (!RemoveDirectory(buf) && flags&2) {
|
||||
log_printf2("Remove folder on reboot: %s",buf);
|
||||
#ifdef NSIS_SUPPORT_REBOOT
|
||||
g_flags.exec_reboot++;
|
||||
g_exec_flags.exec_reboot++;
|
||||
#endif
|
||||
MoveFileOnReboot(buf,0);
|
||||
}
|
||||
|
@ -163,7 +164,7 @@ int NSISCALL is_valid_instpath(char *s)
|
|||
{
|
||||
int ivp=0;
|
||||
// if CH_FLAGS_NO_ROOT_DIR is set, req is 0, which means rootdirs are not allowed.
|
||||
int req=!(inst_flags&CH_FLAGS_NO_ROOT_DIR);
|
||||
int req=!(g_flags&CH_FLAGS_NO_ROOT_DIR);
|
||||
if (*(WORD*)s == CHAR2_TO_WORD('\\','\\')) // \\ path
|
||||
{
|
||||
if (lastchar(s)!='\\') ivp++;
|
||||
|
@ -243,7 +244,7 @@ char * NSISCALL my_GetTempFileName(char *buf, const char *dir)
|
|||
BOOL NSISCALL MoveFileOnReboot(LPCTSTR pszExisting, LPCTSTR pszNew)
|
||||
{
|
||||
BOOL fOk = 0;
|
||||
HMODULE hLib=LoadLibrary("kernel32.dll");
|
||||
HMODULE hLib=GetModuleHandle("kernel32.dll");
|
||||
if (hLib)
|
||||
{
|
||||
typedef BOOL (WINAPI *mfea_t)(LPCSTR lpExistingFileName,LPCSTR lpNewFileName,DWORD dwFlags);
|
||||
|
@ -253,7 +254,6 @@ BOOL NSISCALL MoveFileOnReboot(LPCTSTR pszExisting, LPCTSTR pszNew)
|
|||
{
|
||||
fOk=mfea(pszExisting, pszNew, MOVEFILE_DELAY_UNTIL_REBOOT|MOVEFILE_REPLACE_EXISTING);
|
||||
}
|
||||
FreeLibrary(hLib);
|
||||
}
|
||||
|
||||
if (!fOk)
|
||||
|
@ -270,7 +270,7 @@ BOOL NSISCALL MoveFileOnReboot(LPCTSTR pszExisting, LPCTSTR pszNew)
|
|||
|
||||
if (pszNew) {
|
||||
// create the file if it's not already there to prevent GetShortPathName from failing
|
||||
CloseHandle(myOpenFile(pszNew, 0, CREATE_NEW));
|
||||
CloseHandle(myOpenFile(pszNew,0,CREATE_NEW));
|
||||
GetShortPathName(pszNew,tmpbuf,1024);
|
||||
}
|
||||
// wininit is used as a temporary here
|
||||
|
@ -307,11 +307,11 @@ BOOL NSISCALL MoveFileOnReboot(LPCTSTR pszExisting, LPCTSTR pszNew)
|
|||
char *pszNextSec = mystrstr(pszFirstRenameLine,"\n[");
|
||||
if (pszNextSec)
|
||||
{
|
||||
int l=dwFileSize - (pszNextSec - pszWinInit);
|
||||
void* data=(void*)my_GlobalAlloc(l);
|
||||
mini_memcpy(data, pszNextSec, l);
|
||||
mini_memcpy(pszNextSec + cchRenameLine, data, l);
|
||||
GlobalFree((HGLOBAL)data);
|
||||
char *p = ++pszNextSec;
|
||||
while (p < pszWinInit + dwFileSize) {
|
||||
p[cchRenameLine] = *p;
|
||||
p++;
|
||||
}
|
||||
|
||||
dwRenameLinePos = pszNextSec - pszWinInit;
|
||||
}
|
||||
|
@ -351,21 +351,11 @@ void NSISCALL myRegGetStr(HKEY root, const char *sub, const char *name, char *ou
|
|||
}
|
||||
}
|
||||
|
||||
char ps_tmpbuf[NSIS_MAX_STRLEN*2];
|
||||
|
||||
char * NSISCALL process_string_fromtab(char *out, int offs)
|
||||
void NSISCALL myitoa(char *s, int d)
|
||||
{
|
||||
#ifdef NSIS_SUPPORT_LANG_IN_STRINGS
|
||||
char *p=process_string(GetStringFromStringTab(offs), 0);
|
||||
#else
|
||||
char *p=process_string(GetStringFromStringTab(offs));
|
||||
#endif
|
||||
if (!out) return p;
|
||||
return lstrcpyn(out,p,NSIS_MAX_STRLEN);
|
||||
wsprintf(s,"%d",d);
|
||||
}
|
||||
|
||||
void NSISCALL myitoa(char *s, int d) { wsprintf(s,"%d",d); }
|
||||
|
||||
int NSISCALL myatoi(char *s)
|
||||
{
|
||||
unsigned int v=0;
|
||||
|
@ -419,18 +409,20 @@ int NSISCALL mystrlen(const char *in)
|
|||
return lstrlen(in);
|
||||
}
|
||||
|
||||
// Dave Laundon's simplified process_string
|
||||
#ifdef NSIS_SUPPORT_LANG_IN_STRINGS
|
||||
char * NSISCALL process_string(const char *in, int iStartIdx )
|
||||
#else
|
||||
char * NSISCALL process_string(const char *in)
|
||||
#endif
|
||||
char ps_tmpbuf[NSIS_MAX_STRLEN*2];
|
||||
|
||||
// Based on Dave Laundon's simplified process_string
|
||||
char * NSISCALL GetNSISString(char *outbuf, int strtab)
|
||||
{
|
||||
#ifdef NSIS_SUPPORT_LANG_IN_STRINGS
|
||||
char *out = ps_tmpbuf+iStartIdx;
|
||||
#else
|
||||
char *out = ps_tmpbuf;
|
||||
#endif
|
||||
char *in = (char*)GetNSISStringNP(GetNSISTab(strtab));
|
||||
char *out;
|
||||
if (outbuf >= ps_tmpbuf && outbuf < ps_tmpbuf+sizeof(ps_tmpbuf))
|
||||
{
|
||||
out = outbuf;
|
||||
outbuf = 0;
|
||||
}
|
||||
else
|
||||
out = ps_tmpbuf;
|
||||
while (*in && out - ps_tmpbuf < NSIS_MAX_STRLEN)
|
||||
{
|
||||
int nVarIdx = (unsigned char)*in++;
|
||||
|
@ -446,9 +438,9 @@ char * NSISCALL process_string(const char *in)
|
|||
#ifdef NSIS_SUPPORT_LANG_IN_STRINGS
|
||||
else if (nVarIdx == LANG_CODES_START)
|
||||
{
|
||||
nVarIdx = *(short*)in; in+=sizeof(WORD);
|
||||
process_string(GetStringFromStringTab(nVarIdx), out-ps_tmpbuf);
|
||||
out+=mystrlen(out);
|
||||
nVarIdx = *(short*)in; in+=sizeof(short);
|
||||
GetNSISString(out, nVarIdx);
|
||||
out+=mystrlen(out);
|
||||
}
|
||||
#endif
|
||||
else
|
||||
|
@ -485,22 +477,24 @@ 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
|
||||
case VAR_CODES_START + 26: // TEMP
|
||||
case VAR_CODES_START + 27: // _CLICK
|
||||
case VAR_CODES_START + 28: // PLUGINSDIR
|
||||
mystrcpy(out, g_usrvars[nVarIdx - (VAR_CODES_START + 1)]);
|
||||
break;
|
||||
|
||||
case VAR_CODES_START + 27: // PROGRAMFILES
|
||||
case VAR_CODES_START + 29: // PROGRAMFILES
|
||||
smwcvesf[41]=0;
|
||||
myRegGetStr(HKEY_LOCAL_MACHINE, smwcvesf, "ProgramFilesDir", out);
|
||||
if (!*out)
|
||||
mystrcpy(out, "C:\\Program Files");
|
||||
break;
|
||||
|
||||
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
|
||||
case VAR_CODES_START + 30: // SMPROGRAMS
|
||||
case VAR_CODES_START + 31: // SMSTARTUP
|
||||
case VAR_CODES_START + 32: // DESKTOP
|
||||
case VAR_CODES_START + 33: // STARTMENU
|
||||
case VAR_CODES_START + 34: // QUICKLAUNCH
|
||||
{
|
||||
static const char *tab[]={
|
||||
"Programs",
|
||||
|
@ -510,9 +504,9 @@ char * NSISCALL process_string(const char *in)
|
|||
"AppData"
|
||||
};
|
||||
static char name[20]="Common ";
|
||||
const char *name_=tab[nVarIdx-(VAR_CODES_START+28)];
|
||||
const char *name_=tab[nVarIdx-(VAR_CODES_START+30)];
|
||||
mystrcpy(name+7,name_);
|
||||
f=g_flags.all_user_var & (nVarIdx != VAR_CODES_START + 32);
|
||||
f=g_exec_flags.all_user_var & (nVarIdx != VAR_CODES_START + 34);
|
||||
|
||||
again:
|
||||
|
||||
|
@ -529,7 +523,7 @@ char * NSISCALL process_string(const char *in)
|
|||
mystrcpy(out,temp_directory);
|
||||
}
|
||||
|
||||
if (nVarIdx == VAR_CODES_START + 32) {
|
||||
if (nVarIdx == VAR_CODES_START + 34) {
|
||||
lstrcat(out, "\\Microsoft\\Internet Explorer\\Quick Launch");
|
||||
f = GetFileAttributes(out);
|
||||
if (f != (DWORD)-1 && (f & FILE_ATTRIBUTE_DIRECTORY))
|
||||
|
@ -538,24 +532,25 @@ char * NSISCALL process_string(const char *in)
|
|||
else break;
|
||||
}
|
||||
|
||||
case VAR_CODES_START + 33: // TEMP
|
||||
case VAR_CODES_START + 35: // TEMP
|
||||
mystrcpy(out,temp_directory);
|
||||
break;
|
||||
|
||||
case VAR_CODES_START + 34: // WINDIR
|
||||
case VAR_CODES_START + 36: // WINDIR
|
||||
GetWindowsDirectory(out, NSIS_MAX_STRLEN);
|
||||
break;
|
||||
|
||||
case VAR_CODES_START + 35: // SYSDIR
|
||||
case VAR_CODES_START + 37: // SYSDIR
|
||||
GetSystemDirectory(out, NSIS_MAX_STRLEN);
|
||||
break;
|
||||
|
||||
#if VAR_CODES_START + 35 >= 255
|
||||
#if VAR_CODES_START + 37 >= 255
|
||||
#error "Too many variables! Extend VAR_CODES_START!"
|
||||
#endif
|
||||
} // switch
|
||||
// validate the directory name
|
||||
if (nVarIdx > 21+VAR_CODES_START ) { // only if not $0 to $R9, $CMDLINE, or $HWNDPARENT
|
||||
if (nVarIdx > 21+VAR_CODES_START && nVarIdx != VAR_CODES_START+27) {
|
||||
// only if not $0 to $R9, $CMDLINE, $HWNDPARENT, or $_CLICK
|
||||
// ($LANGUAGE can't have trailing backslash anyway...)
|
||||
validate_filename(out);
|
||||
}
|
||||
|
@ -574,18 +569,18 @@ char * NSISCALL process_string(const char *in)
|
|||
nVarIdx = (*(WORD*)in & 0x0FFF)-1; in+=sizeof(WORD);
|
||||
switch (nVarIdx) // The order of this list must match that in ..\strlist.cpp (err, build.cpp -J)
|
||||
{
|
||||
case 26: // PROGRAMFILES
|
||||
case 28: // PROGRAMFILES
|
||||
smwcvesf[41]=0;
|
||||
myRegGetStr(HKEY_LOCAL_MACHINE, smwcvesf, "ProgramFilesDir", out);
|
||||
if (!*out)
|
||||
mystrcpy(out, "C:\\Program Files");
|
||||
break;
|
||||
|
||||
case 27: // SMPROGRAMS
|
||||
case 28: // SMSTARTUP
|
||||
case 29: // DESKTOP
|
||||
case 30: // STARTMENU
|
||||
case 31: // QUICKLAUNCH
|
||||
case 29: // SMPROGRAMS
|
||||
case 30: // SMSTARTUP
|
||||
case 31: // DESKTOP
|
||||
case 32: // STARTMENU
|
||||
case 33: // QUICKLAUNCH
|
||||
{
|
||||
static const char *tab[]={
|
||||
"Programs",
|
||||
|
@ -595,9 +590,9 @@ char * NSISCALL process_string(const char *in)
|
|||
"AppData"
|
||||
};
|
||||
static char name[20]="Common ";
|
||||
const char *name_=tab[nVarIdx-27];
|
||||
const char *name_=tab[nVarIdx-29];
|
||||
mystrcpy(name+7,name_);
|
||||
f=g_flags.all_user_var & (nVarIdx != 31);
|
||||
f=g_exec_flags.all_user_var & (nVarIdx != 33);
|
||||
|
||||
again:
|
||||
|
||||
|
@ -614,7 +609,7 @@ char * NSISCALL process_string(const char *in)
|
|||
mystrcpy(out,state_temp_dir);
|
||||
}
|
||||
|
||||
if (nVarIdx == 31) {
|
||||
if (nVarIdx == 33) {
|
||||
lstrcat(out, "\\Microsoft\\Internet Explorer\\Quick Launch");
|
||||
f = GetFileAttributes(out);
|
||||
if (f != (DWORD)-1 && (f & FILE_ATTRIBUTE_DIRECTORY))
|
||||
|
@ -623,15 +618,15 @@ char * NSISCALL process_string(const char *in)
|
|||
else break;
|
||||
}
|
||||
|
||||
case 33: // WINDIR
|
||||
case 34: // WINDIR
|
||||
GetWindowsDirectory(out, NSIS_MAX_STRLEN);
|
||||
break;
|
||||
|
||||
case 34: // SYSDIR
|
||||
case 35: // SYSDIR
|
||||
GetSystemDirectory(out, NSIS_MAX_STRLEN);
|
||||
break;
|
||||
|
||||
case 35: // HWNDPARENT
|
||||
case 36: // HWNDPARENT
|
||||
myitoa(out, (unsigned int)g_hwnd);
|
||||
break;
|
||||
|
||||
|
@ -639,17 +634,18 @@ char * NSISCALL process_string(const char *in)
|
|||
mystrcpy(out, g_usrvars[nVarIdx]);
|
||||
} // switch
|
||||
// validate the directory name
|
||||
if (nVarIdx > 21 && nVarIdx < TOTAL_COMPATIBLE_STATIC_VARS_COUNT ) { // only if not $0 to $R9, $CMDLINE, or $HWNDPARENT and not great than $SYSDIR
|
||||
if (nVarIdx > 20 && nVarIdx < TOTAL_COMPATIBLE_STATIC_VARS_COUNT && nVarIdx != 26) {
|
||||
// only if not $0 to $R9, $CMDLINE or $_CLICK and not great than $HWNDPARENT
|
||||
// ($LANGUAGE can't have trailing backslash anyway...)
|
||||
validate_filename(out);
|
||||
}
|
||||
out+=mystrlen(out);
|
||||
} // == VAR_CODES_START
|
||||
#ifdef NSIS_SUPPORT_LANG_IN_STRINGS
|
||||
else if ( nVarIdx == LANG_CODES_START )
|
||||
else if (nVarIdx == LANG_CODES_START)
|
||||
{
|
||||
nVarIdx = *(short*)in; in+=sizeof(WORD);
|
||||
process_string(GetStringFromStringTab(nVarIdx), out-ps_tmpbuf);
|
||||
nVarIdx = *(short*)in; in+=sizeof(short);
|
||||
GetNSISString(out, nVarIdx);
|
||||
out+=mystrlen(out);
|
||||
}
|
||||
#endif
|
||||
|
@ -660,6 +656,8 @@ char * NSISCALL process_string(const char *in)
|
|||
#endif
|
||||
} // while
|
||||
*out = 0;
|
||||
if (outbuf)
|
||||
return lstrcpyn(outbuf, ps_tmpbuf, NSIS_MAX_STRLEN);
|
||||
return ps_tmpbuf;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,12 +1,10 @@
|
|||
#include "config.h"
|
||||
|
||||
extern char ps_tmpbuf[NSIS_MAX_STRLEN*2];
|
||||
#ifdef NSIS_SUPPORT_LANG_IN_STRINGS
|
||||
char * NSISCALL process_string(const char *in, int iStartIdx);
|
||||
#else
|
||||
char * NSISCALL process_string(const char *in);
|
||||
#endif
|
||||
char * NSISCALL process_string_fromtab(char *out, int offs);
|
||||
char * NSISCALL GetNSISString(char *outbuf, int strtab);
|
||||
#define GetNSISStringTT(strtab) GetNSISString(0, (strtab))
|
||||
#define GetNSISStringNP(strtab) ((const char *)g_blocks[NB_STRINGS].offset+(strtab))
|
||||
#define GetNSISTab(strtab) (strtab < 0 ? LANG_STR_TAB(strtab) : strtab)
|
||||
void NSISCALL myRegGetStr(HKEY root, const char *sub, const char *name, char *out);
|
||||
int NSISCALL myatoi(char *s);
|
||||
void NSISCALL myitoa(char *s, int d);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue