Build python 3.10.9, fix MSI display

This commit is contained in:
Twangboy 2023-02-21 17:28:47 -07:00 committed by Pedro Algarvio
parent 65f84e34d5
commit 4f6caca155
4 changed files with 18 additions and 48 deletions

View file

@ -891,19 +891,16 @@ class SaltPkgInstall:
# Remove install dir from the path
if HAS_WINREG:
# Get the current system path
path_key = winreg.OpenKeyEx(
winreg.HKEY_LOCAL_MACHINE,
r"SYSTEM\CurrentControlSet\Control\Session Manager\Environment",
env_key = (
r"SYSTEM\CurrentControlSet\Control\Session Manager\Environment"
)
path_key = winreg.OpenKeyEx(winreg.HKEY_LOCAL_MACHINE, env_key)
current_path = winreg.QueryValueEx(path_key, "path")[0]
path_key.Close()
# If the install path is in the path let's remove it
if str(self.install_dir) in current_path:
path_key = winreg.OpenKeyEx(
winreg.HKEY_LOCAL_MACHINE,
r"SYSTEM\CurrentControlSet\Control\Session Manager\Environment",
0,
winreg.KEY_SET_VALUE,
winreg.HKEY_LOCAL_MACHINE, env_key, 0, winreg.KEY_SET_VALUE
)
new_path = []
path_list = current_path.split(";")

View file

@ -17,7 +17,7 @@ and are called in this order:
build.ps1
.EXAMPLE
build.ps1 -Version 3005 -PythonVersion 3.8.13
build.ps1 -Version 3005 -PythonVersion 3.10.9
#>
@ -39,22 +39,8 @@ param(
[Parameter(Mandatory=$false)]
[ValidatePattern("^\d{1,2}.\d{1,2}.\d{1,2}$")]
[ValidateSet(
# Until Pythonnet supports newer versions
"3.10.10",
"3.10.9",
#"3.10.5",
#"3.10.4",
#"3.10.3",
#"3.9.13",
#"3.9.12",
#"3.9.11",
"3.8.16",
"3.8.15",
"3.8.14",
"3.8.13",
"3.8.12",
"3.8.11",
"3.8.10"
"3.11.2",
"3.10.9"
)]
[Alias("p")]
# The version of Python to be built. Pythonnet only supports up to Python
@ -62,7 +48,7 @@ param(
# supported up to 3.8. So we're pinned to the latest version of Python 3.8.
# We may have to drop support for pycurl.
# Default is: 3.8.16
[String] $PythonVersion = "3.8.16",
[String] $PythonVersion = "3.10.9",
[Parameter(Mandatory=$false)]
[Alias("b")]

View file

@ -11,26 +11,15 @@ as created by the Python installer. This includes all header files, scripts,
dlls, library files, and pip.
.EXAMPLE
build_python.ps1 -Version 3.8.16 -Architecture x86
build_python.ps1 -Version 3.10.9 -Architecture x86
#>
param(
[Parameter(Mandatory=$false)]
[ValidatePattern("^\d{1,2}.\d{1,2}.\d{1,2}$")]
[ValidateSet(
#"3.10.5",
#"3.10.4",
#"3.10.3",
#"3.9.13",
#"3.9.12",
#"3.9.11",
"3.8.16",
"3.8.15",
"3.8.14",
"3.8.13",
"3.8.12",
"3.8.11",
"3.8.10"
"3.11.2",
"3.10.9"
)]
[Alias("v")]
# The version of Python to be built. Pythonnet only supports up to Python
@ -38,7 +27,7 @@ param(
# supported up to 3.8. So we're pinned to the latest version of Python 3.8.
# We may have to drop support for pycurl or build it ourselves.
# Default is: 3.8.16
[String] $Version = "3.8.16",
[String] $Version = "3.10.9",
[Parameter(Mandatory=$false)]
[ValidateSet("x64", "x86", "amd64")]
@ -162,7 +151,7 @@ $SCRIPT_DIR = (Get-ChildItem "$($myInvocation.MyCommand.Definition)").Director
$BUILD_DIR = "$SCRIPT_DIR\buildenv"
$SCRIPTS_DIR = "$BUILD_DIR\Scripts"
$RELENV_DIR = "${env:LOCALAPPDATA}\relenv"
$SYS_PY_BIN = (cmd /c "where python")
$SYS_PY_BIN = (python -c "import sys; print(sys.executable)")
$BLD_PY_BIN = "$BUILD_DIR\Scripts\python.exe"
$SALT_DEP_URL = "https://repo.saltproject.io/windows/dependencies"
@ -255,9 +244,9 @@ if ( $Build ) {
$output = relenv build --clean --arch $ARCH
} else {
Write-Host "Fetching Python with Relenv: " -NoNewLine
relenv fetch --arch $ARCH | Out-Null
relenv fetch --python $Version --arch $ARCH | Out-Null
}
if ( Test-Path -Path "$RELENV_DIR\build\$ARCH-win.tar.xz") {
if ( Test-Path -Path "$RELENV_DIR\build\$Version-$ARCH-win.tar.xz") {
Write-Result "Success" -ForegroundColor Green
} else {
Write-Result "Failed" -ForegroundColor Red
@ -268,7 +257,7 @@ if ( Test-Path -Path "$RELENV_DIR\build\$ARCH-win.tar.xz") {
# Extracting Python environment
#-------------------------------------------------------------------------------
Write-Host "Extracting Python environment: " -NoNewLine
relenv create --arch $ARCH "$BUILD_DIR"
relenv create --python $Version --arch $ARCH "$BUILD_DIR"
If ( Test-Path -Path "$BLD_PY_BIN" ) {
Write-Result "Success" -ForegroundColor Green
} else {

View file

@ -21,9 +21,6 @@ IMCAC - Immediate Custom Action - It's immediate
Id = "*"
Language = "1033">
<!-- This line needed to fix the progress bar on later versions of Windows -->
<UIRef Id="WixUI_ErrorProgressText" />
<!-- Install per Machine -->
<Package
InstallScope = "perMachine"
@ -301,7 +298,9 @@ IMCAC - Immediate Custom Action - It's immediate
-->
<UI>
<TextStyle Id="WixUI_Font_Warning" FaceName="Tahoma" Size="8" Red="200" Bold="yes" />
<UIRef Id="WixUI_Mondo" />
<UIRef Id="WixUI_ErrorProgressText" /> <!-- This line needed to fix the progress bar on later versions of Windows -->
<Publish Dialog="LicenseAgreementDlg" Control="Next" Event="NewDialog" Value="HostsDlg" Order="3">LicenseAccepted = "1"</Publish>
@ -315,7 +314,6 @@ IMCAC - Immediate Custom Action - It's immediate
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="DirectoryDlg" >1</Publish>
<Dialog Id="HostsDlg" Width="370" Height="270" Title="[ProductName] Setup">
<Control Id="Title" Type="Text" X="15" Y="6" Width="300" Height="15" Transparent="yes" NoPrefix="yes" Text="{\WixUI_Font_Title}Minion configuration" />
<Control Id="Description" Type="Text" X="25" Y="23" Width="280" Height="15" Transparent="yes" NoPrefix="yes" Text="Please verify master and minion." />