JayBeeOH

Wix Toolset Deployment Example

Aug 16th, 2017
555
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 7.83 KB | None | 0 0
  1. '------------------------------------------------------------------------------------------
  2. '           Notice of My Copyright and Intellectual Property Rights
  3. '
  4. ' Any intellectual property contained within the program by Joseph L. Bolen remains the
  5. ' intellectual property of the Joseph L. Bolen. This means that no person may distribute,
  6. ' publish or provide such intellectual property to any other person or entity for any
  7. ' reason, commercial or otherwise, without the express written permission of Joseph L. Bolen.
  8. '
  9. '                 Copyright © 2017. All rights reserved.
  10. '        All trademarks remain the property of their respective owners.
  11. '-------------------------------------------------------------------------------------------
  12. ' Program Name:   Wix Toolset Deployment Example
  13. '
  14. ' Author:         Joseph L. Bolen
  15. ' Date Created:   16 AUG 2017
  16. '
  17. ' Description:    An example of the Bundle.wxs and Product.wxs files used to
  18. '                 deploy a program called, "VB Is Fun", using the Wix Toolset.
  19. '
  20. '                 This document is at: https://pastebin.com/Z169466f
  21. '
  22. '-------------------------------------------------------------------------------------------
  23. ' Bundle.wxs
  24. '-------------------------------------------------------------------------------------------
  25. <?xml version="1.0" encoding="UTF-8"?>
  26. <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:bal="http://schemas.microsoft.com/wix/BalExtension">
  27.     <Bundle Name="VB Is Fun" Version="1.0.0.0" Manufacturer="Bolen Computers" UpgradeCode="c998859f-fac2-44f0-9f79-610b87457fab">
  28.  
  29.         <BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.HyperlinkLicense">
  30.             <bal:WixStandardBootstrapperApplication
  31.                 LicenseUrl=""
  32.                 LogoFile="BolenLogo50.png"
  33.                 xmlns:bal="http://schemas.microsoft.com/wix/BalExtension" />
  34.         </BootstrapperApplicationRef>
  35.  
  36.         <Chain>
  37.             <!-- TODO: Define the list of chained packages. -->
  38.             <!-- <MsiPackage SourceFile="path\to\your.msi" /> -->
  39.  
  40.             <!-- If needed, install .Net Framework 4.6.2 -->
  41.             <PackageGroupRef Id="NetFx462Redist"/>
  42.  
  43.             <RollbackBoundary />
  44.             <!-- Call the VBIsFun installer msi -->
  45.             <MsiPackage SourceFile="$(var.VBIsFunInstaller.TargetDir)VBIsFunInstaller.msi" DisplayInternalUI="yes"  Vital="yes" />
  46.         </Chain>
  47.  
  48.     </Bundle>
  49. </Wix>
  50. '-------------------------------------------------------------------------------------------
  51. ' Product.wxs
  52. '-------------------------------------------------------------------------------------------
  53. <?xml version="1.0" encoding="UTF-8"?>
  54. <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
  55.   <?define VBIsFun_TargetDir=$(var.VBIsFun.TargetDir)?>
  56.   <Product Id="ade2108f-0992-4e88-9342-b81cce9ced0d" Name="VB Is Fun" Language="1033" Version="1.0.0.0" Manufacturer="Bolen Computers" UpgradeCode="f86289ee-286a-42e3-9eef-5723f07c2ce2" >
  57.     <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine"  Description="Fun Date and Time Display" />
  58.  
  59.     <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
  60.     <MediaTemplate EmbedCab="yes" />
  61.  
  62.     <!-- Icon for the Installer package -->
  63.     <Icon Id="MyShortcutIcon" SourceFile="$(var.ProjectDir)Bolen.ico" />
  64.     <Property Id="ARPPRODUCTICON" Value="MyShortcutIcon" />
  65.  
  66.     <!-- EULA -->
  67.     <WixVariable Id="WixUILicenseRtf" Value="$(var.ProjectDir)BolenEULA.rtf" />
  68.  
  69.     <WixVariable Id="WixUIDialogBmp" Value="BolenWixBackground.jpg"/>
  70.     <WixVariable Id="WixUIBannerBmp" Value="BolenWixBanner.jpg"/>
  71.  
  72.     <!-- Installation Types
  73.    <UIRef Id="WixUI_Minimal" />
  74.    <UIRef Id="WixUI_InstallDir" />
  75.    <UIRef Id="WixUI_FeatureTree" />
  76.    <UIRef Id="WixUI_Mondo" />
  77.    <UIRef Id="WixUI_Advanced" />
  78.    -->
  79.  
  80.     <Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER" />
  81.     <UIRef Id="WixUI_InstallDir" />
  82.  
  83.  
  84.     <UIRef Id="WixUI_ErrorProgressText" />
  85.  
  86.     <Property Id="WIXUI_EXITDIALOGOPTIONALTEXT" Value="Thank you for installing this Bolen product." />
  87.  
  88.     <Feature Id="ProductFeature" Title="VB Is Fun" Level="1">
  89.       <ComponentGroupRef Id="ProductComponents" />
  90.       <ComponentRef Id="ApplicationShortcut" />
  91.       <ComponentRef Id="ApplicationDesktopShortcut"/>
  92.     </Feature>
  93.  
  94.     <!-- NET Framework Prerequiste Check -->
  95.     <PropertyRef Id="WIX_IS_NETFRAMEWORK_462_OR_LATER_INSTALLED"/>
  96.     <Condition Message="This application requires .NET Framework 4.6.2 or later. Please install the .NET Framework then run this installer again.">
  97.       <![CDATA[Installed OR WIX_IS_NETFRAMEWORK_462_OR_LATER_INSTALLED]]>
  98.     </Condition>
  99.  
  100.   </Product>
  101.  
  102.   <Fragment>
  103.     <Directory Id="TARGETDIR" Name="SourceDir">
  104.  
  105.       <Directory Id="ProgramFilesFolder">
  106.         <Directory Id="ManufacturerFolder" Name="!(bind.property.Manufacturer)">
  107.           <Directory Id="INSTALLFOLDER" Name="!(bind.property.ProductName)" />
  108.         </Directory>
  109.       </Directory>
  110.  
  111.       <!-- Add this folder to define the Start Menu Folder -->
  112.       <!-- This will be used to define the Application shortcut -->
  113.       <Directory Id="ProgramMenuFolder">
  114.         <Directory Id="MfgStartMenuFolder" Name="!(bind.property.Manufacturer)" />
  115.       </Directory>
  116.  
  117.       <!-- Add this folder to define the Desktop Folder -->
  118.       <!-- This will be used to define the Desktop shortcut -->
  119.       <Directory Id="DesktopFolder" Name="Desktop" />
  120.  
  121.     </Directory>
  122.  
  123.   </Fragment>
  124.  
  125.   <!-- Define Program objects -->
  126.   <Fragment>
  127.     <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
  128.       <Component Id="VBIsFun.exe" Guid="53ecd85f-538c-47e6-af42-88b20a653aed">
  129.         <File Id="VBIsFun.exe" Name="VBIsFun.exe" Source="$(var.VBIsFun_TargetDir)VBIsFun.exe" KeyPath="yes" />
  130.       </Component>
  131.       <Component Id="VBIsFun.exe.config" Guid="11f80d41-ae6a-46ac-9841-32fe4ddb40d0">
  132.         <File Id="VBIsFun.exe.config" Name="VBIsFun.exe.config" Source="$(var.VBIsFun_TargetDir)VBIsFun.exe.config" KeyPath="yes" />
  133.       </Component>
  134.     </ComponentGroup>
  135.   </Fragment>
  136.  
  137.   <!-- Define Start Menu Folder objects -->
  138.   <Fragment>
  139.     <DirectoryRef Id="MfgStartMenuFolder" >
  140.       <Component Id="ApplicationShortcut" Guid="62166298-fd48-4585-8555-3d9130d16a7c" >
  141.         <Shortcut Id="ApplicationStartMenuShortcut"
  142.                  Name="!(bind.property.ProductName)"
  143.                  Description="Fun with Date and Time Display"
  144.                  Directory="MfgStartMenuFolder"
  145.                  Target="[INSTALLFOLDER]VBisFun.exe"
  146.                  WorkingDirectory="INSTALLFOLDER"
  147.                  Icon="MyShortcutIcon" />
  148.         <RemoveFolder Id="RemoveMfgStartMenuFolder"
  149.                      Directory="MfgStartMenuFolder"
  150.                      On="uninstall" />
  151.         <RegistryValue Root="HKCU"
  152.                       Key="Software\Bolen Computers\VB Is Fun\ProgramMenuShortcut"
  153.                       Name="installed"
  154.                       Type="integer"
  155.                       Value="1"
  156.                       KeyPath="yes" />
  157.       </Component>
  158.     </DirectoryRef>
  159.   </Fragment>
  160.  
  161.   <!-- Define Desktop Shortcut objects -->
  162.   <Fragment>
  163.     <DirectoryRef Id="DesktopFolder" >
  164.       <Component Id="ApplicationDesktopShortcut" Guid="a0f7ac24-b020-4573-9147-1536102ea8a1" >
  165.         <Shortcut Id="MyDesktopShortcut"
  166.                  Name="!(bind.property.ProductName)"
  167.                  Description="Fun with Date and Time Display"
  168.                  Directory="DesktopFolder"
  169.                  Target="[INSTALLFOLDER]VBisFun.exe"
  170.                  WorkingDirectory="INSTALLFOLDER"
  171.                  Icon="MyShortcutIcon" />
  172.         <RegistryValue Root="HKCU"
  173.                       Key="Software\Bolen Computers\VB Is Fun\DesktopShortcut"
  174.                       Name="installed"
  175.                       Type="integer"
  176.                       Value="1"
  177.                       KeyPath="yes" />
  178.       </Component>
  179.     </DirectoryRef>
  180.   </Fragment>
  181.  
  182. </Wix>
Advertisement
Add Comment
Please, Sign In to add comment