summaryrefslogtreecommitdiffstats
path: root/build/wix/bundle/bundle.wxs
blob: 21d101b587bf71ee77c3b7fc391391fce3c089ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
     xmlns:bal="http://schemas.microsoft.com/wix/BalExtension"
     xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">

  <!-- Get version from the embedded MSI -->
  <?define VersionNumber="!(bind.packageVersion.MainPackage)" ?>

  <!-- NEVER changer Upgrade Code otherwise you will have upgrade troubles -->
  <?define UpgradeCode="EC95672A-1A9D-489D-9283-E6B1CAA15F29" ?>

  <Bundle Name="!(loc.ApplicationName)" Version="$(var.VersionNumber)" Manufacturer="!(loc.ManufacturerFullName)" UpgradeCode="$(var.UpgradeCode)">

    <?if $(var.Platform) = x64 ?>
      <bal:Condition
        Message="#(loc.x86VersionRequired)">
        VersionNT64
      </bal:Condition>
     <?endif ?>

    <!-- checking for 32bits vcredist installation -->
    <util:RegistrySearch Id="vcredist32search"
                         Variable="vcredist32installed"
                         Root="HKLM"
                         Key="SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\x86"
                         Value="Installed"
                         Result="exists"
                         Win64="no" />

    <!-- checking for 64bits vcredist installation -->
    <util:RegistrySearch Id="vcredist64search"
                         Variable="vcredist64installed"
                         Root="HKLM"
                         Key="SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\x64"
                         Value="Installed"
                         Result="exists"
                         Win64="yes" />

    <BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.HyperlinkSidebarLicense">
      <bal:WixStandardBootstrapperApplication
        LicenseUrl=""
        LocalizationFile="..\Localization\mixxx_en-us.wxl"
        ThemeFile="bundletheme.xml"
        SuppressOptionsUI="no"
        ShowVersion="yes"
        LogoFile="build\wix\images\bundle_background_black.png"
      />

<!-- LOCALIZATION -->
      <PayloadGroupRef Id='BundleLoc' />
<!-- END LOCALIZATION -->

    </BootstrapperApplicationRef>

    <Variable Name="InstallFolder" Type="string" Value="[ProgramFiles6432Folder]Mixxx" />
    <Variable Name="LaunchTarget" Value="[InstallFolder]\mixxx.exe"/>

    <Chain DisableSystemRestore="yes">

      <!-- 32-bit / 64-bit variables -->
      <?if $(var.Platform) = x64 ?>
        <ExePackage
          Id="vcredist64"
          Name="Microsoft Visual C++ 2015 Redistributable (x64)"
          SourceFile="$(var.WINLIBPATH)\vc_redist.x64.exe"
          Cache="no"
          Compressed="yes"
          PerMachine="yes"
          Permanent="yes"
          Vital="yes"
          InstallCommand="/install /quiet /norestart"
          RepairCommand="/repair /quiet /norestart"
          UninstallCommand="/uninstall /quiet /norestart"
          DetectCondition="vcredist64installed">

          <!-- -->
          <ExitCode Value="3010" Behavior="forceReboot"/>

          <!-- Ignore "Newer version installed" error -->
          <ExitCode Value="1638" Behavior="success"/>
        </ExePackage>
      <?else ?>
        <ExePackage
          Id="vcredist"
          Name="Microsoft Visual C++ 2015 Redistributable (x86)"
          SourceFile="$(var.WINLIBPATH)\vc_redist.x86.exe"
          Cache="no"
          Compressed="yes"
          PerMachine="yes"
          Permanent="yes"
          Vital="yes"
          InstallCommand="/install /quiet /norestart"
          RepairCommand="/repair /quiet /norestart"
          UninstallCommand="/uninstall /quiet /norestart"
          DetectCondition="vcredist32installed">

          <!-- -->
          <ExitCode Value="3010" Behavior="forceReboot"/>

          <!-- Ignore "Newer version installed" error -->
          <ExitCode Value="1638" Behavior="success"/>
        </ExePackage>
      <?endif ?>

      <RollbackBoundary />

      <MsiPackage
        Id="MainPackage"
        SourceFile="$(var.MSIPackage)"
        DisplayInternalUI="yes"
        EnableFeatureSelection="yes"
        Compressed="yes"
        Vital="yes">
        <MsiProperty Name="INSTALLDIR" Value="[InstallFolder]" />
      </MsiPackage>

    </Chain>
  </Bundle>
</Wix>