PDA

View Full Version : Needing to Customize Custom Installation



lmodern1878
01-07-2024, 11:17 PM
Hello Everyone:

Hope this finds you all well and that 2024 is bringing smiles, I wanted to do some heavy lifting with the custom install as follows:

1) if the setup is launched without any command-line switches, hide certain features (got that accomplished with a lot of conditional logic and it wasn't pretty)
2) if the setup is launched with a command line switch of /TOOLS show only certain features (got that done with a lot of conditional logic and again it wasn't pretty)
3) if the setup is launched with the /TOOLS command line, automatically skip the license agreement, setup types, program folder, and install folder screens thus it would be Welcome > Custom Install > Ready To Install ... (this is partially implemented as no matter what I do, I cannot seem to skip the setup types screen and go directly to the custom installation screen after welcome)

Here's the code that makes all of this mess work and I am curious if anyone happens to know how to conditionally force a specific setup type?



! Hide unnecessary wizard dialogs and features if doing a tools install
If %CMDLINE% Contains "/TOOLS" Then
Hide Wizard Dialog "$LICENSE$"
Hide Wizard Dialog "$INSTALLDIR$"
Hide Wizard Dialog "$PROGRAMFOLDER$"
Set Feature State (NotSelected: "GQMain")
Set Feature State (Hidden: "GQMain")
Set Feature State (Hidden: "SiteManager")
Set Feature State (Hidden: "Manuals")
! if XP show only the key generation tool and hide the password recovery tool
If %WINVER% Less Than or Equal "$WIN_XP$" Then
Set Feature State (Hidden: "GQPass")
End
End
! if command line DOES NOT contain /tools hide all tools options
If %CMDLINE% Does Not Contain "/TOOLS" Then
Set Feature State (Hidden: "GQTOOLS")
Set Feature State (Hidden: "GQPass")
Set Feature State (Hidden: "GQKG")
! if command line contains /TOOLS and OS is XP or older, show only the root tools and key generation, hide password recovery
If %WINVER% Greater Than or Equal "$WIN_XP$" And %NET35STAT% Equals "1" Then
Set Feature State (NotSelected: "GQTOOLS")
Set Feature State (NotSelected: "GQKG")
Set Feature State (Hidden: "GQPass")
End
! if OS is vista or newer show all tools options un custom install
If %WINVER% Greater Than or Equal "$WIN_VISTA$" And %CMDLINE% Does Not Contain "/TOOLS" Then
If %NET35STAT% Equals "1" And %NET40STAT% Equals "1" Then
Set Feature State (NotSelected: "GQTOOLS")
Set Feature State (NotSelected: "GQKG")
Set Feature State (NotSelected: "GQPass")
End
End
End



Additionally, how does the %_SB_FEATURESID% runtime variable work? I'd like to set features from an answer file if possible.

Thanks again for any help given. Please have a happy new year :-)