PDA

View Full Version : Specify Setup Type on Command Line



cptcoconut
05-23-2007, 07:45 AM
I've created a setup with three Setup Types: Complete, Upgrade, and Custom. Some customers will install with the GUI, but others will require an unattended installation and will use the /S silent option.

How can the Setup Type be passed on the command line along with the /S option (e.g. to select the Upgrade setup type)? Is it also possible to select a Custom type and select only certain Features from the command line?

linder
05-23-2007, 07:52 AM
Hello,

What you can do is to detect a silent installation and, if detected, set the active setup type to Upgrade.

You can use the following to detect a silent install:

If %_SB_INSTALLERFLAG% Equals "1" on Position "$SB_SILENTMODEFLAG$" Then

You can use "Set Active Setup Type" to set the type.

Does this help?

Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

cptcoconut
05-23-2007, 08:45 AM
Thank you, that got me headed in the right direction, but I need to let the user specify the Setup Type on the command line (it's not always Upgrade just because it's silent, they still get to choose). I think I have it working like this:


! If the SetupType was passed on the command line, set it here
! e.g.: Setup.exe /V SetupType Upgrade
Set Variable %SETUPTYPE% to ""
If %SETUPTYPE% Equals (Ignore Case) "Complete" Then
Set Active Setup Type to "Complete"
ElseIf %SETUPTYPE% Equals (Ignore Case) "Upgrade" Then
Set Active Setup Type to "Upgrade"
ElseIf %SETUPTYPE% Equals (Ignore Case) "Custom" Then
Set Active Setup Type to "Custom"
End

Is this the best way to accomplish it?

linder
05-23-2007, 08:57 AM
Hello,

Yes, good idea. This should work fine!

You can also use the "Get System Information (Command Line)" function to retrieve the command line. Then check if a specific "upgrade switch" is defined.

For example, you tell your customer that setup.exe /u (or whatever switch you prefer) runs the installer in upgrade mode. Just check if /u is passed through the command line and set your setup type to "Upgrade".

Does this make sense?

Friedrich

cptcoconut
05-23-2007, 09:25 AM
That's great, thank you very much.

While I was testing to see what formats I could pass in with the /V option, I think I've found a (very minor) bug. If I pass a colon between the variable name and value instead of a space, the setup crashes.

Setup.exe /V SetupType:Upgrade

Application Exception 0xc0000005

linder
05-23-2007, 09:51 AM
Thank you for bringing this to my attention. Item in review.

Friedrich