src/jdk.jpackage/windows/classes/jdk/jpackage/internal/resources/main.wxs
branchJDK-8200758-branch
changeset 58696 61c44899b4eb
parent 57404 a477b26bf888
child 58887 920f6770d71c
equal deleted inserted replaced
58695:64adf683bc7b 58696:61c44899b4eb
     1 <?xml version="1.0" encoding="utf-8"?>
     1 <?xml version="1.0" encoding="utf-8"?>
     2 <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
     2 <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
     3      xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
     3      xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
     4      
     4 
     5   <?ifdef JpIsSystemWide ?>
     5   <?ifdef JpIsSystemWide ?>
     6     <?define JpInstallScope="perMachine"?>
     6     <?define JpInstallScope="perMachine"?>
     7     <?define JpRegistryRoot="HKLM"?>
       
     8   <?else?>
     7   <?else?>
     9     <?define JpInstallScope="perUser"?>
     8     <?define JpInstallScope="perUser"?>
    10     <?define JpRegistryRoot="HKCU"?>
       
    11   <?endif?>
     9   <?endif?>
    12   
    10 
    13   <Product  Id="$(var.JpProductCode)" Name="$(var.JpAppName)"
    11   <Product  Id="$(var.JpProductCode)" Name="$(var.JpAppName)"
    14             Language="1033" Version="$(var.JpAppVersion)"
    12             Language="1033" Version="$(var.JpAppVersion)"
    15             Manufacturer="$(var.JpAppVendor)"
    13             Manufacturer="$(var.JpAppVendor)"
    16             UpgradeCode="$(var.JpProductUpgradeCode)">
    14             UpgradeCode="$(var.JpProductUpgradeCode)">
    17     <Package  Description="$(var.JpAppDescription)"
    15     <Package  Description="$(var.JpAppDescription)"
    21     <Media Id="1" Cabinet="simple.cab" EmbedCab="yes" />
    19     <Media Id="1" Cabinet="simple.cab" EmbedCab="yes" />
    22 
    20 
    23     <?ifdef JpAllowDowngrades ?>
    21     <?ifdef JpAllowDowngrades ?>
    24     <MajorUpgrade AllowDowngrades="yes"/>
    22     <MajorUpgrade AllowDowngrades="yes"/>
    25     <?endif?>
    23     <?endif?>
    26     
       
    27         <!-- We use RemoveFolderEx to ensure application folder is fully
       
    28              removed on uninstall. Including files created outside of MSI
       
    29              after application had been installed (e.g. on AU or user state).
       
    30 
    24 
    31              However, RemoveFolderEx is only available in WiX 3.6,
    25     <!-- Standard required root -->
    32              we will comment it out if we running older WiX.
    26     <Directory Id="TARGETDIR" Name="SourceDir"/>
    33 
    27 
    34              RemoveFolderEx requires that we "remember" the path for uninstall.
    28     <Feature Id="DefaultFeature" Title="Main Feature" Level="1">
    35              Read the path value and set the APPLICATIONFOLDER property with the value.
    29       <ComponentGroupRef Id="Shortcuts"/>
    36         -->
    30       <ComponentGroupRef Id="Files"/>
    37         <Property Id="APPLICATIONFOLDER">
    31       <ComponentGroupRef Id="FileAssociations"/>
    38             <RegistrySearch Key="SOFTWARE\$(var.JpAppVendor)\$(var.JpAppName)"
    32     </Feature>
    39                             Root="$(var.JpRegistryRoot)" Type="raw" Win64="yes"
       
    40                             Id="APPLICATIONFOLDER_REGSEARCH" Name="Path" />
       
    41         </Property>
       
    42         <DirectoryRef Id="APPLICATIONFOLDER">
       
    43             <Component Id="CleanupMainApplicationFolder" Guid="*" Win64="yes">
       
    44                 <RegistryValue Root="$(var.JpRegistryRoot)"
       
    45                                Key="SOFTWARE\$(var.JpAppVendor)\$(var.JpAppName)"
       
    46                                Name="Path" Type="string" Value="[APPLICATIONFOLDER]"
       
    47                                KeyPath="yes" />
       
    48                 <!-- We need to use APPLICATIONFOLDER variable here or RemoveFolderEx
       
    49                      will not remove on "install". But only if WiX 3.6 is used. -->
       
    50                   <?ifdef JpWixVersion36OrNewer ?>
       
    51                   <util:RemoveFolderEx On="uninstall" Property="APPLICATIONFOLDER" />
       
    52                   <?endif?>
       
    53             </Component>
       
    54         </DirectoryRef>
       
    55         
       
    56         <?include $(var.JpConfigDir)/bundle.wxi ?>
       
    57         
       
    58         <?ifdef JpInstallDirChooser ?>
       
    59         <Binary Id="JpCaDll" SourceFile="wixhelper.dll"/>
       
    60         <CustomAction Id="JpCheckInstallDir" BinaryKey="JpCaDll" DllEntry="CheckInstallDir" />
       
    61         <?endif?>
       
    62         
       
    63         <UI>
       
    64           <?ifdef JpInstallDirChooser ?>
       
    65           <Dialog Id="JpInvalidInstallDir" Width="300" Height="85" Title="[ProductName] Setup" NoMinimize="yes">
       
    66             <Control Id="JpInvalidInstallDirYes" Type="PushButton" X="100" Y="55" Width="50" Height="15" Default="no" Cancel="no" Text="Yes">
       
    67               <Publish Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
       
    68             </Control>
       
    69             <Control Id="JpInvalidInstallDirNo" Type="PushButton" X="150" Y="55" Width="50" Height="15" Default="yes" Cancel="yes" Text="No">
       
    70               <Publish Event="NewDialog" Value="InstallDirDlg">1</Publish>
       
    71             </Control>
       
    72             <Control Id="Text" Type="Text" X="25" Y="15" Width="250" Height="30" TabSkip="no">
       
    73               <Text>!(loc.message.install.dir.exist)</Text>
       
    74             </Control>
       
    75           </Dialog>
       
    76           
       
    77           <!-- 
       
    78             Run WixUI_InstallDir dialog in the default install directory.
       
    79           -->
       
    80           <Property Id="WIXUI_INSTALLDIR" Value="APPLICATIONFOLDER"/>
       
    81           <UIRef Id="WixUI_InstallDir" />
       
    82 
    33 
    83           <Publish Dialog="InstallDirDlg" Control="Next" Event="DoAction" Value="JpCheckInstallDir" Order="3">1</Publish>
    34     <?ifdef JpInstallDirChooser ?>
    84           <Publish Dialog="InstallDirDlg" Control="Next" Event="NewDialog" Value="JpInvalidInstallDir" Order="5">INSTALLDIR_VALID="0"</Publish>
    35     <Binary Id="JpCaDll" SourceFile="wixhelper.dll"/>
    85           <Publish Dialog="InstallDirDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg" Order="5">INSTALLDIR_VALID="1"</Publish>
    36     <CustomAction Id="JpCheckInstallDir" BinaryKey="JpCaDll" DllEntry="CheckInstallDir" />
    86           
    37     <?endif?>
    87           <?ifndef JpLicenseRtf ?>
       
    88           <!-- 
       
    89             No license file provided. 
       
    90             Override the dialog sequence in built-in dialog set "WixUI_InstallDir"
       
    91             to exclude license dialog. 
       
    92           -->
       
    93           <Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="InstallDirDlg" Order="2">1</Publish>
       
    94           <Publish Dialog="InstallDirDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="2">1</Publish>
       
    95           <?endif?>
       
    96 
    38 
    97           <?else?>
    39     <UI>
    98           
    40       <?ifdef JpInstallDirChooser ?>
    99           <?ifdef JpLicenseRtf ?>
    41       <Dialog Id="JpInvalidInstallDir" Width="300" Height="85" Title="[ProductName] Setup" NoMinimize="yes">
   100           <UIRef Id="WixUI_Minimal" />
    42         <Control Id="JpInvalidInstallDirYes" Type="PushButton" X="100" Y="55" Width="50" Height="15" Default="no" Cancel="no" Text="Yes">
   101           <?endif?>
    43           <Publish Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
   102           
    44         </Control>
   103           <?endif?>
    45         <Control Id="JpInvalidInstallDirNo" Type="PushButton" X="150" Y="55" Width="50" Height="15" Default="yes" Cancel="yes" Text="No">
   104         </UI>
    46           <Publish Event="NewDialog" Value="InstallDirDlg">1</Publish>
   105         
    47         </Control>
   106         <?ifdef JpLicenseRtf ?>
    48         <Control Id="Text" Type="Text" X="25" Y="15" Width="250" Height="30" TabSkip="no">
   107         <WixVariable Id="WixUILicenseRtf" Value="$(var.JpLicenseRtf)"/>
    49           <Text>!(loc.message.install.dir.exist)</Text>
   108         <?endif?>
    50         </Control>
   109         
    51       </Dialog>
   110         <?include $(var.JpConfigDir)/icons.wxi ?>
    52 
   111     </Product>
    53       <!--
       
    54         Run WixUI_InstallDir dialog in the default install directory.
       
    55       -->
       
    56       <Property Id="WIXUI_INSTALLDIR" Value="APPLICATIONFOLDER"/>
       
    57       <UIRef Id="WixUI_InstallDir" />
       
    58 
       
    59       <Publish Dialog="InstallDirDlg" Control="Next" Event="DoAction" Value="JpCheckInstallDir" Order="3">1</Publish>
       
    60       <Publish Dialog="InstallDirDlg" Control="Next" Event="NewDialog" Value="JpInvalidInstallDir" Order="5">INSTALLDIR_VALID="0"</Publish>
       
    61       <Publish Dialog="InstallDirDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg" Order="5">INSTALLDIR_VALID="1"</Publish>
       
    62 
       
    63       <?ifndef JpLicenseRtf ?>
       
    64       <!--
       
    65         No license file provided.
       
    66         Override the dialog sequence in built-in dialog set "WixUI_InstallDir"
       
    67         to exclude license dialog.
       
    68       -->
       
    69       <Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="InstallDirDlg" Order="2">1</Publish>
       
    70       <Publish Dialog="InstallDirDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="2">1</Publish>
       
    71       <?endif?>
       
    72 
       
    73       <?else?>
       
    74 
       
    75       <?ifdef JpLicenseRtf ?>
       
    76       <UIRef Id="WixUI_Minimal" />
       
    77       <?endif?>
       
    78 
       
    79       <?endif?>
       
    80     </UI>
       
    81 
       
    82     <?ifdef JpLicenseRtf ?>
       
    83     <WixVariable Id="WixUILicenseRtf" Value="$(var.JpLicenseRtf)"/>
       
    84     <?endif?>
       
    85 
       
    86   </Product>
   112 </Wix>
    87 </Wix>