- added GetErrorLevel and SetErrorLevl
- fixed some inconsistencies in the error levels the installer/uninstaller set git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@3668 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
f4089b9d60
commit
e82748702c
8 changed files with 45 additions and 14 deletions
|
@ -70,7 +70,7 @@ char *ValidateTempDir()
|
|||
|
||||
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInst,LPSTR lpszCmdParam, int nCmdShow)
|
||||
{
|
||||
static int ret;
|
||||
int ret;
|
||||
const char *m_Err = _LANG_ERRORWRITINGTEMP;
|
||||
|
||||
int cl_flags = 0;
|
||||
|
@ -81,6 +81,8 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInst,LPSTR lpszCmdParam,
|
|||
|
||||
InitCommonControls();
|
||||
|
||||
g_exec_flags.errlvl=-1;
|
||||
|
||||
#if defined(NSIS_SUPPORT_ACTIVEXREG) || defined(NSIS_SUPPORT_CREATESHORTCUT)
|
||||
{
|
||||
extern HRESULT g_hres;
|
||||
|
@ -243,6 +245,8 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInst,LPSTR lpszCmdParam,
|
|||
#endif//NSIS_CONFIG_UNINSTALL_SUPPORT
|
||||
|
||||
ret = ui_doinstall();
|
||||
if (g_exec_flags.errlvl == -1)
|
||||
g_exec_flags.errlvl = ret;
|
||||
|
||||
#ifdef NSIS_CONFIG_LOG
|
||||
#ifndef NSIS_CONFIG_LOG_ODS
|
||||
|
@ -254,13 +258,16 @@ end:
|
|||
CleanUp();
|
||||
|
||||
if (m_Err)
|
||||
{
|
||||
my_MessageBox(m_Err, MB_OK | MB_ICONSTOP | (IDOK << 20));
|
||||
g_exec_flags.errlvl = 2;
|
||||
}
|
||||
|
||||
#if defined(NSIS_SUPPORT_ACTIVEXREG) || defined(NSIS_SUPPORT_CREATESHORTCUT)
|
||||
OleUninitialize();
|
||||
#endif
|
||||
|
||||
ExitProcess(ret);
|
||||
ExitProcess(g_exec_flags.errlvl);
|
||||
}
|
||||
|
||||
void NSISCALL CleanUp()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue