]> asedeno.scripts.mit.edu Git - PuTTY.git/blob - windows/installer.wxs
Set our explicit AppUserModelID on our Start Menu shortcut.
[PuTTY.git] / windows / installer.wxs
1 <?xml version="1.0" encoding="utf-8"?>
2
3 <!-- WiX source code for the PuTTY installer. -->
4
5 <?if $(var.Win64) = yes ?>
6   <?define Bitness = " (64-bit)" ?>
7   <?define RegKeyPathLocation = "Software\SimonTatham\PuTTY64" ?>
8   <?define InstallerVersion = "200" ?>
9   <?define PlatformProgramFilesFolder = "ProgramFiles64Folder" ?>
10   <?define UpgradeCode_GUID = "C9EAA861-2B72-4FAF-9FEE-EEB1AD5FD15E" ?>
11   <?define PuTTY_Component_GUID = "C673C970-25AE-4659-9621-A1FE0598E9DC" ?>
12   <?define Pageant_Component_GUID = "BA37328A-9A9C-4912-B84D-9C4A21B4E79A" ?>
13   <?define PSFTP_Component_GUID = "8BC2740F-CD4A-4076-8C33-2847ECA17B4E" ?>
14   <?define PuTTYgen_Component_GUID = "4E3F554E-C9C9-419B-9816-94135D1F6EFF" ?>
15   <?define Plink_Component_GUID = "72C38830-1C06-40D5-B2C5-BE21F4C9D529" ?>
16   <?define PSCP_Component_GUID = "58FCAA52-CEF9-4665-B95E-7695FCF8F0A9" ?>
17   <?define HelpFile_Component_GUID = "B880CECB-2CDA-4DB1-8EB3-1627D29394FB" ?>
18   <?define Website_Component_GUID = "08A334E8-D376-438A-98C7-4E65BE09A335" ?>
19   <?define LICENCE_Component_GUID = "D15E5FA9-C912-4F7A-A663-9FE3CFD5FB01" ?>
20   <?define README_Component_GUID = "B8F2F9DE-0311-436E-86A4-BEFED84968C0" ?>
21   <?define PPK_Assoc_Component_GUID = "70B4360C-7A2E-4C9E-9135-289C5467CB04" ?>
22   <?define Path_Component_GUID = "A0CFC986-489D-452B-8A8F-F9DBEF6916F4" ?>
23   <?define ProgramMenuDir_GUID = "3B2B7A2B-25F1-4EC4-987F-75BFD038632E" ?>
24   <?define Desktop_Shortcut_Component_GUID = "0A715416-EA6E-4A1C-8670-838307083EE5" ?>
25 <?else ?>
26   <?define Bitness = "" ?>
27   <?define RegKeyPathLocation = "Software\SimonTatham\PuTTY" ?>
28   <?define InstallerVersion = "100" ?>
29   <?define PlatformProgramFilesFolder = "ProgramFilesFolder" ?>
30   <?define UpgradeCode_GUID = "DCE70C63-8808-4646-B16B-A677BD298385" ?>
31   <?define PuTTY_Component_GUID = "07ACF511-6DF6-4883-AABA-33BC14901324" ?>
32   <?define Pageant_Component_GUID = "649F963E-21C4-4755-8CE4-D80598DCEE6D" ?>
33   <?define PSFTP_Component_GUID = "3D7B9536-EC0E-4A6A-A3DF-8D285474391A" ?>
34   <?define PuTTYgen_Component_GUID = "4774F6B3-8A07-42A5-9F4D-E7FE6AA78B84" ?>
35   <?define Plink_Component_GUID = "7D96F9BB-4154-49D6-86AE-0D8F1379ACBC" ?>
36   <?define PSCP_Component_GUID = "71519D4A-3ED5-4A46-A7E4-B6E4600A8684" ?>
37   <?define HelpFile_Component_GUID = "72806A73-9D4D-49BF-8CAA-E90B0D83AEED" ?>
38   <?define Website_Component_GUID = "7DAD6536-C1A7-430C-BC8A-90176CCB78D0" ?>
39   <?define LICENCE_Component_GUID = "6AB710C0-F7A1-4B7A-AC2E-6993D6E98332" ?>
40   <?define README_Component_GUID = "0AB63F2A-0FD9-4961-B8F7-AB85C22D9986" ?>
41   <?define PPK_Assoc_Component_GUID = "13BBF036-F4C0-4F5B-9167-7BA35C673AAB" ?>
42   <?define Path_Component_GUID = "D1F68AAA-D20D-4047-828F-D0AC443FAF64" ?>
43   <?define ProgramMenuDir_GUID = "C12C3BB3-EC24-4883-8349-4AC8017C9E6A" ?>
44   <?define Desktop_Shortcut_Component_GUID = "D039E3D1-CE42-488D-96CC-90E1DE3796F8" ?>
45 <?endif ?>
46
47 <?define ProgramName = "PuTTY$(var.Bitness)" ?>
48
49 <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
50
51   <!--
52       Product tag. The Id component is set to "*", which causes WiX to
53       make up a new GUID every time it's run, whereas UpgradeCode is
54       set to a fixed GUID. This combination allows Windows to
55       recognise each new PuTTY installer as different (because of Id)
56       versions of the same underlying thing (because of the common
57       UpgradeCode).
58
59       $(var.Winver) is define on candle.exe's command line by the
60       build script, and is expected to be a dotted tuple of four
61       16-bit decimal integers (similar to a Windows VERSIONINFO
62       resource). For PuTTY's particular conventions, see comment in
63       Buildscr.
64   -->
65   <Product
66       Name="$(var.Puttytextver)$(var.Bitness)"
67       Manufacturer="Simon Tatham"
68       Id="*"
69       UpgradeCode="$(var.UpgradeCode_GUID)"
70       Language="1033" Codepage="1252" Version="$(var.Winver)">
71
72     <!--
73         We force the install scope to perMachine, largely because I
74         don't really understand how to make it usefully switchable
75         between the two. If anyone is a WiX expert and does want to
76         install PuTTY locally in a user account, I hope they'll send a
77         well explained patch!
78
79         $(var.Puttytextver) is again defined on the candle command
80         line, and describes the version of PuTTY in human-readable
81         form, e.g. "PuTTY 0.67" or "PuTTY development snapshot [foo]".
82     -->
83     <Package Id="*" Keywords="Installer"
84              Description="$(var.Puttytextver) installer"
85              Manufacturer="Simon Tatham"
86              InstallerVersion="$(var.InstallerVersion)" Languages="1033"
87              Compressed="yes" SummaryCodepage="1252"
88              InstallScope="perMachine" />
89
90     <!--
91         Permit installing an arbitrary one of these PuTTY installers
92         over the top of an existing one, whether it's an upgrade or a
93         downgrade. In particular, this makes it easy to switch between
94         trunk development snapshots and a release or prerelease, in
95         cases where you change your mind about whether you want the
96         features or the stability.
97
98         Setting the REINSTALLMODE property to "amus" (from its default
99         of "omus") forces every component replaced by a different
100         version of the installer to be _actually_ reinstalled; the 'o'
101         flag in the default setting breaks the downgrade case by
102         causing Windows to disallow installation of an older version
103         over the top of a newer one - and to do so _silently_, so the
104         installer claims to have worked fine but putty.exe isn't
105         there.
106     -->
107     <MajorUpgrade AllowDowngrades="yes" MigrateFeatures="yes" />
108     <Property Id="REINSTALLMODE" Value="amus"/>
109
110     <!-- Boilerplate -->
111     <Media Id="1" Cabinet="putty.cab" EmbedCab="yes" />
112
113     <!--
114         The actual directory structure and list of 'components'
115         (individual files or shortcuts or additions to PATH) that are
116         installed.
117
118         We install directly under "Program Files\PuTTY" rather than
119         the recommended three-level pathname including a manufacturer.
120         It's bad enough that I put my name irrevocably in everyone's
121         Registry without putting it in all of their filesystems as
122         well...
123     -->
124     <Directory Id="TARGETDIR" Name="SourceDir">
125       <Directory Id="$(var.PlatformProgramFilesFolder)" Name="PFiles">
126         <Directory Id="INSTALLDIR" Name="PuTTY">
127
128           <!--
129               The following components all install things in the main
130               install directory (implicitly, by being nested where
131               they are in the XML structure). Most of them also put a
132               shortcut in a subdir of the Start menu, though some of
133               the more obscure things like LICENCE are just there for
134               the sake of being _somewhere_ and don't rate a shortcut.
135           -->
136           <Component Id="PuTTY_Component"
137                      Guid="$(var.PuTTY_Component_GUID)">
138             <File Id="PuTTY_File"
139                   Source="$(var.Builddir)putty.exe" KeyPath="yes">
140               <Shortcut Id="startmenuPuTTY" Directory="ProgramMenuDir"
141                         WorkingDirectory="INSTALLDIR"
142                         Name="PuTTY" Advertise="no">
143                 <!-- Set AppUserModelId to match what PuTTY sets at runtime.
144                      Source for the GUID key:
145 https://msdn.microsoft.com/en-us/library/windows/desktop/dd391569(v=vs.85).aspx
146                      via http://stackoverflow.com/questions/2820983/ -->
147                 <ShortcutProperty
148                     Key="{9F4C2855-9F79-4B39-A8D0-E1D42DE1D5F3}, 5"
149                     Value="SimonTatham.PuTTY" />
150               </Shortcut>
151             </File>
152           </Component>
153           <Component Id="Pageant_Component"
154                      Guid="$(var.Pageant_Component_GUID)">
155             <File Id="Pageant_File"
156                   Source="$(var.Builddir)pageant.exe" KeyPath="yes">
157               <Shortcut Id="startmenuPageant" Directory="ProgramMenuDir"
158                         WorkingDirectory="INSTALLDIR"
159                         Name="Pageant" Advertise="no" />
160             </File>
161           </Component>
162           <Component Id="PSFTP_Component"
163                      Guid="$(var.PSFTP_Component_GUID)">
164             <File Id="PSFTP_File"
165                   Source="$(var.Builddir)psftp.exe" KeyPath="yes">
166               <Shortcut Id="startmenuPSFTP" Directory="ProgramMenuDir"
167                         WorkingDirectory="INSTALLDIR"
168                         Name="PSFTP" Advertise="no" />
169             </File>
170           </Component>
171           <Component Id="PuTTYgen_Component"
172                      Guid="$(var.PuTTYgen_Component_GUID)">
173             <File Id="PuTTYgen_File"
174                   Source="$(var.Builddir)puttygen.exe" KeyPath="yes">
175               <Shortcut Id="startmenuPuTTYgen" Directory="ProgramMenuDir"
176                         WorkingDirectory="INSTALLDIR"
177                         Name="PuTTYgen" Advertise="no" />
178             </File>
179           </Component>
180           <Component Id="Plink_Component"
181                      Guid="$(var.Plink_Component_GUID)">
182             <File Id="Plink_File"
183                   Source="$(var.Builddir)plink.exe" KeyPath="yes" />
184           </Component>
185           <Component Id="PSCP_Component"
186                      Guid="$(var.PSCP_Component_GUID)">
187             <File Id="PSCP_File"
188                   Source="$(var.Builddir)pscp.exe" KeyPath="yes" />
189           </Component>
190
191           <Component Id="HelpFile_Component"
192                      Guid="$(var.HelpFile_Component_GUID)">
193             <File Id="HelpFile_File"
194                   Source="..\doc\putty.chm" KeyPath="yes">
195               <Shortcut Id="startmenuManual" Directory="ProgramMenuDir"
196                         Name="PuTTY Manual"
197                         Advertise="no" />
198             </File>
199           </Component>
200           <Component Id="Website_Component"
201                      Guid="$(var.Website_Component_GUID)">
202             <File Id="Website_File"
203                   Source="website.url" KeyPath="yes">
204               <Shortcut Id="startmenuWebsite" Directory="ProgramMenuDir"
205                         Name="PuTTY Web Site"
206                         Advertise="no" />
207             </File>
208           </Component>
209           <Component Id="LICENCE_Component"
210                      Guid="$(var.LICENCE_Component_GUID)">
211             <File Id="LICENCE_File"
212                   Source="..\LICENCE" KeyPath="yes" />
213           </Component>
214           <Component Id="README_Component"
215                      Guid="$(var.README_Component_GUID)">
216             <File Id="README_File"
217                   Source="README-msi.txt" Name="README.txt" KeyPath="yes" />
218           </Component>
219
220           <!--
221               This component sets up the file associations for the
222               .ppk private key file extension: right-clicking should
223               give options to launch both Pageant and PuTTYgen with a
224               given key.
225
226               Unlike all the above components, this one also puts a
227               registry entry in HKEY_LOCAL_MACHINE, which is the 'key
228               path' for the component, i.e. the thing Windows checks
229               to know whether this component is installed. Those have
230               to be either files or registry entries; so for all the
231               above things the key paths are the actual files we
232               wanted to install, whereas for this one we have to
233               invent a spurious extra thing to be the key path.
234           -->
235           <Component Id="PPK_Assoc_Component"
236                      Guid="$(var.PPK_Assoc_Component_GUID)">
237             <ProgId Id="PPK_Assoc_ProgId"
238                     Description="PuTTY Private Key File">
239               <Extension Id="ppk"
240                          ContentType="application/x-putty-private-key">
241                 <Verb Id="open" Command="Load into Pageant"
242                       TargetFile="Pageant_File" Argument='"%1"'/>
243                 <Verb Id="edit" Command="Edit with PuTTYgen"
244                       TargetFile="PuTTYgen_File" Argument='"%1"' />
245               </Extension>
246             </ProgId>
247             <RegistryValue Root="HKLM"
248                            Key="$(var.RegKeyPathLocation)\PPKAssociation"
249                            Type="string" Value="" KeyPath="yes" />
250           </Component>
251
252           <!--
253               This component appends the install directory to PATH, so
254               that command prompt windows automatically get the
255               ability to run the command-line utilities (PSCP, PSFTP
256               and Plink, though all the others are available too if
257               you want). Again, it needs a pointless registry entry to
258               act as a key path.
259           -->
260           <Component Id="Path_Component"
261                      Guid="$(var.Path_Component_GUID)">
262             <Environment Id="Path_Environment"
263                          Name="PATH"
264                          Value="[INSTALLDIR]"
265                          Permanent="no"
266                          Part="last"
267                          Action="set"
268                          System="yes"/>
269             <RegistryValue Root="HKLM"
270                            Key="$(var.RegKeyPathLocation)\PathEntry"
271                            Type="string" Value="" KeyPath="yes" />
272           </Component>
273         </Directory>
274       </Directory>
275
276       <!--
277           This component doesn't actually install anything, but it
278           arranges for the Start Menu _directory_ to be removed again
279           on uninstall. All the actual shortcuts inside the directory
280           are placed by code above here.
281       -->
282       <Directory Id="ProgramMenuFolder" Name="Programs">
283         <Directory Id="ProgramMenuDir" Name="$(var.ProgramName)">
284           <Component Id="ProgramMenuDir"
285                      Guid="$(var.ProgramMenuDir_GUID)">
286             <RemoveFolder Id="ProgramMenuDir" On="uninstall" />
287             <RegistryValue Root="HKLM"
288                            Key="$(var.RegKeyPathLocation)\StartMenu"
289                            Type="string" Value="" KeyPath="yes" />
290           </Component>
291         </Directory>
292       </Directory>
293
294       <!--
295           This component puts a shortcut to PuTTY itself on the
296           desktop.
297       -->
298       <Directory Id="DesktopFolder" Name="Desktop">
299         <Component Id="Desktop_Shortcut_Component"
300                    Guid="$(var.Desktop_Shortcut_Component_GUID)">
301           <Shortcut Id="DesktopPuTTY"
302                     WorkingDirectory="INSTALLDIR" Target="[INSTALLDIR]putty.exe"
303                     Name="$(var.ProgramName)" Advertise="no">
304             <!-- Set AppUserModelId to match what PuTTY sets at
305                  runtime. I don't know if this does anything directly
306                  useful on the desktop version of the shortcut, but we
307                  might as well keep it consistent with the Start Menu
308                  version in case someone starts manually moving or
309                  copying shortcuts around. -->
310             <ShortcutProperty
311                 Key="{9F4C2855-9F79-4B39-A8D0-E1D42DE1D5F3}, 5"
312                 Value="SimonTatham.PuTTY" />
313           </Shortcut>
314           <RegistryValue Root="HKLM"
315                          Key="$(var.RegKeyPathLocation)\DesktopEntry"
316                          Type="string" Value="" KeyPath="yes" />
317         </Component>
318       </Directory>
319     </Directory>
320
321     <!--
322         Detect an installation of PuTTY made by the old Inno Setup
323         installer, and refuse to run if we find one. I don't know what
324         would happen if you tried anyway, but since they install files
325         at the same pathnames, it surely wouldn't end well.
326
327         It could be argued that a better approach would be to actually
328         _launch_ the Inno Setup uninstaller automatically at this
329         point (prompting the user first, of course), but I'm not
330         nearly skilled enough with WiX to know how, or even if it's
331         feasible.
332     -->
333     <Property Id="LEGACYINNOSETUPINSTALLERNATIVE32PROPERTY">
334       <RegistrySearch
335           Id="LegacyInnoSetupInstallerNative32RegSearch"
336           Root="HKLM"
337           Key="SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\PuTTY_is1"
338           Name="QuietUninstallString" Type="raw" />
339     </Property>
340     <Property Id="LEGACYINNOSETUPINSTALLER32ON64PROPERTY">
341       <RegistrySearch
342           Id="LegacyInnoSetupInstaller32On64RegSearch"
343           Root="HKLM"
344           Key="SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\PuTTY_is1"
345           Name="QuietUninstallString" Type="raw" />
346     </Property>
347     <Condition Message="A version of PuTTY is already installed on this system using the old Inno Setup installer. Please uninstall that before running the new installer.">
348       <![CDATA[Installed OR
349                (LEGACYINNOSETUPINSTALLERNATIVE32PROPERTY = "" AND
350                 LEGACYINNOSETUPINSTALLER32ON64PROPERTY = "")]]>
351     </Condition>
352
353     <!--
354         Separate the installation into 'features', which are parts of
355         the install that can be chosen separately.
356
357         Since PuTTY is tiny, I haven't bothered to separate the actual
358         _files_ into features; I've just put them all in a single
359         feature that's always installed. The only features that are
360         separately disableable are the auxiliary ones for desktop
361         shortcuts, .PPK file extension and modifying PATH.
362
363         DesktopFeature (the desktop icon) is disabled by default, on
364         the basis of not cluttering up desktops too much unless
365         someone actually wants it. The .PPK association and PATH are
366         behind-the-scenes sorts of thing, so they're on by default.
367
368         (The old Inno Setup installer also made it optional whether
369         PuTTY got a Start Menu subfolder. That seems to be harder in
370         WiX, because the Start Menu shortcuts are tied in to the
371         installation of the files themselves, so the Start Menu
372         subfolder is mandatory if you're using this installer at all.
373         That doesn't seem unreasonable to me - if you don't want
374         _that_, you might as well just unpack the zip file and not
375         bother with an installer at all.)
376     -->
377     <Feature Id="FilesFeature" Level="1" Absent="disallow" AllowAdvertise="no"
378              Title="Install PuTTY files">
379       <ComponentRef Id="PuTTY_Component" />
380       <ComponentRef Id="Pageant_Component" />
381       <ComponentRef Id="PSFTP_Component" />
382       <ComponentRef Id="PuTTYgen_Component" />
383       <ComponentRef Id="Plink_Component" />
384       <ComponentRef Id="PSCP_Component" />
385       <ComponentRef Id="HelpFile_Component" />
386       <ComponentRef Id="Website_Component" />
387       <ComponentRef Id="LICENCE_Component" />
388       <ComponentRef Id="README_Component" />
389       <ComponentRef Id="ProgramMenuDir" />
390     </Feature>
391     <Feature Id="DesktopFeature" Level="2" Absent="allow" AllowAdvertise="no"
392              Title="Add shortcut to PuTTY on the Desktop">
393       <ComponentRef Id="Desktop_Shortcut_Component" />
394     </Feature>
395     <Feature Id="PathFeature" Level="1" Absent="allow" AllowAdvertise="no"
396              Title="Put install directory on the PATH for command prompts">
397       <ComponentRef Id="Path_Component" />
398     </Feature>
399     <Feature Id="PPKFeature" Level="1" Absent="allow" AllowAdvertise="no"
400              Title="Associate .PPK files with PuTTYgen and Pageant">
401       <ComponentRef Id="PPK_Assoc_Component" />
402     </Feature>
403
404     <!--
405         Installer user interface.
406
407         WiX provides several pre-cooked UIs, but annoyingly, every
408         single one of them has the wrong combination of features for
409         what I want. For example, WixUI_InstallDir lets me select the
410         install directory, but not the feature set. WixUI_Advanced
411         lets me select both, but also insists on giving me the option
412         of per-user vs systemwide install (and I haven't managed to
413         get per-user to behave sensibly). And _most_ of them insist on
414         having a click-through EULA page in the interface, which I
415         absolutely don't want - the MIT licence does not need to be
416         presented as a EULA at all (if you didn't accept it in your
417         mind you had no business copying the software in the first
418         place, and it's not imposing any scary restrictions anyway).
419
420         So what we see below is my own sequence of UI dialogs, all
421         included by reference from the WiX standard set. It's probably
422         most similar to WixUI_InstallDir, but I've removed LicenseDlg
423         and included FeaturesDlg.
424
425         (I'm not actually sure that FeaturesDlg is all that good a fit
426         for this particular project, with a treeview control that
427         doesn't really get used as a tree, and inappropriate wording
428         in the dropdown you use to select or deselect features.
429         Perhaps in future I might replace it with a simpler dialog box
430         containing a checkbox for each of the desktop shortcut, the
431         PATH addition and the PPK associations.)
432     -->
433     <UIRef Id="WixUI_Common" />
434
435     <UI>
436       <TextStyle Id="WixUI_Font_Normal" FaceName="Tahoma" Size="8" />
437       <TextStyle Id="WixUI_Font_Bigger" FaceName="Tahoma" Size="12" />
438       <TextStyle Id="WixUI_Font_Title" FaceName="Tahoma" Size="9" Bold="yes" />
439
440       <Property Id="DefaultUIFont" Value="WixUI_Font_Normal" />
441       <Property Id="WixUI_Mode" Value="InstallDir" />
442
443       <DialogRef Id="BrowseDlg" />
444       <DialogRef Id="DiskCostDlg" />
445       <DialogRef Id="ErrorDlg" />
446       <DialogRef Id="FatalError" />
447       <DialogRef Id="FilesInUse" />
448       <DialogRef Id="MsiRMFilesInUse" />
449       <DialogRef Id="PrepareDlg" />
450       <DialogRef Id="ProgressDlg" />
451       <DialogRef Id="ResumeDlg" />
452       <DialogRef Id="UserExit" />
453       <DialogRef Id="FeaturesDlg" />
454
455       <Publish Dialog="BrowseDlg" Control="OK" Event="DoAction" Value="WixUIValidatePath" Order="3">1</Publish>
456       <Publish Dialog="BrowseDlg" Control="OK" Event="SpawnDialog" Value="InvalidDirDlg" Order="4"><![CDATA[NOT WIXUI_DONTVALIDATEPATH AND WIXUI_INSTALLDIR_VALID<>"1"]]></Publish>
457
458       <Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999">1</Publish>
459
460       <Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="InstallDirDlg">NOT Installed</Publish>
461       <Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="FeaturesDlg">Installed</Publish>
462
463       <Publish Dialog="InstallDirDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg">1</Publish>
464       <Publish Dialog="InstallDirDlg" Control="Next" Event="SetTargetPath" Value="[WIXUI_INSTALLDIR]" Order="1">1</Publish>
465       <Publish Dialog="InstallDirDlg" Control="Next" Event="DoAction" Value="WixUIValidatePath" Order="2">NOT WIXUI_DONTVALIDATEPATH</Publish>
466       <Publish Dialog="InstallDirDlg" Control="Next" Event="SpawnDialog" Value="InvalidDirDlg" Order="3"><![CDATA[NOT WIXUI_DONTVALIDATEPATH AND WIXUI_INSTALLDIR_VALID<>"1"]]></Publish>
467       <Publish Dialog="InstallDirDlg" Control="Next" Event="NewDialog" Value="FeaturesDlg" Order="4">WIXUI_DONTVALIDATEPATH OR WIXUI_INSTALLDIR_VALID="1"</Publish>
468       <Publish Dialog="InstallDirDlg" Control="ChangeFolder" Property="_BrowseProperty" Value="[WIXUI_INSTALLDIR]" Order="1">1</Publish>
469       <Publish Dialog="InstallDirDlg" Control="ChangeFolder" Event="SpawnDialog" Value="BrowseDlg" Order="2">1</Publish>
470
471       <Publish Dialog="FeaturesDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg">Installed</Publish>
472       <Publish Dialog="FeaturesDlg" Control="Back" Event="NewDialog" Value="InstallDirDlg">NOT Installed</Publish>
473       <Publish Dialog="FeaturesDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
474
475       <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="InstallDirDlg" Order="1">NOT Installed</Publish>
476       <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg" Order="2">Installed AND NOT PATCH</Publish>
477       <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="2">Installed AND PATCH</Publish>
478
479       <Publish Dialog="MaintenanceWelcomeDlg" Control="Next" Event="NewDialog" Value="MaintenanceTypeDlg">1</Publish>
480
481       <Publish Dialog="MaintenanceTypeDlg" Control="RepairButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
482       <Publish Dialog="MaintenanceTypeDlg" Control="RemoveButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
483       <Publish Dialog="MaintenanceTypeDlg" Control="Back" Event="NewDialog" Value="MaintenanceWelcomeDlg">1</Publish>
484
485       <Publish Dialog="ExitDialog" Control="Finish" Event="DoAction" 
486                Value="LaunchApplication">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed</Publish>
487
488       <!--
489           This ARPNOMODIFY flag prohibits changing the set of
490           installed features, which would otherwise be possible by
491           reactivating the same MSI (from its original disk file, or
492           in Add/Remove Programs, or I think also by GUID on the
493           msiexec command line) and selecting 'Change' from the
494           maintenance-type dialog.
495
496           The reason I've prohibited it is because I couldn't get it
497           to *work* in my initial testing - it would look as if it had
498           done the right thing, but in fact the features it should
499           have removed would still be there after the installer
500           finished running. So if any WiX expert can help me fix this,
501           I'd love to take this flag out and make the installation
502           retrospectively modifiable!
503
504           (As well as removing this flag and fixing whatever the
505           problem is, I'd also have to add a line in the above set of
506           Publish tags which points MaintenanceTypeDlg's ChangeButton
507           at FeaturesDlg.)
508       -->
509       <Property Id="ARPNOMODIFY" Value="1" />
510     </UI>
511
512     <!--
513         Offer to display README after installation.
514     -->
515     <Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT"
516               Value="View README file" />
517     <Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOX" Value="1" />
518     <Property Id="WixShellExecTarget" Value="[#README_File]" />
519     <CustomAction Id="LaunchApplication" BinaryKey="WixCA"
520                   DllEntry="WixShellExec" Impersonate="yes" />
521
522     <!-- Glue: tell the install dir part of the UI what id my actual
523          install dir is known by. Otherwise the former won't know how
524          to alter the setting of the latter. -->
525     <Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR" />
526
527     <!--
528         Include my custom installer artwork, created in Buildscr.
529     -->
530     <WixVariable Id="WixUIDialogBmp" Value="msidialog.bmp" />
531     <WixVariable Id="WixUIBannerBmp" Value="msibanner.bmp" />
532
533     <!--
534         Set the icon that will show up in Add/Remove Programs.
535
536         http://www.codeproject.com/Articles/43564/WiX-Tricks says that
537         for some weird reason the Id of this icon has to end in .exe.
538     -->
539     <Icon Id="installericon.exe" SourceFile="puttyins.ico" />
540     <Property Id="ARPPRODUCTICON" Value="installericon.exe" />
541
542   </Product>
543 </Wix>