cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Barvaz
Level 6

calculate disk space + Ignore popup message in silent mode

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?

Thanks.
Labels (1)
0 Kudos
(3) Replies
skolte
Level 7

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.

In case you need to determine if the Installer is running in silent mode and suppress the MessageBox I would use this code.
0 Kudos
Barvaz
Level 6

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
Do(EXIT);
elseif (nReturn = IDOK) then
// Continue.
endif;


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

Thanks.
0 Kudos
skolte
Level 7

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.


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.


MODE
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
Constant

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:

if (MODE = SILENTMODE) then
// Perform silent setup actions and events.
else
// Perform normal setup actions and events.
endif;

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”.
0 Kudos