aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/resources/main.wxs
blob: d2d0b55aea7a8f0502f4db4495820dbac25593d4 (plain) (blame)
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
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
     xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">

  <?ifdef JpIsSystemWide ?>
    <?define JpInstallScope="perMachine"?>
  <?else?>
    <?define JpInstallScope="perUser"?>
  <?endif?>

  <?define JpProductLanguage=1033 ?>
  <?define JpInstallerVersion=200 ?>
  <?define JpCompressedMsi=yes ?>

  <?ifdef JpAllowUpgrades ?>
    <?define JpUpgradeVersionOnlyDetectUpgrade="no"?>
  <?else?>
    <?define JpUpgradeVersionOnlyDetectUpgrade="yes"?>
  <?endif?>
  <?ifdef JpAllowDowngrades ?>
    <?define JpUpgradeVersionOnlyDetectDowngrade="no"?>
  <?else?>
    <?define JpUpgradeVersionOnlyDetectDowngrade="yes"?>
  <?endif?>

  <?include $(var.JpConfigDir)/overrides.wxi ?>

  <Product
    Id="$(var.JpProductCode)"
    Name="$(var.JpAppName)"
    Language="$(var.JpProductLanguage)"
    Version="$(var.JpAppVersion)"
    Manufacturer="$(var.JpAppVendor)"
    UpgradeCode="$(var.JpProductUpgradeCode)">

    <Package
      Description="$(var.JpAppDescription)"
      Manufacturer="$(var.JpAppVendor)"
      InstallerVersion="$(var.JpInstallerVersion)"
      Compressed="$(var.JpCompressedMsi)"
      InstallScope="$(var.JpInstallScope)" Platform="x64"
    />

    <Media Id="1" Cabinet="Data.cab" EmbedCab="yes" />

    <Upgrade Id="$(var.JpProductUpgradeCode)">
      <UpgradeVersion
        OnlyDetect="$(var.JpUpgradeVersionOnlyDetectUpgrade)"
        Property="JP_UPGRADABLE_FOUND"
        Maximum="$(var.JpAppVersion)"
        MigrateFeatures="yes"
        IncludeMaximum="$(var.JpUpgradeVersionOnlyDetectUpgrade)" />
      <UpgradeVersion
        OnlyDetect="$(var.JpUpgradeVersionOnlyDetectDowngrade)"
        Property="JP_DOWNGRADABLE_FOUND"
        Minimum="$(var.JpAppVersion)"
        MigrateFeatures="yes"
        IncludeMinimum="$(var.JpUpgradeVersionOnlyDetectDowngrade)" />
    </Upgrade>

    <?ifndef JpAllowUpgrades ?>
    <CustomAction Id="JpDisallowUpgrade" Error="!(loc.DisallowUpgradeErrorMessage)" />
    <?endif?>
    <?ifndef JpAllowDowngrades ?>
    <CustomAction Id="JpDisallowDowngrade" Error="!(loc.DowngradeErrorMessage)" />
    <?endif?>

    <!-- Standard required root -->
    <Directory Id="TARGETDIR" Name="SourceDir"/>

    <Feature Id="DefaultFeature" Title="!(loc.MainFeatureTitle)" Level="1">
      <ComponentGroupRef Id="Shortcuts"/>
      <ComponentGroupRef Id="Files"/>
      <ComponentGroupRef Id="FileAssociations"/>
    </Feature>

    <CustomAction Id="JpSetARPINSTALLLOCATION" Property="ARPINSTALLLOCATION" Value="[INSTALLDIR]" />

    <?ifdef JpIcon ?>
    <Property Id="ARPPRODUCTICON" Value="JpARPPRODUCTICON"/>
    <Icon Id="JpARPPRODUCTICON" SourceFile="$(var.JpIcon)"/>
    <?endif?>
    
    <UIRef Id="JpUI"/>

    <InstallExecuteSequence>
      <Custom Action="JpSetARPINSTALLLOCATION" After="CostFinalize">Not Installed</Custom>
      <?ifndef JpAllowUpgrades ?>
      <Custom Action="JpDisallowUpgrade" After="FindRelatedProducts">JP_UPGRADABLE_FOUND</Custom>
      <?endif?>
      <?ifndef JpAllowDowngrades ?>
      <Custom Action="JpDisallowDowngrade" After="FindRelatedProducts">JP_DOWNGRADABLE_FOUND</Custom>
      <?endif?>
      <RemoveExistingProducts Before="CostInitialize"/>
    </InstallExecuteSequence>

  </Product>
</Wix>