As one of our default components, we add the installdir to the path and create a registry key for it. This component is not part of a group. It is included in the primary project componentList.

When I uninstall, I find that the path retains the installdir and the registry key is left behind. Do I have to manually create an uninstall that takes care of these? I haven’t looked into the uninstaller that much, but I assumed that the default would handle this. Was I wrong?

Component:

<component>
    <name>foo</name>
    <description>foo component</description>
    <canBeEdited>1</canBeEdited>
    <selected>1</selected>
    <show>0</show>
    <folderList>
        <folder>
            <description>foo component files</description>
            <destination>${installdir}</destination>
            <name>foo_files</name>
            <platforms>all</platforms>
            <actionList>
                <registrySet>
                    <key>HKEY_LOCAL_MACHINE\\SOFTWARE\\${project.shortname}\\${project.fullname} ${project.version}</key>
                    <name>install_dir</name>
                    <type>REG_SZ</type>
                    <value>${installdir}</value>
                </registrySet>
                <addDirectoryToPath>
                    <path>${installdir}/bin</path>
                </addDirectoryToPath>
            </actionList>
            <distributionFileList>
                <distributionDirectory allowWildcards="1">
                    <origin>${staging}/foo/*</origin>
                </distributionDirectory>
            </distributionFileList>
        </folder>
    </folderList>
</component>

asked 01 Feb '12, 12:44

DevHopeful_2012's gravatar image

DevHopeful_2012
176131521
accept rate: 9%


I will paraphrase here, to avoid plaguarizing Bitrock Support. Bitrock intends on adding a setting that will allow you to define if a path and/or registry key will be uninstalled by the automagically created uninstaller.

Until then, the following was added to the preUninstallationActionList to handle this:

<preUninstallationActionList>
   <registryDelete>
      <key>HKEY_LOCAL_MACHINE\\SOFTWARE\\${project.shortname}\\${project.fullname} ${project.version}</key>
   </registryDelete>
   <removeDirectoryFromPath>
      <path>${installdir}/bin</path>
   </removeDirectoryFromPath>
</preUninstallationActionList>

They were also kind enough to update the "Uninstaller" section of their docs. I wanted to pass along this useful information to the forum community. Tested and verified the code above. Issue resolved.

link

answered 01 Feb '12, 15:39

DevHopeful_2012's gravatar image

DevHopeful_2012
176131521
accept rate: 9%

Note that the <registrydelete> is removing the whole key directory

(01 Feb '12, 15:41) DevHopeful_2012
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×83
×54
×28
×27
×13
×11

Asked: 01 Feb '12, 12:44

Seen: 2,237 times

Last updated: 01 Feb '12, 15:41