Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Register add-ins, project templates and item templates for Visual Studio 11

Tags:

wix

wix3.5

wix3

I've been using Wix 3.5 with WixVSExtension to install project item templates for Visual Studio 2010, Visual C# 2010 Express and Visual Web Developer 2010 Express. I'd like now to add support for Visual Studio 11 Beta.

I added registry search and custom actions to find the VS11 installation folders but, when specifying directory and components structure, I'm getting compilation errors like this one:

error LGHT0204: ICE30: The target file 'ewa5nwrn.zip|BasicApplication.zip' is installed in '[TARGETDIR]\CSharp\' by two different components on an LFN system: 'VS2010CSharpProjectTemplates' and 'VS11CSharpProjectTemplates'. This breaks component reference counting.

I have this directory structure:

<Directory Id="TARGETDIR" Name="SourceDir">
  <Directory Id="VS2010_PROJECTTEMPLATES_DIR">
    <Directory Id="VS2010_PROJECTTEMPLATES_CSHARP_DIR" Name="CSharp">
    </Directory>
  </Directory>
  <Directory Id="VS11_PROJECTTEMPLATES_DIR">
    <Directory Id="VS11_PROJECTTEMPLATES_CSHARP_DIR" Name="CSharp">
    </Directory>
  </Directory>
</Directory>

Notice that I have VS2010_PROJECTTEMPLATES_DIR and VS11_PROJECTTEMPLATES_DIR inside TARGETDIR. The error message shows that they are ignored.

The components are defined as follow:

<DirectoryRef Id="VS2010_PROJECTTEMPLATES_CSHARP_DIR">
  <Component Id="VS2010CSharpProjectTemplates" Guid="{0976A222-8243-40F2-81AB-84D8F1771840}" Transitive="yes">
    <File Id="VS2010BasicApplication" Source="BasicApplication.zip" />
  </Component>
</DirectoryRef>

<DirectoryRef Id="VS11_PROJECTTEMPLATES_CSHARP_DIR">
  <Component Id="VS11CSharpProjectTemplates" Guid="{A70428F1-AE26-4B07-9F58-D67587B44657}" Transitive="yes">
    <File Id="VS11BasicApplication" Source="BasicApplication.zip" />
  </Component>
</DirectoryRef>

Is it possible to install the same file into two different directories specified by properties?

Thanks in advance, aalmada

like image 810
aalmada Avatar asked Apr 02 '12 14:04

aalmada


1 Answers

I don't have any source code to share but I can tell you in general how I've done this in the past.

We decided to "install" the zip files to our main application directory in a Integration folder so that the files would always be available even if VS2008 and/or VS2010 had not been installed at the time of installation. I then used a bunch of built-in properties that exist in the Util extension and a couple custom RegLocator searches to define a bunch of properties related to the location of devenv.exe and ItemTemplate, ProjectTemplates and other directories that we needed in .NET. I then used those properties in CopyFile elements so that MSI would duplicate those files in the Integration folder to the actual VS directories as needed and approriate. Finally I used the WiX QuietExec custom action to call Devenv /setup to register the content with VS. I also used the ProgressText element ( ActionText table ) to make the UI look good while this was all happening as VS devenv can take awhile.

like image 100
Christopher Painter Avatar answered Oct 19 '22 10:10

Christopher Painter