cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
raffaeu
Level 3

InstallScript MSI project does not detect UI Level properly

I have an old InstallScript MSI project that needs to be converted in order to be able to run also in Silent mode.
It is hardcoded by events, so what I have done is to change the OnBegin event with the following code:

function BOOL IsSilent()
string uiLevelName;
number buffer;
begin
buffer = 256;
MsiGetProperty(ISMSI_HANDLE, "UILevel", uiLevelName, buffer);
SprintfMsiLog("Is Silent " + uiLevelName);
if(uiLevelName = "2") then
return TRUE;
endif;
return FALSE;
end;

The problem is that I always get Level 2 even when I run the Setup without the parameter /s.
It seems that InstallShield can't detect the proper UI Level when it's a custom InstallScript MSI project. I tried with MergeModule or Basic MSI and it works as expected.
Should I use a different approach in this case?
Labels (1)
0 Kudos
(1) Reply
raffaeu
Level 3

For some reasons the UILevel property is not working as expected but I found the variable MODE to be absolutely reliable.
In this piece of code I always get the expected result, so in my opinion instead of working with UILevel we should use only MODE.

	if(MODE = NORMALMODE)then
MessageBox("NORMAL MODE", INFORMATION);
endif;
if(MODE = RECORDMODE)then
MessageBox("RECORD MODE", INFORMATION);
endif;
if(MODE = SILENTMODE)then
MessageBox("SILENT MODE", INFORMATION);
endif;
0 Kudos