/
KeybaseApps.wxs
292 lines (273 loc) · 14.6 KB
/
KeybaseApps.wxs
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
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="Keybase Apps" Language="1033" Version="$(env.KEYBASE_WINVER)" Manufacturer="Keybase, Inc." UpgradeCode="c118f7ec-9a1d-4ff1-91f5-15d208499d7b">
<Package InstallerVersion="500" Compressed="yes" InstallPrivileges="limited" InstallScope="perUser" />
<MediaTemplate EmbedCab="yes"/>
<Icon Id="ProductIcon" SourceFile="$(env.GOPATH)\src\github.com\keybase\client\media\icons\Keybase.ico"/>
<Property Id="ARPPRODUCTICON" Value="ProductIcon"/>
<Property Id="ARPHELPLINK" Value="https://www.keybase.io"/>
<Property Id="ARPURLINFOABOUT" Value="https://www.keybase.io"/>
<Property Id="MSIRESTARTMANAGERCONTROL" Value="Disable"/>
<!-- This seems to be the best way to detect pending reboot - MsiSystemRebootPending did NOT work -->
<Property Id="RESTART_PENDING">
<RegistrySearch Id="RestartPending"
Root="HKLM"
Key="SYSTEM\CurrentControlSet\Control\Session Manager"
Name="PendingFileRenameOperations"
Type="raw" />
</Property>
<MajorUpgrade DowngradeErrorMessage="A newer version of Keybase is already installed." AllowSameVersionUpgrades="yes" />
<Feature Id="ProductFeature" Title="Keybase Application" Level="1">
<ComponentGroupRef Id="ProductComponents" />
<ComponentGroupRef Id="GuiComps" />
<ComponentGroupRef Id="ApplicationShortcuts" />
<ComponentGroupRef Id="StartupShortcuts" />
<ComponentGroupRef Id="GuiStartMenuTileColors" />
<ComponentGroupRef Id="BrowserExtensionKbnm" />
</Feature>
<InstallExecuteSequence>
<InstallValidate Suppress="yes">FAKE_PROPERTY</InstallValidate>
<Custom Action="StopUpdater" Before="InstallValidate"><![CDATA[Installed]]></Custom>
<!-- These roaming actions are temporary, while we switch from appdata to localappdata. -->
<Custom Action="StopUpdaterRoaming" Before="InstallValidate"><![CDATA[Installed]]></Custom>
<Custom Action="StopMainAppRoaming" Before="StopGUI"><![CDATA[Installed]]></Custom>
<Custom Action="StopMainApp" Before="StopGUI"><![CDATA[Installed]]></Custom>
<Custom Action="RemoveBrowserExtension" Before="InstallValidate"><![CDATA[Installed]]></Custom>
<Custom Action="StopGUI" Before="InstallValidate"><![CDATA[Installed]]></Custom>
<Custom Action="RunMainAppDummyForRepair" Before="RunMainApp"><![CDATA[NOT (RESTART_PENDING >< "Dokan") AND NOT (REMOVE ~= "ALL")]]></Custom>
<Custom Action="RunMainApp" Before="InstallFinalize"><![CDATA[NOT (RESTART_PENDING >< "Dokan") AND NOT (REMOVE ~= "ALL")]]></Custom>
<Custom Action="RunGUI" Before="InstallFinalize"><![CDATA[NOT (RESTART_PENDING >< "Dokan") AND NOT (REMOVE ~= "ALL")]]></Custom>
<Custom Action="AddBrowserExtension" Before="InstallFinalize"><![CDATA[NOT (RESTART_PENDING >< "Dokan") AND NOT (REMOVE ~= "ALL")]]></Custom>
</InstallExecuteSequence>
<Property Id="Setup">Setup</Property>
<Property Id="ButtonText_No">&No</Property>
<Property Id="ButtonText_Yes">&Yes</Property>
<Property Id="ButtonText_Install">&Install</Property>
<Property Id="ButtonText_Cancel">Cancel</Property>
<Property Id="BannerBitmap">bannrbmp</Property>
<Property Id="Wizard">Setup Wizard</Property>
<Property Id="InfoIcon">info</Property>
<Binary Id="info" SourceFile="Binary\Info.ico" />
<Binary Id="bannrbmp" SourceFile="Binary\Banner.bmp" />
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="LocalAppDataFolder">
<Directory Id="INSTALLFOLDER" Name="Keybase">
</Directory>
</Directory>
<Directory Id="ProgramMenuFolder">
<Directory Id="ApplicationProgramsFolder" Name="Keybase"/>
</Directory>
<Directory Id="StartupFolder" Name="Startup" />
<Directory Id="SystemFolder" Name="System" />
<Directory Id="AppDataFolder">
<Directory Id="ROAMINGINSTALLFOLDER" Name="Keybase">
</Directory>
</Directory>
</Directory>
</Fragment>
<Fragment>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<Component Id="keybase.exe" Guid="88737432-0E15-413D-B23C-4B18D06EDC2C">
<CreateFolder />
<RemoveFolder Id="RemoveMyApp" On="uninstall" />
<!-- The heat tool output (which generates gui.wxs) won't work if there are directories with only subdirectories
and no removable components, so we have to special-case them here and in the xsl transform (gui.xsl) -->
<RemoveFolder Id="GuiResourcesDirRemove" On="uninstall" Directory="GuiResourcesDir"/>
<RemoveFolder Id="GuiNodeModulesDirRemove" On="uninstall" Directory="GuiNodeModulesDir"/>
<RemoveFolder Id="GuiRegeditDirRemove" On="uninstall" Directory="GuiRegeditDir"/>
<RemoveFolder Id="ROAMINGINSTALLFOLDERRemove" On="uninstall" Directory="ROAMINGINSTALLFOLDER"/>
<RemoveFolder Id="ApplicationProgramsFolderRemove" On="uninstall" Directory="ApplicationProgramsFolder"/>
<RegistryKey Root="HKCU" Key="Software\Keybase\Keybase">
<RegistryValue Name="KeybaseExe" Value="1" KeyPath="yes" Type="integer" />
</RegistryKey>
<File Id="keybase.exe" Source="$(env.GOPATH)\src\github.com\keybase\client\go\keybase\keybase.exe" Checksum="yes"/>
</Component>
<Component Id="keybaserq.exe" Guid="{4A8A451F-973A-4E59-AC42-A8A9878FC94B}">
<CreateFolder />
<RemoveFolder Id="RemoveMyKeybaseRQ" On="uninstall" />
<RegistryKey Root="HKCU" Key="Software\Keybase\Keybase">
<RegistryValue Name="keybaserqexe" Value="1" KeyPath="yes" Type="integer" />
</RegistryKey>
<File Id="keybaserq.exe" Source="$(env.GOPATH)\src\github.com\keybase\client\go\tools\runquiet\keybaserq.exe" Checksum="yes"/>
</Component>
<Component Id="KbfsDokanExe" Guid="{98A16FB9-D314-495A-806C-B75DCB74CF9D}">
<CreateFolder />
<RemoveFolder Id="RemoveDokan" On="uninstall" />
<RegistryKey Root="HKCU" Key="Software\Keybase\Keybase">
<RegistryValue Name="KbfsDokanExe" Value="1" KeyPath="yes" Type="integer" />
</RegistryKey>
<File Id='KbfsDokanExe' DiskId='1' Source="$(env.GOPATH)\src\github.com\keybase\kbfs\kbfsdokan\kbfsdokan.exe" />
</Component>
<Component Id="GitHelperExe" Guid="{d8938a5b-c45f-4942-b552-a357a5563329}">
<CreateFolder />
<RemoveFolder Id="RemoveGitHelper" On="uninstall" />
<RegistryKey Root="HKCU" Key="Software\Keybase\Keybase">
<RegistryValue Name="GitHelperExe" Value="1" KeyPath="yes" Type="integer" />
</RegistryKey>
<File Id='GitHelperExe' DiskId='1' Source="$(env.GOPATH)\src\github.com\keybase\kbfs\kbfsgit\git-remote-keybase\git-remote-keybase.exe" />
<Environment Id="PATH" Name="PATH" Value="[INSTALLFOLDER]" Permanent="no" Part="last" Action="set" System="no" />
</Component>
<Component Id="upd.exe" Guid="{65C18DA3-BCD5-4E18-9C80-AC66471B433A}">
<CreateFolder />
<RemoveFolder Id="RemoveUpdater" On="uninstall" />
<RegistryKey Root="HKCU" Key="Software\Keybase\Keybase">
<RegistryValue Name="updaterexe" Value="1" KeyPath="yes" Type="integer" />
</RegistryKey>
<File Id="upd.exe" Source="$(env.GOPATH)\src\github.com\keybase\go-updater\service\upd.exe" Checksum="yes"/>
</Component>
<Component Id="prompter.exe" Guid="{238016CC-6D9B-4B88-8618-EC1203F89CBF}">
<CreateFolder />
<RemoveFolder Id="RemovePrompterExe" On="uninstall" />
<RegistryKey Root="HKCU" Key="Software\Keybase\Keybase">
<RegistryValue Name="prompterexe" Value="1" KeyPath="yes" Type="integer" />
</RegistryKey>
<File Id="prompter.exe" Source="$(env.GOPATH)\src\github.com\keybase\go-updater\windows\WpfPrompter\WpfApplication1\bin\Release\prompter.exe" Checksum="yes"/>
</Component>
<!-- The cleaner will look at these to make sure it only scrubs the driver we installed -->
<Component Id="RegistryEntries" Guid="{753F8CE7-57CF-4824-865F-55B1FA520C48}">
<RegistryKey Root="HKCU"
Key="Software\Keybase\Keybase"
Action="createAndRemoveOnUninstall">
<RegistryValue Type="string" Name="DOKANPRODUCT86" Value="[DOKANPRODUCT86]"/>
<RegistryValue Type="string" Name="DOKANPRODUCT64" Value="[DOKANPRODUCT64]"/>
<RegistryValue Type="string" Name="BUNDLEKEY" Value="[BUNDLEKEY]"/>
</RegistryKey>
</Component>
</ComponentGroup>
</Fragment>
<Fragment>
<ComponentGroup Id="StartupShortcuts" Directory="StartupFolder">
<Component Id="AppShortCutStartUpComponent" Guid="{2EE65854-7CA1-4010-B62B-780F1C39ED0A}">
<Shortcut Id="AppShortCutStartUp" Name="KeybaseStartup"
Description="Start Keybase at boot"
Target="[INSTALLFOLDER]keybaserq.exe"
Arguments="keybase.exe ctl watchdog2"
WorkingDirectory="INSTALLFOLDER"/>
<RegistryKey Root="HKCU" Key="Software\Keybase\Keybase">
<RegistryValue Name="ShortCutStartUp" Type="integer" Value="1" KeyPath="yes" />
</RegistryKey>
</Component>
<Component Id="GUIShortCutStartUpComponent" Guid="{4AC98412-7636-4727-AB39-44A98E25249A}">
<Shortcut Id="GUIShortCutStartUp" Name="GUIStartup"
Description="Start GUI at boot"
Target="[INSTALLFOLDER]keybaserq.exe"
Arguments=""[GuiDir]Keybase.exe""
WorkingDirectory="GuiDir"/>
<RegistryKey Root="HKCU" Key="Software\Keybase\Keybase">
<RegistryValue Name="ShortCutStartUpGUI" Type="integer" Value="1" KeyPath="yes" />
</RegistryKey>
</Component>
</ComponentGroup>
</Fragment>
<Fragment>
<ComponentGroup Id="GuiStartMenuTileColors" Directory="GuiDir">
<Component Id="GUIShortcutVisualElementManifest" Guid="{CC9530CC-0A1B-4F92-829E-EBA66CA04FD8}">
<CreateFolder />
<RemoveFolder Id="RemoveGUIShortcutVisualElementManifest" On="uninstall" />
<RegistryKey Root="HKCU" Key="Software\Keybase\Keybase">
<RegistryValue Name="GUIShortcutVisualElementManifest" Value="1" KeyPath="yes" Type="integer" />
</RegistryKey>
<File Id="GUIShortcutVisualElementManifest.xml" Source="$(env.GOPATH)\src\github.com\keybase\client\packaging\windows\WIXInstallers\KeybaseApps\Keybase.visualelementsmanifest.xml" Checksum="yes"/>
</Component>
</ComponentGroup>
</Fragment>
<Fragment>
<ComponentGroup Id="BrowserExtensionKbnm" Directory="INSTALLFOLDER">
<Component Id="kbnm.exe" Guid="{FE0C96E0-FFC8-4256-A600-50FFFCF58349}">
<CreateFolder />
<RemoveFolder Id="RemoveMyBrowserExtensionExe" On="uninstall" />
<RegistryKey Root="HKCU" Key="Software\Keybase\Keybase">
<RegistryValue Name="kbnmexe" Value="1" KeyPath="yes" Type="integer" />
</RegistryKey>
<File Id="kbnm.exe" Source="$(env.GOPATH)\src\github.com\keybase\client\go\kbnm\kbnm.exe" Checksum="yes"/>
</Component>
</ComponentGroup>
</Fragment>
<Fragment>
<ComponentGroup Id="ApplicationShortcuts" Directory="ApplicationProgramsFolder">
<Component Id="GUIShortCutComponent" Guid="{034E2E25-3676-4101-87F5-F6E081CA446A}">
<Shortcut Id="GUIShortCut"
Name="Keybase"
Description="Start GUI"
Target="[GuiDir]Keybase.exe"
WorkingDirectory="GuiDir"/>
<RegistryKey Root="HKCU" Key="Software\Keybase\Keybase">
<RegistryValue Name="ShortCutGUI" Type="integer" Value="1" KeyPath="yes" />
</RegistryKey>
</Component>
</ComponentGroup>
</Fragment>
<Fragment>
<!-- This has to be run so the repairman can finish moving files before upd.exe is run by watchdog2 -->
<CustomAction Id="RunMainAppDummyForRepair"
Directory="INSTALLFOLDER"
ExeCommand="[INSTALLFOLDER]keybaserq.exe -wait "[INSTALLFOLDER]keybase.exe" --standalone ping"
Execute="commit"
Return="ignore"/>
</Fragment>
<Fragment>
<CustomAction Id="RunMainApp"
Directory="INSTALLFOLDER"
ExeCommand="[INSTALLFOLDER]keybaserq.exe "[INSTALLFOLDER]keybase.exe" ctl watchdog2"
Execute="commit"
Return="ignore"/>
</Fragment>
<Fragment>
<CustomAction Id="StopMainApp"
Directory="INSTALLFOLDER"
ExeCommand="[INSTALLFOLDER]keybaserq.exe -wait "[INSTALLFOLDER]keybase.exe" ctl stop --kill-kbfs"
Execute="immediate"
Return="ignore"/>
</Fragment>
<Fragment>
<CustomAction Id="StopUpdater"
Directory="INSTALLFOLDER"
ExeCommand="[INSTALLFOLDER]keybaserq.exe -wait [WindowsFolder]\System32\taskkill.exe /F /IM upd.exe"
Execute="immediate"
Return="ignore"/>
</Fragment>
<Fragment>
<CustomAction Id="StopMainAppRoaming"
Directory="ROAMINGINSTALLFOLDER"
ExeCommand="[ROAMINGINSTALLFOLDER]keybaserq.exe -wait "[ROAMINGINSTALLFOLDER]keybase.exe" ctl stop --kill-kbfs"
Execute="immediate"
Return="ignore"/>
</Fragment>
<Fragment>
<CustomAction Id="StopUpdaterRoaming"
Directory="ROAMINGINSTALLFOLDER"
ExeCommand="[ROAMINGINSTALLFOLDER]keybaserq.exe -wait [WindowsFolder]\System32\taskkill.exe /F /IM upd.exe"
Execute="immediate"
Return="ignore"/>
</Fragment>
<Fragment>
<CustomAction Id="RunGUI"
Directory="GuiDir"
ExeCommand="[INSTALLFOLDER]keybaserq.exe "[GuiDir]Keybase.exe""
Execute="commit"
Return="ignore"/>
</Fragment>
<Fragment>
<CustomAction Id="StopGUI"
Directory="INSTALLFOLDER"
ExeCommand="[INSTALLFOLDER]keybaserq.exe -wait [WindowsFolder]\System32\taskkill.exe /F /IM Keybase.exe"
Execute="immediate"
Return="ignore"/>
</Fragment>
<Fragment>
<CustomAction Id="AddBrowserExtension"
Directory="INSTALLFOLDER"
ExeCommand="[INSTALLFOLDER]keybaserq.exe -wait "[INSTALLFOLDER]kbnm.exe" install"
Execute="commit"
Return="ignore"/>
</Fragment>
<Fragment>
<CustomAction Id="RemoveBrowserExtension"
Directory="INSTALLFOLDER"
ExeCommand="[INSTALLFOLDER]keybaserq.exe -wait "[INSTALLFOLDER]kbnm.exe" uninstall"
Execute="immediate"
Return="ignore"/>
</Fragment>
</Wix>