installer.wxs 30 KB

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