1
votes

I'm trying to create an installer that installs my DApp into ethereum client.

To do so I just have to copy my files into %appdata%\Parity\Ethereum\dapps\mydappname. So I have this markup which creates a folder in %appdata%\mydappname:

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
    <Product Id="*" Name="MyDapp" Language="1049" Version="1.0.0.0" 
             Manufacturer="Orbita" UpgradeCode="PUT-GUID-HERE" Codepage="1251">

      <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
      <MediaTemplate EmbedCab="yes"/>

        <Feature Id="ProductFeature" Title="MyDapp" Level="1">
            <ComponentGroupRef Id="ProductComponents" />
        </Feature>
    </Product>

    <Fragment>
        <Directory Id="TARGETDIR" Name="SourceDir">
          <Directory Id="AppDataFolder">
            <Directory Id="INSTALLFOLDER" Name="Fairs" />
          </Directory>
        </Directory>
    </Fragment>

    <Fragment>
        <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
          <Component Id="dapp" Guid="PUT-GUID-HERE">
            <RemoveFolder Id="INSTALLFOLDER" On="uninstall" />
            <RegistryValue Root="HKCU" Key="Software\[Manufacturer]\[ProductName]" 
                           Type="string" Value="" KeyPath="yes" />
            <File Id="chain.json" Source="..\..\..\..\config\chain.json"/>
          </Component>
        </ComponentGroup>
    </Fragment>
</Wix>

However, when I change structure to be nested:

  <Fragment>
    <Directory Id="TARGETDIR" Name="SourceDir">
      <Directory Id="AppDataFolder">
        <Directory Id="Parity" Name="Parity">
          <Directory Id="Ethereum" Name="Ethereum">
            <Directory Id="dapps" Name="dapps">
              <Directory Id="INSTALLFOLDER" Name="Fairs" />
            </Directory>
          </Directory>
        </Directory>
      </Directory>
    </Directory>
  </Fragment>

I get ICE64s:

ICE64: The directory Parity is in the user profile but is not listed in the RemoveFile table.
ICE64: The directory Ethereum is in the user profile but is not listed in the RemoveFile table.
ICE64: The directory dapps is in the user profile but is not listed in the RemoveFile table.

What's wrong with markup? I tried change RemoveDirectory to

<RemoveFolder Id="Parity" On="uninstall" />

But it doesn't work.

1

1 Answers

2
votes

Per-User vs Per-Machine: Installing to per-user folders (user profile) is generally not recommended for many reasons. Is installing to a per-machine path out of the question? Does your application need to run from a per-user folder?


ICE64: It looks like you have omitted the Directory attribute in your RemoveFolder element.

It is required in your case (since the Directory attribute defaults to the hosting components installation directory otherwise - which is incorrect in this case).


To resolve your validation error you should be able to do something like this:

Change this:

<RemoveFolder Id="Parity" On="uninstall" />

To this:

<RemoveFolder Id="Parity" Directory="Parity" On="uninstall" />

Do this for all folders that exist in the user profile.


Here is a larger WiX blurb:

<Component Feature="MyFeature" Guid="PUT-GUID-HERE">

    <RegistryValue Root="HKCU" Key="Software\[Manufacturer]\[ProductName]\Test"
                   Name="installed" Type="integer" Value="1" KeyPath="yes"/>

    <File Source="TestFile.txt" />

    <RemoveFolder Id="Parity" Directory="Parity" On="uninstall" />
    <RemoveFolder Id="Ethereum" Directory="Ethereum" On="uninstall" />
    <RemoveFolder Id="dapps" Directory="dapps" On="uninstall" />
    <RemoveFolder Id="INSTALLFOLDER" Directory="INSTALLFOLDER" On="uninstall" />

</Component>