View Full Version : calculate disk space + Ignore popup message in silent mode

11-09-2011, 10:17 AM
Hi All,

I have two questions:

1) How to calculate Disk space before installation: I have an installation file that in addition to my application installation is also installs third-party systems.
Suppose our installation size and size off the 3 third-party systems 100MB for installation.
How can I make disk size check before starting the installation?
2) How to Ignore pop up message in silent mode - If I run the setup in silent mode which property is set? I've function in the install script which should behave different from verbose mode (i.e messegebox etc.) and I want to define this behavior with this property – or should I do it otherwise?


11-09-2011, 11:50 AM
1. You can use InstallScript function GetDiskSpace() to get the disk space on a particular drive. GetDiskInfo() will give you additional info in case you need more.

2. Setup.exe can be run in silent mode using

Setup.exe /s /v"/qn"

More info is available here (http://kb.flexerasoftware.com/selfservice/microsites/search.do?cmd=displayKC&docType=kc&externalId=InstallShield2011-SilentInstallhtm&sliceId=&docTypeID=DT_MACROVISIONHELPNET_1_1&dialogID=118808222&stateId=0%200%20118806295).

In case you need to determine if the Installer is running in silent mode and suppress the MessageBox I would use this code (http://kb.flexerasoftware.com/selfservice/microsites/search.do?cmd=displayKC&docType=kc&externalId=Q105454&sliceId=1&docTypeID=DT_HOWTO_1_1&dialogID=118808222&stateId=0%200%20118806295).

11-10-2011, 02:36 AM
1) Thanks for the answer - i'll read about it...

2) Silent Mode - I know how to run the setup in silent mode.
my question has been refer to the install script behavior during to the silent mode execution - For example how the following code is behave?

nReturn = SprintfBox(MB_OKCANCEL,"WARNING","%s",messege);

if (nReturn = IDCANCEL) then
elseif (nReturn = IDOK) then
// Continue.

Which property is set/get the silent mode flag?
I can use this property in my code to define the behavior in silent mode.


11-10-2011, 11:22 AM
That is exactly what I suggested.

In case you need to determine if the Installer is running in silent mode and suppress the MessageBox I would use this code (http://kb.flexerasoftware.com/selfservice/microsites/search.do?cmd=displayKC&docType=kc&externalId=Q105454&sliceId=1&docTypeID=DT_HOWTO_1_1&dialogID=118808222&stateId=0%200%20118806295).

What I meant is you can use "UILevel" property. The values should be:
2 = Silent
3 = Basic UI
4 = Reduced UI
5 = Full UI.

Or you can use MODE property as given in documentation, InstallShield 2012 InstallScript Reference Guide.pdf.

The system variable MODE holds one of the following constant values (note that the value cannot be changed at run time):
Table 7-11: MODE

SILENTMODE = Indicates that Setup.exe is running in silent mode. (That is, the user ran Setup.exe with the /s argument.)

NORMALMODE = Indicates Setup.exe is running in normal mode.

RECORDMODE = Indicates Setup.exe is automatically generating a silent setup file (.iss file), which is a record of the setup input, by default in the Windows folder. (That is, when you run Setup.exe with the /r argument.)

You can use the system variable MODE in if statements to control the flow of your script based on mode, as shown below:

// Perform silent setup actions and events.
// Perform normal setup actions and events.

Note: For a Basic MSI project, you can find if the user is running the installation in silent mode with the Windows Installer condition “UILevel=2”.