Replacing VDPROJ Installation Files Using InstallShield / WIX

Currently, our product is installed through 4-5 MSI, which are created from .vdproj files, which consist of the results of projects vs 2010 and additional information in the merge modules.

I see InstallShield and WIX as a possible replacement because VS2012 no longer supports VS Setup projects (oh no!), So we need to find something else.

I had a small game with InstallShield, and I could not cope with it, in addition to installing the product, the installer must also accept several parameters, such as the name and location of the database, etc. I could not find a way to get this information in the InstallShield project. It used a limited version of InstallSHield for visual studio, though

I'm not sure which is the best to use? Has anyone had experience converting to WIX or IS from VDPROJ?

EDIT It seems that WIX will be the easiest, and I'm trying to handle this. I do not seem to find useful messages that allow me to direct project output to my WIX installer and how to create variables. (Without using plugins)

+6
source share
4 answers

It is difficult to give a simple answer, because you really ask really high-level questions that require an understanding of your installation needs and a whole bunch of training in creating installers.

Personally, I have installers that are 100% WiX, 100% InstallShield (both Limited Edition and Premiere Edition) and a combination of the two.

The limited version is limited, but it also does some things really well and provides some features that do not actually exist and / or are easily implemented in WiX.

One good strategy is to use InstallShield LE as a simple container, and then most of your authoring in WiX. I describe this diagram here on my blog:

Extending InstallShield with Windows Installer XML - Certificates

InstallShield Professional and above have a tool for migrating VDPROJ projects, but I would use it with caution. Most VDPROJ installers have a terrible authorship, and it would be better to reorganize and then transfer.

+3
source

I highly recommend looking at Wix #. See http://www.codeproject.com/Articles/31407/Wix-WixSharp-managed-interface-for-WiX .
Also see CodePlex Home Page: http://wixsharp.codeplex.com/

For developers, primarily coding in C #, Wix # is likely to be the easiest and most convenient set of skills to add, and it is free and integrates directly with Visual Studio. I used it with great success in Visual Studio 2012 and 2013.

For C # developers who want to create a Windows Installer MSI to deploy their application, Wix # is arguably the best replacement for the Packaging and Deployment project type that Microsoft has removed from Visual Studio since VS2012. Wix is ​​the C # interface for the WiX (Windows Installer Xml) toolkit. Using Wix # allows you to create a complete Windows Installer MSI in C #.

Wix # is useful for a wide range of installation / deployment scenarios and is well suited for continuous integration scenarios. There are Wix # examples for deploying Windows desktop applications, for installing Windows services, and installing ASP.NET websites and many other types of installations.

Wix # handles typical installer requirements, and the Wix # installer code for simple projects is really simple. For applications that are more complex and require advanced features, Wix # can, if necessary, use the entire set of WiX Toolset. For example, when installing a .NET application, a typical requirement would be to install the application exe and dll files, as well as configure some .NET configuration files and / or registry entries on the target system.

The following is an example C # code for a simple Wix # installer that installs an application on the target system and modifies some configuration files. This example assumes that you wrote a utility called "TailorMyConfig.exe", for example, a simple C # program that uses the ConfigurationManager.AppSettings procedures, and you deploy this exe along with your application.

 using System; using System.Windows.Forms; using System.Diagnostics; using Microsoft.Deployment.WindowsInstaller; using WixSharp; class Script { static public void Main(string[] args) { var project = new Project("MyProduct", new Dir(@"%ProgramFiles%\My Company\My Product", new File(@"Files\Bin\MyApp.exe"), new File(@"Files\Bin\TailorMyConfig.exe")), new ManagedAction("UpdateConfigFile")); project.Id = new Guid("6f330b47-2577-43ad-9095-1861ba25889b"); Compiler.BuildMsi(project); } } public class MyCustomAction { [CustomAction] public static ActionResult UpdateConfigFile(Session session) { if (DialogResult.Yes == MessageBox.Show("Config file update ready to run.\n Update config file(s) now?", "Config Tailoring Utility", MessageBoxButtons.YesNo)) { Process.Start("TailorMyConfig.exe", "Run utility to tailor config file to current system"); } return ActionResult.Success; } } 

Please note that there are “best” ways to modify the configuration file using WiX XML features. For simplicity, the above example suggested a special C # exe utility for modifying configuration files. I would suggest using WiX XML features for this. You can incorporate virtually any WiX XML feature directly into your Wix # setup using Wix # "XML injection" technology.

Remember that Wix # is just a C # interface that emits WiX XML syntax. After Wix # has released the WiX XML file (wxs file), this wxs file can be easily processed to insert additional WiX XML features. Then the resulting wxs file is compiled using the WiX toolkit in MSI.

For an example of using XML Injection to include WiX XML features in a Wix # (C #) installation, see here In Wix #, how do I avoid creating a physical folder on the target when deploying only registry entries? In this question, see My answer, which uses the delegate connection method to the "WixSourceGenerated" event.

You can then use this XML embedding approach to insert some WiX XML into your installer, which will edit the configuration file. Typical WiX XML Example for Modifying Configuration Files: How to modify .NET configuration files during installation?

Another typical installer requirement is to add or modify Windows registry entries on the target system. Wix # provides direct support for this using the "RegValue" class. The advantage is that when using Wix # you also get the full “uninstall option” for free, including deleting / restoring registry entries to the state of preset. This is a natural result of creating Wix # on top of WiX Toolset technology and Windows Installer. An example of the Wix # registry installer is only here: In Wix #, how to avoid creating a physical folder on the target system when deploying only registry entries?

The Wix # approach was very useful in my environment, and it allows you to use the familiar C # skillset without having to jump forward to the full complexity of the WiX XML installer technology.

The first accepted answer defended this approach:

One good strategy is to use InstallShield LE as a simple container and then make the most of your authorship on WiX. I describe this pattern here my blog: http://blog.iswix.com/2011/01/augmenting-installshield-using-windows_19.html

Although this is a great and workable approach, the approach I propose here has the following advantages:

ADVANTAGES OF USING WIX # PLUS WiX APPROACH

  • No need to deal with InstallShield LE or any other proprietary installation product
  • The completeness of most installers is written in C # code, a familiar set of skills
  • No need to learn the entire WiX toolkit environment; you can start with C # code and then add advanced WiX features as needed using XML Injection.
  • This approach will work well in continuous integration environments, with all components that have provided themselves for XCopy deployment will be installed on the build servers, and all components will be highly suitable for automation using scripts such as Powershell scripts.
  • If Microsoft changes the AGAIN course to the installer tools bundled with Visual Studio, you will not be affected.

ELEMENTS COMMON WITH LE + WIX

  • Built on top of the WiX Toolset features, all WiX XML features can be included in the installer.
  • Many excellent "practical solutions" for WiX deployment solutions are available in SO and elsewhere.
  • Creates authentic Windows MSI installers, complete with removal features and all the great features of this technology.
  • You want to learn more about WiX and Windows Installer technologies when creating installers. Advanced features often require migration to WiX XML.
  • Both are integrated more or less easily into Visual Studio. (Anyway, the Wix # approach would have a slight advantage)

So, while the other approach is a workable solution, I recommend Wix # + WiX Toolset as the path of least exacerbation, in the future, for VS2012, VS2013, VS201x. Perhaps the biggest advantage is that you are unlikely to ever have to change the underlying deployment technologies and come back to being blinded by Microsoft again, no matter what Microsoft marketing departments offer to enable or bring deployment technology out of Visual Studio.

+2
source

For the free WiX tool, your best bet. If you are also interested in commercial tools, Advanced Installer can help you create or transform a project much faster, without any scripts. It also has a predefined project template for importing your VDPROJ. Why do you need a volume license, since you need access to its Dialogs Editor and SQL Scripts features. But you can check them all out during the trial period.

+1
source

If you want to switch to another installation system - NSIS or Inno Setup, try this Visual Studio extension: http://visualstudiogallery.msdn.microsoft.com/5e57fe9a-ae5d-4740-a1c3-7a8e278e105b

0
source

Source: https://habr.com/ru/post/923492/


All Articles