Issue #23260: Update Windows installer
diff --git a/Tools/msi/lib/lib.props b/Tools/msi/lib/lib.props
new file mode 100644
index 0000000..413ba0c
--- /dev/null
+++ b/Tools/msi/lib/lib.props
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="..\msi.props" />
+ <ItemGroup>
+ <Compile Include="*.wxs" />
+ </ItemGroup>
+ <ItemGroup>
+ <EmbeddedResource Include="*.wxl" />
+ </ItemGroup>
+ <ItemGroup>
+ <ExcludeFolders Include="Lib\test;Lib\tests;Lib\tkinter;Lib\idlelib;Lib\turtledemo" />
+ <InstallFiles Include="$(PySourcePath)Lib\**\*"
+ Exclude="$(PySourcePath)Lib\**\*.pyc;
+ $(PySourcePath)Lib\**\*.pyo;
+ $(PySourcePath)Lib\site-packages\README;
+ @(ExcludeFolders->'$(PySourcePath)%(Identity)\*');
+ @(ExcludeFolders->'$(PySourcePath)%(Identity)\**\*')">
+ <SourceBase>$(PySourcePath)Lib</SourceBase>
+ <Source>!(bindpath.src)Lib\</Source>
+ <TargetBase>$(PySourcePath)Lib</TargetBase>
+ <Target_>Lib\</Target_>
+ <Group>lib_py</Group>
+ </InstallFiles>
+ </ItemGroup>
+
+ <Import Project="..\msi.targets" />
+</Project>
\ No newline at end of file
diff --git a/Tools/msi/lib/lib.wixproj b/Tools/msi/lib/lib.wixproj
new file mode 100644
index 0000000..e9281da
--- /dev/null
+++ b/Tools/msi/lib/lib.wixproj
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <ProjectGuid>{11367E76-3337-4602-8F1E-77DB4F370D7E}</ProjectGuid>
+ <SchemaVersion>2.0</SchemaVersion>
+ <OutputName>lib</OutputName>
+ <OutputType>Package</OutputType>
+ <DefineConstants>IncludeDefaultFeature=1;$(DefineConstants)</DefineConstants>
+ </PropertyGroup>
+ <Import Project="lib.props" />
+</Project>
\ No newline at end of file
diff --git a/Tools/msi/lib/lib.wxs b/Tools/msi/lib/lib.wxs
new file mode 100644
index 0000000..89bea62
--- /dev/null
+++ b/Tools/msi/lib/lib.wxs
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
+ <Product Id="*" Language="!(loc.LCID)" Name="!(loc.Title)" Version="$(var.Version)" Manufacturer="!(loc.Manufacturer)" UpgradeCode="$(var.UpgradeCode)">
+ <Package InstallerVersion="300" Compressed="yes" InstallScope="perUser" Platform="$(var.Platform)" />
+ <MediaTemplate EmbedCab="yes" CompressionLevel="high" />
+
+ <PropertyRef Id="UpgradeTable" />
+ <PropertyRef Id="REGISTRYKEY" />
+
+ <?ifdef IncludeDefaultFeature ?>
+ <Feature Id="DefaultFeature" AllowAdvertise="no" Title="!(loc.Title)" Description="!(loc.Description)">
+ <ComponentGroupRef Id="lib_py" />
+ <ComponentGroupRef Id="lib_files" />
+ <ComponentGroupRef Id="lib_extensions" />
+ </Feature>
+ <?endif ?>
+ <?ifdef IncludeSymbols ?>
+ <Feature Id="Symbols" AllowAdvertise="no" Title="!(loc.TitlePdb)" Description="!(loc.DescriptionPdb)">
+ <ComponentGroupRef Id="lib_extensions_symbols" />
+ </Feature>
+ <?endif ?>
+ <?ifdef IncludeDebugBinaries ?>
+ <Feature Id="DebugBinaries" AllowAdvertise="no" Title="!(loc.Title_d)" Description="!(loc.Description_d)">
+ <ComponentGroupRef Id="lib_extensions_d" />
+ </Feature>
+ <?endif ?>
+ </Product>
+</Wix>
diff --git a/Tools/msi/lib/lib_d.wixproj b/Tools/msi/lib/lib_d.wixproj
new file mode 100644
index 0000000..e632319
--- /dev/null
+++ b/Tools/msi/lib/lib_d.wixproj
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <ProjectGuid>{6C443CD3-8258-4335-BA03-49DA9C34CE4D}</ProjectGuid>
+ <SchemaVersion>2.0</SchemaVersion>
+ <OutputName>lib_d</OutputName>
+ <OutputType>Package</OutputType>
+ <DefineConstants>IncludeDebugBinaries=1;$(DefineConstants)</DefineConstants>
+ </PropertyGroup>
+ <Import Project="lib.props" />
+</Project>
\ No newline at end of file
diff --git a/Tools/msi/lib/lib_en-US.wxl b/Tools/msi/lib/lib_en-US.wxl
new file mode 100644
index 0000000..305bcc7
--- /dev/null
+++ b/Tools/msi/lib/lib_en-US.wxl
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<WixLocalization Culture="en-us" xmlns="http://schemas.microsoft.com/wix/2006/localization">
+ <String Id="Descriptor">Standard Library</String>
+ <String Id="ShortDescriptor">lib</String>
+</WixLocalization>
diff --git a/Tools/msi/lib/lib_files.wxs b/Tools/msi/lib/lib_files.wxs
new file mode 100644
index 0000000..0c901d3
--- /dev/null
+++ b/Tools/msi/lib/lib_files.wxs
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
+ <?define exts=pyexpat;select;unicodedata;winsound;_bz2;_elementtree;_socket;_ssl;_msi;_ctypes;_hashlib;_multiprocessing;_lzma;_decimal;_overlapped;_sqlite3 ?>
+ <Fragment>
+ <ComponentGroup Id="lib_extensions">
+ <?foreach ext in $(var.exts)?>
+
+ <Component Id="$(var.ext).pyd" Directory="DLLs" Guid="*">
+ <File Name="$(var.ext).pyd" KeyPath="yes" />
+ </Component>
+
+ <?endforeach ?>
+
+ <Component Id="sqlite3.dll" Directory="DLLs" Guid="*">
+ <File Name="sqlite3.dll" KeyPath="yes" />
+ </Component>
+ </ComponentGroup>
+ </Fragment>
+
+ <Fragment>
+ <ComponentGroup Id="lib_extensions_symbols">
+ <?foreach ext in $(var.exts)?>
+
+ <Component Id="$(var.ext).pdb" Directory="DLLs" Guid="*">
+ <Condition>SYMBOLS=1</Condition>
+ <File Name="$(var.ext).pdb" />
+ </Component>
+
+ <?endforeach ?>
+
+ <Component Id="sqlite3.pdb" Directory="DLLs" Guid="*">
+ <File Name="sqlite3.pdb" />
+ </Component>
+ </ComponentGroup>
+ </Fragment>
+
+ <Fragment>
+ <ComponentGroup Id="lib_extensions_d">
+ <?foreach ext in $(var.exts)?>
+
+ <Component Id="$(var.ext)_d.pyd" Directory="DLLs" Guid="*">
+ <File Name="$(var.ext)_d.pyd" />
+ </Component>
+ <Component Id="$(var.ext)_d.pdb" Directory="DLLs" Guid="*">
+ <File Name="$(var.ext)_d.pdb" />
+ </Component>
+
+ <?endforeach ?>
+ </ComponentGroup>
+ </Fragment>
+ <Fragment>
+ <PropertyRef Id="REGISTRYKEY" />
+
+ <ComponentGroup Id="lib_files">
+ <Component Id="PythonPathRegistry" Directory="Lib" Guid="*">
+ <RegistryKey Root="HKMU" Key="[REGISTRYKEY]">
+ <RegistryValue Key="PythonPath" Type="string" Value="[Lib];[DLLs]" />
+ </RegistryKey>
+ </Component>
+ <Component Id="Lib_site_packages_README" Directory="Lib_site_packages" Guid="*">
+ <File Id="Lib_site_packages_README" Name="README.txt" Source="!(bindpath.src)Lib\site-packages\README" KeyPath="yes" />
+ </Component>
+ <Component Id="Lib2to3_pickle_remove" Directory="Lib_lib2to3" Guid="$(var.RemoveLib2to3PickleComponentGuid)">
+ <RemoveFile Id="Lib2to3_pickle_remove_files" Name="*.pickle" On="uninstall" />
+ <RemoveFolder Id="Lib2to3_pickle_remove_folder" On="uninstall" />
+ </Component>
+ </ComponentGroup>
+ <DirectoryRef Id="Lib">
+ <Directory Id="Lib_site_packages" Name="site-packages" />
+ </DirectoryRef>
+ </Fragment>
+</Wix>
diff --git a/Tools/msi/lib/lib_pdb.wixproj b/Tools/msi/lib/lib_pdb.wixproj
new file mode 100644
index 0000000..21b5912
--- /dev/null
+++ b/Tools/msi/lib/lib_pdb.wixproj
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <ProjectGuid>{5E0BCE93-D1AC-4591-BBCB-3A2BE5A4B3D1}</ProjectGuid>
+ <SchemaVersion>2.0</SchemaVersion>
+ <OutputName>lib_pdb</OutputName>
+ <OutputType>Package</OutputType>
+ <DefineConstants>IncludeSymbols=1;$(DefineConstants)</DefineConstants>
+ </PropertyGroup>
+ <Import Project="lib.props" />
+</Project>
\ No newline at end of file