Error on Win XP non-admin user

Feb 23, 2012 at 1:19 PM

I have created setup using dotNetInstaller (DNI), version 2.0.81.0 with attribute: administrator_required="True"

During tests I have encountered a problem.

When I run my setup on Windows XP, logged in as user who is not in Administrators group it supposed to be a message defined in: administrator_required_message, but there is windows error reporting service window instead.

Here's log:

2012-02-23 13:20:57    -------------------------------------------------------------------
2012-02-23 13:20:57    dotNetInstaller (DNI), version 2.0.81.0
2012-02-23 13:20:57    Copyright (c) DevAge, Vestris Inc. & Contributors
2012-02-23 13:20:57    Operating system: Windows XP SP3
2012-02-23 13:20:57    -------------------------------------------------------------------
2012-02-23 13:20:57    Sequence: install
2012-02-23 13:20:57    UI level: full
2012-02-23 13:20:57    User is not a member of the Administrators group

Is this known issue or am i doing something wrong?

Feb 23, 2012 at 1:37 PM

Are you running it in silent mode? All messages are suppressed in that case.

Feb 23, 2012 at 5:34 PM

For setup, ui_level="full"

I'm adding silent mode to msi components.

I think that something is wrong in handling exception thrown in RunInstallConfiguration:

(...)
        // Not running Windows Vista or later (major version >= 6) so
        // check whether installation can only be run by an adminstrator
        // as we can't elevate later.
        if (p_configuration->administrator_required)
        {
            if (DVLib::IsUserInAdminGroup())
            {
                LOG("User is a member of the Administrators group");
            }
            else
            {
                LOG("User is not a member of the Administrators group");
                THROW_EX(p_configuration->administrator_required_message);
            }
        }

(...)

Feb 24, 2012 at 3:16 PM

What's the windows error reporting service saying?

Feb 24, 2012 at 4:26 PM

AppName: setup_online.exe     AppVer: 1.0.0.0     ModName: setup_online.exe
ModVer: 1.0.0.0     Offset: 00140048

<?xml version="1.0" encoding="UTF-16"?>
<DATABASE>
<EXE NAME="setup_online.exe" FILTER="GRABMI_FILTER_PRIVACY">
    <MATCHING_FILE NAME="setup_online.exe" SIZE="15212544" CHECKSUM="0x41774461" BIN_FILE_VERSION="1.0.0.0" BIN_PRODUCT_VERSION="1.0.0.0" PRODUCT_VERSION="1.0.0.0" FILE_DESCRIPTION="" COMPANY_NAME="" PRODUCT_NAME="" FILE_VERSION="1.0.0.0" ORIGINAL_FILENAME="" INTERNAL_NAME="" LEGAL_COPYRIGHT=" VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x4" VERFILETYPE="0x2" MODULE_TYPE="WIN32" PE_CHECKSUM="0x197DA7" LINKER_VERSION="0x0" UPTO_BIN_FILE_VERSION="1.0.0.0" UPTO_BIN_PRODUCT_VERSION="1.0.0.0" LINK_DATE="09/28/2011 01:38:44" UPTO_LINK_DATE="09/28/2011 01:38:44" VER_LANGUAGE="Angielski (Stany Zjednoczone) [0x409]" />
</EXE>
<EXE NAME="kernel32.dll" FILTER="GRABMI_FILTER_THISFILEONLY">
    <MATCHING_FILE NAME="kernel32.dll" SIZE="1018368" CHECKSUM="0x362CC3BB" BIN_FILE_VERSION="5.1.2600.5781" BIN_PRODUCT_VERSION="5.1.2600.5781" PRODUCT_VERSION="5.1.2600.5781" FILE_DESCRIPTION="Biblioteka DLL klienta Windows NT BASE API" COMPANY_NAME="Microsoft Corporation" PRODUCT_NAME="System operacyjny Microsoft® Windows®" FILE_VERSION="5.1.2600.5781 (xpsp_sp3_gdr.090321-1317)" ORIGINAL_FILENAME="kernel32" INTERNAL_NAME="kernel32" LEGAL_COPYRIGHT="© Microsoft Corporation. Wszelkie prawa zastrzeżone." VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x40004" VERFILETYPE="0x2" MODULE_TYPE="WIN32" PE_CHECKSUM="0x103A91" LINKER_VERSION="0x50001" UPTO_BIN_FILE_VERSION="5.1.2600.5781" UPTO_BIN_PRODUCT_VERSION="5.1.2600.5781" LINK_DATE="03/21/2009 14:08:59" UPTO_LINK_DATE="03/21/2009 14:08:59" VER_LANGUAGE="Polski [0x415]" />
</EXE>
</DATABASE>

And tons of dissassebly/memory dump.. i don't know.

Feb 27, 2012 at 7:06 PM

Looks like a crash. It's possible that XP is preventing the bootstrapper from popping up a message. Unfortunately we're not going to get much further without a debugger. Did you try this on a different OS? Windows 7?

Feb 27, 2012 at 7:54 PM

It works great in other configurations, it crushes only in this particular situation: XP + non-admin user.

Feb 27, 2012 at 8:09 PM

You need some dev hands on this setup, attaching a debugger, getting a call stack, a build with debug symbols, etc. I won't be able to help you, but if you have someone with some C++ background, go for it.

Mar 5, 2012 at 3:13 PM

Call stack:   

setup_online.exe!__except_list()  + 0x540048 bytes    Unknown
     user32.dll!7e368734()    
     [Frames below may be incorrect and/or missing, no symbols loaded for user32.dll]   
     user32.dll!7e368816()    
     user32.dll!7e378ea0()    
     user32.dll!7e378eec()    
     ntdll.dll!7c90e473()    
     user32.dll!7e37b11e()    
     user32.dll!7e38ada0()    
     user32.dll!7e368734()    
     user32.dll!7e37413c()    
     user32.dll!7e373b30()    
     user32.dll!7e373d5c()    
     user32.dll!7e368734()    
     user32.dll!7e368816()    
     user32.dll!7e37927b()    
     user32.dll!7e37651a()    
     user32.dll!7e37b7d0()    
     user32.dll!7e3749b1()    
     user32.dll!7e38a956()    
     ntdll.dll!7c911028()    
     ntdll.dll!7c911086()    
     ntdll.dll!7c9101db()    
     ntdll.dll!7c910222()    
     ntdll.dll!7c910222()    
     ntdll.dll!7c91019b()    
     ntdll.dll!7c9101db()    
     ntdll.dll!7c910222()    
     ntdll.dll!7c910222()    
     ntdll.dll!7c91019b()    
     ntdll.dll!7c9101db()    
     ntdll.dll!7c910222()    
     ntdll.dll!7c91019b()    
     user32.dll!7e38a2bc()    
     ntdll.dll!7c9100b8()    
     ntdll.dll!7c910041()    
     ntdll.dll!7c91005d()    
     ntdll.dll!7c9100b8()    
     user32.dll!7e3b63fd()    
     user32.dll!7e3a0853()    
     user32.dll!7e3b6579()    
>    setup_online.exe!AfxCtxMessageBoxW(HWND__ * hWnd=0x00000000, const wchar_t * lpText=0x0012fecc, const wchar_t * lpCaption=0x01793168, unsigned int uType=16)  Line 449 + 0x48 bytes    C++
     setup_online.exe!CWinApp::ShowAppMessageBox(CWinApp * pApp=0x004ac1f0, const wchar_t * lpszPrompt=0x0012fecc, unsigned int nType=16, unsigned int nIDPrompt=0)  Line 129 + 0x12 bytes    C++
     setup_online.exe!CWinApp::DoMessageBox(const wchar_t * lpszPrompt=0x0012fecc, unsigned int nType=16, unsigned int nIDPrompt=0)  Line 45 + 0x12 bytes    C++
     setup_online.exe!DniMessageBox::Show(const std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> > & p_lpszText={...}, unsigned int p_nType=16, unsigned int p_nDefaultResult=0, unsigned int p_nIDHelp=0)  Line 61    C++
     setup_online.exe!CHtmlInstallerApp::InitInstance()  Line 92 + 0x4c bytes    C++
     ntdll.dll!7c9032a8()    
     ntdll.dll!7c90327a()    
     ntdll.dll!7c92a8c3()    
     ntdll.dll!7c9100b8()    
     ntdll.dll!7c910041()    
     ntdll.dll!7c91005d()    
     ntdll.dll!7c90e48a()    
     kernel32.dll!7c812afb()    
     kernel32.dll!7c812afb()    
     ntdll.dll!7c9100b8()    
     ntdll.dll!7c910041()    
     ntdll.dll!7c91005d()    
     ntdll.dll!7c91005d()    
     ntdll.dll!7c912e61()    
     ntdll.dll!7c914ee7()    
     ntdll.dll!7c9100b8()    
     ntdll.dll!7c910041()    
     ntdll.dll!7c91005d()    
     shlwapi.dll!77f643e0()    
     shlwapi.dll!77f643ed()    
     kernel32.dll!7c812afb()    
     setup_online.exe!_CxxThrowException(void * pExceptionObject=0x0012f918, const _s__ThrowInfo * pThrowInfo=0x00499110)  Line 161    C++
     setup_online.exe!InstallerUI::RunInstallConfiguration(const shared_any<Configuration *,close_delete,null_t,0> & configuration={...}, bool p_additional_config=false)  Line 276    C++
     setup_online.exe!ConfigFileManager::OnRunConfiguration(const shared_any<Configuration *,close_delete,null_t,0> & config={...})  Line 51    C++
     setup_online.exe!ConfigFiles::Run()  Line 149 + 0x17 bytes    C++
     setup_online.exe!CHtmlInstallerApp::InitInstance()  Line 87    C++
     setup_online.exe!AfxWinMain(HINSTANCE__ * hInstance=0x00400000, HINSTANCE__ * hPrevInstance=0x00000000, wchar_t * lpCmdLine=0x0002071a, int nCmdShow=1)  Line 37 + 0x7 bytes    C++
     setup_online.exe!__tmainCRTStartup()  Line 324 + 0x1c bytes    C
     setup_online.exe!_MsiGetProductInfoW@16()  + 0x8adc bytes    C++
     2b7b5a63() 
  

Problem with MessageBox not attached to any window?

Mar 6, 2012 at 4:49 PM

Further information.

I have attached debugger and there is Access vilation exception reading location: 0xfeeefeee

>	htmlInstaller.exe!HtmlWindow::WinProc(HWND__ * hwnd=0x000b0344, unsigned int message=28, unsigned int wParam=1, long lParam=0)  Line 250 + 0x16 bytes	C++

variables:
        mc    -858993460    int
+        hwnd    0x000b0344 {unused=??? }    HWND__ *
        message    28    unsigned int
        wParam    1    unsigned int
        lParam    0    long
        bHandled    0    int
+        me    0x017a4fa8 {hwnd=0xfeeefeee m_title=<Bad Ptr> body={...} ...}    HtmlWindow *
        lResult    1    long

Any ideas?

Mar 7, 2012 at 12:40 PM

Looks like the bootstrapper is trying to popup a message, but it doesn't have a window to do so. It's most likely a bug, so you can file that. I won't have time to look at it though any time soon - and I think it's not going to be quick. Seems like you know what you're doing - get the source code, build it and look how we're getting this hwnd value in there.

Mar 8, 2012 at 5:16 PM

In this particular situation all i needed was application that shows messagebox and close kindly so i just cauhjt and ignore the exception... I know it is not a good idea but it works...

if (me)
{
	int mc = 0;
	__try 
	{
		mc = me->OnMessage(message, wParam, lParam);
	}
	__except(GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION)
	{
	}
	if (mc != 0)
	{
		return mc;
	}
}

Mar 9, 2012 at 12:37 AM

You can fork the code and do whatever you want, but if I were you I'd look into fixing the bug :)

May 4, 2012 at 12:57 AM

I believe this is fixed with commit cc629435baa42dc6b6d824acaf9a016994a9c94f on https://github.com/dblock/dotnetinstaller on May 1st, 2012.

Fixed crash when WaitForSingleObject returns nonsignaled member when Start() and End() were called quickly in succession causing pointers to be deleted while a dependent thread is still running.

Jul 25, 2012 at 1:37 PM

Unfortunately, no, setup still crushes. (used dotnetinstaller 2.1.528, i assume that this fix was in that build)

Jul 26, 2012 at 9:14 PM

I created a new issue here: https://github.com/dblock/dotnetinstaller/issues/21

These discussions are closed, so please post any follow ups on github.

Thank you.