Reputation: 19
I am not a regular VS developer
I have a VS2010 project that creates a VSTO add-in for Outlook and uses the Click-Once install
Although this still works even with the latest Office 365, VS2010 is now getting long in the tooth and the Click Once method has created a few headaches over the years I would now like to create an MSI version of the installer
I have installed VS2019 Community along with WiX, I have converted a copy of my project to VS2019 and it still seems to run
I have read various web pages on creating WiX but they are either quite old or don't go into enough detail for me.
I guess what I am trying to do is slightly unusual in that I want to use the latest VS to create a VSTO addin MSI with .NET4 and VSTO2010
Whilst I have got the jist of what is required, the devil is in the detail and I'm sure it's not going to work unless I get versions/paths/reg entries/dependencies etc absolutely correct
My current click once installer has folders for DotNetFX40Client VSTOR40 WindowsInstaller3_1
Using the info here https://www.add-in-express.com/creating-addins-blog/2012/11/13/wix-installation-vsto-office-addin/
I'm not quite sure exactly what XML entries to put in, how to get it to install if something is missing, I have also seen checks for Office2007 etc but I don't what to tie it to a specific office version. ie as now it still works in O365
Sorry for the rambling post but obviously the click once manifest have quite a lot of info in but i'm not quite sure how to get from there to a working msi installer
For Example having rebuilt the project in VS2019 both debug and release I don't have manifest files in those obj folder which it looks like the installer needs
For all it's faults the Click Once is just a few clicks in the studio and it sorts the rest out for you
Hopefully there is a dummies guide out there ... or even a guide for a dummy !
Thanks
Upvotes: -1
Views: 1936
Reputation: 11
VSTO 2010 is the latest version of the runtime. You could update your project to a newer version of .NET Framework though.
There is no need to include the full VSTO 2010 redistributable in your installer. In my experience, the add-ins run perfectly fine if you just include the runtime assemblies from your target folder in the installer package.
You state that you cannot find the manifest file in your obj-folder. However, upon successful compilation of your add-in you should find at least your add-in's dll, its vsto-file, its manifest and all referenced dlls in your target folder. You will need to include all those files in your installer. If you cannot find them, you are either searching in the wrong folder or an error occurred during compilation.
The team maintaining and developing the WiX toolset does an excellent job. However, the documentation of WiX has not kept up with the toolset. Also, many questions regarding the creation of a WiX install script are actually questions of the functionality of the windows installer itself and what you need it to do in your specific circumstances. That is why it can be quite tedious to come up with a working solution.
In the following I will give you an example of the structure of the install script I came up with. Please note, that there might be some typos as I didn't actually run this script. Apart from that it should be fine. I use this kind of script with the WiX toolset version 3.12 to install a PowerPoint add-in. Please, make sure that you reference the WixUiExtension and WixUtilExtension in your WiX-project. Should you like to use some additional functionality also reference the WixNetFXExtensions. Some advanced functionality will be only available if you create custom actions. For the sake of both simplicity and generalizability, I did not include them here.
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<?if $(var.Platform) = x64 ?>
<?define Win64 = "yes" ?>
<?define PlatformProgramFilesFolder = "ProgramFiles64Folder" ?>
<?else ?>
<?define Win64 = "no" ?>
<?define PlatformProgramFilesFolder = "ProgramFilesFolder" ?>
<?endif ?>
<?define YOUR_PROJECT_TargetDir=$(var.YOUR_PROJECT.TargetDir)?>
<Product Id="*" Name="YOUR_PRODUCT_NAME" Language="1033" Version="YOUR_VERSION_NUMBER" Manufacturer="YOUR_MANUFACTURER_NAME" UpgradeCode="6DC92DB3-AA62-4C13-95E0-45C06AADDB32">
<Package InstallerVersion="500" Compressed="yes" Platform="x64" InstallScope="perMachine"/>
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate EmbedCab="yes"/>
<Feature Id="ProductFeature" Title="YOUR_FEATURE_TITLE" Level="1">
<ComponentGroupRef Id="ProductComponents" />
<ComponentRef Id="RegistryEntries"/>
</Feature>
<Icon Id="ProductIcon" SourceFile="$(var.ProjectDir)NAME_OF_YOUR_PRODUCT_ICON.ico"/>
<Property Id="ARPPRODUCTICON" Value="ProductIcon"/>
<WixVariable Id="WixUIBannerBmp" Value="$(var.ProjectDir)NAME_OF_YOUR_BANNER.bmp"/>
<WixVariable Id="WixUIDialogBmp" Value="$(var.ProjectDir)NAME_OF_YOUR_BACKGROUND.bmp"/>
<UIRef Id="WixUI_Minimal" />
<PropertyRef Id="WIX_ACCOUNT_USERS" />
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="$(var.PlatformProgramFilesFolder)">
<Directory Id="MANUFACTURERFOLDER" Name="!(bind.property.Manufacturer)" >
<Directory Id="INSTALLFOLDER" Name="!(bind.property.ProductName)" />
</Directory>
</Directory>
</Directory>
</Fragment>
<Fragment>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<Component Id="NAME_OF_YOUR_DLL.dll" Guid="1E9A1682-0F62-4CDF-A0C9-6D86B6950E26">
<File Id="NAME_OF_YOUR_DLL.dll" Name="NAME_OF_YOUR_DLL.dll" Source="$(var.YOUR_PROJECT_TargetDir)NAME_OF_YOUR_DLL.dll" />
</Component>
<Component Id="NAME_OF_YOUR_MANIFEST.dll.manifest" Guid="736F51B1-5B1F-49DA-976E-33EE4C5C8AC0">
<File Id="NAME_OF_YOUR_MANIFEST.dll.manifest" Name="NAME_OF_YOUR_MANIFEST.dll.manifest" Source="$(var.YOUR_PROJECT_TargetDir)NAME_OF_YOUR_MANIFEST.dll.manifest" />
</Component>
<Component Id="NAME_OF_YOUR_VSTO_FILE.vsto" Guid="12D44F21-62A4-4B8E-B018-3B9B325512C1">
<File Id="NAME_OF_YOUR_VSTO_FILE.vsto" Name="NAME_OF_YOUR_VSTO_FILE.vsto" Source="$(var.YOUR_PROJECT_TargetDir)NAME_OF_YOUR_VSTO_FILE.vsto" />
</Component>
</ComponentGroup>
</Fragment>
<Fragment>
<DirectoryRef Id="TARGETDIR">
<Component Id="RegistryEntries" Guid="A495FAB3-8440-4357-83F7-D1F4EABAA06A" Win64="$(var.Win64)">
<RegistryKey Root="HKLM" Key="Software\Microsoft\Office\Outlook\AddIns\!(bind.property.ProductName)">
<RegistryValue Id="Description" Type="string" Name="Description" Value="!(bind.property.ProductName)" />
<RegistryValue Id="FriendlyName" Type="string" Name="FriendlyName" Value="!(bind.property.ProductName)" />
<RegistryValue Id="LoadBehavior" Type="integer" Name="LoadBehavior" Value="3"/>
<RegistryValue Id="Manifest" Type="string" Name="Manifest" Value="[#NAME_OF_YOUR_VSTO_FILE.vsto]|vstolocal" KeyPath="yes"/>
</RegistryKey>
</Component>
</DirectoryRef>
</Fragment>
</Wix>
Please, let me know if you have further questions.
Upvotes: 1