/
Setup.wxs
285 lines (246 loc) · 19.2 KB
/
Setup.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
<?xml version="1.0" encoding="UTF-8"?>
<!-- These variables define the Windows Installer product version, product code and upgrade code. They -->
<!-- will be used later on in this file. -->
<?define Property_ProductVersion = "2.0.11.0" ?>
<?define Property_ProductCode = "D9457E26-03F5-41ac-A137-EA3132AC4D0F" ?>
<?define Property_UpgradeCode = "1AA59629-46C2-42d5-AD06-534A20F68296" ?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="$(var.Property_ProductCode)" UpgradeCode="$(var.Property_UpgradeCode)" Name="!(loc.Property_ProductName)" Language="!(loc.Property_ProductLanguage)" Version="$(var.Property_ProductVersion)" Manufacturer="!(loc.Property_CompanyName)">
<Package Description="!(loc.Package_Description)" Comments="!(loc.Package_Comments)" InstallerVersion="200" Compressed="yes" />
<PropertyRef Id="NETFRAMEWORK35" />
<!-- This information enables Windows Installer major upgrade functionality so users can seamlessly -->
<!-- install a new version of the product and have the old version automatically uninstall behind -->
<!-- the scenes. See the following topic in the MSDN Library for additional information: -->
<!-- http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/major_upgrades.asp -->
<Upgrade Id="$(var.Property_UpgradeCode)">
<UpgradeVersion Minimum="$(var.Property_ProductVersion)" OnlyDetect="yes" Property="NEWERVERSIONDETECTED" />
<UpgradeVersion Minimum="1.0.0.0" IncludeMinimum="yes" Maximum="$(var.Property_ProductVersion)" IncludeMaximum="no" Property="OLDERVERSIONBEINGUPGRADED" />
</Upgrade>
<!-- This custom action prevents users from installing if a newer version of this product is already -->
<!-- installed on the system. This is a part of Windows Installer major upgrade functionality. -->
<CustomAction Id="CA_BlockOlderVersionInstall" Error="!(loc.LaunchCondition_LaterVersion)" />
<!-- This custom action prevents users from installing this product on unsupported operating system -->
<!-- versions. The conditions that are checked for operating system version are defined below. -->
<CustomAction Id="CA_ErrWrongWindowsVersion" Error="!(loc.LaunchCondition_WrongOSVersion)" />
<!-- This condition adds an item to the LaunchCondition table of the MSI to block a user from -->
<!-- installing this product unless they have administrative privileges on the system. -->
<Condition Message="!(loc.LaunchCondition_AdminPrivs)">
<![CDATA[Privileged]]>
</Condition>
<Condition Message="!(loc.LaunchCondition_WrongDotNetFramework)">
<![CDATA[Installed OR NETFRAMEWORK35]]>
</Condition>
<!-- This is a list of directories that are used by this product as installation locations or custom -->
<!-- action file search locations. -->
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="WindowsFolder" Name="WINDOWS">
<Directory Id="EhomeFolder" Name="eHome"/>
</Directory>
<Directory Id="ProgramFilesFolder" Name="Program Files">
<Directory Id="MyCompany" Name="MediaBrowser">
<Directory Id="APPROOTDIRECTORY" Name="MediaBrowser"/>
</Directory>
</Directory>
<Directory Id="ProgramMenuFolder">
<Directory Id="ApplicationProgramsFolder" Name="Media Browser"/>
</Directory>
<Directory Id="TEMPDIR" Name="TempFolder"/>
</Directory>
<DirectoryRef Id="ApplicationProgramsFolder">
<Component Id="ApplicationShortcut" Guid="C68522A1-03ED-4416-8326-F1375212ACB0">
<Shortcut Id="ConfigurationWizard"
Name="Configuration Wizard"
Description="media browser configuration wizard"
Target="[APPROOTDIRECTORY]Configurator.exe"
WorkingDirectory="APPLICATIONROOTDIRECTORY"/>
<RemoveFolder Id="ApplicationProgramsFolder" On="uninstall"/>
<RegistryValue Root="HKCU" Key="Software\GPL\MediaBrowser" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
</Component>
</DirectoryRef>
<!-- This is a list of all components installed as a part of this product. A component is the -->
<!-- smallest atomic unit of installation in Windows Installer. Each component must have a unique -->
<!-- GUID. In general, it is recommended that each file be installed by a separate component in -->
<!-- order to avoid reference counting problems and make future servicing of this product easier. -->
<!-- Each component is listed as a child of the DirectoryRef that represents the directory that -->
<!-- the file it contains will install to. -->
<DirectoryRef Id="APPROOTDIRECTORY">
<Component Id="Configurator.exe" Guid="3186FBE0-641C-45f9-AA16-7EAA85B7405C" DiskId="1">
<File Id="Configurator.exe" Name="Configurator.exe" KeyPath="yes" Source="..\Configurator\bin\$(var.BuildType)\Configurator.exe" Checksum="yes" Vital="yes"/>
</Component>
<Component Id="MediaBrowser.dll" Guid="3D581843-2412-458d-AF79-29845B277677" DiskId="1">
<File Id="MediaBrowser.dll" Name="MediaBrowser.dll" KeyPath="yes" Source="..\MediaBrowser\bin\$(var.BuildType)\MediaBrowser.dll" Checksum="yes" Vital="yes" Assembly=".net"/>
</Component>
<Component Id="Registration.xml" Guid="C3CA4268-C97F-414f-99E8-BD1106A6B12C" DiskId="1">
<File Id="Registration.xml" Name="Registration.xml" Source="..\MediaBrowser\Registration.xml" Checksum="no" />
</Component>
<Component Id="Registration7.xml" Guid="C079A9EC-299A-4b0b-B5F3-9661E3A32AD0" DiskId="1">
<File Id="Registration7.xml" Name="Registration.xml7" Source="..\MediaBrowser\Registration7.xml" Checksum="no" />
</Component>
<Component Id="Application.png" Guid="85297F6D-29E5-4288-83EB-FBF9C2D70FE2" DiskId="1">
<File Id="Application.png" Name="Application.png" Source="..\MediaBrowser\Images\Application.png" Checksum="no" />
</Component>
<Component Id="ApplicationInactive.png" Guid="B555C4A3-415F-47a7-8565-C994A03F49C6" DiskId="1">
<File Id="ApplicationInactive.png" Name="ApplicationInactive.png" Source="..\MediaBrowser\Images\ApplicationInactive.png" Checksum="no" />
</Component>
</DirectoryRef>
<!-- This is a list of features that are installed as a part of this product. In this case, there is -->
<!-- only one feature. Each feature contains a list of components that it will install. Features can -->
<!-- can be displayed and allow user selection in setup UI if desired. -->
<Feature Id="APPROOTFEATURE" Title="MediaBrowser" Level="1">
<ComponentRef Id="Configurator.exe" />
<ComponentRef Id="MediaBrowser.dll" />
<ComponentRef Id="Application.png" />
<ComponentRef Id="ApplicationInactive.png" />
<ComponentRef Id="ApplicationShortcut" />
<ComponentRef Id="Registration.xml" />
<ComponentRef Id="Registration7.xml" />
</Feature>
<!-- The media table defines the location that the MSI will look to find source files during -->
<!-- installation or repair scenarios. In this case, the source files are in a cab file that will be -->
<!-- embedded directly into the MSI at build time. -->
<Media Id="1" Cabinet="Application.cab" EmbedCab="yes" />
<!-- These custom actions are used to register the application with Media Center using the utility -->
<!-- RegisterMceApp.exe that is installed as a part of the Windows Media Center feature. Each custom -->
<!-- action is defined as a pair in order to leverage the WiX QtExec custom action to suppress the -->
<!-- pop-up UI that would ordinarily appear when running RegisterMceApp.exe. Registering a Windows -->
<!-- Media Center application will fail if it is already registered, so this setup will first -->
<!-- unregister the application and then attempt to re-register it. This setup ignores the return -->
<!-- code from the unregistration custom action but checks the return code of the registration -->
<!-- action. If registration fails, setup will fail and roll back. These custom actions use the -->
<!-- REGISTERMCEAPP property that is defined below in order to find the exact location of the file -->
<!-- RegisterMceApp.exe on the system. -->
<CustomAction Id="CA_RegisterMceApp_Unregister_Install_Cmd" Property="CA_RegisterMceApp_Unregister_Install" Value=""[REGISTERMCEAPP]" /u /allusers "[#Registration.xml]""/>
<CustomAction Id="CA_RegisterMceApp_Unregister_Uninstall_Cmd" Property="CA_RegisterMceApp_Unregister_Uninstall" Value=""[REGISTERMCEAPP]" /u /allusers "[#Registration.xml]""/>
<CustomAction Id="CA_RegisterMceApp_Register_Cmd" Property="CA_RegisterMceApp_Register" Value=""[REGISTERMCEAPP]" /allusers "[#Registration.xml]""/>
<CustomAction Id="CA_RegisterMceApp_Rollback_Cmd" Property="CA_RegisterMceApp_Rollback" Value=""[REGISTERMCEAPP]" /u /allusers "[#Registration.xml]""/>
<!-- Windows 7 -->
<CustomAction Id="CA_RegisterMceApp_Unregister_Install_Cmd7" Property="CA_RegisterMceApp_Unregister_Install" Value=""[REGISTERMCEAPP]" /u /allusers "[#Registration7.xml]""/>
<CustomAction Id="CA_RegisterMceApp_Unregister_Uninstall_Cmd7" Property="CA_RegisterMceApp_Unregister_Uninstall" Value=""[REGISTERMCEAPP]" /u /allusers "[#Registration7.xml]""/>
<CustomAction Id="CA_RegisterMceApp_Register_Cmd7" Property="CA_RegisterMceApp_Register" Value=""[REGISTERMCEAPP]" /allusers "[#Registration7.xml]""/>
<CustomAction Id="CA_RegisterMceApp_Rollback_Cmd7" Property="CA_RegisterMceApp_Rollback" Value=""[REGISTERMCEAPP]" /u /allusers "[#Registration7.xml]""/>
<CustomAction Id="CA_RegisterMceApp_Unregister_Install" BinaryKey="WixCA" DllEntry="CAQuietExec" Execute="deferred" Return="ignore" Impersonate="no"/>
<CustomAction Id="CA_RegisterMceApp_Unregister_Uninstall" BinaryKey="WixCA" DllEntry="CAQuietExec" Execute="deferred" Return="ignore" Impersonate="no"/>
<CustomAction Id="CA_RegisterMceApp_Register" BinaryKey="WixCA" DllEntry="CAQuietExec" Execute="deferred" Return="check" Impersonate="no"/>
<CustomAction Id="CA_RegisterMceApp_Rollback" BinaryKey="WixCA" DllEntry="CAQuietExec" Execute="rollback" Return="ignore" Impersonate="no"/>
<CustomAction Id="CA_CheckDotNetFramework" BinaryKey="WixCA" ExeCommand="" />
<!-- The InstallExecuteSequence table describes the order that actions will be executed during -->
<!-- installation, repair and uninstall of this product. -->
<InstallExecuteSequence>
<Custom Action="CA_BlockOlderVersionInstall" After="FindRelatedProducts">
<![CDATA[NEWERVERSIONDETECTED]]>
</Custom>
<RemoveExistingProducts After="InstallValidate" />
<LaunchConditions After="AppSearch"/>
<!-- This custom action searches for Windows version 6.0, the Windows Media Center Ident registry -->
<!-- value 5.0 and the presence of the file %windir%\eHome\RegisterMceApp.exe. If all of these -->
<!-- conditions are met, the system is a Windows Vista Home Premium or Ultimate Edition operating -->
<!-- system and the product will be allowed to install. -->
<Custom Action="CA_ErrWrongWindowsVersion" Before="CostInitialize"><![CDATA[(NOT VersionNT >= 600 OR NOT REGISTERMCEAPP) AND NOT Installed]]></Custom>
<Custom Action="CA_RegisterMceApp_Unregister_Install_Cmd" After="CostFinalize">
<![CDATA[(NOT REMOVE) AND (VersionNT = 600)]]>
</Custom>
<Custom Action="CA_RegisterMceApp_Unregister_Uninstall_Cmd" After="CA_RegisterMceApp_Unregister_Install_Cmd" >
<![CDATA[(REMOVE) AND (NOT UPGRADINGPRODUCTCODE) AND (VersionNT = 600)]]>
</Custom>
<Custom Action="CA_RegisterMceApp_Register_Cmd" After="CA_RegisterMceApp_Unregister_Uninstall_Cmd">
<![CDATA[NOT REMOVE AND (VersionNT = 600)]]>
</Custom>
<Custom Action="CA_RegisterMceApp_Rollback_Cmd" After="CA_RegisterMceApp_Register_Cmd">
<![CDATA[NOT REMOVE AND (VersionNT = 600)]]>
</Custom>
<!-- Win 7 -->
<Custom Action="CA_RegisterMceApp_Unregister_Install_Cmd7" After="CostFinalize">
<![CDATA[(NOT REMOVE) AND (VersionNT = 601)]]>
</Custom>
<Custom Action="CA_RegisterMceApp_Unregister_Uninstall_Cmd7" After="CA_RegisterMceApp_Unregister_Install_Cmd7" >
<![CDATA[(REMOVE) AND (NOT UPGRADINGPRODUCTCODE) AND (VersionNT = 601)]]>
</Custom>
<Custom Action="CA_RegisterMceApp_Register_Cmd7" After="CA_RegisterMceApp_Unregister_Uninstall_Cmd7">
<![CDATA[NOT REMOVE AND (VersionNT = 601)]]>
</Custom>
<Custom Action="CA_RegisterMceApp_Rollback_Cmd7" After="CA_RegisterMceApp_Register_Cmd7">
<![CDATA[NOT REMOVE AND (VersionNT = 601)]]>
</Custom>
<!-- This unregistration custom action must occur before files are removed during uninstall of the -->
<!-- product because the custom action requires the registration XML file in order to run -->
<!-- correctly. It is conditioned to only run during uninstall using the REMOVE condition. -->
<Custom Action="CA_RegisterMceApp_Unregister_Uninstall" Before="RemoveFiles">
<![CDATA[REMOVE]]>
</Custom>
<!-- This sequence of actions is important. In order to allow the roll back custom action to run -->
<!-- at the correct time in case the setup fails, it must be scheduled before the other actions -->
<!-- because Windows Installer pushes each action onto a stack and then pops them off of the stack -->
<!-- in case of any failure in order to accomplish the roll back. -->
<Custom Action="CA_RegisterMceApp_Rollback" After="InstallFiles">
<![CDATA[NOT REMOVE]]>
</Custom>
<Custom Action="CA_RegisterMceApp_Unregister_Install" After="CA_RegisterMceApp_Rollback">
<![CDATA[NOT REMOVE]]>
</Custom>
<Custom Action="CA_RegisterMceApp_Register" After="CA_RegisterMceApp_Unregister_Install">
<![CDATA[NOT REMOVE]]>
</Custom>
</InstallExecuteSequence>
<!-- The InstallUISequence table describes the order that actions will be executed when the user -->
<!-- runs setup in full UI mode. Some actions must be scheduled in the UI and the execute sequence -->
<!-- tables to ensure that they will run regardless of whether the user runs setup in full UI mode -->
<!-- or in reduced UI or silent modes. -->
<InstallUISequence>
<Custom Action="CA_BlockOlderVersionInstall" After="FindRelatedProducts">
<![CDATA[NEWERVERSIONDETECTED]]>
</Custom>
<Custom Action="CA_ErrWrongWindowsVersion" Before="CostInitialize"><![CDATA[(NOT VersionNT >= 600 OR NOT REGISTERMCEAPP) AND NOT Installed]]></Custom>
</InstallUISequence>
<!-- These properties define links that will appear in the Add/Remove Programs control panel when -->
<!-- this product is installed on the system. -->
<Property Id="ARPHELPLINK" Value="!(loc.Property_ArpHelpLink)" />
<Property Id="ARPURLINFOABOUT" Value="!(loc.Property_ArpUrlInfoAbout)" />
<!-- This property defines the ALLUSERS property to be 1, which indicates that this product will be -->
<!-- installed per-machine instead of per-user. -->
<Property Id="ALLUSERS">
<![CDATA[1]]>
</Property>
<!-- This property uses a registry locator to determine the version of Windows Media Center present -->
<!-- on the system (if any). This registry-based version detection algorithm is documented in the -->
<!-- Windows Media Center SDK for Windows Vista. -->
<Property Id="MCEINSTALLVERSION" Secure="yes">
<RegistrySearch Id="MceInstallRegKey" Root="HKLM" Key="SOFTWARE\Microsoft\Windows\CurrentVersion\Media Center" Name="Ident" Type="raw"/>
</Property>
<!-- This property uses an AppSearch to attempt to locate the file %windir\eHome\ehShell.exe on the -->
<!-- system. If it is found, the property is set to the fully qualified path to this file, and this -->
<!-- path is used to create a desktop shortcut to launch the application in Windows Media Center. -->
<Property Id="EHSHELLEXE" Secure="yes">
<DirectorySearch Id="EhomeDirectory2" Path="[WindowsFolder]\ehome">
<FileSearch Id="EhShellExe" Name="ehShell.exe" MinVersion="6.0.0.0" />
</DirectorySearch>
</Property>
<!-- This property uses an AppSearch to attempt to locate the file %windir\eHome\RegisterMceApp.exe -->
<!-- on the system. If it is found, the property is set to the fully qualified path to this file, -->
<!-- and this path is used to call RegisterMceApp.exe in several custom actions listed above to -->
<!-- register this application with Windows Media Center. -->
<Property Id="REGISTERMCEAPP" Secure="yes">
<DirectorySearch Id="EhomeDirectory" Path="[WindowsFolder]\ehome">
<FileSearch Id="RegisterMceAppExe" Name="RegisterMceApp.exe" />
</DirectorySearch>
</Property>
<!-- This property is used as the default installation directory, and the user can change this path -->
<!-- during setup. The Id must be set to WIXUI_INSTALLDIR and the value must match the directory Id -->
<!-- defined above that represents the root installation directory. -->
<Property Id="WIXUI_INSTALLDIR" Value="APPROOTDIRECTORY"/>
<!-- This UIRef element specifies what WiXUI dialog set to use for the setup UI. This package uses -->
<!-- the WixUI_InstallDir dialog set, which provides a welcome page, a license agreement page, a -->
<!-- page to allow changing the installation path, an installation confirmation page, a progress -->
<!-- page and a completion page. Other dialog sets are available in the WiX toolset and are -->
<!-- described in more detail in the WiX documentation. -->
<UIRef Id="WixUI_InstallDir"/>
<!-- In WiX v3.0, this variable is used to override the default license agreement text that is -->
<!-- included in the WixUIExtension with a custom file. -->
<WixVariable Id="WixUILicenseRtf" Value="License.rtf" />
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOX" Value="1" />
<CustomAction Id="StartAppOnExit" FileKey="Configurator.exe" ExeCommand="" Execute="immediate" Impersonate="yes" Return="asyncNoWait" />
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="Configure initial settings" />
<UI>
<Publish Dialog="ExitDialog" Control="Finish" Order="1" Event="DoAction" Value="StartAppOnExit">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed</Publish>
</UI>
</Product>
</Wix>