Home > front end >  Visual Studio Installer single MSI creation
Visual Studio Installer single MSI creation

Time:10-30

I developed VSTO Excel Add-In and usually I do installers with Advanced Installer, but my current client insist on VS Installer, which is dreadful... I target x64 Office, and have .NET 4.8 prerequisite and VSTO 2010 Runtime prerequisite. So, the questions are:

  1. How do I create a single .MSI (without setup.exe bootstrap)
  2. Do I really need to search for presence of prerequisites?
  3. I have Launch condition:

enter image description here

But then, I also defined the following in Setup > Properties > Prerequisites:

enter image description here

So how do they co-exist together? It's been at least 10 years since I touched VS Installer, and it is still the same cryptic creature...

CodePudding user response:

  1. If you want prerequisites, you will have EXE. This is just how MS installer project works. To disable EXE, uncheck the top box in that dialog ("Create Setup program to install prerequisite components")

  2. It depends. NET Framework 4.8 is installed with Window 10 updates after 2019, VSTO Runtime is preinstalled with Office 2010 and later. Here is a Microsoft article regarding preinstalled .NET frameworks

  3. Launch condition applies to MSI itself (not EXE), so if you don't have prerequisites installed, MSI will refuse to install, telling the user where he should go to install the required prerequisite.

Other than that, maybe your client actually meant built-in Visual Studio packaging for VSTO (not Visual Studio installer extension), like when you right-click your project and use "Publish" you get a One-Click installer (not MSI)?

CodePudding user response:

How do I create a single .MSI (without setup.exe bootstrap)

Just turn off the prerequisites option to not generate the bootstrapper (see the Create setup program to install prerequisite components check box on the screenshot). Anyway, even if it is generated, you are free to continue using the MSI alone. The setup.exe file doesn't affect the MSI file in any way.

Do I really need to search for presence of prerequisites?

If you are sure that all target machines will have the required components like the required .net framework version, VSTO runtime and other components required for your solution the bootstrapper is not required. It is up to you completely.

I have Launch condition. But then, I also defined the following in Setup > Properties > Prerequisites. So how do they co-exist together?

These are entirely different things. Launch condition like it sounds from its name is just a condition which lets the Windows Installer runtime to continue installation process or not (gives a warning message box). Prerequisites is the list of required components that is configured so they can be installed prior to running the MSI file. You can read more about them in the Windows Installer section.

Finally, you may find the Deploying a VSTO Solution Using Windows Installer article helpful.

  • Related