update wix installer template to match stock jdk25 plus registry entries
What changed, and why it matters
This commit updates the Windows installer template used by Sparrow Wallet to match the version that ships with JDK 25. It also keeps Sparrow's custom registry entries that register 'auth47', 'bitcoin', and 'lightning' web link types with Windows. There is no indication in the commit of a security vulnerability being fixed or introduced.
No security action required. Treat as routine build/maintenance update. If desired, verify the generated installer behaves correctly during upgrade/downgrade and that URI scheme registration still works.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff updates src/main/deploy/package/windows/main.wxs from an older jpackage WiX template to the JDK 25 stock template. The customizations retained are the RegistryEntries component for URI scheme registration (auth47, bitcoin, lightning) and its ComponentRef in the Feature. The upgrade logic is refactored from MajorUpgrade to Upgrade/UpgradeVersion elements plus custom actions, and UI handling is moved to a referenced JpUI fragment. No code paths handling keys, transactions, or network behavior are changed.
Changed components
Windows MSI installer WiX template (src/main/deploy/package/windows/main.wxs)Inspect captured patch +83 / −77
diff --git a/src/main/deploy/package/windows/main.wxs b/src/main/deploy/package/windows/main.wxs
index c3b10c6..fa63f6f 100644
--- a/src/main/deploy/package/windows/main.wxs
+++ b/src/main/deploy/package/windows/main.wxs
@@ -1,4 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ This file is a copy of the jpackage WiX template (src/jdk.jpackage/windows/classes/jdk/jpackage/internal/resources/main.wxs in the JDK sources),
+ customized only to add the RegistryEntries component registering the auth47, bitcoin and lightning URI schemes, and its ComponentRef in the Feature.
+ When upgrading the build JDK, re-diff this file against that JDK's template and re-apply the RegistryEntries block, keeping the component GUID unchanged.
+-->
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
@@ -14,6 +20,17 @@
<?include $(var.JpConfigDir)/overrides.wxi ?>
+ <?ifdef JpAllowUpgrades ?>
+ <?define JpUpgradeVersionOnlyDetectUpgrade="no"?>
+ <?else?>
+ <?define JpUpgradeVersionOnlyDetectUpgrade="yes"?>
+ <?endif?>
+ <?ifdef JpAllowDowngrades ?>
+ <?define JpUpgradeVersionOnlyDetectDowngrade="no"?>
+ <?else?>
+ <?define JpUpgradeVersionOnlyDetectDowngrade="yes"?>
+ <?endif?>
+
<Product
Id="$(var.JpProductCode)"
Name="$(var.JpAppName)"
@@ -32,45 +49,31 @@
<Media Id="1" Cabinet="Data.cab" EmbedCab="yes" />
- <?ifdef JpAllowDowngrades ?>
- <?ifdef JpAllowUpgrades ?>
- <MajorUpgrade
- AllowDowngrades="yes"
- Disallow="no"
- />
- <?endif?>
- <?endif?>
+ <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>
- <?ifdef JpAllowDowngrades ?>
<?ifndef JpAllowUpgrades ?>
- <MajorUpgrade
- AllowDowngrades="yes"
- Disallow="yes"
- DisallowUpgradeErrorMessage="!(loc.DisallowUpgradeErrorMessage)"
- />
- <?endif?>
+ <CustomAction Id="JpDisallowUpgrade" Error="!(loc.DisallowUpgradeErrorMessage)" />
<?endif?>
-
<?ifndef JpAllowDowngrades ?>
- <?ifdef JpAllowUpgrades ?>
- <MajorUpgrade
- AllowDowngrades="no"
- Disallow="no"
- DowngradeErrorMessage="!(loc.DowngradeErrorMessage)"
- />
- <?endif?>
+ <CustomAction Id="JpDisallowDowngrade" Error="!(loc.DowngradeErrorMessage)" />
<?endif?>
- <?ifndef JpAllowDowngrades ?>
- <?ifndef JpAllowUpgrades ?>
- <MajorUpgrade
- AllowDowngrades="no"
- Disallow="yes"
- DowngradeErrorMessage="!(loc.DowngradeErrorMessage)"
- DisallowUpgradeErrorMessage="!(loc.DisallowUpgradeErrorMessage)"
- />
- <?endif?>
- <?endif?>
+ <Binary Id="JpCaDll" SourceFile="wixhelper.dll"/>
+
+ <CustomAction Id="JpFindRelatedProducts" BinaryKey="JpCaDll" DllEntry="FindRelatedProductsEx" />
<!-- Standard required root -->
<Directory Id="TARGETDIR" Name="SourceDir"/>
@@ -114,60 +117,63 @@
<ComponentGroupRef Id="Shortcuts"/>
<ComponentGroupRef Id="Files"/>
<ComponentGroupRef Id="FileAssociations"/>
+ <ComponentGroupRef Id="FragmentOsCondition"/>
<ComponentRef Id="RegistryEntries"/>
</Feature>
- <?ifdef JpInstallDirChooser ?>
- <Binary Id="JpCaDll" SourceFile="wixhelper.dll"/>
- <CustomAction Id="JpCheckInstallDir" BinaryKey="JpCaDll" DllEntry="CheckInstallDir" />
+ <CustomAction Id="JpSetARPINSTALLLOCATION" Property="ARPINSTALLLOCATION" Value="[INSTALLDIR]" />
+ <CustomAction Id="JpSetARPCOMMENTS" Property="ARPCOMMENTS" Value="$(var.JpAppDescription)" />
+ <CustomAction Id="JpSetARPCONTACT" Property="ARPCONTACT" Value="$(var.JpAppVendor)" />
+ <CustomAction Id="JpSetARPSIZE" Property="ARPSIZE" Value="$(var.JpAppSizeKb)" />
+
+ <?ifdef JpHelpURL ?>
+ <CustomAction Id="JpSetARPHELPLINK" Property="ARPHELPLINK" Value="$(var.JpHelpURL)" />
<?endif?>
- <UI>
- <?ifdef JpInstallDirChooser ?>
- <Dialog Id="JpInvalidInstallDir" Width="300" Height="85" Title="[ProductName] Setup" NoMinimize="yes">
- <Control Id="JpInvalidInstallDirYes" Type="PushButton" X="100" Y="55" Width="50" Height="15" Default="no" Cancel="no" Text="Yes">
- <Publish Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
- </Control>
- <Control Id="JpInvalidInstallDirNo" Type="PushButton" X="150" Y="55" Width="50" Height="15" Default="yes" Cancel="yes" Text="No">
- <Publish Event="NewDialog" Value="InstallDirDlg">1</Publish>
- </Control>
- <Control Id="Text" Type="Text" X="25" Y="15" Width="250" Height="30" TabSkip="no">
- <Text>!(loc.message.install.dir.exist)</Text>
- </Control>
- </Dialog>
-
- <!--
- Run WixUI_InstallDir dialog in the default install directory.
- -->
- <Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR"/>
- <UIRef Id="WixUI_InstallDir" />
-
- <Publish Dialog="InstallDirDlg" Control="Next" Event="DoAction" Value="JpCheckInstallDir" Order="3">1</Publish>
- <Publish Dialog="InstallDirDlg" Control="Next" Event="NewDialog" Value="JpInvalidInstallDir" Order="5">INSTALLDIR_VALID="0"</Publish>
- <Publish Dialog="InstallDirDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg" Order="5">INSTALLDIR_VALID="1"</Publish>
-
- <?ifndef JpLicenseRtf ?>
- <!--
- No license file provided.
- Override the dialog sequence in built-in dialog set "WixUI_InstallDir"
- to exclude license dialog.
- -->
- <Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="InstallDirDlg" Order="2">1</Publish>
- <Publish Dialog="InstallDirDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="2">1</Publish>
- <?endif?>
+ <?ifdef JpAboutURL ?>
+ <CustomAction Id="JpSetARPURLINFOABOUT" Property="ARPURLINFOABOUT" Value="$(var.JpAboutURL)" />
+ <?endif?>
- <?else?>
+ <?ifdef JpUpdateURL ?>
+ <CustomAction Id="JpSetARPURLUPDATEINFO" Property="ARPURLUPDATEINFO" Value="$(var.JpUpdateURL)" />
+ <?endif?>
+
+ <?ifdef JpIcon ?>
+ <Property Id="ARPPRODUCTICON" Value="JpARPPRODUCTICON"/>
+ <Icon Id="JpARPPRODUCTICON" SourceFile="$(var.JpIcon)"/>
+ <?endif?>
+
+ <UIRef Id="JpUI"/>
- <?ifdef JpLicenseRtf ?>
- <UIRef Id="WixUI_Minimal" />
+ <InstallExecuteSequence>
+ <Custom Action="JpSetARPINSTALLLOCATION" After="CostFinalize">Not Installed</Custom>
+ <Custom Action="JpSetARPCOMMENTS" After="CostFinalize">Not Installed</Custom>
+ <Custom Action="JpSetARPCONTACT" After="CostFinalize">Not Installed</Custom>
+ <Custom Action="JpSetARPSIZE" After="CostFinalize">Not Installed</Custom>
+ <?ifdef JpHelpURL ?>
+ <Custom Action="JpSetARPHELPLINK" After="CostFinalize">Not Installed</Custom>
+ <?endif?>
+ <?ifdef JpAboutURL ?>
+ <Custom Action="JpSetARPURLINFOABOUT" After="CostFinalize">Not Installed</Custom>
+ <?endif?>
+ <?ifdef JpUpdateURL ?>
+ <Custom Action="JpSetARPURLUPDATEINFO" After="CostFinalize">Not Installed</Custom>
<?endif?>
+ <?ifndef JpAllowUpgrades ?>
+ <Custom Action="JpDisallowUpgrade" After="JpFindRelatedProducts">JP_UPGRADABLE_FOUND</Custom>
<?endif?>
- </UI>
+ <?ifndef JpAllowDowngrades ?>
+ <Custom Action="JpDisallowDowngrade" After="JpFindRelatedProducts">JP_DOWNGRADABLE_FOUND</Custom>
+ <?endif?>
+ <LaunchConditions Before="AppSearch"/>
+ <RemoveExistingProducts Before="CostInitialize"/>
+ <Custom Action="JpFindRelatedProducts" After="FindRelatedProducts"/>
+ </InstallExecuteSequence>
- <?ifdef JpLicenseRtf ?>
- <WixVariable Id="WixUILicenseRtf" Value="$(var.JpLicenseRtf)"/>
- <?endif?>
+ <InstallUISequence>
+ <Custom Action="JpFindRelatedProducts" After="FindRelatedProducts"/>
+ </InstallUISequence>
</Product>
-</Wix>
\ No newline at end of file
+</Wix>
Why this scored 11/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.