Silent Install ReturnCode

Got a problem you cannot solve? Try here.
jzhong
Posts: 2
Joined: Wed Mar 15, 2006 9:49 am

Silent Install ReturnCode

Postby jzhong » Wed Mar 15, 2006 9:57 am

Hi

When performing silent installation using SMS, how could I tell whether my setup is installed successful or not ? The return code from setup.exe is always return 0 even the installation is failed like no enough space, etc.

Thanks

Joe

Ton_B
Posts: 115
Joined: Wed Nov 16, 2005 8:34 am
Location: Netherlands
Contact:

Postby Ton_B » Wed Mar 15, 2006 10:32 am

Hello Joe,

I previously had the same problem.
When you use a silend setup, no dialogs or even error messages are shown.

If you only want to know if a setup has run correctly you can use a logged setup. Simply add the following line to the commandline:

Code: Select all

..\\YourSetup.exe /l=c:\\logfilename.ext


I was not happy with a setup wich would not give you any information of the progress of even pre conditions etc.
So I created my own variable to check if the setup must be attended or unattended.

All the way on the top of my script I added the following code:

Code: Select all

Set variable SILENTMODE to $SILENT$
If SILENTMODE equals TRUE
  Set variable SILENT to FALSE
End


Now you can use the SILENTMODE variable to manually decide what you want to do, and of cource, every messagebox (like errors) will now be shown!
I even edited the progress dialog, wich will be shown in an unattended setup, but does not have any controls on it, so you can see the setup is running.

The only thing you must not forget is to add code like this in the dialogs loop.:

Code: Select all

 if Variable SILENTMODE not Equals TRUE
  wizard loop
    Display Dialog: welcome
    [compiler if Variable BUILDMODE not Equals PATCH]
    Display Dialog: licensecheck
    Display Dialog: readme
    Display Dialog: registration
    Display Dialog: destination
    Display Dialog: startmenu
    [compiler end]
    Display Dialog: startinstallation
  end
GoTo Label: Main Install
[ etc ]
 Display Dialog: progress


hope this helps.

Ton Blokhuizen
BMA BV- Netherlands[/code]

MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Postby MichaelNesmith » Wed Mar 15, 2006 12:37 pm

Very easily done. Use the Terminate with Exit Code command. There you can specify any custom non-zero return code for a variety of error conditions in your setup script. For instance, 1 if prereq installs failed, 2 if setup itself failed, 3 if incorrect command line parameters specified, and so on...
Michael Nesmith
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/

jzhong
Posts: 2
Joined: Wed Mar 15, 2006 9:49 am

Postby jzhong » Wed Mar 15, 2006 3:01 pm

When the installation involves the main setup logic, I know I have the full control by terminate with exit code command and I am doing it currently.

However, in our customer site, the installation run into "Setup resource decompression failure" error and the setup.exe still report success (ie, return 0) using SMS. That is why this question arise, and this is out of my control. Any thought on the solution ?

MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Postby MichaelNesmith » Wed Mar 15, 2006 3:44 pm

Thanks for that report. I'll escalate this to product management so they can make sure a correct error code is returned upon initialization errors.
Michael Nesmith

InstallAware

Home of The Next Generation MSI Installer

Get your free copy today - http://www.installaware.com/


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 165 guests