summaryrefslogtreecommitdiff
path: root/contrib/wix/mercurial.wxs
blob: fdd47e0a48e4f12d33c71f2293754ba937ecf1f1 (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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
<?xml version='1.0' encoding='windows-1252'?>
<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>

  <!-- Copyright 2010 Steve Borho <steve@borho.org>

  This software may be used and distributed according to the terms of the
  GNU General Public License version 2 or any later version. -->

  <?include guids.wxi ?>
  <?include defines.wxi ?>

  <?if $(var.Platform) = "x64" ?>
    <?define PFolder = ProgramFiles64Folder ?>
  <?else?>
    <?define PFolder = ProgramFilesFolder ?>
  <?endif?>

  <Product Id='*'
    Name='Mercurial $(var.Version) ($(var.Platform))' 
    UpgradeCode='$(var.ProductUpgradeCode)'
    Language='1033' Codepage='1252' Version='$(var.Version)'
    Manufacturer='Matt Mackall and others'>

    <Package Id='*'
      Keywords='Installer'
      Description="Mercurial distributed SCM (version $(var.Version))"
      Comments='$(var.Comments)'
      Platform='$(var.Platform)'
      Manufacturer='Matt Mackall and others'
      InstallerVersion='300' Languages='1033' Compressed='yes' SummaryCodepage='1252' />

    <Media Id='1' Cabinet='mercurial.cab' EmbedCab='yes' DiskPrompt='CD-ROM #1'
           CompressionLevel='high' />
    <Property Id='DiskPrompt' Value="Mercurial $(var.Version) Installation [1]" />

    <Condition Message='Mercurial MSI installers require Windows XP or higher'>
        VersionNT >= 501
    </Condition>

    <Property Id="INSTALLDIR">
      <ComponentSearch Id='SearchForMainExecutableComponent'
                       Guid='$(var.ComponentMainExecutableGUID)' />
    </Property>

    <!--Property Id='ARPCOMMENTS'>any comments</Property-->
    <Property Id='ARPCONTACT'>mercurial@selenic.com</Property>
    <Property Id='ARPHELPLINK'>http://mercurial.selenic.com/wiki/</Property>
    <Property Id='ARPURLINFOABOUT'>http://mercurial.selenic.com/about/</Property>
    <Property Id='ARPURLUPDATEINFO'>http://mercurial.selenic.com/downloads/</Property>
    <Property Id='ARPHELPTELEPHONE'>http://mercurial.selenic.com/wiki/Support</Property>
    <Property Id='ARPPRODUCTICON'>hgIcon.ico</Property>

    <Property Id='INSTALLEDMERCURIALPRODUCTS' Secure='yes'></Property>
    <Property Id='REINSTALLMODE'>amus</Property>

    <!--Auto-accept the license page-->
    <Property Id='LicenseAccepted'>1</Property>

    <Directory Id='TARGETDIR' Name='SourceDir'>
      <Directory Id='$(var.PFolder)' Name='PFiles'>
        <Directory Id='INSTALLDIR' Name='Mercurial'>
          <Component Id='MainExecutable' Guid='$(var.ComponentMainExecutableGUID)' Win64='$(var.IsX64)'>
            <File Id='hgEXE' Name='hg.exe' Source='dist\hg.exe' KeyPath='yes' />
            <Environment Id="Environment" Name="PATH" Part="last" System="yes"
                         Permanent="no" Value="[INSTALLDIR]" Action="set" />
          </Component>
          <Component Id='ReadMe' Guid='$(var.ReadMe.guid)' Win64='$(var.IsX64)'>
              <File Id='ReadMe' Name='ReadMe.html' Source='contrib\win32\ReadMe.html'
                    KeyPath='yes'/>
          </Component>
          <Component Id='COPYING' Guid='$(var.COPYING.guid)' Win64='$(var.IsX64)'>
            <File Id='COPYING' Name='COPYING.rtf' Source='contrib\wix\COPYING.rtf'
                  KeyPath='yes'/>
          </Component>

          <Directory Id='HGRCD' Name='hgrc.d'>
            <Component Id='mercurial.rc' Guid='$(var.mercurial.rc.guid)' Win64='$(var.IsX64)'>
              <File Id='mercurial.rc' Name='Mercurial.rc' Source='contrib\win32\mercurial.ini'
                    ReadOnly='yes' KeyPath='yes'/>
            </Component>
            <Component Id='mergetools.rc' Guid='$(var.mergetools.rc.guid)' Win64='$(var.IsX64)'>
              <File Id='mergetools.rc' Name='MergeTools.rc' Source='contrib\mergetools.hgrc'
                    ReadOnly='yes' KeyPath='yes'/>
            </Component>
            <Component Id='paths.rc' Guid='$(var.paths.rc.guid)' Win64='$(var.IsX64)'>
              <CreateFolder/>
              <IniFile Id="ini0" Action="createLine" Directory="HGRCD" Name="Paths.rc"
                Section="web" Key="cacerts" Value="[INSTALLDIR]hgrc.d\cacert.pem" />
            </Component>
            <Component Id='cacert.pem' Guid='$(var.cacert.pem.guid)' Win64='$(var.IsX64)'>
              <File Id='cacert.pem' Name='cacert.pem' Source='..\misc\cacert.pem'
                    ReadOnly='yes' KeyPath='yes'/>
            </Component>
          </Directory>

        </Directory>
      </Directory>

      <Directory Id="ProgramMenuFolder" Name="Programs">
        <Directory Id="ProgramMenuDir" Name="Mercurial $(var.Version)">
          <Component Id="ProgramMenuDir" Guid="$(var.ProgramMenuDir.guid)" Win64='$(var.IsX64)'>
            <RemoveFolder Id='ProgramMenuDir' On='uninstall' />
            <RegistryValue Root='HKCU' Key='Software\Mercurial\InstallDir' Type='string'
                           Value='[INSTALLDIR]' KeyPath='yes' />
            <Shortcut Id='UrlShortcut' Directory='ProgramMenuDir' Name='Mercurial Web Site'
                      Target='[ARPHELPLINK]' Icon="hgIcon.ico" IconIndex='0' />
          </Component>
        </Directory>
      </Directory>

      <?if $(var.Platform) = "x86" ?>
        <Merge Id='VCRuntime' DiskId='1' Language='1033'
              SourceFile='$(var.VCRedistSrcDir)\microsoft.vcxx.crt.x86_msm.msm' />
        <Merge Id='VCRuntimePolicy' DiskId='1' Language='1033'
              SourceFile='$(var.VCRedistSrcDir)\policy.x.xx.microsoft.vcxx.crt.x86_msm.msm' />
      <?else?>
        <Merge Id='VCRuntime' DiskId='1' Language='1033'
              SourceFile='$(var.VCRedistSrcDir)\microsoft.vcxx.crt.x64_msm.msm' />
        <Merge Id='VCRuntimePolicy' DiskId='1' Language='1033'
              SourceFile='$(var.VCRedistSrcDir)\policy.x.xx.microsoft.vcxx.crt.x64_msm.msm' />
      <?endif?>
    </Directory>

    <Feature Id='Complete' Title='Mercurial' Description='The complete package'
        Display='expand' Level='1' ConfigurableDirectory='INSTALLDIR' >
      <Feature Id='MainProgram' Title='Program' Description='Mercurial command line app'
             Level='1' Absent='disallow' >
        <ComponentRef Id='MainExecutable' />
        <ComponentRef Id='distOutput' />
        <ComponentRef Id='ProgramMenuDir' />
        <ComponentRef Id='ReadMe' />
        <ComponentRef Id='COPYING' />
        <ComponentRef Id='mercurial.rc' />
        <ComponentRef Id='mergetools.rc' />
        <ComponentRef Id='paths.rc' />
        <ComponentRef Id='cacert.pem' />
        <ComponentRef Id='helpFolder' />
        <ComponentGroupRef Id='templatesFolder' />
        <MergeRef Id='VCRuntime' />
        <MergeRef Id='VCRuntimePolicy' />
      </Feature>
      <Feature Id='Locales' Title='Translations' Description='Translations' Level='1'>
        <ComponentGroupRef Id='localeFolder' />
        <ComponentRef Id='i18nFolder' />
      </Feature>
      <Feature Id='Documentation' Title='Documentation' Description='HTML man pages' Level='1'>
        <ComponentGroupRef Id='docFolder' />
      </Feature>
      <Feature Id='Misc' Title='Miscellaneous' Description='Contributed scripts' Level='1'>
        <ComponentGroupRef Id='contribFolder' />
      </Feature>
    </Feature>

    <UIRef Id="WixUI_FeatureTree" />
    <UIRef Id="WixUI_ErrorProgressText" />

    <WixVariable Id="WixUILicenseRtf" Value="contrib\wix\COPYING.rtf" />

    <Icon Id="hgIcon.ico" SourceFile="contrib/win32/mercurial.ico" />

    <Upgrade Id='$(var.ProductUpgradeCode)'>
      <UpgradeVersion
        IncludeMinimum='yes' Minimum='0.0.0' IncludeMaximum='no' OnlyDetect='no'
        Property='INSTALLEDMERCURIALPRODUCTS' />
    </Upgrade>

    <InstallExecuteSequence>
      <RemoveExistingProducts After='InstallInitialize'/>
    </InstallExecuteSequence>

  </Product>
</Wix>