-
Notifications
You must be signed in to change notification settings - Fork 15
/
build.wxs
219 lines (178 loc) · 10.6 KB
/
build.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
<?xml version='1.0' encoding='windows-1252'?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<!-- Set product upgrade code for later upgrade of HDFView -->
<?define ProductUpgradeCode = "75386B8B-ABB3-492A-EF6B-75A62D699B65"?>
<!-- Set variables to determine whether target platform is 32- or 64-bit -->
<?if $(sys.BUILDARCH) = x64 ?>
<?define Win64 = "yes" ?>
<?define PlatformProgramFilesFolder = "ProgramFiles64Folder" ?>
<?else ?>
<?define Win64 = "no" ?>
<?define PlatformProgramFilesFolder = "ProgramFilesFolder" ?>
<?endif ?>
<!-- Give an error if product name and version were not passed to candle.exe from within ANT -->
<?ifndef productName ?>
<?error productName must be defined. ?>
<?endif?>
<?ifndef productVersion ?>
<?error productVersion must be defined. ?>
<?endif?>
<Product Name="$(var.productName) $(var.productVersion)"
Manufacturer="The HDF Group"
Language="1033"
Id="*"
UpgradeCode="$(var.ProductUpgradeCode)"
Codepage="1252"
Version="$(var.productVersion)">
<Package Id="*"
Keywords="Installer"
Description="A visual tool for browsing and editing HDF files."
Manufacturer="The HDF Group"
Platform="$(sys.BUILDARCH)"
Languages="1033"
Compressed="yes"
InstallerVersion="500"
SummaryCodepage="1252" />
<Upgrade Id="$(var.ProductUpgradeCode)">
<UpgradeVersion Minimum="$(var.productVersion)" OnlyDetect="yes" Property="NEWERVERSIONDETECTED" />
<UpgradeVersion Minimum="1.0.0" IncludeMinimum="yes" Maximum="$(var.productVersion)" IncludeMaximum="no" Property="OLDERVERSIONBEINGUPGRADED" />
</Upgrade>
<InstallExecuteSequence>
<RemoveExistingProducts After="InstallValidate" />
</InstallExecuteSequence>
<Media Id="1"
Cabinet="media.cab"
EmbedCab="yes" />
<!-- Reference to HDF icon to be used later -->
<Icon Id="hdf_icon" SourceFile="src\hdf\view\icons\hdfview.ico"/>
<!-- Property to set the default program installation folder name -->
<Property Id="ApplicationFolderName" Value="HDF_Group\$(var.productName)\$(var.productVersion)" />
<!-- Property to set the default installation type selection for per-machine
vs per-user installs. Default is per-machine system-wide install,
which generally requires admin rights. -->
<Property Id="WixAppFolder" Value="WixPerMachineFolder" />
<!-- Generate folder structure for install -->
<Directory Id="TARGETDIR" Name="SourceDir">
<!-- Folder to install main application to -->
<Directory Id="$(var.PlatformProgramFilesFolder)">
<Directory Id="HDFDir" Name="HDF_Group">
<Directory Id="HDFViewDir" Name="$(var.productName)">
<Directory Id="APPLICATIONFOLDER" Name="$(var.productVersion)" />
</Directory>
</Directory>
</Directory>
<!-- Folder to install to for Start Menu shortcut -->
<Directory Id="ProgramMenuFolder">
<Directory Id="ApplicationProgramsFolder" Name="$(var.productName)-$(var.productVersion)"/>
</Directory>
<!-- Folder to install to for Desktop shortcut -->
<Directory Id="DesktopFolder" Name="Desktop"/>
</Directory>
<!-- Register main application and add hdf file associations -->
<Feature Id="MainApplication" Title="Main Application" Level="1">
<ComponentGroupRef Id="MediaGroup" />
<Component Id="FILE_ASSOCIATIONS" Guid="{1C4371C4-80EA-4B1C-8B1B-A634513F67DE}" Directory="APPLICATIONFOLDER" KeyPath="yes">
<!-- Manually add hdfview.bat since heat file-scraping doesn't assign it an Id -->
<File Id="HDFViewBat" Source="$(var.releasedir)\hdfview.bat" />
<!-- Associate HDFView with the file extensions: hdf, hdf4, h4, hdf5, h5, he2, he5 -->
<ProgId Id="HDF_FILE">
<Extension Id="hdf" ContentType="application/hdf">
<Verb Id="open" Command="Open" TargetFile="HDFViewBat" Argument='"%1"' />
</Extension>
</ProgId>
<ProgId Id="HDF4_FILE">
<Extension Id="hdf4" ContentType="application/hdf4">
<Verb Id="open" Command="Open" TargetFile="HDFViewBat" Argument='"%1"' />
</Extension>
</ProgId>
<ProgId Id="H4_FILE">
<Extension Id="h4" ContentType="application/h4">
<Verb Id="open" Command="Open" TargetFile="HDFViewBat" Argument='"%1"' />
</Extension>
</ProgId>
<ProgId Id="HDF5_FILE">
<Extension Id="hdf5" ContentType="application/hdf5">
<Verb Id="open" Command="Open" TargetFile="HDFViewBat" Argument='"%1"' />
</Extension>
</ProgId>
<ProgId Id="H5_FILE">
<Extension Id="h5" ContentType="application/h5">
<Verb Id="open" Command="Open" TargetFile="HDFViewBat" Argument='"%1"' />
</Extension>
</ProgId>
<ProgId Id="HE2_FILE">
<Extension Id="he2" ContentType="application/he2">
<Verb Id="open" Command="Open" TargetFile="HDFViewBat" Argument='"%1"' />
</Extension>
</ProgId>
<ProgId Id="HE5_FILE">
<Extension Id="he5" ContentType="application/he5">
<Verb Id="open" Command="Open" TargetFile="HDFViewBat" Argument='"%1"' />
</Extension>
</ProgId>
<ProgId Id="FITS_FILE">
<Extension Id="fits" ContentType="application/fits">
<Verb Id="open" Command="Open" TargetFile="HDFViewBat" Argument='"%1"' />
</Extension>
</ProgId>
<ProgId Id="NC_FILE">
<Extension Id="nc" ContentType="application/nc">
<Verb Id="open" Command="Open" TargetFile="HDFViewBat" Argument='"%1"' />
</Extension>
</ProgId>
</Component>
</Feature>
<!-- Feature for adding Start Menu and Desktop Shortcuts if wanted -->
<Feature Id="Shortcuts" Title="Create Start Menu and Desktop Shortcuts" Level="1">
<Component Id="StartMenuShortcut" Directory="ApplicationProgramsFolder" Guid="A9B52E31-0ABA-4AC6-8723-9128E5574F8C">
<Shortcut Id="ApplicationStartMenuShortcut"
Name="$(var.productName)-$(var.productVersion)"
Description="$(var.productName)-$(var.productVersion), a visual tool for browsing and editing HDF files."
Target="[APPLICATIONFOLDER]\hdfview.bat"
Icon="hdf_icon"
WorkingDirectory="APPLICATIONFOLDER"/>
<RemoveFolder Id="ApplicationProgramsFolder" On="uninstall"/>
<RegistryValue Root="HKCU" Key="Software\HDF_Group\$(var.productName)-$(var.productVersion)" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
</Component>
<Component Id="DesktopShortcut" Directory="DesktopFolder" Guid="F1BDA726-9967-4B3D-A4D6-3F1340B4DC50">
<Shortcut Id="HDFViewDesktopShortcut"
Directory="DesktopFolder"
Name="$(var.productName)-$(var.productVersion)"
WorkingDirectory="APPLICATIONFOLDER"
Target="[APPLICATIONFOLDER]\hdfview.bat"
Description="$(var.productName)-$(var.productVersion), a visual tool for browsing and editing HDF files."
Icon="hdf_icon"/>
<RemoveFile Id="HDFViewDesktopShortcut" Name="$(var.productName)-$(var.productVersion)" On="uninstall"/>
<RegistryValue Root="HKCU" Key="Software\HDF_Group\$(var.productName)-$(var.productVersion)" Name="App" Type="integer" Value="1" KeyPath="yes"/>
</Component>
</Feature>
<!-- Set up UI -->
<UI>
<UIRef Id="WixUI_Advanced" />
<Publish Dialog="ExitDialog"
Control="Finish"
Event="DoAction"
Value="LaunchApplication">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed</Publish>
</UI>
<!-- Customize exit dialog text and ask user if they want to launch HDFView after install -->
<Property Id="WIXUI_EXITDIALOGOPTIONALTEXT"
Value="$(var.productName)-$(var.productVersion) has been installed on your computer." />
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="Launch $(var.productName)-$(var.productVersion)" />
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOX" Value="1" />
<Property Id="WixShellExecTarget" Value="[#HDFViewBat]" />
<CustomAction Id="LaunchApplication" BinaryKey="WixCA" DllEntry="WixShellExec" Impersonate="yes" />
<!-- Override default Program Files/Program Files (x86) folder due to a bug in WixUI_Advanced -->
<CustomAction Id="Overwrite_WixSetDefaultPerMachineFolder" Property="WixPerMachineFolder" Value="[$(var.PlatformProgramFilesFolder)][ApplicationFolderName]" Execute="immediate" />
<InstallUISequence>
<Custom Action="Overwrite_WixSetDefaultPerMachineFolder" After="WixSetDefaultPerMachineFolder" />
</InstallUISequence>
<!-- Override default Local AppData folder due to the default path including an unwanted "Apps" subfolder -->
<CustomAction Id="Overwrite_WixSetDefaultPerUserFolder" Property="WixPerUserFolder" Value="[LocalAppDataFolder][ApplicationFolderName]" Execute="immediate" />
<InstallUISequence>
<Custom Action="Overwrite_WixSetDefaultPerUserFolder" After="WixSetDefaultPerUserFolder" />
</InstallUISequence>
<!-- Add HDF icon for HDFView to Add/Remove Programs in Windows -->
<Property Id="ARPPRODUCTICON" Value="hdf_icon" />
<!-- Replace default bitmaps in installer -->
</Product>
</Wix>