HilaB
HilaB

Reputation: 179

Wix toolset doesn't install targets in all vs2017 IDEs

The company I work for uses wix toolset to create a msi, that should install our extension in Visual Studio. Everything was working fine until Visual Studio 2017. When there are a few IDEs of VS installed on the client's computer, for example Professional and Enterprise, our extension would be installed only in one of them. Does anyone know how to fix this issue? Is there a way to iterate VS2017's IDEs? EDIT: the code of the installation in VS2017 looks like this:

<Directory Id="VS2017_IDE_DIR">
  <Directory Id="VS2017_EXTENSIONS_DIR">
    <Directory Id="VS2017_MYCOMPANY_EX" Name="MYCOMPANY">
      <Directory Id="VS2017_AUTORUNNER_EX" Name="MYCOMPANY Extension">
        <Directory Id="VS2017_AUTORUNNER_EX_VERSION" Name="$(var.MajorAndMinorVersion)">
          <Component Id="VS2017_AUTORUNNER_EXTENSIONSHORTCUTS" Guid="">

            <Condition>VS2017DEVENV</Condition>
            <CreateFolder />
            <util:RestartResource Path="[VS2017DEVENV]"/>

            <RemoveFolder Id="REMOVE_VS_VERSION_VS2017" On="uninstall" Directory="VS2017_MYCOMPANY_EX" />
            <RemoveFolder Id="REMOVE_VS2017_EXTENSIONS" On="uninstall" Directory="VS2017_AUTORUNNER_EX" />
            <RemoveFolder Id="REMOVE_VS2017_MYCOMPANY_EX" On="uninstall" Directory="VS2017_AUTORUNNER_EX_VERSION" />

            <File Source="$(var.ManagedBinariesDir)VisualStudioExtension\extension.vsixmanifest" Name="extension.vsixmanifest"
                    Id="extension.vsixmanifest_VS2017" />
            <File Source="$(var.ManagedBinariesDir)VisualStudioExtension\MYCOMPANY.VSExtension.pkgdef"
                    Name="MYCOMPANY.VSExtension.pkgdef" Id="MYCOMPANY.AutoRunner.pkgdef_VS2017" />
          </Component>
        </Directory>
      </Directory>
    </Directory>
  </Directory>
</Directory>

As written above, this code installs the extension only in one IDE of VS 2017, and I want the extension to be installed in all VS 2017 IDEs.

Upvotes: 1

Views: 223

Answers (1)

David
David

Reputation: 36

Disclaimer: I work at Typemock - the unit testing company

We had the same issue with our Wix installer, here's what you need to do:

• create properties for each VS 2017 instance:

<Property Id="VS2017_INSTANCE_1" />

<Property Id="VS2017_INSTANCE_2" />

<Property Id="VS2017_INSTANCE_3" />

• assign values to them with the help of vswhere (a tool that locates all installed VS 2017 paths):

add a CustomAction that activates vswhere and assign the paths to the properties.

• create a piece of code like you wrote above for each one of these properties:

<Directory Id="VS2017_INSTANCE_1">

...

</Directory>

<Directory Id="VS2017_INSTANCE_2">

...

</Directory>

<Directory Id="VS2017_INSTANCE_3">

...

</Directory>

• Most important part: put the CustomAction before CostFinalize at the InstallUISequence

Upvotes: 1

Related Questions