locked
Bug using CheckBox Dialog to impose an install condition on a merge module RRS feed

  • Question

  • User-1698788709 posted

    Hello,  I am attempting to create a Web Setup MSI to wrap two merge modules. I want to add a CheckBox dialog such that if the user selects checkbox 1 and not checkbox 2, only merge module 1 and associated components will be installed (vice versa for checkbox 2 and merge module 2, or both boxes selected should install all components of both msm's). One caveat is that the merge modules do not define the target machine file system. The MSI must define the file system using merge module retargetable properties. I have successfully gotten the MSI to INSTALL based on checkbox conditions, but the configuration results in a fatal error during uninstall as it tries to uninstall all components regardless if they were selected by the install condition.

    Here is the scenario I followed to repro this uninstall bug: "Could not access network location \New Folder #1"

    Please let me know if you can see what I'm doing wrong or have any suggestions. Thanks in advance -

    1. Create a new Web Setup project "WebSetup1"
    2. Add two Merge Module projects to the solution, MergeModule1, MergeModule2
    3. Add File1.txt to MergeModule1
    4. Add File2.txt to MergeModule2
    5. (File1 and File2 should automatically be assigned to "Module Retargetable Folder" in each respective msm - this is good)
    6. Add the Project Output of MergeModule1 to the WebSetup1 project
    7. Add the Project Output of MergeModule2 to the WebSetup1 project
    8. (compile both MergeModule projects so the retargetable properties will appear in the WebSetup1 project)
    9. Open the WebSetup1 User Interface view and add the "Checkboxes (A)" dialog to the Install\Start sequence. Move the Checkboxes dialog between Welcome and Installation Address.
    10. Open the WebSetup1 File System view
    11. Add a new Custom Folder called "Custom Folder #1"
    12. Add a new Custom Folder underneath Custom Folder #1 called "New Folder #1"
    13. Add a new Custom Folder called "Custom Folder #2"
    14. Add a new Custom Folder underneath Custom Folder #2 called "New Folder #2"
    15. From the WebSetup1 Properties, set the Module Retargetable Folder property of MergeModule1 to "New Folder #1"
    16. From the WebSetup1 Properties, set the Module Retargetable Folder property of MergeModule2 to "New Folder #2"
    17. (File1.txt from MergeModule1 should now get installed in NewFolder#1, and File2.txt from MergeModule2 should now be installed to NewFolder#2)
    18. ---------From here on is the questionable part- how does one define the checkbox conditions properly? Setting checkbox conditions on CustomFolder#1/2 or NewFolder#1/2 from the WebSetup1 File System has absolutley no affect on the installation. The only way i found is to...
    19. Go to the MergeModule1 project and the File1.txt properties. Set the Condition to CHECKBOXA1=1
    20. Go to the MergeModule2 project and the File2.txt properties. Set the Condition to CHECKBOXA2=1

    This results in the proper behaviour during install time, but a Fatal Error during uninstall. The MSI tries to uninstall the mergemodule components regardless if they are selected during install via one of the checkboxes. Running the installer and selecting only 1 of the checkboxes, and then attempting to uninstall will result in the following error:

    "Could not access network location \New Folder #1"

    So the question is, am I doing this right and this is a bug in Studio or Windows Installer? Is there another way to impose the checkbox conditions on the merge module components without resulting in a fatal error during uninstall?

    NOTE: The application will be impossible to uninstall without editing the cached msi in C:\Windows\Installer using Orca or another msi editor and removing the erroneous row from the CustomAction table which causes the uninstall to attempt to delete the nonexistent component.

    Thursday, March 1, 2007 9:06 PM

All replies

  • User-1698788709 posted

    Some exceprts from the logfile..

    appears the CHECKBOXA# properties are being deleted when the uninstall begins. That isn't good since the conditions are based on them.

    MSI (s) (1C:1C) [12:11:18:230]: Doing action: CustomCheckA_SetProperty_CHECKBOX1
    Action ended 12:11:18: ValidateProductID. Return value 1.
    MSI (s) (1C:1C) [12:11:18:230]: PROPERTY CHANGE: Deleting CHECKBOXA1 property. Its current value is '1'.
    Action start 12:11:18: CustomCheckA_SetProperty_CHECKBOX1.
    MSI (s) (1C:1C) [12:11:18:230]: Doing action: CustomCheckA_SetProperty_CHECKBOX2
    Action ended 12:11:18: CustomCheckA_SetProperty_CHECKBOX1. Return value 1.
    MSI (s) (1C:1C) [12:11:18:230]: PROPERTY CHANGE: Deleting CHECKBOXA2 property. Its current value is '1'.
    Action start 12:11:18: CustomCheckA_SetProperty_CHECKBOX2.
    MSI (s) (1C:1C) [12:11:18:230]: Doing action: CustomCheckA_SetProperty_CHECKBOX3
    Action ended 12:11:18: CustomCheckA_SetProperty_CHECKBOX2. Return value 1.
    MSI (s) (1C:1C) [12:11:18:230]: PROPERTY CHANGE: Deleting CHECKBOXA3 property. Its current value is '1'.
    Action start 12:11:18: CustomCheckA_SetProperty_CHECKBOX3.
    MSI (s) (1C:1C) [12:11:18:230]: Doing action: CustomCheckA_SetProperty_CHECKBOX4
    Action ended 12:11:18: CustomCheckA_SetProperty_CHECKBOX3. Return value 1.
    MSI (s) (1C:1C) [12:11:18:230]: PROPERTY CHANGE: Deleting CHECKBOXA4 property. Its current value is '1'.
    Action start 12:11:18: CustomCheckA_SetProperty_CHECKBOX4.
    MSI (s) (1C:1C) [12:11:18:230]: Doing action: WEBCA_TARGETVDIR
    Action ended 12:11:18: CustomCheckA_SetProperty_CHECKBOX4. Return value 1.

    it should "just work" if msiexec was smart enough to reevaluate NEWRETARGETABLEPROPERTY1 for BOTH merge modules. There is a missing action where it should reevaluate the property for the other merge module, like the bolded line:

    MSI (s) (1C:1C) [12:11:18:246]: PROPERTY CHANGE: Adding NEWRETARGETABLEPROPERTY1.E46E3E8310E74365B35A6231809997DB property. Its value is '\New Folder #1'.
    Action start 12:11:18: DIRCA_NEWRETARGETABLEPROPERTY1.E46E3E8310E74365B35A6231809997DB.
    MSI (s) (1C:1C) [12:11:18:246]: Doing action: DIRCA_NEWRETARGETABLEPROPERTY1.914B1368423F45B1ACCD59865A01DD80
    Action ended 12:11:18: DIRCA_NEWRETARGETABLEPROPERTY1.E46E3E8310E74365B35A6231809997DB. Return value 1.
    MSI (s) (1C:1C) [12:11:18:246]: PROPERTY CHANGE: Adding NEWRETARGETABLEPROPERTY1.914B1368423F45B1ACCD59865A01DD80 property. Its value is '\New Folder #2'.
    Action start 12:11:18: DIRCA_NEWRETARGETABLEPROPERTY1.914B1368423F45B1ACCD59865A01DD80.

    .

    .

    .

    MSI (s) (1C:1C) [12:11:18:262]: PROPERTY CHANGE: Adding TARGETDIR property. Its value is 'C:\inetpub\wwwroot\WebSetup1'.
    MSI (s) (1C:1C) [12:11:18:262]: PROPERTY CHANGE: Adding _2BD001CD248A4F849B03A7F6E43A6351 property. Its value is 'C:\inetpub\wwwroot\WebSetup1\bin'.
    MSI (s) (1C:1C) [12:11:18:262]: PROPERTY CHANGE: Modifying NEWRETARGETABLEPROPERTY1.914B1368423F45B1ACCD59865A01DD80 property. Its current value is '\New Folder #2'. Its new value: 'C:\inetpub\wwwroot\WebSetup1\New Folder #2'.
    MSI (s) (1C:1C) [12:11:18:262]: Note: 1: 2262 2: Condition 3: -2147287038
    MSI (s) (1C:1C) [12:11:18:262]: PROPERTY CHANGE: Modifying TARGETDIR property. Its current value is 'C:\inetpub\wwwroot\WebSetup1'. Its new value: 'C:\inetpub\wwwroot\WebSetup1\'.
    MSI (s) (1C:1C) [12:11:18:262]: PROPERTY CHANGE: Modifying NEWRETARGETABLEPROPERTY1.914B1368423F45B1ACCD59865A01DD80 property. Its current value is 'C:\inetpub\wwwroot\WebSetup1\New Folder #2'. Its new value: 'C:\inetpub\wwwroot\WebSetup1\New Folder #2\'.
    MSI (s) (1C:1C) [12:11:18:262]: Note: 1: 1314 2: \New Folder #1
    MSI (s) (1C:1C) [12:11:18:262]: Note: 1: 1606 2: \New Folder #1
    MSI (s) (1C:1C) [12:11:18:262]: Note: 1: 2262 2: Error 3: -2147287038
    Action start 12:11:18: CostFinalize.
    MSI (s) (1C:1C) [12:11:20:000]: Note: 1: 2262 2: Error 3: -2147287038
    MSI (s) (1C:1C) [12:11:20:000]: Product: WebSetup1 -- Error 1606. Could not access network location \New Folder #1.

    MSI (s) (1C:1C) [12:11:20:016]: Note: 1: 1606 2: \New Folder #1
    MSI (s) (1C:1C) [12:11:20:016]: Note: 1: 2262 2: Error 3: -2147287038
    MSI (c) (50:34) [12:11:18:277]: Font created.  Charset: Req=0, Ret=0, Font: Req=MS Shell Dlg, Ret=MS Shell Dlg

    Error 1606. Could not access network location \New Folder #1.
    MSI (s) (1C:1C) [12:11:20:596]: Note: 1: 2262 2: Error 3: -2147287038
    MSI (s) (1C:1C) [12:11:20:596]: Product: WebSetup1 -- Error 1606. Could not access network location \New Folder #1.

    MSI (c) (50:34) [12:11:20:016]: Font created.  Charset: Req=0, Ret=0, Font: Req=MS Shell Dlg, Ret=MS Shell Dlg

    Error 1606. Could not access network location \New Folder #1.

     

    Saturday, March 3, 2007 1:07 PM
  • User-1698788709 posted

    After reviewing the log files, it is obvious that there is an uninstall sequence bug.  The [TARGETDIR] property is not assigned until AFTER the CustomAction table sequences are executed.

    This precludes any actions in the CustomAction table from having a "Target" that uses the [TARGETDIR] property (without the Property value getting re-evaluated after TARGETDIR is applied..but because the property for my non-installed merge module component is not getting re-evaluated (for whatever reason, maybe another bug), it must be evaluated correctly the first time).

    In order for these properties to evaluate correctly the first time, I must change the "DefaultLocation" value within Studio for "Custom Folder #1" to be something other than [TARGETDIR], which is the default value Studio provides. Looking at the log, [TARGETVDIR] is defined by the WEBCA_TARGETVDIR custom action in the CustomAction table. Luckily this action is before the DIRCA_RETARGETABLE actions, so I can safely change "DefaultLocation" to C:\Inetpub\wwwroot\[TARGETVDIR] to workaround these bugs.

    Saturday, March 3, 2007 1:38 PM
  • User-1167591364 posted

    Hi,

     Can i ask you how you managed to set the condition of selective checkbox installation ,, because i have done exactly the same as you mentioned ,, and still couldnt let the installer exclude merge module 1 if checkbox 1 not selected?

    Do u have any idea?

    Tuesday, September 4, 2007 11:45 AM