Wix installation Deployment (v) Bootstrapper bundled installation

Source: Internet
Author: User

The XML configuration of WiX is really laborious, it's a bit like a spit slot, the first four completed features in Windows Installer through the configuration can quickly get out. Unfortunately, there are a lot of locking features in the InstallShield Limited Edition version is not used. But basically meet the installation requirements. According to this directory () one to match, the matching out also decent (not to say here). But can't customize the behavior, as well as patching and so on. WiX is also an extreme, completely dependent on XML. These two days to resolve the automatic installation of the. NET Framework version without the ability to automatically install and register DLLs is very laborious. In Windows Installer, set up in Redistributables and registry, and especially register, you can drag the directory directly from your own computer. But what we're going to talk about today is the bootstrapper project in WiX, making a bundle installer that's not in Windows Installer. Installs multiple files that need to be installed, in order, once.

First, a Bootstrapper of knowledge

Cause: The WiX Setup project is unable to automatically install the. NET Framework and must be installed through the bootstrapper application to drive the burn engine in WiX. In WiX, you can only determine if there is a suitable version and then terminate the installation. The premise is to introduce WixNetFxExtension.dll. The XML code is as follows

  <propertyref id= "Netframework40full"/>    <condition message= "This application requires. NET Framework 4.0" > <! [Cdata[installed OR netframework40full]]> </Condition>

So you need to create a new bootstrapper project

Generates a bundle of WXS files supporting four file formats

    • <MsiPackage>
    • <ExePackage>
    • <MspPackage>
    • <MsuPackage>
View Code

Second, how to bundle

Purpose: Detects the. NET version, installs automatically without matching, and then installs our own project.

1. Refer to WixNetFxExtension.dll in the bootstrapper project first the various. NET versions are already included in this dynamic link library

2. Add the installation manifest in the chain element.

<Chain>      <packagegroupref id= "Netfx40web"/>      <msipackage id= "Scada" sourcefile= "D:\VS2012\ Scadasetup\scadasetup\bin\debug\scadasetup.msi "></MsiPackage>    </Chain>

The Packagegroupref ID here means that there is no. Net Framework4.0 to download the installation from the Web, of course, if you install 4.5, this is backwards compatible, will not give you a 4.0. The other versions are as follows:

Netfx40web

/td>

. Net Framework 4.0 full Web Setup.

netfx40redist

. Net Framework 4.0 full standalone setup.

Netfx40clientweb

. Net Framework 4.0 Client Profile Web Setup.

netfx40clientredist

. Net Framework 4.0 Client profile Stand Alone setup.

Netfx45web

. Net Framework 4.5 Web Setup.

netfx45redist

. Net Framework 4.5 Standalone setup.

The msipackage here is our own packaging project, will be installed after the. NET version is determined, and the address pair on the line, there is no need to copy to the root directory, generated when he will automatically an EXE installation files. However, the installer in bootstrapper is not a window. Installation sequence silently installed, no previous step, next. Same as the click once deployment. Once loaded.

If you want to have the MSI installation file display interface, to set the property Displayinternalui is yes to see the display interface

   <packagegroupref id= "Netfx40web"/>      <msipackage sourcefile= "$ (var. MSIpath) Scadasetupwix.msi "  displayinternalui=" yes "    />

3. Install the file settings.

The above is a simple bundle installer, we can further configure. You can now set up the file in the fragment element and add it to the list.

<?xml version= "1.0" encoding= "UTF-8"? ><wix xmlns= "Http://schemas.microsoft.com/wix/2006/wi" xmlns:bal= "         Http://schemas.microsoft.com/wix/BalExtension "xmlns:netfx=" Http://schemas.microsoft.com/wix/NetFxExtension " Xmlns:util= "Http://schemas.microsoft.com/wix/UtilExtension" > <bundle name= "Diaview" version= "1.0.0.0" Manufacturer= "Delta" upgradecode= "87714fb5-9cdb-4323-af55-821c05974378" iconsourcefile= "$ (var. photoes) Diaapp.ico "compressed=" yes "> <bootstrapperapplicationref id=" Wixstandardbootstrapperapplication.rtflicense "> <bal:wixstandardbootstrapperapplication LicenseFile=" $ ( Var. photoes) license.rtf "logofile=" $ (var. photoes) dialogo.jpg "/> </BootstrapperApplicationRef> <!--<bootstrapperapplicationref id=" Managed Bootstrapperapplicationhost "> iconsourcefile=" $ (var. photoes) Diaapp.ico "<bal:wixstandardbootstrapperapplication licensefile=" $ (var. photoes) license.rtf "logofile=" $ (var. Photoes) Scon.ico " /> </BootstrapperApplicationRef>--> <Chain> <!--<packagegroupref id= "Netfx40web"/&gt ;--> <packagegroupref id= "Netfx4full"/> <msipackage id= "Diaview" sourcefile= "$ (var.)    Dia) Diaviewsetup.msi "compressed=" no "displayinternalui=" yes "/> </Chain> </Bundle> <Fragment> <!--<packagegroup id= "Netfx4full" > <exepackage id= "netfx4full" cache= "no" compressed= "no" permachine= "y Es "permanent=" yes "vital=" yes "installcommand="/q "sourcefile=" $ (var. Dia) Dotnetfx40_full_x86_x64.exe "detectcondition=" (netfx4fullversion=&quot;4.0.30319&quot;) and (Not VersionNT64 OR (netfx4x64fullversion=&quot;4.0.30319&quot;)) "Downloadurl=" Http://go.micro soft.com/fwlink/? linkid=164193 "installcondition=" (versionnt >= v5.1 OR VersionNT64 >= v5.1) and (Not (netfx4fullversion=& amp;quot;4.0.30319&quot; OR netfx4x64fullversion=&quot;4.0.30319&qUot;)) "/> </PackageGroup>--> <util:registrysearchref id=" NETFRAMEWORK40 "/> <packagegroup                Id= "Netfx4full" > <exepackage id= "netfx4fullexe" cache= "no"                Compressed= "No" permachine= "yes" permanent= "yes" vital= "yes" Sourcefile= "$ (var.) Dia) Dotnetfx40_full_x86_x64.exe "installcommand="/q/norestart "detectcondition=" Netframewo RK40 "Downloadurl=" http://go.microsoft.com/fwlink/? linkid=164193 "/> </PackageGroup> </Fragment></Wix>

(The detection in the comment section. net4.0 has a problem and will be loaded once every time. net4.0 can even cause a reboot in a 32-bit system. )

Exepackage is specifically for EXE files, Msipackage is the MSI file, and so on. Say a few important attributes: compress= "yes" means compression, no then, in debug this installation package will be independent, all yes, and eventually an EXE file.

Permanent= "Yes" means that if it is unloaded, the file will be retained, and if no, the user will unload it when uninstalled. VersionNT variable represents the system, 5.1 refers to XP

4. Decide whether to register.

We use Registrysearch to search the registry, and we can make the detection sequence.

    <wix xmlns= "Http://schemas.microsoft.com/wix/2006/wi"         xmlns:util= "http://schemas.microsoft.com/wix/ Utilextension ">      <Fragment>        <util:registrysearch id="Path"            variable=" UniqueId "            root= "Hklm,software\microsoft\myproduct\unique id\"            key= "Product"            result= "Value"/>        <util:registrysearch             variable= "Patchlevel" root= "HKLM            , Software\microsoft\myproduct\[uniqueid]\setup "            key=" Patchlevel "            result=" Exists "             after=" Path "/ >      </Fragment>    </Wix>

The expression here is to perform a second registry search after the path is executed, and the result you store in variable, and this variable can be used as a condition for whether or not to install.

   <exepackage             sourcefile= "[Sources]\packages\shared\mypackage.exe"            downloadurl= "/http/ Mywebdomain.com/?mypackage.exe            installcommand= "/q/action=install"            repaircommand= "/q ACTION=Repair/ Hideconsole "            uninstallcommand="/q action=uninstall/hideconsole "            installcondition=" x86 = 1 and OSVersion > = v5.0.5121.0 and patchlevel = 0 "/>        </PackageGroup>

This one-time installation of the way still feel not very good, some mandatory. Here's just a simple reference.

Many PC software can be automatically detected version, download updates, vs comes with ClickOnce can also run their own motion detection, found that the new version will be prompted to download updates, need to use a publishing site on the line. But that's a little more configurable. There should be other ways to seek the passing hero pointing twos.

Wix installation Deployment (v) Bootstrapper bundled installation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.