Creating New Wix Project In Visual Studio 2017 throws an error - wix

I have installed Visual Studio 2017 Community Edition. Installed it without any specific things selected like C++ development or Windows development etc. After that I have installed Wix through wixtoolset, which downloaded and installed wix tool set components. After that I have installed the Wix ToolSet extension for Visual Studio 2017. Restarted the Visual Studio and trying to create a new project through File -> New -> Project - WiX Toolset -> Setup Project.
It gives the error and does not let me create the project. I am totally new to WiX and have just a little knowledge about Visual Studio.

Initially, I did not select any of the Installation workloads for VS17 and installed it just to make the installation faster.
Through the comments from Azaz, I came to know that NuGet Package Manager is required to install the packages on demand. But since I could not see the NuGet option at all, I tried to install it with Extensions and updates but it did not work. I did a bit of research and found that at least one .Net development workload is required at a time of VS17 installation which will make the NuGet install automatically in VS17.
So I uninstalled the VS17, WiX at all and removed them from the system. Then Installed VS17 with certain workload packages as shown in the below screenshot.
After that I installed WiX and an extension for the same in VS17. i.e. Votive2017.vsix.
I restart the VS17 and now I am able to create project for WiX.
Looks like there is something I missed somewhere in installing which did not let me install required DLLs and GUID feature, which were important for creating project templates.

Sharing the steps I followed in order to fix the same issue that I found with Visual Studio 2019, as I also installed it without any workload. I was also looking at a reduced installation.
The steps I did in order to fix the template error, install the following individual components:
.NET 5.0 Runtime
.Net Core 3.1 Runtime
.NET SDK
C# and Visual Baisc Roslyn compilers
ClickOnce Publishing
Microsoft Visual Studio Installer Projects
Hope it helps someone else. I have to point out that the comments before helped me understand the issue. But, for example, I couldn't even open the NuGet command line.

Related

Wix Installer won't build on buildserver

I have tried to build a Wix MSI using our build server. I have set the build configuration in the Configuration manager to DEBUG/x86. All the other projects build correctly EXCEPT for the Wix Installer.
Initially there was an error requesting the latest version of WIX was installed on the build server "The WiX Toolset v3.11 (or newer) build tools must be installed to build this project. To download the WiX Toolset, see http://wixtoolset.org/releases/" so I follwed this -
https://subscription.packtpub.com/book/web_development/9781784393212/1/ch01lvl1sec12/compiling-a-wix-installer-on-a-build-machine-using-msbuild
also have used this -
https://wixtoolset.org/documentation/manual/v3/msbuild/wix_with_team_build.html
Now the build freezes on the Wix project and eventually times oout at 59 minutes. What would be wrong? what needs correctling?
I have tried these suggestions already - https://subscription.packtpub.com/book/web_development/9781784393212/1/ch01lvl1sec12/compiling-a-wix-installer-on-a-build-machine-using-msbuild
also have used this -
https://wixtoolset.org/documentation/manual/v3/msbuild/wix_with_team_build.html
Expecting it to build, then I can create an MSI file.
.NET 3.5: This might very well be something else, but maybe try to install the .NET Framework 3.5. WiX 3.x has a build-dependency requiring this .NET version.
How-To: Please see this answer for more details: WiX Toolset: Creating a simple WiX project breaks in VS2017: The "CreateProjectReferenceDefineConstants" task was not found

VS2017 Bootstrapper: Engine/setup.bin missing

I have moved to a new machine and upgraded with this MSVC 2015 to MSVC2017. Now I wanted to build a new (WiX) installer for our project. But I don't find current Bootstrapper location.
C:\Program Files (x86)\Microsoft SDKs\ClickOnce Bootstrapper does not include Engine/setup.bin, which WiX will have.
Windows 10 SDK (10.0.16299) is installed.
Any idea which software I have to install to obtain required setup.bin? (Searched my whole PC for a setup.bin, but not a single setup.bin exists, so it's not just on a "wrong" oath)
OK, not sure why you refer to ClickOnce and WiX together - I am not aware of any connections here - they are different technologies - but maybe there are connections I am not aware of (something relating to AppX maybe).
The file you refer to: setup.bin is installed via two MSI files on my system:
Microsoft.ClickOnce.BootStrapper.Msi.msi (installed from source at C:\ProgramData\Microsoft\VisualStudio\Packages\Microsoft.ClickOnce.BootStrapper.Msi,version=15.0.27005.2)
Microsoft.ClickOnce.SignTool.Msi.msi (installed from source at C:\ProgramData\Microsoft\VisualStudio\Packages\Microsoft.ClickOnce.SignTool.Msi,version=15.0.27005.2)
Did you go to Tools => Get Tools and Features => Individual Components and select "ClickOnce Publishing"? I would try that first. There is no clear match between the actual MSI names and these "Individual Components" that I can see.
I believe "Microsoft Visual Studio 2017 Installer Projects", "WiX Toolset Visual Studio 2017 Extensions" and "IsWiX" (front end for WiX) can be installed from the Tools => Extension and Updates. Or you can install the WiX 2017 extension from here.
You also obviously need to install the WiX toolkit itself to be able to make WiX installers. Here is the download location: http://wixtoolset.org/releases/ (and a WiX quick start suggestion answer).

Sample application for WiX bootstrapper for beginners

I'm very new to WiX based applications, and I need to create an MSI file where it has to check for .NET Framework 4.0 and SQL Server 2008. If they are not installed, I have to get them installed first and then have to install my application's EXE file and one more VBScript agent. It must be done like when you install WiX 3.7 setup (if we double click the setup file, it will show a UI as shown below!
Where do I start? Is there any step-by-step guide to develop this kind of application?
You'll need the following projects. They can be created from project templates in Visual Studio. Each of them would probably have separate tutorials that you might find with a Web search.
A WiX Setup project to build an .msi. The source files for such a project declare a WiX/Product. It could have conditions that check for .Net Framework4.0 and SQL Server 2008. If a check fails, installation of the .msi will fail, which is all that can be done in an .msi. The project would include your application .exe as a Component.
A WiX Bootstrapper project to build an .exe. The source files for such a project declare a WiX/Bundle. In the bundle is a Chain of installers, which would include .Net Framework4.0, SQL Server 2008, your .msi, and your VBScript Agent.
A WPF Library project to provide a BootstrapperApplication implementation with a custom UI for the bootstrapper project.
Your best bet is to consult the documentation, the WiX source code and various tutorials. Keep in the mind that tutorials might be out-of-date--in most cases WiX has gotten simpler with each version.

VS2012 and Wix 3.6 - Installing .Net 4.5 with my application

I am very new to the installer world.
I have successfully made an .msi for my application and it is building with short-cuts and also uninstalls correctly.
My next goal is to package .Net 4.5 with the installer and have it be installed prior to the installation of my application.
I also have a third party application that needs to be installed. It is packaged as an msi.
From what I can gather I need to develop a Bootstraper solution to have these applications install in sequence.
Can anyone provide a guide as to how to implement an installer in such a way? My searches have come up with a bunch of partial implementations with an assumption of the design of a Wix Bootstrapper Project in Visual Studio.
I hope this helps someone. It took me 5 hours to figure it out. Maybe, my bad, but did not find anything about it in the docs or blogs.
So my scenario is: VS 2012, WIX 3.6 with Burn bootsrapper, create a Setup executable in order to check .NET Framework 4.5 and install it by downloading if not installed already. Sounds simple. And it is. Actually very.
Create your MSI installer project (WIX Setup Project), to produce an installer for your application.
Create a WIX Bootstrapper Project for your Setup executable.
Follow the instructions here, to create your Boundle.wxs
Add a reference to the WixNetFxExtension.dll which can be found in the WIX program directory.
Include the following line in your Chain:
<PackageGroupRef Id="NetFx45Redist"/>
Actually the WixNetFx extension contains a working install package definition for the .NET Framework 4.5.
As caveman_dick mentioned, Burn in WiX 3.6 supports this but you may also want to take a look at dotNetInstaller (http://dblock.github.com/dotnetinstaller/). We use it to install .NET 4.0 but I'm sure it works for installing 4.5 as well. It can also install other MSI dependencies very easily.

Installing WiX 3.5 alongside WiX 3.0

Is it possible to install both WiX 3.0 and 3.5? If I install 3.5 after installing 3.0, it removes the 3.0 files - and if I attempt to install 3.0 after 3.5, it tells me there is a newer version already installed.
I'm in the process of migrating from VS 2008 to VS 2010, so one version (branch) of my application is is using VS 2008 (existing production version), and another one is in VS 2010 (future version). WiX 3.5 is required for VS2010.
What this means is on my build server, at the moment, I cannot build both the current version and the new version, as one will report an error about not finding WiX files:
c:\buildAgent\work\fe55ddb47cebe4fd\MyApp.wixproj(25, 11): error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\WiX\v3.0\Wix.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
I'd prefer not to upgrade the current version of my product to WiX 3.5 as 3.5 is still in beta, and as is I had to cherry pick a weekly build to get it to work at all (I'm just hoping by the time my next version is ready, that WiX 3.5 will be stable).
Is there a way to install both side-by-side? Do I just need to copy the 3.0 files into the Msbuild directory?
I ended up:
Installing WiX 3.5.1916 with the .MSI package (later versions failed in strange ways which I didn't put much effort into figuring out)
Copying the following files to the build server:
%programfiles%\Windows Installer XML v3**
HKLM\SOFTWARE\Microsoft\Windows Installer XML\3.0
(SOFTWARE\Wow6432Node\ for x64 systems)
%programfiles%\MSBuild\Microsoft\WiX\v3.0**
It builds successfully now, I haven't done much testing with the resulting files though. So it seems it is possible to have 3.0 and 3.5 concurrently, it's just a minor pain to make it work.
The way wix is currently designed you can't have 3.0 and 3.5 both installed on the same machine. They do provide a zip version of wix that enables you to let your build automation self deploy wix onto the build server to get around this limitation. You do lose certain things like visual studio integration though.