Remembering selected Features in upgrade

Got a problem you cannot solve? Try here.
matthewj
Posts: 66
Joined: Tue Dec 07, 2004 12:48 pm

Remembering selected Features in upgrade

Postby matthewj » Tue Dec 21, 2004 8:18 am

Is there a way to have the installer remember the previous feature selection in upgrade/update mode? At the moment it does an uninstall, and then starts afresh. Can the script be changed to do this?

Thanks,

Matthew

sinan
Site Admin
Posts: 1020
Joined: Sat Nov 13, 2004 8:12 am
Contact:

Postby sinan » Tue Dec 21, 2004 10:22 am

Yes, this can be done with custom scripting.

For instance, you could use the Write to Text File command and save your selection information to a plain text file. Then you could use the Read from Text File command and obtain feature selection information during an upgrade.

matthewj
Posts: 66
Joined: Tue Dec 07, 2004 12:48 pm

Postby matthewj » Thu Dec 23, 2004 9:07 am

I think I'm going to need more help on this one. Looking at the script, I've defined 4 components. The install part uses the Get Component State function to put the selection into SELECTED. But the dialog that shows the selector has an object action to put the result into COMPONENTS, which isn't listed in the pre-defined variables.

It therefore seems that I cannot just store the contents of the components string and save that in the registry, but I must instead do some additional code to save each component seperately, and then later use the SetComponentState to restore them. Is this the case?

I presume that I can restore the state at any point in the script to have it work okay? Or are they initialised only at the "define components" section?

Thanks, Matthew

sinan
Site Admin
Posts: 1020
Joined: Sat Nov 13, 2004 8:12 am
Contact:

Postby sinan » Fri Dec 24, 2004 11:14 am

Yes - that is precisely the case. You need to read the selection state for the individual components using Get Component State, and later set them individually using the Set Component State.

If you are planning on using the registry for storing component states, do the following:

1) Move the code that defines your components all the way to the top of the script

2) Before "Apply Install", add the registry commands to save your feature selection information

3) Before "Install/Remove MSI Package", add the registry commands to read your feature selection information (if you add them after here, they will already have been removed)

Hope this is useful :)

matthewj
Posts: 66
Joined: Tue Dec 07, 2004 12:48 pm

Postby matthewj » Mon Dec 27, 2004 6:19 am

Many thanks - I will go experiment with that.

matthewj
Posts: 66
Joined: Tue Dec 07, 2004 12:48 pm

Postby matthewj » Wed Dec 29, 2004 6:26 am

Okay, for anyone else who is interested, the following works fine. I preserved the state of the "install type" variables too, since it makes sense. You can just copy/paste these lines into the script and it will look a lot nicer! You may want to modify the YourCompany and YourProduct with a search and replace first.

Right at the top (moved from lower in standard script)

Code: Select all

~InstallAWARE Clipboard Data~
~Define Component~
~{E4695060-EB59-426C-80F6-D1A0A22F5409}~
~Full manuals (PDF)~
~TRUE~
~Reference Manual, User's Guide and Introduction in PDF format~
~Define Component~
~{15DD84A8-0BAD-4B07-98B2-2B582ACC7853}~
~Sample models~
~TRUE~
~Sample models~
~Define Component~
~{A2D52C62-1C8C-431C-B9E1-73026317AB08}~
~Help and tutorials~
~TRUE~
~Help and tutorials~
~Define Component~
~{20122FD3-B078-4AF2-AC31-ABFB74DF79E7}~
~Main application~
~TRUE~
~Main application files - required~
~Comment~
~{8BE18D7D-1203-4E92-8025-E050E49431A5}~
~Define Setup Components~


Before Install/Remove MSI package

Code: Select all

~InstallAWARE Clipboard Data~
~Read Registry~
~{FAD357F9-A57A-42EE-834B-1E08332238FD}~
~PERSONALIZED~
~1~
~Software\\YourCompany\\Installer\\YourProduct~
~Personalized~
~Read Registry~
~{F5754A36-A0B3-4472-B068-E8726DC7452C}~
~MINIMUM~
~1~
~Software\\YourCompany\\Installer\\YourProduct~
~Minimum~
~Read Registry~
~{52C461A5-55C6-48A3-B591-E00736E5F578}~
~COMPLETE~
~1~
~Software\\YourCompany\\Installer\\YourProduct~
~Complete~
~End~
~{F753F422-CC44-4F4D-A630-C2F96E8FCF61}~
~Set Component State~
~{DCC68235-B80D-42F9-9020-C557C53BE74D}~
~Full manuals (PDF)~
~FALSE~
~If~
~{48BE5E13-8F80-4142-9E4D-314A94FE844B}~
~BX_COMPONENTSTATE~
~0~
~FALSE~
~FALSE~
~Read Registry~
~{6C532DA6-FD67-422C-859D-845FC3391C11}~
~BX_COMPONENTSTATE~
~1~
~Software\\YourCompany\\Installer\\YourProduct~
~PDFs~
~End~
~{30000859-F00B-4489-956D-EEA30E9405D0}~
~Set Component State~
~{D786D78F-8FA3-492F-862D-1FDE6B9DAA4D}~
~Sample models~
~FALSE~
~If~
~{71361234-EB86-4957-A2C7-3EED4B873CBB}~
~BX_COMPONENTSTATE~
~0~
~FALSE~
~FALSE~
~Read Registry~
~{A2A77A51-57B7-43B8-8D46-4CA48E03A8D7}~
~BX_COMPONENTSTATE~
~1~
~Software\\YourCompany\\Installer\\YourProduct~
~Samples~
~End~
~{D0B3F99C-1A71-49DB-B52C-FCF23FC8D325}~
~Set Component State~
~{3CC2B6E6-BE09-4854-BB45-2C63F902E45A}~
~Help and tutorials~
~FALSE~
~If~
~{BEA8AB58-200F-4E1D-8398-5DB88F0D93CE}~
~BX_COMPONENTSTATE~
~0~
~FALSE~
~FALSE~
~Read Registry~
~{F4E5CAAF-61F5-4372-BCD2-813F42B1B0E8}~
~BX_COMPONENTSTATE~
~1~
~Software\\YourCompany\\Installer\\YourProduct~
~Help~
~End~
~{E0DE1E96-EAB8-4E14-BA73-377E5577F022}~
~Set Component State~
~{48220F35-979E-410B-8085-2246A6A0C5D8}~
~Main application~
~FALSE~
~If~
~{2C2CBFC0-2082-4B1A-A42A-1998CC06F87C}~
~BX_COMPONENTSTATE~
~0~
~FALSE~
~FALSE~
~Read Registry~
~{552D5D2C-E246-4030-8EC4-9E0F48E5C9A4}~
~BX_COMPONENTSTATE~
~1~
~Software\\YourCompany\\Installer\\YourProduct~
~MainApp~



Before Apply Install:

Code: Select all

~InstallAWARE Clipboard Data~
~Write Registry~
~{838B8C9C-9149-463D-AF1B-0966D0268FEF}~
~0~
~1~
~Software\\YourCompany\\Installer\\YourProduct~
~Personalized~
~$PERSONALIZED$~
~TRUE~
~FALSE~
~Write Registry~
~{14DCF537-E4A2-40D6-9ECC-05BDE2755296}~
~0~
~1~
~Software\\YourCompany\\Installer\\YourProduct~
~Minimum~
~$MINIMUM$~
~TRUE~
~FALSE~
~Write Registry~
~{FBD21428-BADC-4DCE-B18D-C2E7B885444A}~
~0~
~1~
~Software\\YourCompany\\Installer\\YourProduct~
~Complete~
~$COMPLETE$~
~TRUE~
~FALSE~
~Comment~
~{2FB3B4B1-18FC-42FF-99E8-1345421F619A}~
~~
~Write Registry~
~{58433BE3-7C61-4EF0-8DF0-D5173F867F0D}~
~0~
~1~
~Software\\YourCompany\\Installer\\YourProduct~
~PDFs~
~$BX_COMPONENTSTATE$~
~TRUE~
~FALSE~
~Get Component State~
~{67C44A30-503E-4DB7-A511-BDE3FB662502}~
~Full manuals (PDF)~
~BX_COMPONENTSTATE~
~Write Registry~
~{CFF54BB5-7314-4C65-B2E1-E601E9E4758F}~
~0~
~1~
~Software\\YourCompany\\Installer\\YourProduct~
~Samples~
~$BX_COMPONENTSTATE$~
~TRUE~
~FALSE~
~Get Component State~
~{CC031807-4995-4E1D-87B4-DE1F3C498462}~
~Sample models~
~BX_COMPONENTSTATE~
~Write Registry~
~{FE95E2DC-96B0-43CF-9718-121AD5ECA460}~
~0~
~1~
~Software\\YourCompany\\Installer\\YourProduct~
~Help~
~$BX_COMPONENTSTATE$~
~TRUE~
~FALSE~
~Get Component State~
~{1C0C4C8A-D862-4990-A599-A98806D6C5F6}~
~Help and tutorials~
~BX_COMPONENTSTATE~
~Write Registry~
~{FBE892BA-596F-4614-A231-9F4D9DE3C3D2}~
~0~
~1~
~Software\\YourCompany\\Installer\\YourProduct~
~MainApp~
~$BX_COMPONENTSTATE$~
~TRUE~
~FALSE~
~Get Component State~
~{5753BD40-C4F3-4B79-A18D-A3B5352FC4FD}~
~Main application~
~BX_COMPONENTSTATE~


Matthew Jones

sinan
Site Admin
Posts: 1020
Joined: Sat Nov 13, 2004 8:12 am
Contact:

Postby sinan » Wed Dec 29, 2004 10:53 am

Thanks - this is great :D

If you feel like it, send me an example project (a complete project) and I can post it up on the InstallAWARE server so others can download a complete sample project.

matthewj
Posts: 66
Joined: Tue Dec 07, 2004 12:48 pm

Postby matthewj » Wed Dec 29, 2004 11:53 am

To be honest, I don't think it is needed. By the time someone gets to this issue, they'll have a project and it will be easier to copy/paste these and adjust them than to do so from another project. Your instructions were easy, but I thought it would be worth passing on a tested set of lines that did the work.

Matthew


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 50 guests