cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
tnand53
Level 5

MsiDatabaseOpenView problem in InstallScript

I am using MsiDatabaseOpenView problem in installscript.

HWND hView,hDatabase


hDatabase = MsiGetActiveDatabase(hInstall);
if ( !hDatabase )
{
return ERROR_INSTALL_FAILURE;
}
// Look for the ONLY Control table record where
// `Dialog_`='ReadyToInstall' AND `Control`='SummaryText'
if ( ERROR_SUCCESS != (uiRet = MsiDatabaseOpenView(hDatabase, "SELECT `Dialog_`, `Control`, `Text`, FROM `Control` WHERE (`Dialog_`='ReadyToInstall' AND `Control`='Summary')", hView)))
{
return ERROR_INSTALL_FAILURE;
}

Even Though it is giving ERROR_SUCCESS; but the value of hView is null when used in installscript.

The same script in c++ will be working if we just replace &hView in MsiDatabaseOpenView query. How do i use in installscript.

if(! hView) then
MessageBox("Null ")
else
MessageBox("NOT Null ")
endif

In C++ it will give NOT NULL but InstallScript it wil give NULL.

How to access the dialog in installscript.
Labels (1)
0 Kudos
(2) Replies
joshstechnij
Level 10 Flexeran
Level 10 Flexeran

There is an extra comma between `Text` and FROM that seems to be preventing this query from executing correctly. Note that this should not behave any differently in InstallScript or C++ since they both call directly into the same MSI API.
0 Kudos
tnand53
Level 5

I think the problem with the MsiDatabaseOpenView is the last parameter which is the HANDLE to HWND. in c++ it is &hView, but in installscript when we write &hView , it will give error on compilation.

Anyway to rectify the problem.
0 Kudos