summaryrefslogtreecommitdiff
path: root/windows/pandoc.wxs
blob: c1465ffcfbd99714833a42ad117a7834c60d86b0 (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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
<?xml version="1.0"?>
<?define UpgradeCode = "A68E8EF6-ABB1-4F22-A3C5-68DFDF0AB562" ?>
<?if $(sys.BUILDARCH)=x64?>
  <?define ProgFilesFolder="ProgramFiles64Folder"?>
<?else?>
  <?define ProgFilesFolder="ProgramFilesFolder"?>
<?endif?>

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
  <Product Id="*"
  UpgradeCode="$(var.UpgradeCode)" Name="Pandoc $(var.VERSION)"
  Version="$(var.VERSION)" Manufacturer="John MacFarlane"
  Language="1033">

    <Package InstallerVersion="200" Compressed="yes"
    Comments="Windows Installer Package" />
    <Media Id="1" Cabinet="product.cab" EmbedCab="yes" />
    <Property Id="PREVIOUSVERSIONSINSTALLED" Secure="yes" />
    <Upgrade Id="$(var.UpgradeCode)">
      <UpgradeVersion Property='PREVIOUSVERSIONSINSTALLED'
        Minimum='0.0.0.0'  IncludeMinimum='yes'
        Maximum="99.0.0.0" IncludeMaximum="no" />
    </Upgrade>
    <Property Id="ARPURLINFOABOUT" Value="http://pandoc.org" />

    <InstallExecuteSequence>
      <RemoveExistingProducts After="InstallFinalize"/>
    </InstallExecuteSequence>

    <Property Id="DISABLEADVTSHORTCUTS" Value="1" />

    <Directory Id="TARGETDIR" Name="SourceDir">

      <Directory Id="$(var.ProgFilesFolder)">
        <Directory Id="APPLICATIONFOLDER" Name="Pandoc">
          <Component Id="MainExecutable"
                     Guid="ECD35082-4C28-49E1-977E-B90FC7C400C7">
            <RegistryValue Root="HKMU"
                           Key="Software\John MacFarlane\Pandoc"
                           Name="Version" Type="string" Value="[ProductVersion]"
                           KeyPath="yes"/>
            <RemoveFolder Id="APPLICATIONFOLDER" On="uninstall"/>
            <File Id="pandocEXE" Name="pandoc.exe"
                  Source="..\.cabal-sandbox\bin\pandoc.exe" />
            <File Id="pandocCOPYRIGHT" Name="COPYRIGHT.txt"
                  Source="..\COPYRIGHT.txt" />
            <File Id="pandocCOPYING" Name="COPYING.rtf"
                  Source="..\COPYING.rtf" />
          </Component>

          <Component Id="CitationSupport"
                     Guid="0A214839-2E69-4026-8DBB-0F0A9DB75C12">
            <RegistryValue Root="HKMU"
                           Key="Software\John MacFarlane\Pandoc"
                           Name="Version" Type="string" Value="[ProductVersion]"
                           KeyPath="yes"/>
            <File Id="pandoc_citeprocEXE" Name="pandoc-citeproc.exe"
                  Source="..\.cabal-sandbox\bin\pandoc-citeproc.exe" />
          </Component>

          <Component Id="Documentation"
                     Guid="A8D54A76-1A3D-4647-8327-81B69D39D8A3">
            <File Id="pandocREADME" Name="Pandoc User's Guide.html"
                  Source="..\README.html" KeyPath="yes">
              <Shortcut Id="ApplicationStartMenuShortcut"
                        Directory="ApplicationProgramsFolder"
                        Name="Pandoc User’s Guide" Advertise="yes" />
            </File>
          </Component>


          <Component Id="UpdateUserPath"
                     Guid="7ECEAD05-CA5C-4147-82CB-F7CADABAC7F3"
                     KeyPath="yes">
            <Condition>ALLUSERS = "" OR ALLUSERS = 2</Condition>
            <Environment Id='SetUserPath' Name='PATH' Action='set'
                       Permanent='no' System='no' Part='last'
                       Value='[APPLICATIONFOLDER]' />
          </Component>

          <Component Id="UpdateSystemPath"
                     Guid="F8AC4135-C0AE-48C7-BAC5-311DAC97CFD8"
                     KeyPath="yes">
            <Condition>ALLUSERS = 1</Condition>
            <Environment Id='SetSystemPath' Name='PATH' Action='set'
                       Permanent='no' System='yes' Part='last'
                       Value='[APPLICATIONFOLDER]' />
          </Component>

        </Directory>
      </Directory>

      <Directory Id="ProgramMenuFolder">
        <Directory Id="ApplicationProgramsFolder" Name="Pandoc">
          <Component Id="ApplicationShortcut"
                     Guid="7F807DD5-CC54-474A-B571-89630893F563">
            <RemoveFolder Id="ApplicationProgramsFolder"
                          On="uninstall"/>
            <RegistryValue Root="HKMU" Key="Software\John MacFarlane\Pandoc"
                           Name="ShortcutInstalled" Type="integer" Value="1"
                           KeyPath="yes"/>
          </Component>
        </Directory>
      </Directory>

    </Directory>

    <Feature Id="Complete" Level="1" Title="Pandoc $(var.VERSION)"
             Description="Complete package"  Display="expand"
             ConfigurableDirectory="APPLICATIONFOLDER">
      <Feature Id="MainProgram"
               Title="Program"
               Description="The main executable."
               Level="1">
        <ComponentRef Id="MainExecutable" />
        <ComponentRef Id="UpdateUserPath" />
        <ComponentRef Id="UpdateSystemPath" />
      </Feature>
      <Feature Id="Manual" Title="Manual">
        <ComponentRef Id="Documentation" />
        <ComponentRef Id="ApplicationShortcut" />
      </Feature>
      <Feature Id="Citation" Title="Citation Support"
               Description="Citation support.">
        <ComponentRef Id="CitationSupport" />
      </Feature>
    </Feature>


    <SetProperty Id="ARPINSTALLLOCATION" Value="[APPLICATIONFOLDER]"
                 After="CostFinalize" />

    <CustomAction Id="SetExitDialogOptText"
                  Property="WIXUI_EXITDIALOGOPTIONALTEXT"
                  Value="[ProductName] was installed in [APPLICATIONFOLDER]. You may need to restart Cmd/Powershell windows before using it." />

    <CustomAction Id="CustomWixSetPerUserFolder"
                  Property="WixPerUserFolder"
                  Value="[LocalAppDataFolder][ApplicationFolderName]"
                  Execute="immediate" />


    <InstallExecuteSequence>
      <Custom Action="CustomWixSetPerUserFolder" After="WixSetDefaultPerUserFolder">
        ACTION="INSTALL" AND (ALLUSERS="" OR (ALLUSERS=2 AND (NOT Privileged)))
      </Custom>
    </InstallExecuteSequence>

    <InstallUISequence>
      <Custom Action="SetExitDialogOptText" Before="ExecuteAction">
        NOT Installed
      </Custom>
      <Custom Action="CustomWixSetPerUserFolder" After="WixSetDefaultPerUserFolder">
        ACTION="INSTALL" AND (ALLUSERS="" OR (ALLUSERS=2 AND (NOT Privileged)))
      </Custom>
    </InstallUISequence>

    <CustomActionRef Id="WixBroadcastSettingChange" />
    <CustomActionRef Id="WixBroadcastEnvironmentChange" />

    <Property Id="ApplicationFolderName" Value="Pandoc" />
    <Property Id="WixAppFolder" Value="WixPerUserFolder" />
    <Property Id="ALLUSERS" Value="2" Secure="yes" />
    <Property Id="MSIINSTALLPERUSER" Value="1" />

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

    <UI Id="MyWixUI_Advanced">
      <UIRef Id="WixUI_Advanced" />
      <UIRef Id="WixUI_ErrorProgressText" />

      <Publish Dialog="InstallScopeDlg" Control="Next"
               Event="NewDialog" Value="VerifyReadyDlg"
               Order="6">WixAppFolder = "WixPerUserFolder"</Publish>

      <Publish Dialog="InstallScopeDlg" Control="Next"
               Property="APPLICATIONFOLDER"
               Value="[$(var.ProgFilesFolder)][ApplicationFolderName]"
               Order="7">WixAppFolder = "WixPerMachineFolder"</Publish>

      <Publish Dialog="InstallScopeDlg" Control="Next"
               Property="APPLICATIONFOLDER" Value="[LocalAppDataFolder][ApplicationFolderName]"
               Order="8">WixAppFolder = "WixPerUserFolder"</Publish>

      <Publish Dialog="InstallScopeDlg" Control="Next"
               Property="MSIINSTALLPERUSER" Value="{}"
               Order="18">WixAppFolder = "WixPerMachineFolder" AND ALLUSERS = 1</Publish>
      <Publish Dialog="InstallScopeDlg" Control="Next"
               Property="MSIINSTALLPERUSER" Value="1"
               Order="19">WixAppFolder = "WixPerUserFolder" AND ALLUSERS = 2</Publish>
      <Publish Dialog="InstallScopeDlg" Control="Next"
               Property="ALLUSERS" Value="2"
               Order="20">WixAppFolder = "WixPerUserFolder"</Publish>


      <Publish Dialog="InstallDirDlg" Control="Next"
               Event="NewDialog" Value="VerifyReadyDlg"
               Order="4">
        WIXUI_DONTVALIDATEPATH OR
        WIXUI_INSTALLDIR_VALID="1"
      </Publish>

      <Publish Dialog="VerifyReadyDlg" Control="Back"
               Event="NewDialog" Value="InstallScopeDlg"
               Order="11">
        WixAppFolder = "WixPerUserFolder"
      </Publish>
      <Publish Dialog="VerifyReadyDlg" Control="Back"
               Event="NewDialog" Value="InstallDirDlg"
               Order="12">
        WixAppFolder = "WixPerMachineFolder"
      </Publish>
    </UI>

  </Product>

</Wix>