2002-08-19 21:24:44 +00:00
|
|
|
/*
|
2002-08-02 10:01:35 +00:00
|
|
|
Nullsoft "SuperPimp" Installation System - main.c - executable header main code
|
|
|
|
|
2003-02-09 15:56:29 +00:00
|
|
|
Copyright (C) 1999-2003 Nullsoft, Inc.
|
2002-08-19 21:24:44 +00:00
|
|
|
|
2002-08-02 10:01:35 +00:00
|
|
|
This software is provided 'as-is', without any express or implied
|
|
|
|
warranty. In no event will the authors be held liable for any damages
|
|
|
|
arising from the use of this software.
|
|
|
|
|
|
|
|
Permission is granted to anyone to use this software for any purpose,
|
|
|
|
including commercial applications, and to alter it and redistribute it
|
|
|
|
freely, subject to the following restrictions:
|
|
|
|
|
|
|
|
1. The origin of this software must not be misrepresented; you must not
|
|
|
|
claim that you wrote the original software. If you use this software
|
|
|
|
in a product, an acknowledgment in the product documentation would be
|
|
|
|
appreciated but is not required.
|
|
|
|
2. Altered source versions must be plainly marked as such, and must not be
|
|
|
|
misrepresented as being the original software.
|
|
|
|
3. This notice may not be removed or altered from any source distribution.
|
|
|
|
|
2002-08-19 21:24:44 +00:00
|
|
|
This source distribution includes portions of zlib. see zlib/zlib.h for
|
2002-08-02 10:01:35 +00:00
|
|
|
its license and so forth. Note that this license is also borrowed from zlib.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#include <windows.h>
|
|
|
|
#include <commctrl.h>
|
|
|
|
#include "resource.h"
|
|
|
|
#include "util.h"
|
|
|
|
#include "fileform.h"
|
|
|
|
#include "state.h"
|
|
|
|
#include "ui.h"
|
|
|
|
#include "lang.h"
|
2003-03-18 20:36:52 +00:00
|
|
|
#include "state.h"
|
2002-08-02 10:01:35 +00:00
|
|
|
|
2002-08-19 23:18:19 +00:00
|
|
|
extern unsigned long NSISCALL CRC32(unsigned long crc, const unsigned char *buf, unsigned int len);
|
2002-08-02 10:01:35 +00:00
|
|
|
|
|
|
|
#if !defined(NSIS_CONFIG_VISIBLE_SUPPORT) && !defined(NSIS_CONFIG_SILENT_SUPPORT)
|
|
|
|
#error One of NSIS_CONFIG_SILENT_SUPPORT or NSIS_CONFIG_VISIBLE_SUPPORT must be defined.
|
|
|
|
#endif
|
|
|
|
#ifdef NSIS_COMPRESS_WHOLE
|
|
|
|
extern HANDLE dbd_hFile;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef NSIS_CONFIG_UNINSTALL_SUPPORT
|
|
|
|
static const char *g_errorcopyinginstall=_LANG_UNINSTINITERROR;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
char g_caption[NSIS_MAX_STRLEN*2];
|
|
|
|
int g_filehdrsize;
|
|
|
|
HWND g_hwnd;
|
|
|
|
|
2002-08-21 19:05:14 +00:00
|
|
|
int m_length;
|
|
|
|
int m_pos;
|
|
|
|
|
2002-08-02 10:01:35 +00:00
|
|
|
#ifdef NSIS_CONFIG_VISIBLE_SUPPORT
|
2002-08-21 19:05:14 +00:00
|
|
|
#if defined(NSIS_CONFIG_CRC_SUPPORT) || defined(NSIS_COMPRESS_WHOLE)
|
|
|
|
BOOL CALLBACK verProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
2002-08-02 10:01:35 +00:00
|
|
|
{
|
2002-08-21 19:05:14 +00:00
|
|
|
static char *msg;
|
2002-08-19 21:24:44 +00:00
|
|
|
if (uMsg == WM_INITDIALOG)
|
2002-08-02 10:01:35 +00:00
|
|
|
{
|
|
|
|
SetTimer(hwndDlg,1,250,NULL);
|
2002-08-21 19:05:14 +00:00
|
|
|
msg = (char*)lParam;
|
2002-08-02 10:01:35 +00:00
|
|
|
uMsg = WM_TIMER;
|
|
|
|
}
|
|
|
|
if (uMsg == WM_TIMER)
|
|
|
|
{
|
|
|
|
static char bt[64];
|
2002-08-21 19:05:14 +00:00
|
|
|
wsprintf(bt,msg,MulDiv(m_pos,100,m_length));
|
2002-08-02 10:01:35 +00:00
|
|
|
|
2002-12-02 23:08:10 +00:00
|
|
|
my_SetWindowText(hwndDlg,bt);
|
2002-09-21 02:34:34 +00:00
|
|
|
my_SetDialogItemText(hwndDlg,IDC_STR,bt);
|
2002-08-02 10:01:35 +00:00
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
#endif//NSIS_CONFIG_CRC_SUPPORT
|
|
|
|
#endif//NSIS_CONFIG_VISIBLE_SUPPORT
|
|
|
|
|
|
|
|
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInst,LPSTR lpszCmdParam, int nCmdShow)
|
|
|
|
{
|
2003-03-29 17:16:09 +00:00
|
|
|
int ret;
|
|
|
|
const char *m_Err = 0;
|
2002-08-02 10:01:35 +00:00
|
|
|
#ifdef NSIS_CONFIG_CRC_SUPPORT
|
|
|
|
#ifdef NSIS_CONFIG_VISIBLE_SUPPORT
|
|
|
|
static HWND hwnd;
|
|
|
|
#endif
|
|
|
|
static int crc;
|
|
|
|
static char no_crc;
|
|
|
|
static char do_crc;
|
|
|
|
#endif//NSIS_CONFIG_CRC_SUPPORT
|
|
|
|
#if defined(NSIS_CONFIG_SILENT_SUPPORT) && defined(NSIS_CONFIG_VISIBLE_SUPPORT)
|
2003-03-29 17:16:09 +00:00
|
|
|
char silent = 0;
|
2002-08-02 10:01:35 +00:00
|
|
|
#endif//NSIS_CONFIG_SILENT_SUPPORT && NSIS_CONFIG_VISIBLE_SUPPORT
|
|
|
|
int left;
|
|
|
|
|
|
|
|
#ifdef NSIS_CONFIG_VISIBLE_SUPPORT
|
|
|
|
unsigned int verify_time=GetTickCount()+1000;
|
|
|
|
#endif
|
2003-06-17 23:59:13 +00:00
|
|
|
|
2002-08-02 10:01:35 +00:00
|
|
|
char *realcmds;
|
|
|
|
char seekchar=' ';
|
2003-06-17 23:59:13 +00:00
|
|
|
char *cmdline;
|
2003-07-08 23:18:47 +00:00
|
|
|
//WIN32_FIND_DATA *pfd;
|
2002-08-02 10:01:35 +00:00
|
|
|
|
|
|
|
InitCommonControls();
|
2003-07-08 23:18:47 +00:00
|
|
|
|
|
|
|
mystrcpy(g_caption,_LANG_GENERIC_ERROR);
|
2002-11-30 13:15:49 +00:00
|
|
|
|
2003-06-23 22:40:11 +00:00
|
|
|
GetTempPath(sizeof(state_temp_dir), state_temp_dir);
|
2003-07-08 23:18:47 +00:00
|
|
|
validate_filename(state_temp_dir);
|
|
|
|
|
|
|
|
// This is not so effective...!!??!
|
|
|
|
// The perfect way is:
|
|
|
|
// - Test Access for filewrite
|
|
|
|
// - Test Access for folder creation (needed for plugins)
|
|
|
|
// - And if one of the above tests fail, change to "$WINDIR\TEMP" and re-test
|
|
|
|
// but this will take to much size in exehead and is unreliable too
|
|
|
|
/*
|
|
|
|
pfd = file_exists(state_temp_dir);
|
|
|
|
if (!pfd || !(pfd->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))
|
|
|
|
{
|
|
|
|
// Setup temp dir to "$WINDIR\TEMP"
|
|
|
|
mystrcpy(state_temp_dir+GetWindowsDirectory(state_temp_dir, sizeof(state_temp_dir)), "\\Temp");
|
|
|
|
if ( !file_exists(state_temp_dir) || !CreateDirectory(state_temp_dir, NULL) )
|
|
|
|
{
|
|
|
|
m_Err = _LANG_ERRORWRITINGTEMP;
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
*/
|
2002-11-30 13:15:49 +00:00
|
|
|
|
2002-08-02 10:01:35 +00:00
|
|
|
lstrcpyn(state_command_line,GetCommandLine(),NSIS_MAX_STRLEN);
|
|
|
|
|
|
|
|
g_hInstance=GetModuleHandle(NULL);
|
|
|
|
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)
|
|
|
|
{
|
|
|
|
m_Err = _LANG_CANTOPENSELF;
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
|
|
|
|
// make state_exe_directory point to dir, not full exe.
|
2002-08-19 21:24:44 +00:00
|
|
|
|
2002-08-02 10:01:35 +00:00
|
|
|
trimslashtoend(state_exe_directory);
|
|
|
|
|
|
|
|
left = m_length = GetFileSize(g_db_hFile,NULL);
|
|
|
|
while (left > 0)
|
|
|
|
{
|
|
|
|
static char temp[512];
|
|
|
|
DWORD l=left;
|
|
|
|
if (l > 512) l=512;
|
2002-09-25 03:34:30 +00:00
|
|
|
if (!ReadSelfFile(temp,l))
|
2002-08-02 10:01:35 +00:00
|
|
|
{
|
2002-09-21 07:05:31 +00:00
|
|
|
m_Err=_LANG_INVALIDCRC;
|
2002-08-02 10:01:35 +00:00
|
|
|
#if defined(NSIS_CONFIG_CRC_SUPPORT) && defined(NSIS_CONFIG_VISIBLE_SUPPORT)
|
|
|
|
if (hwnd) DestroyWindow(hwnd);
|
|
|
|
#endif//NSIS_CONFIG_CRC_SUPPORT
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!g_filehdrsize)
|
|
|
|
{
|
|
|
|
int dbl;
|
|
|
|
dbl=isheader((firstheader*)temp);
|
|
|
|
if (dbl)
|
|
|
|
{
|
|
|
|
int a=*(int*)temp;
|
|
|
|
g_filehdrsize=m_pos;
|
|
|
|
if (dbl > left)
|
|
|
|
{
|
2002-09-21 07:05:31 +00:00
|
|
|
m_Err=_LANG_INVALIDCRC;
|
2002-08-02 10:01:35 +00:00
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
#if defined(NSIS_CONFIG_SILENT_SUPPORT) && defined(NSIS_CONFIG_VISIBLE_SUPPORT)
|
|
|
|
if (a&FH_FLAGS_SILENT) silent++;
|
|
|
|
#endif//NSIS_CONFIG_SILENT_SUPPORT && NSIS_CONFIG_VISIBLE_SUPPORT
|
|
|
|
|
|
|
|
#ifdef NSIS_CONFIG_CRC_SUPPORT
|
|
|
|
// Changed by Amir Szekely 23rd July 2002 (CRCCheck force)
|
|
|
|
if ((no_crc && !(a&FH_FLAGS_FORCE_CRC)) || !(a&FH_FLAGS_CRC)) break; // if first bit is not set, then no crc checking.
|
|
|
|
|
|
|
|
do_crc++;
|
|
|
|
|
|
|
|
#ifndef NSIS_CONFIG_CRC_ANAL
|
|
|
|
left=dbl-4;
|
2002-08-19 21:24:44 +00:00
|
|
|
// end crc checking at crc :) this means you can tack shit on the end and it'll still work.
|
2002-08-02 10:01:35 +00:00
|
|
|
#else //!NSIS_CONFIG_CRC_ANAL
|
|
|
|
left-=4;
|
|
|
|
#endif//NSIS_CONFIG_CRC_ANAL
|
2002-08-19 21:24:44 +00:00
|
|
|
// this is in case the end part is < 512 bytes.
|
2002-08-02 10:01:35 +00:00
|
|
|
if (l > (DWORD)left) l=(DWORD)left;
|
|
|
|
|
|
|
|
#else//!NSIS_CONFIG_CRC_SUPPORT
|
|
|
|
break;
|
|
|
|
#endif//!NSIS_CONFIG_CRC_SUPPORT
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#ifdef NSIS_CONFIG_CRC_SUPPORT
|
|
|
|
|
|
|
|
#ifdef NSIS_CONFIG_VISIBLE_SUPPORT
|
|
|
|
|
|
|
|
#ifdef NSIS_CONFIG_SILENT_SUPPORT
|
|
|
|
else if (!silent)
|
|
|
|
#endif//NSIS_CONFIG_SILENT_SUPPORT
|
|
|
|
{
|
|
|
|
if (hwnd)
|
|
|
|
{
|
2003-03-29 13:39:48 +00:00
|
|
|
MSG msg;
|
2002-08-02 10:01:35 +00:00
|
|
|
while (PeekMessage(&msg,NULL,0,0,PM_REMOVE)) DispatchMessage(&msg);
|
|
|
|
}
|
2002-08-19 21:24:44 +00:00
|
|
|
else if (GetTickCount() > verify_time)
|
2002-08-21 19:05:14 +00:00
|
|
|
hwnd=CreateDialogParam(
|
|
|
|
g_hInstance,
|
|
|
|
MAKEINTRESOURCE(IDD_VERIFY),
|
2003-03-09 19:49:19 +00:00
|
|
|
0,
|
2002-08-21 19:05:14 +00:00
|
|
|
verProc,
|
|
|
|
(LPARAM)_LANG_VERIFYINGINST
|
|
|
|
);
|
2002-08-02 10:01:35 +00:00
|
|
|
}
|
|
|
|
#endif//NSIS_CONFIG_VISIBLE_SUPPORT
|
|
|
|
|
|
|
|
#ifndef NSIS_CONFIG_CRC_ANAL
|
2002-08-19 21:24:44 +00:00
|
|
|
if (left<m_length)
|
2002-08-02 10:01:35 +00:00
|
|
|
#endif//NSIS_CONFIG_CRC_ANAL
|
|
|
|
crc=CRC32(crc, temp, l);
|
|
|
|
|
|
|
|
#endif//NSIS_CONFIG_CRC_SUPPORT
|
|
|
|
m_pos+=l;
|
|
|
|
left -= l;
|
|
|
|
}
|
|
|
|
#ifdef NSIS_CONFIG_VISIBLE_SUPPORT
|
|
|
|
#ifdef NSIS_CONFIG_CRC_SUPPORT
|
|
|
|
if (hwnd) DestroyWindow(hwnd);
|
|
|
|
#endif//NSIS_CONFIG_CRC_SUPPORT
|
|
|
|
#endif//NSIS_CONFIG_VISIBLE_SUPPORT
|
2002-09-21 07:05:31 +00:00
|
|
|
if (!g_filehdrsize) m_Err=_LANG_INVALIDCRC;
|
2002-08-19 21:24:44 +00:00
|
|
|
else
|
2002-08-02 10:01:35 +00:00
|
|
|
{
|
|
|
|
#ifdef NSIS_CONFIG_CRC_SUPPORT
|
|
|
|
if (do_crc)
|
|
|
|
{
|
|
|
|
int fcrc;
|
2002-09-24 23:26:55 +00:00
|
|
|
SetSelfFilePointer(m_pos,FILE_BEGIN);
|
2002-09-25 03:34:30 +00:00
|
|
|
if (!ReadSelfFile(&fcrc,4) || crc != fcrc)
|
2002-08-02 10:01:35 +00:00
|
|
|
{
|
2002-09-21 07:05:31 +00:00
|
|
|
m_Err=_LANG_INVALIDCRC;
|
2002-08-02 10:01:35 +00:00
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif//NSIS_CONFIG_CRC_SUPPORT
|
2002-09-24 23:26:55 +00:00
|
|
|
SetSelfFilePointer(g_filehdrsize,FILE_BEGIN);
|
2002-08-02 10:01:35 +00:00
|
|
|
|
2002-09-21 07:05:31 +00:00
|
|
|
m_Err=loadHeaders();
|
2002-08-02 10:01:35 +00:00
|
|
|
}
|
|
|
|
if (m_Err) goto end;
|
|
|
|
|
2003-06-17 23:59:13 +00:00
|
|
|
cmdline = state_command_line;
|
|
|
|
if (*cmdline == '\"') seekchar = *cmdline++;
|
|
|
|
|
|
|
|
while (*cmdline && *cmdline != seekchar) cmdline=CharNext(cmdline);
|
|
|
|
cmdline=CharNext(cmdline);
|
|
|
|
realcmds=cmdline;
|
|
|
|
|
|
|
|
for (;;)
|
|
|
|
{
|
|
|
|
// skip over any spaces
|
|
|
|
while (*cmdline == ' ') cmdline=CharNext(cmdline);
|
|
|
|
if (cmdline[0] != '/') break;
|
|
|
|
cmdline++;
|
|
|
|
|
|
|
|
#define END_OF_ARG(c) (((c)|' ')==' ')
|
|
|
|
|
|
|
|
#if defined(NSIS_CONFIG_VISIBLE_SUPPORT) && defined(NSIS_CONFIG_SILENT_SUPPORT)
|
|
|
|
if (cmdline[0] == 'S' && END_OF_ARG(cmdline[1])) silent++;
|
|
|
|
#endif//NSIS_CONFIG_SILENT_SUPPORT && NSIS_CONFIG_VISIBLE_SUPPORT
|
|
|
|
#ifdef NSIS_CONFIG_CRC_SUPPORT
|
|
|
|
if (*(DWORD*)cmdline == CHAR4_TO_DWORD('N','C','R','C') && END_OF_ARG(cmdline[4])) no_crc++;
|
|
|
|
#endif//NSIS_CONFIG_CRC_SUPPORT
|
|
|
|
|
|
|
|
if (*(WORD*)cmdline == CHAR2_TO_WORD('D','='))
|
|
|
|
{
|
|
|
|
cmdline[-2]=0; // keep this from being passed to uninstaller if necessary
|
|
|
|
mystrcpy(state_install_directory,cmdline+2);
|
|
|
|
cmdline=""; // prevent further processing of cmdline
|
|
|
|
break; // not necessary, but for some reason makes smaller exe :)
|
|
|
|
}
|
|
|
|
|
|
|
|
// skip over our parm
|
|
|
|
while (!END_OF_ARG(*cmdline)) cmdline=CharNext(cmdline);
|
|
|
|
}
|
|
|
|
|
2002-08-02 10:01:35 +00:00
|
|
|
#ifdef NSIS_CONFIG_UNINSTALL_SUPPORT
|
|
|
|
if (g_is_uninstaller)
|
|
|
|
{
|
2002-09-13 18:00:11 +00:00
|
|
|
char *p=cmdline;
|
2002-09-22 19:05:43 +00:00
|
|
|
while (*p) p++;
|
2002-09-13 18:00:11 +00:00
|
|
|
|
2003-06-17 23:59:13 +00:00
|
|
|
while (p >= cmdline && (p[0] != '_' || p[1] != '?' || p[2] != '=')) p--;
|
|
|
|
|
2002-09-13 18:00:11 +00:00
|
|
|
if (p >= cmdline)
|
2002-08-02 10:01:35 +00:00
|
|
|
{
|
2003-01-08 20:06:22 +00:00
|
|
|
*(p-1)=0; // terminate before the " _?="
|
2002-09-13 18:00:11 +00:00
|
|
|
p+=3; // skip over _?=
|
|
|
|
if (is_valid_instpath(p))
|
2002-08-02 10:01:35 +00:00
|
|
|
{
|
2002-09-13 18:00:11 +00:00
|
|
|
mystrcpy(state_install_directory,p);
|
|
|
|
mystrcpy(state_output_directory,p);
|
2002-08-02 10:01:35 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
m_Err = g_errorcopyinginstall;
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
int x,done=0;
|
|
|
|
|
|
|
|
for (x = 0; x < 26; x ++)
|
|
|
|
{
|
2003-07-08 23:18:47 +00:00
|
|
|
// File name need slash before coz temp dir was changed by validate_filename(...)
|
|
|
|
static char s[]="\\A~NSISu_.exe";
|
2002-08-02 10:01:35 +00:00
|
|
|
static char buf2[NSIS_MAX_STRLEN*2];
|
|
|
|
static char ibuf[NSIS_MAX_STRLEN];
|
2002-08-19 21:24:44 +00:00
|
|
|
|
2002-08-02 10:01:35 +00:00
|
|
|
buf2[0]='\"';
|
2003-06-23 22:40:11 +00:00
|
|
|
mystrcpy(buf2+1,state_temp_dir);
|
2002-08-02 10:01:35 +00:00
|
|
|
lstrcat(buf2,s);
|
|
|
|
|
|
|
|
DeleteFile(buf2+1); // clean up after all the other ones if they are there
|
2002-08-19 21:24:44 +00:00
|
|
|
|
2002-08-02 10:01:35 +00:00
|
|
|
if (!done)
|
|
|
|
{
|
|
|
|
// get current name
|
|
|
|
int l=GetModuleFileName(g_hInstance,ibuf,sizeof(ibuf));
|
|
|
|
// check if it is ?~NSISu_.exe - if so, fuck it
|
|
|
|
if (!lstrcmpi(ibuf+l-(sizeof(s)-2),s+1)) break;
|
|
|
|
|
|
|
|
// copy file
|
|
|
|
if (CopyFile(ibuf,buf2+1,FALSE))
|
|
|
|
{
|
|
|
|
HANDLE hProc;
|
|
|
|
#ifdef NSIS_SUPPORT_MOVEONREBOOT
|
|
|
|
MoveFileOnReboot(buf2+1,NULL);
|
|
|
|
#endif
|
2002-08-19 21:24:44 +00:00
|
|
|
if (state_install_directory[0]) mystrcpy(ibuf,state_install_directory);
|
2002-08-02 10:01:35 +00:00
|
|
|
else trimslashtoend(ibuf);
|
|
|
|
done++;
|
|
|
|
lstrcat(buf2,"\" ");
|
|
|
|
lstrcat(buf2,realcmds);
|
2002-09-13 18:00:11 +00:00
|
|
|
lstrcat(buf2," _?=");
|
2002-08-02 10:01:35 +00:00
|
|
|
lstrcat(buf2,ibuf);
|
2003-06-23 22:40:11 +00:00
|
|
|
hProc=myCreateProcess(buf2,state_temp_dir);
|
2002-08-02 10:01:35 +00:00
|
|
|
if (hProc) CloseHandle(hProc);
|
|
|
|
else m_Err = g_errorcopyinginstall;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
s[0]++;
|
|
|
|
}
|
|
|
|
if (!done) m_Err=g_errorcopyinginstall;
|
2002-08-19 21:24:44 +00:00
|
|
|
goto end;
|
2002-08-02 10:01:35 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif//NSIS_CONFIG_UNINSTALL_SUPPORT
|
|
|
|
#ifdef NSIS_CONFIG_VISIBLE_SUPPORT
|
|
|
|
#ifdef NSIS_CONFIG_SILENT_SUPPORT
|
2003-03-18 20:36:52 +00:00
|
|
|
if (silent) inst_flags |= CH_FLAGS_SILENT;
|
2002-08-02 10:01:35 +00:00
|
|
|
#endif//NSIS_CONFIG_SILENT_SUPPORT
|
|
|
|
#endif//NSIS_CONFIG_VISIBLE_SUPPORT
|
|
|
|
|
|
|
|
ret=ui_doinstall();
|
|
|
|
|
|
|
|
#ifdef NSIS_CONFIG_LOG
|
|
|
|
log_write(1);
|
|
|
|
#endif//NSIS_CONFIG_LOG
|
|
|
|
end:
|
|
|
|
if (g_db_hFile!=INVALID_HANDLE_VALUE) CloseHandle(g_db_hFile);
|
|
|
|
#ifdef NSIS_COMPRESS_WHOLE
|
|
|
|
if (dbd_hFile!=INVALID_HANDLE_VALUE) CloseHandle(dbd_hFile);
|
|
|
|
#endif
|
2002-08-09 14:21:45 +00:00
|
|
|
if (m_Err) my_MessageBox(m_Err,MB_OK|MB_ICONSTOP);
|
2002-08-05 02:05:00 +00:00
|
|
|
|
|
|
|
#ifdef NSIS_CONFIG_PLUGIN_SUPPORT
|
2002-08-08 15:04:45 +00:00
|
|
|
// Clean up after plug-ins
|
2003-05-24 13:50:24 +00:00
|
|
|
if (state_plugins_dir[0]) doRMDir(state_plugins_dir,1);
|
2002-08-05 02:05:00 +00:00
|
|
|
#endif // NSIS_CONFIG_PLUGIN_SUPPORT
|
2002-09-25 03:06:36 +00:00
|
|
|
if (g_hIcon) DeleteObject(g_hIcon);
|
2002-08-05 02:05:00 +00:00
|
|
|
|
2002-08-02 10:01:35 +00:00
|
|
|
ExitProcess(ret);
|
|
|
|
}
|