Can't uninstall an individual component if it is added later with allowAddRemoveComponents feature

Comments

1 comment

  • Avatar
    wojciechka

    I was not able to reproduce the issue. Instead of checking if file exists, I have simply implemented a page to reproduce:

    <booleanParameter>
      <name>allowtest</name>
      <description>Allow test component?</description>
      <default>1</default>
      <insertBefore>installdir</insertBefore>
      <postShowPageActionList>
        <setInstallerVariable>
          <name>project.component(test).selected</name>
          <value>${allowtest}</value>
        </setInstallerVariable>
        <setInstallerVariable>
          <name>project.component(test).show</name>
          <value>${allowtest}</value>
        </setInstallerVariable>
        <setInstallerVariable>
          <name>project.component(test).canBeEdited</name>
          <value>${allowtest}</value>
        </setInstallerVariable>
      </postShowPageActionList>
    </booleanParameter>
    

    Please note that as it is shown before installdir, it is also shown before component selection screen.

    I first installed it with allowtest set to 0, did not see or select the test component. Next I installed it with allowtest set to 1, manually selected the test component and the uninstaller showed test component properly.

    Can you try to make a minimal project that reproduces the issue and can be built by us without all the files your installer has? Please send it to support@bitrock.com so we can try to reproduce the issue.

    Also, you can try to add setting it as always visible in <postInstallationActionList>:

    <postInstallationActionList>
      <setInstallerVariable>
        <name>project.component(test).show</name>
        <value>1</value>
      </setInstallerVariable>
      <setInstallerVariable>
        <name>project.component(test).canBeEdited</name>
        <value>1</value>
      </setInstallerVariable>
    </postInstallationActionList>
    

    This could also resolve the issue.

    The reason is that if latest run of the installer sets show/canBeEdited to 0, then running the uninstaller causes the component not to be shown. Which in most cases is desired - i.e. to disallow uninstalling a mandatory component, however, in this case has to be set manually after the installation.

    Setting this to 1 does not break anything as when it is not installed, it will not be shown in uninstaller, also, the next installer will have those values set based on actions/rules run before component selection page - in my example the <setInstallerVariable> in <postShowPageActionList>, in your probably it is set in <preInstalllationActionList> or <initializationActionList> based on <fileTest> or similar rule.

Please sign in to leave a comment.