views:

98

answers:

1

When I'm uninstalling my product directory where custom action binary was placed stays. How can I delete it. Also strange named directory is created on installation - unistallation: "RSCustomActions.CA.dll-" and "RSCustomActions.CA.dll-0" (my binary name RSCustomActions.CA.dll)

My WIX code is

<Directory Id="TARGETDIR" Name="SourceDir">
        <Directory Id="ProgramFilesFolder">
          <Directory Id="Product.Id" Name="Product">
            <Directory Id="INSTALLLOCATION" Name="Product">
              <!-- TEST -->
              <Directory Id="Installer" Name="Installer">
                <Component Id="InstallerFiles"
                             Guid="{0904DB36-2496-419c-A992-B7D86F068F12}">
                  <File Id="RSCustomActions.CA.dll" Name="RSCustomActions.CA.dll" Source="Binaries\RSCustomActions.CA.dll" />                      
                </Component>
              </Directory>
              <!-- END TEST -->                  
              <?include "Product.Files.wxi" ?>                

            </Directory>
          </Directory>
        </Directory>
        <Directory Id="ProgramMenuFolder" Name="PMenu">
            <Directory Id="ProgramMenuDir" Name="Aspose">
                <?include "Product.ProgramMenu.wxi" ?>
            </Directory>
        </Directory>
        <Component Id="Main" Shared="yes" Guid="{EDD4477A-D188-469c-B8D0-4423377C03C6}" Feature="Main.InstallFeatures">
            <RemoveFolder Id="DeleteProgramMenuDir" Directory="ProgramMenuDir" On="uninstall" />
        </Component>
    </Directory>

"Product.Files.wxi" also contains

<Component Id="Product.Remove" Guid="{C6D9D74C-66E8-442a-8E53-78A8D0E2B24D}">
    <RemoveFolder Id="Product.RemoveFolder.Action" On="uninstall"/>
  </Component>  

Please suggest any way how can I remove Installer folder and those strage folders with binary name.

Thanks!

A: 

Why do you need installing the CA DLL as a file of the product? You can simply put it to Binary table and forget about it, like this:

  <!-- This is a reference to the DLL where all custom actions reside -->
  <Binary Id="CustomActions" SourceFile="$(var.Root)\CA\CustomActions.CA.dll" />

And the custom action definition is something like this:

  <!-- Sample CA definition  -->
  <CustomAction Id="MyAction" BinaryKey="CustomActions" DllEntry="MyActionMethod" />

Note that MyActionMethod should be defined in that CA assembly and marked appropriately. There's a good sample of this in dtf.chm in WiX distribution.

Hope this helps.

Yan Sklyarenko
Thanks, Yan. Your advice resolved my problem.
PavelM Aspose