Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

How detect 'silent mode' (run with /s)


4 replies to this topic

SinDos

SinDos
  • Full Members
  • 25 posts

Posted 19 June 2009 - 10:15

Hello all

I have problem with detection of mode for my installation running

the root of the matter
I have special custom action in my installation (install script)

The script contains code for installation and uninstallation:
if (MAINTENANCE) then
// (1) some actions during installation
else
// (2) some actions during uninstallation
endif;

But now I want to disable (2) actions when my setup is running with /s option:
setup.exe /S /V"/qn INSTALLDIR=\"C:\Program Files\CCC\" REBOOT=ReallySuppress"

I tried to check 'MODE':
if (MODE = SILENTMODE) then
......
no effect

Could help me, please?




SinDos

SinDos
  • Full Members
  • 25 posts

Posted 22 June 2009 - 01:30

please help

luke_s

luke_s
  • Full Members
  • 532 posts

Posted 22 June 2009 - 02:35

I'm not too familar with the install shield setup.exe, but try looking at a property called "UILEVEL".

You can test this by running the installation in silent and non-silent mode and checking the value.

http://msdn.microsof...096(VS.85).aspx





SinDos

SinDos
  • Full Members
  • 25 posts

Posted 24 June 2009 - 03:33

Thanks a lot!

Just for anybody knowledge:

STRING UILevelName;
NUMBER nvSize;

begin
nvSize = 256;
MsiGetProperty (hMSI, "UILevel", UILevelName, nvSize);
SprintfBox(INFORMATION, "UILevel Box", " %s ", UILevelName);

if (UILevelName = "2") then
// SILENT MODE
..........

SinDos

SinDos
  • Full Members
  • 25 posts

Posted 25 June 2009 - 01:48

Another problem

My installation contains a cutom action (InstallScript) for adding specific keys to the registry during uninstallaing. The custom action asks user before the adding: input keys for the adding (using AskOptions dialog) ONLY for normal mode:
if (MAINTENANCE) then
// INSTALLATION
ellse
// UNINSTALLTION
if (UILevelName = "2") then
// SILENT MODE
.... nothing
else
// NORMAL MODE
......... AskOptions dialog
endif;
endif;

The dialog is called only for normal mode (my first question in the topic).

So, I supposed when I run next upgrade installation (for example I have customer release installation with the action and the release is installed), the installation calls uninstalling previous version AND its custom action.
For normal mode - no problem
BUT if I run the upgrade in silent mode I expect to have the same mode for the uninstalling .... false!
I checked UILevel:
upgrade installation = 2 - expected
uninstalling = 3 !!! the same as normal mode

why?