| 1 |
<?xml version="1.0" encoding="UTF-8"?> |
| 2 |
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> |
| 3 |
|
| 4 |
<!-- OpenNI2 installation script |
| 5 |
|
| 6 |
Prerequisites: |
| 7 |
WiX - http://wix.sourceforge.net/ |
| 8 |
Python 2.7 - http://www.python.org/getit/releases/2.7/ |
| 9 |
PyWin32 - http://sourceforge.net/projects/pywin32/ |
| 10 |
Doxygen - http://www.doxygen.org/ |
| 11 |
Microsoft HTML Help - http://msdn.microsoft.com/en-us/library/windows/desktop/ms669985%28v=vs.85%29.aspx |
| 12 |
|
| 13 |
The Install project performs the following: |
| 14 |
1) Run the redist script (use existing-no rebuild, as this is done by Visual Studio's references). |
| 15 |
2) Use heat.exe harvester to build RedistFragments.wxs containing all the files to be installed. |
| 16 |
3) Compile the install to .msi file (* see notes). |
| 17 |
4) Convert the installer .msi to an executable using setupbld.exe. |
| 18 |
|
| 19 |
* Please note that the following warnings/errors were suppressed: |
| 20 |
1) Heat.exe warnings (called in pre-build): |
| 21 |
5150 - String too long warnings, ignored. |
| 22 |
2) ICE errors: |
| 23 |
ICE38 - The compiler thinks the installer is writing to the user's applications menu when |
| 24 |
in fact it is writing to the 'all-users' menu. |
| 25 |
This causes an error as it is required to write registry key to HKCU when doing so. |
| 26 |
If we write a registry key, it does not help, as we are not writing to the user at all, so it was suppressed. |
| 27 |
ICE43 - Similar to ICE38, same root cause, so was suppressed as well. |
| 28 |
3) Compiler warnings: |
| 29 |
1076 - Warning when compiler tries to process the driver files (it mismatches the file type). |
| 30 |
--> |
| 31 |
|
| 32 |
<?include $(sys.CURRENTDIR)Includes\Variables.wxi ?> |
| 33 |
|
| 34 |
<Product Id="*" Name="$(var.ProductFullName)" Language="!(loc.LANG)" Version="$(var.VersionNumber)" |
| 35 |
Manufacturer="!(loc.ManufacturerName)" UpgradeCode="$(var.UpgradeCode)"> |
| 36 |
<Package InstallerVersion="300" Compressed="yes" InstallScope="perMachine" |
| 37 |
Platform="$(var.Platform)" InstallPrivileges="elevated" /> |
| 38 |
|
| 39 |
<Media Id="1" Cabinet="media1.cab" EmbedCab="yes" CompressionLevel="low"/> |
| 40 |
|
| 41 |
<MajorUpgrade Schedule="afterInstallInitialize" AllowSameVersionUpgrades="yes" IgnoreRemoveFailure="yes" |
| 42 |
DowngradeErrorMessage="A later version of [ProductName] is already installed. Setup will now exit." /> |
| 43 |
|
| 44 |
<!-- |
| 45 |
Startup conditions that checks if we're running the OS higher than Windows XP SP2. |
| 46 |
If not the installation is aborted. |
| 47 |
By doing the (Installed OR ...) property means that this condition will only |
| 48 |
be evaluated if the app is being installed and not on uninstall or changing |
| 49 |
--> |
| 50 |
<Condition Message="!(loc.AppNotSupported)"> |
| 51 |
<![CDATA[Installed OR ((VersionNT >= 501 AND ServicePackLevel >= 2) OR (VersionNT >= 502))]]> |
| 52 |
</Condition> |
| 53 |
|
| 54 |
<UIRef Id="CostumeInstallUI" /> |
| 55 |
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLLOCATION" /> |
| 56 |
|
| 57 |
<!-- Set the icon to show next to the program name in Add/Remove programs --> |
| 58 |
<Icon Id="MainIcon.ico" SourceFile="$(var.ResourcesDir)\mainicon.ico" /> |
| 59 |
<Property Id="ARPPRODUCTICON" Value="MainIcon.ico" /> |
| 60 |
|
| 61 |
<WixVariable Id="WixUIDialogBmp" Value="$(var.ResourcesDir)\OpenNIBackground.bmp"/> |
| 62 |
<WixVariable Id="WixUIBannerBmp" Value="$(var.ResourcesDir)\OpenNIHeader.bmp" /> |
| 63 |
|
| 64 |
<!-- Directory structure --> |
| 65 |
<Directory Id="TARGETDIR" Name="SourceDir"> |
| 66 |
|
| 67 |
<!-- Program Files --> |
| 68 |
<Directory Id="$(var.PlatformProgramFilesFolder)"> |
| 69 |
<Directory Id="INSTALLLOCATION" Name="OpenNI2"> |
| 70 |
<Directory Id="Redist" Name="Redist"/> |
| 71 |
<Directory Id="Include" Name="Include"/> |
| 72 |
<Directory Id="Lib" Name="Lib"/> |
| 73 |
<Directory Id="Driver" Name="Driver"/> |
| 74 |
<Directory Id="Tools" Name="Tools"/> |
| 75 |
<Directory Id="Samples" Name="Samples"> |
| 76 |
<Directory Id="SamplesBin" Name="Bin"/> |
| 77 |
</Directory> |
| 78 |
<Directory Id="Documentation" Name="Documentation"/> |
| 79 |
</Directory> |
| 80 |
</Directory> |
| 81 |
|
| 82 |
<!-- Start Menu --> |
| 83 |
<Directory Id="ProgramMenuFolder"> |
| 84 |
<Directory Id="ApplicationProgramsFolder" Name="$(var.ProductShortName) $(var.MajorVersion)" > |
| 85 |
<Directory Id="DocumentationMenu" Name="Documentation" /> |
| 86 |
<Directory Id="SamplesMenu" Name="Samples" /> |
| 87 |
<Directory Id="ToolsMenu" Name="Tools" /> |
| 88 |
</Directory> |
| 89 |
</Directory> |
| 90 |
|
| 91 |
</Directory> |
| 92 |
|
| 93 |
<!-- Cleanup --> |
| 94 |
<DirectoryRef Id="INSTALLLOCATION"> |
| 95 |
<Component Id="RemoveINSTALLLOCATIONComponent" Guid="53E5601C-6AB5-40EA-9FB3-DF88B029D25B"> |
| 96 |
<RemoveFolder Id="RemoveINSTALLLOCATION" On="uninstall"/> |
| 97 |
</Component> |
| 98 |
</DirectoryRef> |
| 99 |
|
| 100 |
<!-- Start Menu --> |
| 101 |
<DirectoryRef Id="ApplicationProgramsFolder"> |
| 102 |
<Component Id="Shortcuts" Guid="$(var.ShortcutsGuid)" > |
| 103 |
|
| 104 |
<RemoveFolder Id="RemoveApplicationProgramsFolder" On="uninstall" /> |
| 105 |
<RemoveFolder Id="RemoveSamples" Directory="SamplesMenu" On="uninstall" /> |
| 106 |
<RemoveFolder Id="RemoveDocumentation" Directory="DocumentationMenu" On="uninstall" /> |
| 107 |
<RemoveFolder Id="RemoveTools" Directory="ToolsMenu" On="uninstall" /> |
| 108 |
|
| 109 |
<Shortcut Id="SimpleViewer" Name="SimpleViewer" Target="[SamplesBin]SimpleViewer.exe" |
| 110 |
WorkingDirectory="SamplesBin" Directory="SamplesMenu" /> |
| 111 |
<Shortcut Id="SimpleRead" Name="SimpleRead" Target="[SamplesBin]SimpleRead.exe" |
| 112 |
WorkingDirectory="SamplesBin" Directory="SamplesMenu" /> |
| 113 |
<Shortcut Id="SamplesDir" Name="Samples Directory" Target="[Samples]" |
| 114 |
WorkingDirectory="Samples" Directory="SamplesMenu" /> |
| 115 |
|
| 116 |
<Shortcut Id="OpenNIHelp" Name="OpenNI $(var.MajorVersion).$(var.MinorVersion) Documentation" Target="[Documentation]OpenNI.chm" |
| 117 |
WorkingDirectory="DocumentationMenu" Directory="DocumentationMenu" /> |
| 118 |
|
| 119 |
<Shortcut Id="OpenNIJavaHelp" Name="OpenNI $(var.MajorVersion).$(var.MinorVersion) Java Documentation" Target="[Documentation]java/index.html" |
| 120 |
WorkingDirectory="DocumentationMenu" Directory="DocumentationMenu" /> |
| 121 |
|
| 122 |
<Shortcut Id="NiViewer" Name="NiViewer" Target="[Tools]NiViewer.exe" |
| 123 |
WorkingDirectory="Tools" Directory="ToolsMenu" /> |
| 124 |
|
| 125 |
<Shortcut Id="PS1080Console" Name="PS1080Console" Target="[Tools]PS1080Console.exe" |
| 126 |
WorkingDirectory="Tools" Directory="ToolsMenu" /> |
| 127 |
|
| 128 |
<Shortcut Id="PSLinkConsole" Name="PSLinkConsole" Target="[Tools]PSLinkConsole.exe" |
| 129 |
WorkingDirectory="Tools" Directory="ToolsMenu" /> |
| 130 |
|
| 131 |
<Shortcut Id="UninstallProduct" Name="Uninstall OpenNI" Target="[SystemFolder]msiexec.exe" |
| 132 |
Arguments="/x [ProductCode]" Directory="ApplicationProgramsFolder"/> |
| 133 |
|
| 134 |
</Component> |
| 135 |
</DirectoryRef> |
| 136 |
<DirectoryRef Id="ApplicationProgramsFolder"> |
| 137 |
<Component Id="RemoveShortcuts" Guid="8BE20F1A-E91E-4BC5-8ABF-83D819C55CFE" > |
| 138 |
<RemoveFolder Id="RemoveShortcutFolder" On="uninstall" /> |
| 139 |
</Component> |
| 140 |
</DirectoryRef> |
| 141 |
|
| 142 |
<DirectoryRef Id="TARGETDIR"> |
| 143 |
<Component Id="RegistryEntries" Guid="*" > |
| 144 |
|
| 145 |
<RegistryKey Root="HKLM" Key="Software\OpenNI2" Action="none" > |
| 146 |
<RegistryValue Type="string" Name="InstallDir" Value="[INSTALLLOCATION]" /> |
| 147 |
<RegistryValue Type="string" Name="Version" Value="$(var.VersionNumber)"/> |
| 148 |
</RegistryKey> |
| 149 |
|
| 150 |
<RegistryKey Root="HKCR" Key=".oni" Action="createAndRemoveOnUninstall" > |
| 151 |
<RegistryValue Type="string" Value="NIRecording"/> |
| 152 |
</RegistryKey> |
| 153 |
|
| 154 |
<RegistryKey Root="HKCR" Key="NIRecording" Action="createAndRemoveOnUninstall"> |
| 155 |
<RegistryValue Type="string" Value="OpenNI Recording File"/> |
| 156 |
</RegistryKey> |
| 157 |
|
| 158 |
<RegistryKey Root="HKCR" Key="NIRecording\DefaultIcon" Action="createAndRemoveOnUninstall"> |
| 159 |
<RegistryValue Type="string" Value="[Tools]NiViewer$(var.PlatformSuffix).exe,0"/> |
| 160 |
</RegistryKey> |
| 161 |
|
| 162 |
<RegistryKey Root="HKCR" Key="NIRecording\shell\open\command" Action="createAndRemoveOnUninstall"> |
| 163 |
<RegistryValue Type="string" Value="[Tools]NiViewer.exe %1"/> |
| 164 |
</RegistryKey> |
| 165 |
|
| 166 |
</Component> |
| 167 |
</DirectoryRef> |
| 168 |
|
| 169 |
<!-- Environment Variables --> |
| 170 |
<DirectoryRef Id="TARGETDIR" > |
| 171 |
<Component Id="EnvironmentVars" Guid="$(var.EnvironmentVarsGuid)" DiskId="1" > |
| 172 |
<Environment Id="OPENNIREDIST" |
| 173 |
Action="set" |
| 174 |
Part="all" |
| 175 |
Name="OPENNI2_REDIST$(var.PlatformSuffix)" |
| 176 |
Permanent="no" |
| 177 |
System="yes" |
| 178 |
Value="[Redist]" /> |
| 179 |
<Environment Id="OPENNIINCLUDE" |
| 180 |
Action="set" |
| 181 |
Part="all" |
| 182 |
Name="OPENNI2_INCLUDE$(var.PlatformSuffix)" |
| 183 |
Permanent="no" |
| 184 |
System="yes" |
| 185 |
Value="[Include]"/> |
| 186 |
<Environment Id="OPENNILIB" |
| 187 |
Action="set" |
| 188 |
Part="all" |
| 189 |
Name="OPENNI2_LIB$(var.PlatformSuffix)" |
| 190 |
Permanent="no" |
| 191 |
System="yes" |
| 192 |
Value="[Lib]"/> |
| 193 |
</Component> |
| 194 |
</DirectoryRef> |
| 195 |
|
| 196 |
<!-- Install the visual studio 2008 DLLs--> |
| 197 |
<DirectoryRef Id="TARGETDIR"> |
| 198 |
<?if $(var.Platform)="x86"?> |
| 199 |
<Merge Id="VCRedist2008" SourceFile="$(var.ResourcesDir)\\Microsoft_VC90_CRT_x86.msm" DiskId="1" Language="0" /> |
| 200 |
<Merge Id="VCRedist2010" SourceFile="$(var.ResourcesDir)\\Microsoft_VC100_CRT_x86.msm" DiskId="1" Language="0" /> |
| 201 |
<?else?> |
| 202 |
<Merge Id="VCRedist2008" SourceFile="$(var.ResourcesDir)\\Microsoft_VC90_CRT_x86_x64.msm" DiskId="1" Language="0"/> |
| 203 |
<Merge Id="VCRedist2010" SourceFile="$(var.ResourcesDir)\\Microsoft_VC100_CRT_x64.msm" DiskId="1" Language="0"/> |
| 204 |
<?endif?> |
| 205 |
</DirectoryRef> |
| 206 |
|
| 207 |
<!-- Install the USB Driver --> |
| 208 |
<CustomAction Id='drivex86Install' Directory="Driver" Return="ignore" Impersonate="no" Execute="deferred" |
| 209 |
ExeCommand=""[Driver]dpinst-x86.exe" /sw /el" /> |
| 210 |
<CustomAction Id='driveamd64Install' Directory="Driver" Return="ignore" Impersonate="no" Execute="deferred" |
| 211 |
ExeCommand=""[Driver]dpinst-amd64.exe" /sw /el"/> |
| 212 |
|
| 213 |
<!-- Install features --> |
| 214 |
<Feature Id="ProductFeature" Title="OpenNI2" Level="1"> |
| 215 |
|
| 216 |
<!-- Uninstall components (cleanup) --> |
| 217 |
<ComponentRef Id="RemoveINSTALLLOCATIONComponent" /> |
| 218 |
<ComponentRef Id="RemoveShortcuts" /> |
| 219 |
|
| 220 |
<!-- Install components --> |
| 221 |
<ComponentGroupRef Id="RedistComponentGroup" /> |
| 222 |
<!-- Note: The following ComponentGroupRef is required to pull in generated authoring from project references. --> |
| 223 |
<ComponentGroupRef Id="Product.Generated" /> |
| 224 |
<ComponentRef Id="RegistryEntries" /> |
| 225 |
<ComponentRef Id="EnvironmentVars" /> |
| 226 |
<ComponentRef Id="Shortcuts" /> |
| 227 |
|
| 228 |
<!-- Uninstall components (cleanup #2) --> |
| 229 |
<ComponentRef Id="RemoveShortcuts" /> |
| 230 |
<ComponentRef Id="RemoveINSTALLLOCATIONComponent" /> |
| 231 |
|
| 232 |
</Feature> |
| 233 |
|
| 234 |
<Feature Id="VCRedist" Title="Visual C++ 9.0 Runtime" AllowAdvertise="no" Display="hidden" Level="1" > |
| 235 |
<MergeRef Id="VCRedist2008" /> |
| 236 |
<MergeRef Id="VCRedist2010" /> |
| 237 |
</Feature> |
| 238 |
|
| 239 |
<WixVariable Id="WixUICostingPopupOptOut" Value="0" /> |
| 240 |
|
| 241 |
<InstallExecuteSequence> |
| 242 |
<Custom Action='driveamd64Install' After='PublishProduct'><![CDATA[NOT Installed AND VersionNT64]]></Custom> |
| 243 |
<Custom Action='drivex86Install' After='PublishProduct'><![CDATA[NOT Installed AND NOT VersionNT64]]></Custom> |
| 244 |
</InstallExecuteSequence> |
| 245 |
|
| 246 |
</Product> |
| 247 |
</Wix> |