View Full Version : Toggle bettween install types
Sergio_S
08-21-2006, 05:44 PM
On my setup project, I have 2 install types, for instance, minimum and full install type.
I created two packages, the minimum with the essential files (checked by default) and the full with all the files to be installed.
I want the user may toggle between the two packages. I mean, when he checks one, the other unchecks.
Do you have an example on how to perform this in SUF 7? (I remember it was a piece of cake with SUF 5, as it was automatically set).
Sergio
Lorne
08-22-2006, 10:05 AM
If you're using the Select Packages screen, you could add that functionality to the On Ctrl Message script...although that approach is a bit advanced.
A much easier approach would be to use a radio buttons screen to get that functionality. Just use actions in the On Next event to turn the appropriate packages on or off based on the user's selection.
-- Convert the selected radio button control to a number for the comparison.
local nSelectedControl = String.ToNumber(SessionVar.Expand("%RadioSelection%"));
if (nSelectedControl == CTRL_RADIO_BUTTON_01) then
SetupData.SetPackageProperties("Minimum", {Install=true});
SetupData.SetPackageProperties("Full", {Install=false});
elseif (nSelectedControl == CTRL_RADIO_BUTTON_02) then
SetupData.SetPackageProperties("Minimum", {Install=false});
SetupData.SetPackageProperties("Full", {Install=true});
else
Dialog.Message("Error", "Invalid selection");
end
For example, copy this text and then paste it into your screen gallery:
<SUF7_CB_SCREENS>
<Screen>
<Type>135</Type>
<Name>Install Type</Name>
<BannerStyle>2</BannerStyle>
<TemplateName>Radio Buttons</TemplateName>
<OverrideProjTheme>0</OverrideProjTheme>
<StyleData>
<CstClrs>0</CstClrs>
<TBBG format="hex">ffffff</TBBG>
<BDYBG format="hex">ece9d8</BDYBG>
<FTBG format="hex">ece9d8</FTBG>
<TBTXT format="hex">000000</TBTXT>
<BDYTXT format="hex">000000</BDYTXT>
<CBG format="hex">ffffff</CBG>
<C3DFACE format="hex">ece9d8</C3DFACE>
<C3DHLT format="hex">ece9d8</C3DHLT>
<C3DLIT format="hex">ffffff</C3DLIT>
<C3DSH format="hex">aca899</C3DSH>
<CBTNTXT format="hex">000000</CBTNTXT>
<CTEXT format="hex">000000</CTEXT>
<CDISTXT format="hex">aca899</CDISTXT>
<CPRGRS format="hex">316ac5</CPRGRS>
<C3DSHDK format="hex">716f64</C3DSHDK>
<TBIMG>Default_Top_Banner.jpg</TBIMG>
<SBIMG>Default_Side_Banner.jpg</SBIMG>
<BDIMG/>
<BDFILL>0</BDFILL>
<HDSEP>1</HDSEP>
<FTSEP>1</FTSEP>
<CstFnts>0</CstFnts>
<Fonts>
<FontData>
<FontName>Arial</FontName>
<CharacterSet>0</CharacterSet>
<Height>-13</Height>
<Weight>700</Weight>
<Italic>0</Italic>
<Underline>0</Underline>
<StrikeOut>0</StrikeOut>
<AntiAlias>1</AntiAlias>
</FontData>
<FontData>
<FontName>Arial</FontName>
<CharacterSet>0</CharacterSet>
<Height>-13</Height>
<Weight>700</Weight>
<Italic>0</Italic>
<Underline>0</Underline>
<StrikeOut>0</StrikeOut>
<AntiAlias>1</AntiAlias>
</FontData>
<FontData>
<FontName>Arial</FontName>
<CharacterSet>0</CharacterSet>
<Height>-24</Height>
<Weight>700</Weight>
<Italic>0</Italic>
<Underline>0</Underline>
<StrikeOut>0</StrikeOut>
<AntiAlias>1</AntiAlias>
</FontData>
<FontData>
<FontName>Arial</FontName>
<CharacterSet>0</CharacterSet>
<Height>-13</Height>
<Weight>400</Weight>
<Italic>0</Italic>
<Underline>0</Underline>
<StrikeOut>0</StrikeOut>
<AntiAlias>1</AntiAlias>
</FontData>
<FontData>
<FontName>Arial</FontName>
<CharacterSet>0</CharacterSet>
<Height>-13</Height>
<Weight>400</Weight>
<Italic>0</Italic>
<Underline>0</Underline>
<StrikeOut>0</StrikeOut>
<AntiAlias>1</AntiAlias>
</FontData>
</Fonts>
<CAOff>
<TP>0</TP>
<L>15</L>
<T>15</T>
<R>15</R>
<B>15</B>
</CAOff>
<CAOff>
<TP>1</TP>
<L>15</L>
<T>15</T>
<R>15</R>
<B>15</B>
</CAOff>
<CAOff>
<TP>2</TP>
<L>15</L>
<T>15</T>
<R>15</R>
<B>15</B>
</CAOff>
<TBTXTX>10</TBTXTX>
<TBTXTY>10</TBTXTY>
</StyleData>
<NumRadioButtons>2</NumRadioButtons>
<Radio0>0</Radio0>
<Radio1>1</Radio1>
<Cols>1</Cols>
<Distribute>0</Distribute>
<DefaultSelection>604</DefaultSelection>
<Variable>%RadioSelection%</Variable>
<Events>
<Event>
<Name>On Preload</Name>
<Args/>
<Script>-- These actions are performed before the screen is shown.
</Script>
</Event>
<Event>
<Name>On Back</Name>
<Args/>
<Script>-- These actions are performed when the Back button is clicked.
-- go back to the previous screen
Screen.Back();
</Script>
</Event>
<Event>
<Name>On Next</Name>
<Args/>
<Script>-- These actions are performed when the Next button is clicked.
-- Tip: this is where you could add actions to validate the
-- user's input before proceeding
-- Convert the selected radio button control to a number for the comparison.
local nSelectedControl = String.ToNumber(SessionVar.Expand("%RadioSelection%"));
if (nSelectedControl == CTRL_RADIO_BUTTON_01) then
SetupData.SetPackageProperties("Minimum", {Install=true});
SetupData.SetPackageProperties("Full", {Install=false});
elseif (nSelectedControl == CTRL_RADIO_BUTTON_02) then
SetupData.SetPackageProperties("Minimum", {Install=false});
SetupData.SetPackageProperties("Full", {Install=true});
else
Dialog.Message("Error", "Invalid selection");
end
-- advance to the next screen
Screen.Next();
</Script>
</Event>
<Event>
<Name>On Cancel</Name>
<Args/>
<Script>-- These actions are performed when the Cancel button is clicked.
-- from _SUF70_Global_Functions.lua:
-- ask user if they're sure they want to exit
if g_ConfirmSetupAbort() then
Application.Exit(EXIT_REASON_USER_ABORTED);
end
</Script>
</Event>
<Event>
<Name>On Help</Name>
<Args/>
<Script>-- These actions are performed when the Help button is clicked.
</Script>
</Event>
<Event>
<Name>On Ctrl Message</Name>
<Args>number e_CtrlID, number e_MsgID, table e_Details</Args>
<Script>-- These actions are triggered by the controls on the screen.
</Script>
</Event>
</Events>
<Controls>
<Control>
<Type>1</Type>
<ID>103</ID>
<Visible>0</Visible>
<Enabled>0</Enabled>
<TabOrder>75</TabOrder>
<FTButton>1</FTButton>
</Control>
<Control>
<Type>1</Type>
<ID>101</ID>
<Visible>1</Visible>
<Enabled>1</Enabled>
<TabOrder>76</TabOrder>
<FTButton>1</FTButton>
</Control>
<Control>
<Type>1</Type>
<ID>100</ID>
<Visible>1</Visible>
<Enabled>1</Enabled>
<TabOrder>-10</TabOrder>
<FTButton>1</FTButton>
</Control>
<Control>
<Type>1</Type>
<ID>102</ID>
<Visible>1</Visible>
<Enabled>1</Enabled>
<TabOrder>-9</TabOrder>
<FTButton>1</FTButton>
</Control>
<Control>
<Type>2</Type>
<ID>203</ID>
<Visible>1</Visible>
<Enabled>1</Enabled>
<TabOrder>0</TabOrder>
<IsHeading>0</IsHeading>
</Control>
<Control>
<Type>2</Type>
<ID>204</ID>
<Visible>1</Visible>
<Enabled>1</Enabled>
<TabOrder>33</TabOrder>
<IsHeading>0</IsHeading>
</Control>
<Control>
<Type>5</Type>
<ID>604</ID>
<Visible>1</Visible>
<Enabled>1</Enabled>
<TabOrder>1</TabOrder>
<Group>1</Group>
<StartID>604</StartID>
<EndID>635</EndID>
</Control>
<Control>
<Type>5</Type>
<ID>605</ID>
<Visible>1</Visible>
<Enabled>1</Enabled>
<TabOrder>2</TabOrder>
<Group>1</Group>
<StartID>604</StartID>
<EndID>635</EndID>
</Control>
<Control>
<Type>5</Type>
<ID>606</ID>
<Visible>1</Visible>
<Enabled>1</Enabled>
<TabOrder>3</TabOrder>
<Group>1</Group>
<StartID>604</StartID>
<EndID>635</EndID>
</Control>
<Control>
<Type>5</Type>
<ID>607</ID>
<Visible>1</Visible>
<Enabled>1</Enabled>
<TabOrder>4</TabOrder>
<Group>1</Group>
<StartID>604</StartID>
<EndID>635</EndID>
</Control>
<Control>
<Type>5</Type>
<ID>608</ID>
<Visible>0</Visible>
<Enabled>0</Enabled>
<TabOrder>5</TabOrder>
<Group>1</Group>
<StartID>604</StartID>
<EndID>635</EndID>
</Control>
<Control>
<Type>5</Type>
<ID>609</ID>
<Visible>0</Visible>
<Enabled>0</Enabled>
<TabOrder>6</TabOrder>
<Group>1</Group>
<StartID>604</StartID>
<EndID>635</EndID>
</Control>
<Control>
<Type>5</Type>
<ID>610</ID>
<Visible>0</Visible>
<Enabled>0</Enabled>
<TabOrder>7</TabOrder>
<Group>1</Group>
<StartID>604</StartID>
<EndID>635</EndID>
</Control>
<Control>
<Type>5</Type>
<ID>611</ID>
<Visible>0</Visible>
<Enabled>0</Enabled>
<TabOrder>8</TabOrder>
<Group>1</Group>
<StartID>604</StartID>
<EndID>635</EndID>
</Control>
<Control>
<Type>5</Type>
<ID>612</ID>
<Visible>0</Visible>
<Enabled>0</Enabled>
<TabOrder>9</TabOrder>
<Group>1</Group>
<StartID>604</StartID>
<EndID>635</EndID>
</Control>
<Control>
<Type>5</Type>
<ID>613</ID>
<Visible>0</Visible>
<Enabled>0</Enabled>
<TabOrder>10</TabOrder>
<Group>1</Group>
<StartID>604</StartID>
<EndID>635</EndID>
</Control>
<Control>
<Type>5</Type>
<ID>614</ID>
<Visible>0</Visible>
<Enabled>0</Enabled>
<TabOrder>11</TabOrder>
<Group>1</Group>
<StartID>604</StartID>
<EndID>635</EndID>
</Control>
<Control>
<Type>5</Type>
<ID>615</ID>
<Visible>0</Visible>
<Enabled>0</Enabled>
<TabOrder>12</TabOrder>
<Group>1</Group>
<StartID>604</StartID>
<EndID>635</EndID>
</Control>
<Control>
<Type>5</Type>
<ID>616</ID>
<Visible>0</Visible>
<Enabled>0</Enabled>
<TabOrder>13</TabOrder>
<Group>1</Group>
<StartID>604</StartID>
<EndID>635</EndID>
</Control>
<Control>
<Type>5</Type>
<ID>617</ID>
<Visible>0</Visible>
<Enabled>0</Enabled>
<TabOrder>14</TabOrder>
<Group>1</Group>
<StartID>604</StartID>
<EndID>635</EndID>
</Control>
<Control>
<Type>5</Type>
<ID>618</ID>
<Visible>0</Visible>
<Enabled>0</Enabled>
<TabOrder>15</TabOrder>
<Group>1</Group>
<StartID>604</StartID>
<EndID>635</EndID>
</Control>
<Control>
<Type>5</Type>
<ID>619</ID>
<Visible>0</Visible>
<Enabled>0</Enabled>
<TabOrder>16</TabOrder>
<Group>1</Group>
<StartID>604</StartID>
<EndID>635</EndID>
</Control>
<Control>
<Type>5</Type>
<ID>620</ID>
<Visible>0</Visible>
<Enabled>0</Enabled>
<TabOrder>17</TabOrder>
<Group>1</Group>
<StartID>604</StartID>
<EndID>635</EndID>
</Control>
<Control>
<Type>5</Type>
<ID>621</ID>
<Visible>0</Visible>
<Enabled>0</Enabled>
<TabOrder>18</TabOrder>
<Group>1</Group>
<StartID>604</StartID>
<EndID>635</EndID>
</Control>
<Control>
<Type>5</Type>
<ID>622</ID>
<Visible>0</Visible>
<Enabled>0</Enabled>
<TabOrder>19</TabOrder>
<Group>1</Group>
<StartID>604</StartID>
<EndID>635</EndID>
</Control>
<Control>
<Type>5</Type>
<ID>623</ID>
<Visible>0</Visible>
<Enabled>0</Enabled>
<TabOrder>20</TabOrder>
<Group>1</Group>
<StartID>604</StartID>
<EndID>635</EndID>
</Control>
<Control>
<Type>5</Type>
<ID>624</ID>
<Visible>0</Visible>
<Enabled>0</Enabled>
<TabOrder>21</TabOrder>
<Group>1</Group>
<StartID>604</StartID>
<EndID>635</EndID>
</Control>
<Control>
<Type>5</Type>
<ID>625</ID>
<Visible>0</Visible>
<Enabled>0</Enabled>
<TabOrder>22</TabOrder>
<Group>1</Group>
<StartID>604</StartID>
<EndID>635</EndID>
</Control>
<Control>
<Type>5</Type>
<ID>626</ID>
<Visible>0</Visible>
<Enabled>0</Enabled>
<TabOrder>23</TabOrder>
<Group>1</Group>
<StartID>604</StartID>
<EndID>635</EndID>
</Control>
<Control>
<Type>5</Type>
<ID>627</ID>
<Visible>0</Visible>
<Enabled>0</Enabled>
<TabOrder>24</TabOrder>
<Group>1</Group>
<StartID>604</StartID>
<EndID>635</EndID>
</Control>
<Control>
<Type>5</Type>
<ID>628</ID>
<Visible>0</Visible>
<Enabled>0</Enabled>
<TabOrder>25</TabOrder>
<Group>1</Group>
<StartID>604</StartID>
<EndID>635</EndID>
</Control>
<Control>
<Type>5</Type>
<ID>629</ID>
<Visible>0</Visible>
<Enabled>0</Enabled>
<TabOrder>26</TabOrder>
<Group>1</Group>
<StartID>604</StartID>
<EndID>635</EndID>
</Control>
<Control>
<Type>5</Type>
<ID>630</ID>
<Visible>0</Visible>
<Enabled>0</Enabled>
<TabOrder>27</TabOrder>
<Group>1</Group>
<StartID>604</StartID>
<EndID>635</EndID>
</Control>
<Control>
<Type>5</Type>
<ID>631</ID>
<Visible>0</Visible>
<Enabled>0</Enabled>
<TabOrder>28</TabOrder>
<Group>1</Group>
<StartID>604</StartID>
<EndID>635</EndID>
</Control>
<Control>
<Type>5</Type>
<ID>632</ID>
<Visible>0</Visible>
<Enabled>0</Enabled>
<TabOrder>29</TabOrder>
<Group>1</Group>
<StartID>604</StartID>
<EndID>635</EndID>
</Control>
<Control>
<Type>5</Type>
<ID>633</ID>
<Visible>0</Visible>
<Enabled>0</Enabled>
<TabOrder>30</TabOrder>
<Group>1</Group>
<StartID>604</StartID>
<EndID>635</EndID>
</Control>
<Control>
<Type>5</Type>
<ID>634</ID>
<Visible>0</Visible>
<Enabled>0</Enabled>
<TabOrder>31</TabOrder>
<Group>1</Group>
<StartID>604</StartID>
<EndID>635</EndID>
</Control>
<Control>
<Type>5</Type>
<ID>635</ID>
<Visible>0</Visible>
<Enabled>0</Enabled>
<TabOrder>32</TabOrder>
<Group>1</Group>
<StartID>604</StartID>
<EndID>635</EndID>
</Control>
</Controls>
<Languages>
<SUF70Messages>
<Language>
<Name>English</Name>
<Default>1</Default>
<Primary>9</Primary>
<Secondary>
<ID>1</ID>
<ID>2</ID>
<ID>3</ID>
<ID>4</ID>
<ID>5</ID>
<ID>6</ID>
<ID>7</ID>
<ID>8</ID>
<ID>9</ID>
<ID>10</ID>
<ID>11</ID>
<ID>12</ID>
<ID>13</ID>
</Secondary>
</Language>
<Messages>
<IDS_WINDOW_TITLE>%ProductName% Setup</IDS_WINDOW_TITLE>
<IDS_HEADER_TEXT>Install Type</IDS_HEADER_TEXT>
<IDS_SUBHEADER_TEXT>Select an install type and click Next to continue.</IDS_SUBHEADER_TEXT>
<IDS_CTRL_BUTTON_NEXT>&Next ></IDS_CTRL_BUTTON_NEXT>
<IDS_CTRL_BUTTON_BACK>< &Back</IDS_CTRL_BUTTON_BACK>
<IDS_CTRL_BUTTON_CANCEL>&Cancel</IDS_CTRL_BUTTON_CANCEL>
<IDS_CTRL_BUTTON_HELP>&Help</IDS_CTRL_BUTTON_HELP>
<IDS_CTRL_STATICTEXT_TOPINSTRUCTIONS>Please select one of the following install types: </IDS_CTRL_STATICTEXT_TOPINSTRUCTIONS>
<IDS_CTRL_STATICTEXT_BOTTOMINSTRUCTIONS/>
<IDS_CTRL_RADIO_BUTTON_01>Minimum - install only the required files</IDS_CTRL_RADIO_BUTTON_01>
<IDS_CTRL_RADIO_BUTTON_02>Full - install everything</IDS_CTRL_RADIO_BUTTON_02>
</Messages>
</SUF70Messages>
</Languages>
</Screen>
</SUF7_CB_SCREENS>
Here's an example that just uses checkboxes (not necessarily for the packages screen) but it should give you an idea what to do.
result1 = DlgCheckBox.GetProperties(CTRL_CHECK_BOX_01);
result2 = DlgCheckBox.GetProperties(CTRL_CHECK_BOX_02);
if e_CtrlID == 1300 then
if result1.Checked then
DlgCheckBox.SetProperties(CTRL_CHECK_BOX_02, {Checked=false});
else
DlgCheckBox.SetProperties(CTRL_CHECK_BOX_02, {Checked=true});
end
elseif e_CtrlID == 1301 then
if result2.Checked then
DlgCheckBox.SetProperties(CTRL_CHECK_BOX_01, {Checked=false});
else
DlgCheckBox.SetProperties(CTRL_CHECK_BOX_01, {Checked=true});
end
end
I hope this helps.
Edit: Ahh Lorne you beat me to it, and yours is more relevant. :)
Sergio_S
08-23-2006, 12:44 AM
Thank you guys!
Your examples were very useful. I think I can do it now.
Another idea that comes to me is to use the button screen and perform the set package action according the pressed button. Dont you think it is a good way too?
Lorne
08-23-2006, 10:17 AM
Yeah, that would work too. Although the radio buttons would make it readily apparent that only one choice is in effect at a time.
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.