forked from adoptium/installer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMain.wxs.template
240 lines (222 loc) · 17 KB
/
Main.wxs.template
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
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<?include $(sys.CURRENTDIR)\Workdir\$(var.OutputBaseFilename)-$(var.ProductSku).Variables.wxi ?>
<Product Id="$(var.ProductId)" Name="$(var.ProductNameWithVersion)" Language="$(var.ProductLanguage)" Version="$(var.ProductVersion)" Manufacturer="$(var.ProductManufacturer)" UpgradeCode="$(var.ProductUpgradeCode)">
<Package Description="$(var.PackageDescription)" Manufacturer="$(var.ProductManufacturer)" InstallerVersion="200" Compressed="yes" />
<MajorUpgrade DowngradeErrorMessage="!(loc.DowngradeDenied)"/>
<Media Id="1" Cabinet="Data1.cab" EmbedCab="yes" CompressionLevel="high" />
<Property Id="ARPHELPLINK" Value="!(loc.ProductHelpLink)" />
<Property Id="ARPURLINFOABOUT" Value="!(loc.ProductUrlInfoAbout)" />
<Property Id="ARPURLUPDATEINFO" Value="!(loc.ProductUrlUpdateInfo)" />
<Property Id="ALLUSERS" Value="2" /> <!-- Allow per User or per Machine setup -->
<Property Id="ARPPRODUCTICON" Value="logo.ico" />
<Property Id="ORACLE_VERSION_KEY" Value="$(var.OracleVersionKey)" />
<Property Id="ORACLE_JAVASOFT_BASE_KEY" Value="$(var.OracleJavasoftBaseKey)" />
<Property Id="DLL_PATH" Value="$(var.DllPath)" />
<SetProperty Id="ARPINSTALLLOCATION" Value="[INSTALLDIR]" After="CostFinalize" />
<Icon Id="logo.ico" SourceFile="{vendor_branding_logo}" />
<!-- Windows 7 and later is required. -->
<Condition Message="!(loc.OSVersionRequired)"><![CDATA[Installed OR VersionNT >= 601]]></Condition>
<Condition Message="!(loc.ProductIsNotSupportedOnItanium)"><![CDATA[(Not ITANIUM = "Itanium") AND (Not ITANIUM = "Itanium 2")]]></Condition>
<!--
We may need to be able to install JDK in parallel. Therefore an in-place
upgrade need to be disabled. Keep the code as reference in case we allow
this in future or with JRE.
<Upgrade Id="$(var.ProductUpgradeCode)">
<UpgradeVersion OnlyDetect="yes" Minimum="$(var.ProductVersion)" Property="NEWPRODUCTFOUND" IncludeMinimum="no" />
<UpgradeVersion Minimum="$(var.RTMProductVersion)" IncludeMinimum="yes" Maximum="$(var.ProductVersion)" Property="UPGRADEFOUND" IncludeMaximum="no" MigrateFeatures="yes" />
</Upgrade>
<CustomAction Id="PreventDowngrading" Error="!(loc.NewerVersionInstalled)" />
<InstallExecuteSequence>
<Custom Action="PreventDowngrading" After="FindRelatedProducts">NEWPRODUCTFOUND</Custom>
<RemoveExistingProducts After="InstallFinalize" />
</InstallExecuteSequence>
<InstallUISequence>
<Custom Action="PreventDowngrading" After="FindRelatedProducts">NEWPRODUCTFOUND</Custom>
</InstallUISequence>
-->
<!-- Define the directory structure -->
<Directory Id="TARGETDIR" Name="SourceDir">
<?if $(env.Platform)=x86?>
<Directory Id="ProgramFilesFolder">
<Directory Id="PRODUCTMANUFACTURER" Name="$(var.ProductManufacturer)">
<Directory Id="INSTALLDIR" Name="$(var.AppFolder)" />
</Directory>
</Directory>
<?elseif $(env.Platform)=x64?>
<Directory Id="ProgramFiles64Folder">
<Directory Id="PRODUCTMANUFACTURER" Name="$(var.ProductManufacturer)">
<Directory Id="INSTALLDIR" Name="$(var.AppFolder)" />
</Directory>
</Directory>
<?elseif $(env.Platform)=arm64?>
<Directory Id="ProgramFilesARMFolder" Name="Program Files (Arm)">
<Directory Id="PRODUCTMANUFACTURER" Name="$(var.ProductManufacturer)">
<Directory Id="INSTALLDIR" Name="$(var.AppFolder)" />
</Directory>
</Directory>
<?else?>
<!-- unknown arch > build must failed without directory-->
<?endif?>
</Directory>
<!--
RemoveFolderEx requires that we "remember" the path for uninstall.
This workaround is only required for the uninstall.
-->
<Property Id="INSTALLDIR_PER_MACHINE">
<RegistrySearch Id="INSTALLDIR_REGSEARCH_HKLM" Root="HKLM" Key="SOFTWARE\$(var.ProductManufacturer)\$(var.ProductCategory)\$(var.ProductVersion)\$(var.JVM)\MSI" Name="Path" Type="raw" />
</Property>
<Property Id="INSTALLDIR_PER_USER">
<RegistrySearch Id="INSTALLDIR_REGSEARCH_HKCU" Root="HKCU" Key="SOFTWARE\$(var.ProductManufacturer)\$(var.ProductCategory)\$(var.ProductVersion)\$(var.JVM)\MSI" Name="Path" Type="raw" />
</Property>
<CustomAction Id="PerMachineInstall" Property="TARGETDIR" Value="[INSTALLDIR_PER_MACHINE]" Execute="immediate"/>
<CustomAction Id="PerUserInstall" Property="TARGETDIR" Value="[INSTALLDIR_PER_USER]" Execute="immediate"/>
<InstallExecuteSequence>
<Custom Action="PerMachineInstall" Before="CostFinalize">ALLUSERS=1 OR (ALLUSERS=2 AND Privileged)</Custom>
<Custom Action="PerUserInstall" Before="CostFinalize">ALLUSERS="" OR (ALLUSERS=2 AND (NOT Privileged))</Custom>
</InstallExecuteSequence>
<!-- Add the shortcuts to your installer package -->
<DirectoryRef Id="INSTALLDIR">
<Component Id="CleanupMainInstallDir" Guid="*">
<RegistryValue Root="HKMU" Key="SOFTWARE\$(var.ProductManufacturer)\$(var.ProductCategory)\$(var.ProductVersion)\$(var.JVM)\MSI" Name="Path" Type="string" Value="[INSTALLDIR]" KeyPath="yes" />
<RegistryValue Root="HKMU" Key="SOFTWARE\$(var.ProductManufacturer)\$(var.ProductCategory)\$(var.ProductVersion)\$(var.JVM)\MSI" Name="Main" Type="integer" Value="1" />
<!-- We need to use INSTALLDIR variable here or RemoveFolderEx will not remove on "install". -->
<util:RemoveFolderEx On="uninstall" Property="INSTALLDIR" />
<RemoveFolder Id="PRODUCTMANUFACTURER_REMOVE" Directory="PRODUCTMANUFACTURER" On="uninstall" />
</Component>
<Component Id="AddToEnvironmentPath" Guid="*">
<RegistryValue Root="HKMU" Key="SOFTWARE\$(var.ProductManufacturer)\$(var.ProductCategory)\$(var.ProductVersion)\$(var.JVM)\MSI" Name="EnvironmentPath" Type="integer" Value="1" KeyPath="yes" />
</Component>
<Component Id="AddToEnvironmentPathSystem" Guid="*">
<Condition>ALLUSERS=1 OR (ALLUSERS=2 AND Privileged)</Condition>
<RegistryValue Root="HKMU" Key="SOFTWARE\$(var.ProductManufacturer)\$(var.ProductCategory)\$(var.ProductVersion)\$(var.JVM)\MSI" Name="EnvironmentPathSetForSystem" Type="integer" Value="1" KeyPath="yes" /> <!-- Only to get a Keypath and can use Guid="*" for having different guid for each installer -->
<Environment Id="PATH_SYSTEM" Name="PATH" Value="[INSTALLDIR]bin" Permanent="no" Part="first" Action="set" System="yes" />
</Component>
<Component Id="AddToEnvironmentPathUser" Guid="*">
<Condition>ALLUSERS="" OR (ALLUSERS=2 AND (NOT Privileged))</Condition>
<RegistryValue Root="HKMU" Key="SOFTWARE\$(var.ProductManufacturer)\$(var.ProductCategory)\$(var.ProductVersion)\$(var.JVM)\MSI" Name="EnvironmentPathSetForUser" Type="integer" Value="1" KeyPath="yes" /> <!-- Only to get a Keypath and can use Guid="*" for having different guid for each installer -->
<Environment Id="PATH_USER" Name="PATH" Value="[INSTALLDIR]bin" Permanent="no" Part="first" Action="set" System="no" />
</Component>
<Component Id="SetJavaHomeVariable" Guid="*">
<RegistryValue Root="HKMU" Key="SOFTWARE\$(var.ProductManufacturer)\$(var.ProductCategory)\$(var.ProductVersion)\$(var.JVM)\MSI" Name="JavaHome" Type="integer" Value="1" KeyPath="yes" />
</Component>
<Component Id="SetJavaHomeVariableSystem" Guid="*">
<Condition>ALLUSERS=1 OR (ALLUSERS=2 AND Privileged)</Condition>
<RegistryValue Root="HKMU" Key="SOFTWARE\$(var.ProductManufacturer)\$(var.ProductCategory)\$(var.ProductVersion)\$(var.JVM)\MSI" Name="JavaHomeSetForSystem" Type="integer" Value="1" KeyPath="yes" /> <!-- Only to get a Keypath and can use Guid="*" for having different guid for each installer -->
<Environment Id="JAVA_HOME_SYSTEM" Name="JAVA_HOME" Value="[INSTALLDIR]" Permanent="no" Action="set" System="yes" />
</Component>
<Component Id="SetJavaHomeVariableUser" Guid="*">
<Condition>ALLUSERS="" OR (ALLUSERS=2 AND (NOT Privileged))</Condition>
<RegistryValue Root="HKMU" Key="SOFTWARE\$(var.ProductManufacturer)\$(var.ProductCategory)\$(var.ProductVersion)\$(var.JVM)\MSI" Name="JavaHomeSetForUser" Type="integer" Value="1" KeyPath="yes" /> <!-- Only to get a Keypath and can use Guid="*" for having different guid for each installer -->
<Environment Id="JAVA_HOME_USER" Name="JAVA_HOME" Value="[INSTALLDIR]" Permanent="no" Action="set" System="no" />
</Component>
<!-- Add jar launch by double click -->
<Component Id="SetJarFileRunWith" Guid="*">
<!--
https://support.microsoft.com/en-us/help/256986/windows-registry-information-for-advanced-users
If you write keys to a key under HKEY_CLASSES_ROOT, the system stores the information under HKEY_LOCAL_MACHINE\Software\Classes.
If you write values to a key under HKEY_CLASSES_ROOT, and the key already exists under HKEY_CURRENT_USER\Software\Classes, the system will store the information there instead of under HKEY_LOCAL_MACHINE\Software\Classes.
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.jar\OpenWithProgids
is automatically created by Windows when running jar file for the first time
-->
<RegistryValue Root="HKMU" Key="SOFTWARE\Classes\.jar" Type="string" Value="{vendor}.jarfile" KeyPath="yes" />
<RegistryValue Root="HKMU" Key="SOFTWARE\Classes\.jar" Type="string" Name="Content Type" Value="application/java-archive" KeyPath="no" />
<RegistryValue Root="HKMU" Key="SOFTWARE\Classes\{vendor}.jarfile\shell\open\command" Type="string" Value=""[INSTALLDIR]bin\javaw.exe" -jar "%1" %*" KeyPath="no" />
</Component>
<Component Id="SetOracleJavaSoftKeysCurrentVersion" Guid="*">
<Condition><![CDATA[NOT JAVASOFT_CURRENTVERSION OR JAVASOFT_CURRENTVERSION <> "1.8" AND JAVASOFT_CURRENTVERSION < $(var.ProductMajorVersion)]]></Condition>
<RegistryValue Root="HKLM" Key="SOFTWARE\JavaSoft\[ORACLE_JAVASOFT_BASE_KEY]" Name="CurrentVersion" Type="string" Value="[ORACLE_VERSION_KEY]" KeyPath="yes" />
</Component>
<Component Id="SetOracleJavaSoftKeys" Guid="*">
<RegistryValue Root="HKLM" Key="SOFTWARE\JavaSoft\[ORACLE_JAVASOFT_BASE_KEY]\[ORACLE_VERSION_KEY]" Name="JavaHome" Type="string" Value="[INSTALLDIR]" KeyPath="yes" />
<?if $(env.PRODUCT_CATEGORY)="jre"?>
<RegistryValue Root="HKLM" Key="SOFTWARE\JavaSoft\[ORACLE_JAVASOFT_BASE_KEY]\[ORACLE_VERSION_KEY]" Name="RuntimeLib" Type="string" Value="[INSTALLDIR][DLL_PATH]" KeyPath="no" />
<!-- Oracle dont set RuntimeLib for JDK .. because JRE is "private" JRE so no ?else? -->
<?endif?>
<RegistryValue Root="HKLM" Key="SOFTWARE\JavaSoft\[ORACLE_JAVASOFT_BASE_KEY]\$(var.ProductVersion)" Name="JavaHome" Type="string" Value="[INSTALLDIR]" KeyPath="no" />
<?if $(env.PRODUCT_CATEGORY)="jre"?>
<RegistryValue Root="HKLM" Key="SOFTWARE\JavaSoft\[ORACLE_JAVASOFT_BASE_KEY]\$(var.ProductVersion)" Name="RuntimeLib" Type="string" Value="[INSTALLDIR][DLL_PATH]" KeyPath="no" />
<!-- Oracle don't set RuntimeLib for JDK .. because JRE is "private" JRE so no ?else? -->
<?endif?>
</Component>
<!-- Add jnlp launch by double click -->
<?if $(env.Platform)=x64?>
<?if $(env.PRODUCT_MAJOR_VERSION)=8?>
<?if $(env.BUNDLE_ICEDTEAWEB)=true?>
<Component Id="SetJNLPFileRunWith" Guid="*">
<!--
https://support.microsoft.com/en-us/help/256986/windows-registry-information-for-advanced-users
If you write keys to a key under HKEY_CLASSES_ROOT, the system stores the information under HKEY_LOCAL_MACHINE\Software\Classes.
If you write values to a key under HKEY_CLASSES_ROOT, and the key already exists under HKEY_CURRENT_USER\Software\Classes, the system will store the information there instead of under HKEY_LOCAL_MACHINE\Software\Classes.
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.jnlp\OpenWithProgids
is automatically created by Windows when running jnlp file for the first time
-->
<RegistryValue Root="HKMU" Key="SOFTWARE\Classes\.jnlp" Type="string" Value="{vendor}.jnlpfile" KeyPath="yes" />
<RegistryValue Root="HKMU" Key="SOFTWARE\Classes\.jnlp" Type="string" Name="Content Type" Value="application/jnlp" KeyPath="no" />
<RegistryValue Root="HKMU" Key="SOFTWARE\Classes\{vendor}.jnlpfile\shell\open\command" Type="string" Value=""[INSTALLDIR]bin\javaws.exe" -jnlp "%1" %*" KeyPath="no" />
</Component>
<?endif?>
<?endif?>
<?endif?>
</DirectoryRef>
<Property Id="JAVASOFT_CURRENTVERSION">
<RegistrySearch Id="JAVASOFT_CURRENTVERSION"
Root="HKLM"
Key="SOFTWARE\JavaSoft\[ORACLE_JAVASOFT_BASE_KEY]"
Name="CurrentVersion"
Type="raw" />
</Property>
<!-- List of features to install -->
<Feature Id="FeatureMain" ConfigurableDirectory="INSTALLDIR" Level="1" Title="$(var.FeatureMainName)" Description="$(var.FeatureMainDescription)" Absent="disallow" Display="expand" AllowAdvertise="no" InstallDefault="local">
<ComponentRef Id="CleanupMainInstallDir" />
<ComponentGroupRef Id="AppFiles" />
<Feature Id="FeatureEnvironment" Level="1" Title="!(loc.FeatureEnvironmentTitle)" Description="!(loc.FeatureEnvironmentDescription)" Absent="allow" AllowAdvertise="no" InstallDefault="followParent">
<ComponentRef Id="AddToEnvironmentPath" />
<ComponentRef Id="AddToEnvironmentPathSystem" />
<ComponentRef Id="AddToEnvironmentPathUser" />
</Feature>
<Feature Id="FeatureJarFileRunWith" Level="1" Title="!(loc.FeatureJarFileRunWithTitle)" Description="!(loc.FeatureJarFileRunWithDescription)" Absent="allow" AllowAdvertise="no" InstallDefault="followParent">
<ComponentRef Id="SetJarFileRunWith" />
</Feature>
<Feature Id="FeatureJavaHome" Level="2" Title="!(loc.FeatureJavaHomeTitle)" Description="!(loc.FeatureJavaHomeDescription)" Absent="allow" AllowAdvertise="no" InstallDefault="followParent">
<ComponentRef Id="SetJavaHomeVariable" />
<ComponentRef Id="SetJavaHomeVariableSystem" />
<ComponentRef Id="SetJavaHomeVariableUser" />
</Feature>
<Feature Id="FeatureOracleJavaSoft" Level="2" Title="!(loc.FeatureOracleJavaSoftName)" Description="!(loc.FeatureOracleJavaSoftDescription)" Absent="allow" AllowAdvertise="no" InstallDefault="followParent" >
<!-- See https://docs.oracle.com/javase/9/install/installation-jdk-and-jre-microsoft-windows-platforms.htm#JSJIG-GUID-47C269A3-5220-412F-9E31-4B8C37A82BFB -->
<!-- As Oracle, don't override if current value is already bigger ( newer java ): "a value that is the highest installed version on the system"
Note !! : the reg key is not removed during uninstall if any other installer reference it
-->
<ComponentRef Id="SetOracleJavaSoftKeysCurrentVersion" />
<ComponentRef Id="SetOracleJavaSoftKeys" />
</Feature>
<?if $(env.Platform)=x64?>
<?if $(env.PRODUCT_MAJOR_VERSION)=8?>
<?if $(env.BUNDLE_ICEDTEAWEB)=true?>
<Feature Id="FeatureIcedTeaWeb" ConfigurableDirectory="INSTALLDIR" Level="2" Title="!(loc.FeatureIcedTeaWebTitle)" Description="!(loc.FeatureIcedTeaWebDescription)" Absent="allow" AllowAdvertise="no" InstallDefault="local">
<ComponentGroupRef Id="IcedTeaWebFiles" />
<Feature Id="FeatureJNLPFileRunWith" Level="3" Title="!(loc.FeatureJNLPFileRunWithTitle)" Description="!(loc.FeatureJNLPFileRunWithDescription)" Absent="allow" AllowAdvertise="no" InstallDefault="followParent">
<ComponentRef Id="SetJNLPFileRunWith" />
</Feature>
</Feature>
<?endif?>
<?endif?>
<?endif?>
</Feature>
<!-- <Feature Id="FeatureSource" ConfigurableDirectory="INSTALLDIR" Level="1" Title="!(loc.FeatureSourceTitle)" Description="!(loc.FeatureSourceDescription)" Absent="allow" AllowAdvertise="no" InstallDefault="local">
<ComponentGroupRef Id="SrcFiles" />
</Feature> -->
<WixVariable Id="WixUILicenseRtf" Value="$(var.SetupResourcesDir)\$(var.license)" />
<WixVariable Id="WixUIDialogBmp" Value="{vendor_branding_dialog}" />
<WixVariable Id="WixUIBannerBmp" Value="{vendor_branding_banner}" />
<UI>
<UIRef Id="WixUI_FeatureTree" />
<?if $(var.license_shown)=0 ?>
<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="CustomizeDlg" Order="3">1</Publish>
<!-- skip the page on the way back too -->
<Publish Dialog="CustomizeDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="3">1</Publish>
<?endif?>
</UI>
</Product>
</Wix>