mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Update to python 3.7 - Remove Py2
This commit is contained in:
parent
c0078a5870
commit
73e18a9096
9 changed files with 116 additions and 558 deletions
|
@ -37,7 +37,6 @@ if %errorLevel%==0 (
|
|||
@echo ---------------------------------------------------------------------
|
||||
|
||||
set "Version="
|
||||
set "Python="
|
||||
:: First Parameter
|
||||
if not "%~1"=="" (
|
||||
echo.%1 | FIND /I "=" > nul && (
|
||||
|
@ -51,46 +50,18 @@ if not "%~1"=="" (
|
|||
)
|
||||
)
|
||||
|
||||
:: Second Parameter
|
||||
if not "%~2"=="" (
|
||||
echo.%2 | FIND /I "=" > nul && (
|
||||
:: Named Parameter
|
||||
set "%~2"
|
||||
) || (
|
||||
:: Positional Parameter
|
||||
set "Python=%~2"
|
||||
)
|
||||
)
|
||||
|
||||
:: If Version not defined, Get the version from Git
|
||||
if "%Version%"=="" (
|
||||
for /f "delims=" %%a in ('git describe') do @set "Version=%%a"
|
||||
)
|
||||
|
||||
:: If Python not defined, Assume Python 2
|
||||
if "%Python%"=="" (
|
||||
set Python=2
|
||||
)
|
||||
|
||||
:: Verify valid Python value (2 or 3)
|
||||
set "x="
|
||||
for /f "delims=23" %%i in ("%Python%") do set x=%%i
|
||||
if Defined x (
|
||||
echo Invalid Python Version specified. Must be 2 or 3. Passed %Python%
|
||||
goto eof
|
||||
)
|
||||
|
||||
@echo =====================================================================
|
||||
@echo.
|
||||
|
||||
:: Define Variables
|
||||
@echo %0 :: Defining Variables...
|
||||
@echo ---------------------------------------------------------------------
|
||||
if %Python%==2 (
|
||||
Set "PyDir=C:\Python27"
|
||||
) else (
|
||||
Set "PyDir=C:\Python35"
|
||||
)
|
||||
Set "PyDir=C:\Python37"
|
||||
Set "PATH=%PATH%;%PyDir%;%PyDir%\Scripts"
|
||||
|
||||
Set "CurDir=%~dp0"
|
||||
|
@ -102,10 +73,10 @@ for /f "delims=" %%a in ('git rev-parse --show-toplevel') do @set "SrcDir=%%a"
|
|||
:: Create Build Environment
|
||||
@echo %0 :: Create the Build Environment...
|
||||
@echo ---------------------------------------------------------------------
|
||||
PowerShell.exe -ExecutionPolicy RemoteSigned -File "%CurDir%build_env_%Python%.ps1" -Silent
|
||||
PowerShell.exe -ExecutionPolicy RemoteSigned -File "%CurDir%build_env.ps1" -Silent
|
||||
|
||||
if not %errorLevel%==0 (
|
||||
echo "%CurDir%build_env_%Python%.ps1" returned errorlevel %errorLevel%. Aborting %0
|
||||
echo "%CurDir%build_env.ps1" returned errorlevel %errorLevel%. Aborting %0
|
||||
goto eof
|
||||
)
|
||||
@echo.
|
||||
|
@ -135,7 +106,7 @@ if not %errorLevel%==0 (
|
|||
:: Build the Salt Package
|
||||
@echo %0 :: Build the Salt Package...
|
||||
@echo ---------------------------------------------------------------------
|
||||
call "%CurDir%build_pkg.bat" "%Version%" %Python%
|
||||
call "%CurDir%build_pkg.bat" "%Version%"
|
||||
@echo.
|
||||
|
||||
:eof
|
||||
|
|
|
@ -167,19 +167,19 @@ If (Test-Path "$($ini[$bitPaths]['VCppBuildToolsDir'])\vcbuildtools.bat") {
|
|||
#------------------------------------------------------------------------------
|
||||
# Install Python
|
||||
#------------------------------------------------------------------------------
|
||||
Write-Output " - Checking for Python 3.5 installation . . ."
|
||||
If (Test-Path "$($ini['Settings']['Python3Dir'])\python.exe") {
|
||||
Write-Output " - Checking for Python 3 installation . . ."
|
||||
If (Test-Path "$($ini['Settings']['PythonDir'])\python.exe") {
|
||||
# Found Python 3.5, do nothing
|
||||
Write-Output " - Python 3.5 Found . . ."
|
||||
Write-Output " - Python 3 Found . . ."
|
||||
} Else {
|
||||
Write-Output " - Downloading $($ini[$bitPrograms]['Python3']) . . ."
|
||||
$file = "$($ini[$bitPrograms]['Python3'])"
|
||||
Write-Output " - Downloading $($ini[$bitPrograms]['Python']) . . ."
|
||||
$file = "$($ini[$bitPrograms]['Python'])"
|
||||
$url = "$($ini['Settings']['SaltRepo'])/$bitFolder/$file"
|
||||
$file = "$($ini['Settings']['DownloadDir'])\$bitFolder\$file"
|
||||
DownloadFileWithProgress $url $file
|
||||
|
||||
Write-Output " - $script_name :: Installing $($ini[$bitPrograms]['Python3']) . . ."
|
||||
$p = Start-Process $file -ArgumentList "/Quiet InstallAllUsers=1 TargetDir=`"$($ini['Settings']['Python3Dir'])`" Include_doc=0 Include_tcltk=0 Include_test=0 Include_launcher=1 PrependPath=1 Shortcuts=0" -Wait -NoNewWindow -PassThru
|
||||
Write-Output " - $script_name :: Installing $($ini[$bitPrograms]['Python']) . . ."
|
||||
$p = Start-Process $file -ArgumentList "/Quiet InstallAllUsers=1 TargetDir=`"$($ini['Settings']['PythonDir'])`" Include_doc=0 Include_tcltk=0 Include_test=0 Include_launcher=1 PrependPath=1 Shortcuts=0" -Wait -NoNewWindow -PassThru
|
||||
}
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
@ -187,8 +187,8 @@ If (Test-Path "$($ini['Settings']['Python3Dir'])\python.exe") {
|
|||
#------------------------------------------------------------------------------
|
||||
Write-Output " - Updating Environment Variables . . ."
|
||||
$Path = (Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH).Path
|
||||
If (!($Path.ToLower().Contains("$($ini['Settings']['Scripts3Dir'])".ToLower()))) {
|
||||
$newPath = "$($ini['Settings']['Scripts3Dir']);$Path"
|
||||
If (!($Path.ToLower().Contains("$($ini['Settings']['ScriptsDir'])".ToLower()))) {
|
||||
$newPath = "$($ini['Settings']['ScriptsDir']);$Path"
|
||||
Set-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH -Value $newPath
|
||||
$env:Path = $newPath
|
||||
}
|
||||
|
@ -199,7 +199,7 @@ If (!($Path.ToLower().Contains("$($ini['Settings']['Scripts3Dir'])".ToLower())))
|
|||
Write-Output " ----------------------------------------------------------------"
|
||||
Write-Output " - $script_name :: Updating PIP and SetupTools . . ."
|
||||
Write-Output " ----------------------------------------------------------------"
|
||||
Start_Process_and_test_exitcode "cmd" "/c $($ini['Settings']['Python3Dir'])\python.exe -m pip --disable-pip-version-check --no-cache-dir install -r $($script_path)\req_pip.txt" "python pip"
|
||||
Start_Process_and_test_exitcode "cmd" "/c $($ini['Settings']['PythonDir'])\python.exe -m pip --disable-pip-version-check --no-cache-dir install -r $($script_path)\req_pip.txt" "python pip"
|
||||
|
||||
|
||||
#==============================================================================
|
||||
|
@ -208,7 +208,7 @@ Start_Process_and_test_exitcode "cmd" "/c $($ini['Settings']['Python3Dir'])\pyth
|
|||
Write-Output " ----------------------------------------------------------------"
|
||||
Write-Output " - $script_name :: Installing windows specific pypi resources using pip . . ."
|
||||
Write-Output " ----------------------------------------------------------------"
|
||||
Start_Process_and_test_exitcode "cmd" "/c $($ini['Settings']['Python3Dir'])\python.exe -m pip --disable-pip-version-check --no-cache-dir install -r $($script_path)\req_win.txt" "pip install"
|
||||
Start_Process_and_test_exitcode "cmd" "/c $($ini['Settings']['PythonDir'])\python.exe -m pip --disable-pip-version-check --no-cache-dir install -r $($script_path)\req_win.txt" "pip install"
|
||||
|
||||
#==============================================================================
|
||||
# Install pypi resources using pip
|
||||
|
@ -217,13 +217,14 @@ If ($NoPipDependencies -eq $false) {
|
|||
Write-Output " ----------------------------------------------------------------"
|
||||
Write-Output " - $script_name :: Installing pypi resources using pip . . ."
|
||||
Write-Output " ----------------------------------------------------------------"
|
||||
Start_Process_and_test_exitcode "cmd" "/c $($ini['Settings']['Python3Dir'])\python.exe -m pip --disable-pip-version-check --no-cache-dir install -r $($script_path)\req.txt" "pip install"
|
||||
Start_Process_and_test_exitcode "cmd" "/c $($ini['Settings']['PythonDir'])\python.exe -m pip --disable-pip-version-check --no-cache-dir install -r $($script_path)\req.txt" "pip install"
|
||||
}
|
||||
|
||||
#==============================================================================
|
||||
# Cleaning Up PyWin32
|
||||
#==============================================================================
|
||||
If (Test-Path "$($ini['Settings']['SitePkgs3Dir'])\pywin32_system32" -PathType Container ) {
|
||||
If (Test-Path "$($ini['Settings']['SitePkgsDir'])\pywin32_system32" -PathType Container )
|
||||
{
|
||||
#==============================================================================
|
||||
# Cleaning Up PyWin32
|
||||
#==============================================================================
|
||||
Write-Output " ----------------------------------------------------------------"
|
||||
Write-Output " - $script_name :: Cleaning Up PyWin32 . . ."
|
||||
Write-Output " ----------------------------------------------------------------"
|
||||
|
@ -231,20 +232,20 @@ If (Test-Path "$($ini['Settings']['SitePkgs3Dir'])\pywin32_system32" -PathType C
|
|||
# Move DLL's to Python Root
|
||||
# The dlls have to be in Python directory and the site-packages\win32 directory
|
||||
Write-Output " - $script_name :: Moving PyWin32 DLLs . . ."
|
||||
Copy-Item "$( $ini['Settings']['SitePkgs3Dir'] )\pywin32_system32\*.dll" "$( $ini['Settings']['Python3Dir'] )" -Force
|
||||
Move-Item "$( $ini['Settings']['SitePkgs3Dir'] )\pywin32_system32\*.dll" "$( $ini['Settings']['SitePkgs3Dir'] )\win32" -Force
|
||||
Copy-Item "$( $ini['Settings']['SitePkgsDir'] )\pywin32_system32\*.dll" "$( $ini['Settings']['PythonDir'] )" -Force
|
||||
Move-Item "$( $ini['Settings']['SitePkgsDir'] )\pywin32_system32\*.dll" "$( $ini['Settings']['SitePkgsDir'] )\win32" -Force
|
||||
|
||||
# Create gen_py directory
|
||||
Write-Output " - $script_name :: Creating gen_py Directory . . ."
|
||||
New-Item -Path "$( $ini['Settings']['SitePkgs3Dir'] )\win32com\gen_py" -ItemType Directory -Force | Out-Null
|
||||
New-Item -Path "$( $ini['Settings']['SitePkgsDir'] )\win32com\gen_py" -ItemType Directory -Force | Out-Null
|
||||
|
||||
# Remove pywin32_system32 directory
|
||||
Write-Output " - $script_name :: Removing pywin32_system32 Directory . . ."
|
||||
Remove-Item "$( $ini['Settings']['SitePkgs3Dir'] )\pywin32_system32"
|
||||
Remove-Item "$( $ini['Settings']['SitePkgsDir'] )\pywin32_system32"
|
||||
|
||||
# Remove PyWin32 PostInstall and testall Scripts
|
||||
Write-Output " - $script_name :: Removing PyWin32 scripts . . ."
|
||||
Remove-Item "$( $ini['Settings']['Scripts3Dir'] )\pywin32_*" -Force -Recurse
|
||||
Remove-Item "$( $ini['Settings']['ScriptsDir'] )\pywin32_*" -Force -Recurse
|
||||
}
|
||||
|
||||
#==============================================================================
|
||||
|
@ -260,7 +261,7 @@ ForEach($key in $ini[$bitDLLs].Keys) {
|
|||
$url = "$($ini['Settings']['SaltRepo'])/$bitFolder/$file"
|
||||
$file = "$($ini['Settings']['DownloadDir'])\$bitFolder\$file"
|
||||
DownloadFileWithProgress $url $file
|
||||
Copy-Item $file -destination $($ini['Settings']['Python3Dir'])
|
||||
Copy-Item $file -destination $($ini['Settings']['PythonDir'])
|
||||
}
|
||||
|
||||
#------------------------------------------------------------------------------
|
|
@ -1,288 +0,0 @@
|
|||
#==============================================================================
|
||||
# You may need to change the execution policy in order to run this script
|
||||
# Run the following in powershell:
|
||||
#
|
||||
# Set-ExecutionPolicy RemoteSigned
|
||||
#
|
||||
#==============================================================================
|
||||
#
|
||||
# FILE: dev_env.ps1
|
||||
#
|
||||
# DESCRIPTION: Development Environment Installation for Windows
|
||||
#
|
||||
# BUGS: https://github.com/saltstack/salt-windows-bootstrap/issues
|
||||
#
|
||||
# COPYRIGHT: (c) 2012-2017 by the SaltStack Team, see AUTHORS.rst for more
|
||||
# details.
|
||||
#
|
||||
# LICENSE: Apache 2.0
|
||||
# ORGANIZATION: SaltStack (saltstack.org)
|
||||
# CREATED: 03/15/2015
|
||||
#==============================================================================
|
||||
|
||||
# Load parameters
|
||||
param(
|
||||
[switch]$Silent,
|
||||
[switch]$NoPipDependencies
|
||||
)
|
||||
|
||||
#==============================================================================
|
||||
# Get the Directory of actual script
|
||||
#==============================================================================
|
||||
$script_path = dir "$($myInvocation.MyCommand.Definition)"
|
||||
$script_path = $script_path.DirectoryName
|
||||
|
||||
#==============================================================================
|
||||
# Get the name of actual script
|
||||
#==============================================================================
|
||||
$script_name = $MyInvocation.MyCommand.Name
|
||||
|
||||
Write-Output "================================================================="
|
||||
Write-Output ""
|
||||
Write-Output " Development Environment Installation"
|
||||
Write-Output ""
|
||||
Write-Output " - Installs All Salt Dependencies"
|
||||
Write-Output " - Detects 32/64 bit Architectures"
|
||||
Write-Output ""
|
||||
Write-Output " To run silently add -Silent"
|
||||
Write-Output " eg: ${script_name} -Silent"
|
||||
Write-Output ""
|
||||
Write-Output " To run skip installing pip dependencies add -NoPipDependencies"
|
||||
Write-Output " eg: ${script_name} -NoPipDependencies"
|
||||
Write-Output ""
|
||||
Write-Output "================================================================="
|
||||
Write-Output ""
|
||||
|
||||
#==============================================================================
|
||||
# Import Modules
|
||||
#==============================================================================
|
||||
Import-Module $script_path\Modules\download-module.psm1
|
||||
Import-Module $script_path\Modules\get-settings.psm1
|
||||
Import-Module $script_path\Modules\uac-module.psm1
|
||||
Import-Module $script_path\Modules\zip-module.psm1
|
||||
Import-Module $script_path\Modules\start-process-and-test-exitcode.psm1
|
||||
#==============================================================================
|
||||
# Check for Elevated Privileges
|
||||
#==============================================================================
|
||||
If (!(Get-IsAdministrator)) {
|
||||
If (Get-IsUacEnabled) {
|
||||
# We are not running "as Administrator" - so relaunch as administrator
|
||||
# Create a new process object that starts PowerShell
|
||||
$newProcess = new-object System.Diagnostics.ProcessStartInfo "PowerShell";
|
||||
|
||||
# Specify the current script path and name as a parameter
|
||||
$newProcess.Arguments = $myInvocation.MyCommand.Definition
|
||||
|
||||
# Specify the current working directory
|
||||
$newProcess.WorkingDirectory = "$script_path"
|
||||
|
||||
# Indicate that the process should be elevated
|
||||
$newProcess.Verb = "runas";
|
||||
|
||||
# Start the new process
|
||||
[System.Diagnostics.Process]::Start($newProcess);
|
||||
|
||||
# Exit from the current, unelevated, process
|
||||
Exit
|
||||
} Else {
|
||||
Throw "You must be administrator to run this script"
|
||||
}
|
||||
}
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# Load Settings
|
||||
#------------------------------------------------------------------------------
|
||||
$ini = Get-Settings
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# Create Directories
|
||||
#------------------------------------------------------------------------------
|
||||
$p = New-Item $ini['Settings']['DownloadDir'] -ItemType Directory -Force
|
||||
$p = New-Item "$($ini['Settings']['DownloadDir'])\64" -ItemType Directory -Force
|
||||
$p = New-Item "$($ini['Settings']['DownloadDir'])\32" -ItemType Directory -Force
|
||||
$p = New-Item $ini['Settings']['SaltDir'] -ItemType Directory -Force
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# Determine Architecture (32 or 64 bit) and assign variables
|
||||
#------------------------------------------------------------------------------
|
||||
If ([System.IntPtr]::Size -ne 4) {
|
||||
Write-Output "Detected 64bit Architecture..."
|
||||
|
||||
$bitDLLs = "64bitDLLs"
|
||||
$bitPaths = "64bitPaths"
|
||||
$bitPrograms = "64bitPrograms"
|
||||
$bitFolder = "64"
|
||||
} Else {
|
||||
Write-Output "Detected 32bit Architecture"
|
||||
$bitDLLs = "32bitDLLs"
|
||||
$bitPaths = "32bitPaths"
|
||||
$bitPrograms = "32bitPrograms"
|
||||
$bitFolder = "32"
|
||||
}
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# Check for installation of NSIS
|
||||
#------------------------------------------------------------------------------
|
||||
Write-Output " - Checking for NSIS installation . . ."
|
||||
If (Test-Path "$($ini[$bitPaths]['NSISDir'])\NSIS.exe") {
|
||||
# Found NSIS, do nothing
|
||||
Write-Output " - NSIS Found . . ."
|
||||
} Else {
|
||||
# NSIS not found, install
|
||||
Write-Output " - NSIS Not Found . . ."
|
||||
Write-Output " - Downloading $($ini['Prerequisites']['NSIS']) . . ."
|
||||
$file = "$($ini['Prerequisites']['NSIS'])"
|
||||
$url = "$($ini['Settings']['SaltRepo'])/$file"
|
||||
$file = "$($ini['Settings']['DownloadDir'])\$file"
|
||||
DownloadFileWithProgress $url $file
|
||||
|
||||
# Install NSIS
|
||||
Write-Output " - Installing $($ini['Prerequisites']['NSIS']) . . ."
|
||||
$file = "$($ini['Settings']['DownloadDir'])\$($ini['Prerequisites']['NSIS'])"
|
||||
$p = Start-Process $file -ArgumentList '/S' -Wait -NoNewWindow -PassThru
|
||||
}
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# Check for installation of Microsoft Visual C++ Compiler for Python 2.7
|
||||
#------------------------------------------------------------------------------
|
||||
Write-Output " - Checking for VC Compiler for Python 2.7 installation . . ."
|
||||
If (Test-Path "$($ini[$bitPaths]['VCforPythonDir'])\vcvarsall.bat") {
|
||||
# Found Microsoft Visual C++ for Python2.7, do nothing
|
||||
Write-Output " - Microsoft Visual C++ for Python 2.7 Found . . ."
|
||||
} Else {
|
||||
# Microsoft Visual C++ for Python2.7 not found, install
|
||||
Write-Output " - Microsoft Visual C++ for Python2.7 Not Found . . ."
|
||||
Write-Output " - Downloading $($ini['Prerequisites']['VCforPython']) . . ."
|
||||
$file = "$($ini['Prerequisites']['VCforPython'])"
|
||||
$url = "$($ini['Settings']['SaltRepo'])/$file"
|
||||
$file = "$($ini['Settings']['DownloadDir'])\$file"
|
||||
DownloadFileWithProgress $url $file
|
||||
|
||||
# Install Microsoft Visual C++ for Python2.7
|
||||
Write-Output " - Installing $($ini['Prerequisites']['VCforPython']) . . ."
|
||||
$file = "$($ini['Settings']['DownloadDir'])\$($ini['Prerequisites']['VCforPython'])"
|
||||
$p = Start-Process msiexec.exe -ArgumentList "/i $file /quiet ALLUSERS=1" -Wait -NoNewWindow -PassThru
|
||||
}
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# Install Python
|
||||
#------------------------------------------------------------------------------
|
||||
Write-Output " - Checking for Python 2.7 installation . . ."
|
||||
If (Test-Path "$($ini['Settings']['Python2Dir'])\python.exe") {
|
||||
# Found Python2.7, do nothing
|
||||
Write-Output " - Python 2.7 Found . . ."
|
||||
} Else {
|
||||
Write-Output " - Downloading $($ini[$bitPrograms]['Python2']) . . ."
|
||||
$file = "$($ini[$bitPrograms]['Python2'])"
|
||||
$url = "$($ini['Settings']['SaltRepo'])/$bitFolder/$file"
|
||||
$file = "$($ini['Settings']['DownloadDir'])\$bitFolder\$file"
|
||||
DownloadFileWithProgress $url $file
|
||||
|
||||
Write-Output " - $script_name :: Installing $($ini[$bitPrograms]['Python2']) . . ."
|
||||
$p = Start-Process msiexec -ArgumentList "/i $file /quiet ADDLOCAL=DefaultFeature,SharedCRT,Extensions,pip_feature,PrependPath TARGETDIR=`"$($ini['Settings']['Python2Dir'])`"" -Wait -NoNewWindow -PassThru
|
||||
}
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# Update Environment Variables
|
||||
#------------------------------------------------------------------------------
|
||||
Write-Output " - Updating Environment Variables . . ."
|
||||
$Path = (Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH).Path
|
||||
If (!($Path.ToLower().Contains("$($ini['Settings']['Scripts2Dir'])".ToLower()))) {
|
||||
$newPath = "$($ini['Settings']['Scripts2Dir']);$Path"
|
||||
Set-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH -Value $newPath
|
||||
$env:Path = $newPath
|
||||
}
|
||||
|
||||
#==============================================================================
|
||||
# Update PIP and SetupTools
|
||||
#==============================================================================
|
||||
Write-Output " ----------------------------------------------------------------"
|
||||
Write-Output " - $script_name :: Updating PIP and SetupTools . . ."
|
||||
Write-Output " ----------------------------------------------------------------"
|
||||
Start_Process_and_test_exitcode "cmd" "/c $($ini['Settings']['Python2Dir'])\python.exe -m pip --disable-pip-version-check --no-cache-dir install -r $($script_path)\req_pip.txt" "python pip"
|
||||
|
||||
|
||||
#==============================================================================
|
||||
# Install windows specific pypi resources using pip
|
||||
#==============================================================================
|
||||
Write-Output " ----------------------------------------------------------------"
|
||||
Write-Output " - $script_name :: Installing windows specific pypi resources using pip . . ."
|
||||
Write-Output " ----------------------------------------------------------------"
|
||||
Start_Process_and_test_exitcode "cmd" "/c $($ini['Settings']['Python2Dir'])\python.exe -m pip --disable-pip-version-check --no-cache-dir install -r $($script_path)\req_win.txt" "pip install"
|
||||
|
||||
|
||||
#==============================================================================
|
||||
# Install pypi resources using pip
|
||||
#==============================================================================
|
||||
If ($NoPipDependencies -eq $false) {
|
||||
Write-Output " ----------------------------------------------------------------"
|
||||
Write-Output " - $script_name :: Installing pypi resources using pip . . ."
|
||||
Write-Output " ----------------------------------------------------------------"
|
||||
Start_Process_and_test_exitcode "cmd" "/c $($ini['Settings']['Python2Dir'])\python.exe -m pip --disable-pip-version-check --no-cache-dir install -r $($script_path)\req.txt" "pip install"
|
||||
}
|
||||
|
||||
#==============================================================================
|
||||
# Cleaning Up PyWin32
|
||||
#==============================================================================
|
||||
If ( Test-Path "$($ini['Settings']['SitePkgs2Dir'])\pywin32_system32" -PathType Container ) {
|
||||
Write-Output " ----------------------------------------------------------------"
|
||||
Write-Output " - $script_name :: Cleaning Up PyWin32 . . ."
|
||||
Write-Output " ----------------------------------------------------------------"
|
||||
|
||||
# Move DLL's to Python Root
|
||||
Write-Output " - $script_name :: Moving PyWin32 DLLs . . ."
|
||||
# The dlls have to be in Python directory and the site-packages\win32 directory
|
||||
Copy-Item "$( $ini['Settings']['SitePkgs2Dir'] )\pywin32_system32\*.dll" "$( $ini['Settings']['Python2Dir'] )" -Force
|
||||
Move-Item "$( $ini['Settings']['SitePkgs2Dir'] )\pywin32_system32\*.dll" "$( $ini['Settings']['SitePkgs2Dir'] )\win32" -Force
|
||||
|
||||
# Create gen_py directory
|
||||
Write-Output " - $script_name :: Creating gen_py Directory . . ."
|
||||
New-Item -Path "$( $ini['Settings']['SitePkgs2Dir'] )\win32com\gen_py" -ItemType Directory -Force | Out-Null
|
||||
|
||||
# Remove pywin32_system32 directory
|
||||
Write-Output " - $script_name :: Removing pywin32_system32 Directory . . ."
|
||||
Remove-Item "$( $ini['Settings']['SitePkgs2Dir'] )\pywin32_system32"
|
||||
|
||||
# Remove PyWin32 PostInstall and testall Scripts
|
||||
Write-Output " - $script_name :: Removing PyWin32 scripts . . ."
|
||||
Remove-Item "$( $ini['Settings']['Scripts2Dir'] )\pywin32_*" -Force -Recurse
|
||||
}
|
||||
|
||||
#==============================================================================
|
||||
# Copy DLLs to Python Directory
|
||||
#==============================================================================
|
||||
Write-Output " ----------------------------------------------------------------"
|
||||
Write-Output " - $script_name :: Copying DLLs . . ."
|
||||
Write-Output " ----------------------------------------------------------------"
|
||||
# Architecture Specific DLL's
|
||||
ForEach($key in $ini[$bitDLLs].Keys) {
|
||||
Write-Output " - $key . . ."
|
||||
$file = "$($ini[$bitDLLs][$key])"
|
||||
$url = "$($ini['Settings']['SaltRepo'])/$bitFolder/$file"
|
||||
$file = "$($ini['Settings']['DownloadDir'])\$bitFolder\$file"
|
||||
DownloadFileWithProgress $url $file
|
||||
Copy-Item $file -destination $($ini['Settings']['Python2Dir'])
|
||||
}
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# Script complete
|
||||
#------------------------------------------------------------------------------
|
||||
Write-Output "================================================================="
|
||||
Write-Output " $script_name :: Salt Stack Dev Environment Script Complete"
|
||||
Write-Output "================================================================="
|
||||
Write-Output ""
|
||||
|
||||
If (-Not $Silent) {
|
||||
Write-Output "Press any key to continue ..."
|
||||
$p = $HOST.UI.RawUI.Flushinputbuffer()
|
||||
$p = $HOST.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
|
||||
}
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# Remove the temporary download directory
|
||||
#------------------------------------------------------------------------------
|
||||
Write-Output " ----------------------------------------------------------------"
|
||||
Write-Output " - $script_name :: Cleaning up downloaded files"
|
||||
Write-Output " ----------------------------------------------------------------"
|
||||
Write-Output ""
|
||||
Remove-Item $($ini['Settings']['DownloadDir']) -Force -Recurse
|
|
@ -7,7 +7,6 @@
|
|||
@echo %0 :: Get Passed Parameters...
|
||||
@echo ---------------------------------------------------------------------
|
||||
Set "Version="
|
||||
Set "Python="
|
||||
:: First Parameter
|
||||
if not "%~1"=="" (
|
||||
echo.%1 | FIND /I "=" > nul && (
|
||||
|
@ -18,48 +17,19 @@ if not "%~1"=="" (
|
|||
set "Version=%~1"
|
||||
)
|
||||
)
|
||||
:: Second Parameter
|
||||
if not "%~2"=="" (
|
||||
echo.%2 | FIND /I "=" > nul && (
|
||||
:: Named Parameter
|
||||
set "%~2"
|
||||
) || (
|
||||
:: Positional Parameter
|
||||
set "Python=%~2"
|
||||
)
|
||||
)
|
||||
|
||||
:: If Version not defined, Get the version from Git
|
||||
if "%Version%"=="" (
|
||||
for /f "delims=" %%a in ('git describe') do @set "Version=%%a"
|
||||
)
|
||||
|
||||
:: If Python not defined, Assume Python 2
|
||||
if "%Python%"=="" (
|
||||
set Python=2
|
||||
)
|
||||
|
||||
:: Verify valid Python value (2 or 3)
|
||||
set "x="
|
||||
for /f "delims=23" %%i in ("%Python%") do set x=%%i
|
||||
if Defined x (
|
||||
echo Invalid Python Version specified. Must be 2 or 3. Passed %Python%
|
||||
goto eof
|
||||
)
|
||||
@echo.
|
||||
|
||||
:: Define Variables
|
||||
@echo Defining Variables...
|
||||
@echo ----------------------------------------------------------------------
|
||||
if %Python%==2 (
|
||||
Set "PyDir=C:\Python27"
|
||||
Set "PyVerMajor=2"
|
||||
Set "PyVerMinor=7"
|
||||
) else (
|
||||
Set "PyDir=C:\Python35"
|
||||
Set "PyVerMajor=3"
|
||||
Set "PyVerMinor=5"
|
||||
)
|
||||
Set "PyDir=C:\Python37"
|
||||
Set "PyVerMajor=3"
|
||||
Set "PyVerMinor=7"
|
||||
|
||||
:: Verify the Python Installation
|
||||
If not Exist "%PyDir%\python.exe" (
|
||||
|
@ -132,9 +102,6 @@ If Defined ProgramFiles(x86) (
|
|||
If Exist "%PreDir%" rd /s /q "%PreDir%"
|
||||
mkdir "%PreDir%"
|
||||
|
||||
:: Skip KB2999226 if on Py3
|
||||
If %Python%==2 goto get_vcredist
|
||||
|
||||
:: For PY 3, include KB2999226
|
||||
@echo Copying KB2999226 to Prerequisites
|
||||
@echo ----------------------------------------------------------------------
|
||||
|
@ -180,25 +147,6 @@ powershell -ExecutionPolicy RemoteSigned -File download_url_file.ps1 -url %Url80
|
|||
@echo - Downloading %Name81%
|
||||
powershell -ExecutionPolicy RemoteSigned -File download_url_file.ps1 -url %Url81% -file "%PreDir%\%Name81%"
|
||||
|
||||
goto prereq_end
|
||||
|
||||
:: For PY 2, include VCRedist
|
||||
:get_vcredist
|
||||
@echo Copying VCRedist to Prerequisites
|
||||
@echo ----------------------------------------------------------------------
|
||||
|
||||
:: Set the location of the vcredist to download
|
||||
Set Url64="http://repo.saltstack.com/windows/dependencies/64/vcredist_x64_2008_mfc.exe"
|
||||
Set Url32="http://repo.saltstack.com/windows/dependencies/32/vcredist_x86_2008_mfc.exe"
|
||||
|
||||
:: Check for 64 bit by finding the Program Files (x86) directory
|
||||
If Defined ProgramFiles(x86) (
|
||||
powershell -ExecutionPolicy RemoteSigned -File download_url_file.ps1 -url "%Url64%" -file "%PreDir%\vcredist.exe"
|
||||
) Else (
|
||||
powershell -ExecutionPolicy RemoteSigned -File download_url_file.ps1 -url "%Url32%" -file "%PreDir%\vcredist.exe"
|
||||
)
|
||||
@echo.
|
||||
|
||||
:prereq_end
|
||||
|
||||
:: Remove the fixed path in .exe files
|
||||
|
@ -616,7 +564,7 @@ If Exist "%BinDir%\Scripts\salt-unity*"^
|
|||
@echo ----------------------------------------------------------------------
|
||||
:: Make the Master installer if the nullsoft script exists
|
||||
If Exist "%InsDir%\Salt-Setup.nsi"^
|
||||
makensis.exe /DSaltVersion=%Version% /DPythonVersion=%Python% "%InsDir%\Salt-Setup.nsi"
|
||||
makensis.exe /DSaltVersion=%Version% "%InsDir%\Salt-Setup.nsi"
|
||||
|
||||
:: Remove files not needed for Salt Minion
|
||||
:: salt
|
||||
|
@ -648,7 +596,7 @@ if Exist "%CnfDir%\master"^
|
|||
del /Q "%CnfDir%\master" 1>nul
|
||||
|
||||
:: Make the Salt Minion Installer
|
||||
makensis.exe /DSaltVersion=%Version% /DPythonVersion=%Python% "%InsDir%\Salt-Minion-Setup.nsi"
|
||||
makensis.exe /DSaltVersion=%Version% "%InsDir%\Salt-Minion-Setup.nsi"
|
||||
@echo.
|
||||
|
||||
@echo.
|
||||
|
|
|
@ -57,7 +57,7 @@ goto CheckPython3
|
|||
:CheckPython3
|
||||
if exist "\Python35" goto RemovePython3
|
||||
|
||||
goto eof
|
||||
goto CheckPython37
|
||||
|
||||
:RemovePython3
|
||||
echo %0 :: Uninstalling Python 3 ...
|
||||
|
@ -94,6 +94,38 @@ goto eof
|
|||
|
||||
goto eof
|
||||
|
||||
:CheckPython37
|
||||
if exist "\Python37" goto RemovePython37
|
||||
|
||||
goto eof
|
||||
|
||||
:RemovePython37
|
||||
echo %0 :: Uninstalling Python 3.7 ...
|
||||
echo ---------------------------------------------------------------------
|
||||
:: 64 bit
|
||||
if exist "%LOCALAPPDATA%\Package Cache\{8ae589dd-de2e-42cd-af56-102374115fee}" (
|
||||
echo %0 :: - 3.7.4 64bit
|
||||
"%LOCALAPPDATA%\Package Cache\{8ae589dd-de2e-42cd-af56-102374115fee}\python-3.7.4-amd64.exe" /uninstall /quiet
|
||||
)
|
||||
|
||||
:: 32 bit
|
||||
if exist "%LOCALAPPDATA%\Package Cache\{b66087e3-469e-4725-8b9b-f0981244afea}" (
|
||||
echo %0 :: - 3.7.4 32bit
|
||||
"%LOCALAPPDATA%\Package Cache\{b66087e3-469e-4725-8b9b-f0981244afea}\python-3.7.4" /uninstall /quiet
|
||||
)
|
||||
|
||||
rem wipe the Python directory
|
||||
echo %0 :: Removing the C:\Python37 Directory ...
|
||||
echo ---------------------------------------------------------------------
|
||||
rd /s /q "C:\Python37"
|
||||
if %errorLevel%==0 (
|
||||
echo Successful
|
||||
) else (
|
||||
echo Failed, please remove manually
|
||||
)
|
||||
|
||||
goto eof
|
||||
|
||||
:eof
|
||||
echo.
|
||||
echo =====================================================================
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
|
||||
!define PRODUCT_UNINST_KEY_OTHER "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME_OTHER}"
|
||||
!define PRODUCT_UNINST_ROOT_KEY "HKLM"
|
||||
!define OUTFILE "Salt-Minion-${PRODUCT_VERSION}-Py${PYTHON_VERSION}-${CPUARCH}-Setup.exe"
|
||||
!define OUTFILE "Salt-Minion-${PRODUCT_VERSION}-${CPUARCH}-Setup.exe"
|
||||
|
||||
# Import Libraries
|
||||
!include "MUI2.nsh"
|
||||
|
@ -31,12 +31,6 @@ ${StrStrAdv}
|
|||
!define PRODUCT_VERSION "Undefined Version"
|
||||
!endif
|
||||
|
||||
!ifdef PythonVersion
|
||||
!define PYTHON_VERSION "${PythonVersion}"
|
||||
!else
|
||||
!define PYTHON_VERSION "2"
|
||||
!endif
|
||||
|
||||
!if "$%PROCESSOR_ARCHITECTURE%" == "AMD64"
|
||||
!define CPUARCH "AMD64"
|
||||
!else if "$%PROCESSOR_ARCHITEW6432%" == "AMD64"
|
||||
|
@ -73,21 +67,6 @@ ${StrStrAdv}
|
|||
!define MUI_UNWELCOMEFINISHPAGE_BITMAP "panel.bmp"
|
||||
|
||||
|
||||
# This entire if block can be removed for the Sodium release... including the !define MUI_WELCOMEPAGE_TEXT
|
||||
# NSIS will just use the default like it does for Python 3, which should be the same test
|
||||
!if "${PYTHON_VERSION}" == "2"
|
||||
!define MUI_WELCOMEPAGE_TEXT "\
|
||||
WARNING: Python 2 Support will be discontinued in Sodium. Salt will only ship Python 3 \
|
||||
installers starting with the Sodium release.$\r$\n\
|
||||
$\r$\n\
|
||||
Setup will guide you through the installation of ${PRODUCT_NAME} ${PRODUCT_VERSION}.$\r$\n\
|
||||
$\r$\n\
|
||||
It is recommended that you close all other applications before starting Setup. This will make it possible to \
|
||||
update relevant system files without having to reboot your computer.$\r$\n\
|
||||
$\r$\n\
|
||||
Click Next to continue."
|
||||
!endif
|
||||
|
||||
# Welcome page
|
||||
!insertmacro MUI_PAGE_WELCOME
|
||||
|
||||
|
@ -410,11 +389,7 @@ FunctionEnd
|
|||
###############################################################################
|
||||
# Installation Settings
|
||||
###############################################################################
|
||||
!if ${PYTHON_VERSION} == 3
|
||||
Name "${PRODUCT_NAME} ${PRODUCT_VERSION} (Python ${PYTHON_VERSION})"
|
||||
!else
|
||||
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
|
||||
!endif
|
||||
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
|
||||
OutFile "${OutFile}"
|
||||
InstallDir "c:\salt"
|
||||
InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
|
||||
|
@ -423,7 +398,7 @@ ShowUnInstDetails show
|
|||
|
||||
Section -copy_prereqs
|
||||
# Copy prereqs to the Plugins Directory
|
||||
# These files will be vcredist 2008 and KB2999226 for Win8.1 and below
|
||||
# These files will be KB2999226 for Win8.1 and below
|
||||
# These files are downloaded by build_pkg.bat
|
||||
# This directory gets removed upon completion
|
||||
SetOutPath "$PLUGINSDIR\"
|
||||
|
@ -439,9 +414,6 @@ Section -install_ucrt
|
|||
Var /GLOBAL MsuPrefix
|
||||
Var /GLOBAL MsuFileName
|
||||
|
||||
# UCRT only needs to be installed for Python 3
|
||||
StrCmp ${PYTHON_VERSION} 2 lbl_done
|
||||
|
||||
# Get the Major.Minor version Number
|
||||
# Windows 10 introduced CurrentMajorVersionNumber
|
||||
ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" \
|
||||
|
@ -523,84 +495,6 @@ Section -install_ucrt
|
|||
SectionEnd
|
||||
|
||||
|
||||
# Check and install Visual C++ redist packages
|
||||
# See http://blogs.msdn.com/b/astebner/archive/2009/01/29/9384143.aspx for more info
|
||||
# Hidden section (-) to install VCRedist
|
||||
Section -install_vcredist
|
||||
|
||||
Var /GLOBAL VcRedistName
|
||||
Var /GLOBAL VcRedistGuid
|
||||
Var /GLOBAL NeedVcRedist
|
||||
Var /GLOBAL CheckVcRedist
|
||||
StrCpy $CheckVcRedist "False"
|
||||
|
||||
# Visual C++ 2008 SP1 MFC Security Update redist packages
|
||||
!define PY2_VC_REDIST_NAME "VC_Redist_2008_SP1_MFC"
|
||||
!define PY2_VC_REDIST_X64_GUID "{5FCE6D76-F5DC-37AB-B2B8-22AB8CEDB1D4}"
|
||||
!define PY2_VC_REDIST_X86_GUID "{9BE518E6-ECC6-35A9-88E4-87755C07200F}"
|
||||
|
||||
# VCRedist only needs to be installed for Python 2
|
||||
${If} ${PYTHON_VERSION} == 2
|
||||
|
||||
StrCpy $VcRedistName ${PY2_VC_REDIST_NAME}
|
||||
${If} ${CPUARCH} == "AMD64"
|
||||
StrCpy $VcRedistGuid ${PY2_VC_REDIST_X64_GUID}
|
||||
${Else}
|
||||
StrCpy $VcRedistGuid ${PY2_VC_REDIST_X86_GUID}
|
||||
${EndIf}
|
||||
|
||||
# VCRedist 2008 only needed on Windows Server 2008R2/Windows 7 and below
|
||||
${If} ${AtMostWin2008R2}
|
||||
StrCpy $CheckVcRedist "True"
|
||||
${EndIf}
|
||||
|
||||
${EndIf}
|
||||
|
||||
${If} $CheckVcRedist == "True"
|
||||
|
||||
Push $VcRedistGuid
|
||||
Call MsiQueryProductState
|
||||
${If} $NeedVcRedist == "True"
|
||||
MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 \
|
||||
"$VcRedistName is currently not installed. Would you like to install?" \
|
||||
/SD IDYES IDNO endVcRedist
|
||||
|
||||
# If an output variable is specified ($0 in the case below),
|
||||
# ExecWait sets the variable with the exit code (and only sets the
|
||||
# error flag if an error occurs; if an error occurs, the contents
|
||||
# of the user variable are undefined).
|
||||
# http://nsis.sourceforge.net/Reference/ExecWait
|
||||
ClearErrors
|
||||
ExecWait '"$PLUGINSDIR\vcredist.exe" /q' $0
|
||||
IfErrors 0 CheckVcRedistErrorCode
|
||||
MessageBox MB_OK \
|
||||
"$VcRedistName failed to install. Try installing the package manually." \
|
||||
/SD IDOK
|
||||
Goto endVcRedist
|
||||
|
||||
CheckVcRedistErrorCode:
|
||||
# Check for Reboot Error Code (3010)
|
||||
${If} $0 == 3010
|
||||
MessageBox MB_OK \
|
||||
"$VcRedistName installed but requires a restart to complete." \
|
||||
/SD IDOK
|
||||
|
||||
# Check for any other errors
|
||||
${ElseIfNot} $0 == 0
|
||||
MessageBox MB_OK \
|
||||
"$VcRedistName failed with ErrorCode: $0. Try installing the package manually." \
|
||||
/SD IDOK
|
||||
${EndIf}
|
||||
|
||||
endVcRedist:
|
||||
|
||||
${EndIf}
|
||||
|
||||
${EndIf}
|
||||
|
||||
SectionEnd
|
||||
|
||||
|
||||
Section "MainSection" SEC01
|
||||
|
||||
SetOutPath "$INSTDIR\"
|
||||
|
@ -890,18 +784,6 @@ FunctionEnd
|
|||
###############################################################################
|
||||
# Helper Functions
|
||||
###############################################################################
|
||||
Function MsiQueryProductState
|
||||
# Used for detecting VCRedist Installation
|
||||
!define INSTALLSTATE_DEFAULT "5"
|
||||
|
||||
Pop $R0
|
||||
StrCpy $NeedVcRedist "False"
|
||||
System::Call "msi::MsiQueryProductStateA(t '$R0') i.r0"
|
||||
StrCmp $0 ${INSTALLSTATE_DEFAULT} +2 0
|
||||
StrCpy $NeedVcRedist "True"
|
||||
|
||||
FunctionEnd
|
||||
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# Trim Function
|
||||
|
|
|
@ -16,12 +16,9 @@ Function Get-Settings {
|
|||
$Settings = @{
|
||||
"SaltRepo" = "https://repo.saltstack.com/windows/dependencies"
|
||||
"SaltDir" = "C:\salt"
|
||||
"Python2Dir" = "C:\Python27"
|
||||
"Scripts2Dir" = "C:\Python27\Scripts"
|
||||
"SitePkgs2Dir" = "C:\Python27\Lib\site-packages"
|
||||
"Python3Dir" = "C:\Python35"
|
||||
"Scripts3Dir" = "C:\Python35\Scripts"
|
||||
"SitePkgs3Dir" = "C:\Python35\Lib\site-packages"
|
||||
"PythonDir" = "C:\Python37"
|
||||
"ScriptsDir" = "C:\Python37\Scripts"
|
||||
"SitePkgsDir" = "C:\Python37\Lib\site-packages"
|
||||
"DownloadDir" = "$env:Temp\DevSalt"
|
||||
}
|
||||
|
||||
|
@ -54,15 +51,13 @@ Function Get-Settings {
|
|||
|
||||
# Filenames for 64 bit Windows
|
||||
$64bitPrograms = @{
|
||||
"Python2" = "python-2.7.15.amd64.msi"
|
||||
"Python3" = "python-3.5.4-amd64.exe"
|
||||
"Python" = "python-3.7.4-amd64.exe"
|
||||
}
|
||||
$ini.Add("64bitPrograms", $64bitPrograms)
|
||||
|
||||
# Filenames for 32 bit Windows
|
||||
$32bitPrograms = @{
|
||||
"Python2" = "python-2.7.15.msi"
|
||||
"Python3" = "python-3.5.4.exe"
|
||||
"Python" = "python-3.7.4.exe"
|
||||
}
|
||||
$ini.Add("32bitPrograms", $32bitPrograms)
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ PyMySQL==0.9.3
|
|||
pyopenssl==19.0.0
|
||||
python-dateutil==2.8.0
|
||||
python-gnupg==0.4.4
|
||||
pythonnet==2.3.0
|
||||
pythonnet==2.4.0
|
||||
pyyaml==5.1.2
|
||||
pyzmq==18.0.1 ; python_version < "3.8"
|
||||
pyzmq==19.0.0 ; python_version >= "3.8"
|
||||
|
|
|
@ -48,11 +48,26 @@ if [%1]==[] (
|
|||
|
||||
for /F "tokens=1,2 delims=." %%a in ("%Version%") do (set Series=%%a.%%b)
|
||||
|
||||
:: See if the Series Directory exists (uses new versioning)
|
||||
if not exist .\%Series%\ (
|
||||
echo - Series %Series% was not found, trying new naming convention
|
||||
for /F "tokens=1,2 delims=." %%a in ("%Version%") do (set Series=%%a)
|
||||
)
|
||||
if not exist .\%Series%\ (
|
||||
echo - Series %Series% is not valid
|
||||
exit 1
|
||||
)
|
||||
|
||||
:: If it ends in a '.' trim it
|
||||
if "%Series:~-1%"=="." (
|
||||
set Series=%Series:~0,-1%
|
||||
)
|
||||
|
||||
:: Sign Installer Files
|
||||
echo ===========================================================================
|
||||
echo Signing...
|
||||
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
signtool.exe sign /t http://timestamp.digicert.com ^
|
||||
signtool.exe sign /a /t http://timestamp.digicert.com ^
|
||||
"%Series%\Salt-Minion-%Version%-AMD64-Setup.exe" ^
|
||||
"%Series%\Salt-Minion-%Version%-x86-Setup.exe" ^
|
||||
"%Series%\Salt-%Version%-AMD64-Setup.exe" ^
|
||||
|
@ -65,6 +80,8 @@ signtool.exe sign /t http://timestamp.digicert.com ^
|
|||
"%Series%\Salt-Minion-%Version%-Py2-x86-Setup.exe" ^
|
||||
"%Series%\Salt-Minion-%Version%-Py3-AMD64-Setup.exe" ^
|
||||
"%Series%\Salt-Minion-%Version%-Py3-x86-Setup.exe"
|
||||
|
||||
echo %ERRORLEVEL%
|
||||
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
echo Signing Complete
|
||||
echo ===========================================================================
|
||||
|
@ -77,86 +94,86 @@ set "file_name=Salt-Minion-%Version%-AMD64-Setup.exe"
|
|||
set "file=.\%Series%\%file_name%"
|
||||
if exist "%file%" (
|
||||
echo - %file_name%
|
||||
powershell -c "$hash = (Get-FileHash -Algorithm MD5 \"%file%\").Hash; Out-File -InputObject $hash\" %file_name%\" -FilePath \"%file%.md5\""
|
||||
powershell -c "$hash = (Get-FileHash -Algorithm SHA256 \"%file%\").Hash; Out-File -InputObject $hash\" %file_name%\" -FilePath \"%file%.sha256\"")
|
||||
powershell -c "$hash = (Get-FileHash -Algorithm MD5 \"%file%\").Hash; Out-File -InputObject $hash\" %file_name%\" -FilePath \"%file%.md5\"" -NoNewLine
|
||||
powershell -c "$hash = (Get-FileHash -Algorithm SHA256 \"%file%\").Hash; Out-File -InputObject $hash\" %file_name%\" -FilePath \"%file%.sha256\"" -NoNewLine)
|
||||
|
||||
|
||||
set "file_name=Salt-Minion-%Version%-x86-Setup.exe"
|
||||
set "file=.\%Series%\%file_name%"
|
||||
if exist "%file%" (
|
||||
echo - %file_name%
|
||||
powershell -c "$hash = (Get-FileHash -Algorithm MD5 \"%file%\").Hash; Out-File -InputObject $hash\" %file_name%\" -FilePath \"%file%.md5\""
|
||||
powershell -c "$hash = (Get-FileHash -Algorithm SHA256 \"%file%\").Hash; Out-File -InputObject $hash\" %file_name%\" -FilePath \"%file%.sha256\"")
|
||||
powershell -c "$hash = (Get-FileHash -Algorithm MD5 \"%file%\").Hash; Out-File -InputObject $hash\" %file_name%\" -FilePath \"%file%.md5\"" -NoNewLine
|
||||
powershell -c "$hash = (Get-FileHash -Algorithm SHA256 \"%file%\").Hash; Out-File -InputObject $hash\" %file_name%\" -FilePath \"%file%.sha256\"" -NoNewLine)
|
||||
|
||||
set "file_name=Salt-%Version%-AMD64-Setup.exe"
|
||||
set "file=.\%Series%\%file_name%"
|
||||
if exist "%file%" (
|
||||
echo - %file_name%
|
||||
powershell -c "$hash = (Get-FileHash -Algorithm MD5 \"%file%\").Hash; Out-File -InputObject $hash\" %file_name%\" -FilePath \"%file%.md5\""
|
||||
powershell -c "$hash = (Get-FileHash -Algorithm SHA256 \"%file%\").Hash; Out-File -InputObject $hash\" %file_name%\" -FilePath \"%file%.sha256\"")
|
||||
powershell -c "$hash = (Get-FileHash -Algorithm MD5 \"%file%\").Hash; Out-File -InputObject $hash\" %file_name%\" -FilePath \"%file%.md5\"" -NoNewLine
|
||||
powershell -c "$hash = (Get-FileHash -Algorithm SHA256 \"%file%\").Hash; Out-File -InputObject $hash\" %file_name%\" -FilePath \"%file%.sha256\"" -NoNewLine)
|
||||
|
||||
set "file_name=Salt-%Version%-x86-Setup.exe"
|
||||
set "file=.\%Series%\%file_name%"
|
||||
if exist "%file%" (
|
||||
echo - %file_name%
|
||||
powershell -c "$hash = (Get-FileHash -Algorithm MD5 \"%file%\").Hash; Out-File -InputObject $hash\" %file_name%\" -FilePath \"%file%.md5\""
|
||||
powershell -c "$hash = (Get-FileHash -Algorithm SHA256 \"%file%\").Hash; Out-File -InputObject $hash\" %file_name%\" -FilePath \"%file%.sha256\"")
|
||||
powershell -c "$hash = (Get-FileHash -Algorithm MD5 \"%file%\").Hash; Out-File -InputObject $hash\" %file_name%\" -FilePath \"%file%.md5\"" -NoNewLine
|
||||
powershell -c "$hash = (Get-FileHash -Algorithm SHA256 \"%file%\").Hash; Out-File -InputObject $hash\" %file_name%\" -FilePath \"%file%.sha256\"" -NoNewLine)
|
||||
|
||||
set "file_name=Salt-%Version%-Py2-AMD64-Setup.exe"
|
||||
set "file=.\%Series%\%file_name%"
|
||||
if exist "%file%" (
|
||||
echo - %file_name%
|
||||
powershell -c "$hash = (Get-FileHash -Algorithm MD5 \"%file%\").Hash; Out-File -InputObject $hash\" %file_name%\" -FilePath \"%file%.md5\""
|
||||
powershell -c "$hash = (Get-FileHash -Algorithm SHA256 \"%file%\").Hash; Out-File -InputObject $hash\" %file_name%\" -FilePath \"%file%.sha256\"")
|
||||
powershell -c "$hash = (Get-FileHash -Algorithm MD5 \"%file%\").Hash; Out-File -InputObject $hash\" %file_name%\" -FilePath \"%file%.md5\"" -NoNewLine
|
||||
powershell -c "$hash = (Get-FileHash -Algorithm SHA256 \"%file%\").Hash; Out-File -InputObject $hash\" %file_name%\" -FilePath \"%file%.sha256\"" -NoNewLine)
|
||||
|
||||
set "file_name=Salt-%Version%-Py2-x86-Setup.exe"
|
||||
set "file=.\%Series%\%file_name%"
|
||||
if exist "%file%" (
|
||||
echo - %file_name%
|
||||
powershell -c "$hash = (Get-FileHash -Algorithm MD5 \"%file%\").Hash; Out-File -InputObject $hash\" %file_name%\" -FilePath \"%file%.md5\""
|
||||
powershell -c "$hash = (Get-FileHash -Algorithm SHA256 \"%file%\").Hash; Out-File -InputObject $hash\" %file_name%\" -FilePath \"%file%.sha256\"")
|
||||
powershell -c "$hash = (Get-FileHash -Algorithm MD5 \"%file%\").Hash; Out-File -InputObject $hash\" %file_name%\" -FilePath \"%file%.md5\"" -NoNewLine
|
||||
powershell -c "$hash = (Get-FileHash -Algorithm SHA256 \"%file%\").Hash; Out-File -InputObject $hash\" %file_name%\" -FilePath \"%file%.sha256\"" -NoNewLine)
|
||||
|
||||
set "file_name=Salt-%Version%-Py3-AMD64-Setup.exe"
|
||||
set "file=.\%Series%\%file_name%"
|
||||
if exist "%file%" (
|
||||
echo - %file_name%
|
||||
powershell -c "$hash = (Get-FileHash -Algorithm MD5 \"%file%\").Hash; Out-File -InputObject $hash\" %file_name%\" -FilePath \"%file%.md5\""
|
||||
powershell -c "$hash = (Get-FileHash -Algorithm SHA256 \"%file%\").Hash; Out-File -InputObject $hash\" %file_name%\" -FilePath \"%file%.sha256\"")
|
||||
powershell -c "$hash = (Get-FileHash -Algorithm MD5 \"%file%\").Hash; Out-File -InputObject $hash\" %file_name%\" -FilePath \"%file%.md5\"" -NoNewLine
|
||||
powershell -c "$hash = (Get-FileHash -Algorithm SHA256 \"%file%\").Hash; Out-File -InputObject $hash\" %file_name%\" -FilePath \"%file%.sha256\"" -NoNewLine)
|
||||
|
||||
set "file_name=Salt-%Version%-Py3-x86-Setup.exe"
|
||||
set "file=.\%Series%\%file_name%"
|
||||
if exist "%file%" (
|
||||
echo - %file_name%
|
||||
powershell -c "$hash = (Get-FileHash -Algorithm MD5 \"%file%\").Hash; Out-File -InputObject $hash\" %file_name%\" -FilePath \"%file%.md5\""
|
||||
powershell -c "$hash = (Get-FileHash -Algorithm SHA256 \"%file%\").Hash; Out-File -InputObject $hash\" %file_name%\" -FilePath \"%file%.sha256\"")
|
||||
powershell -c "$hash = (Get-FileHash -Algorithm MD5 \"%file%\").Hash; Out-File -InputObject $hash\" %file_name%\" -FilePath \"%file%.md5\"" -NoNewLine
|
||||
powershell -c "$hash = (Get-FileHash -Algorithm SHA256 \"%file%\").Hash; Out-File -InputObject $hash\" %file_name%\" -FilePath \"%file%.sha256\"" -NoNewLine)
|
||||
|
||||
set "file_name=Salt-Minion-%Version%-Py2-AMD64-Setup.exe"
|
||||
set "file=.\%Series%\%file_name%"
|
||||
if exist "%file%" (
|
||||
echo - %file_name%
|
||||
powershell -c "$hash = (Get-FileHash -Algorithm MD5 \"%file%\").Hash; Out-File -InputObject $hash\" %file_name%\" -FilePath \"%file%.md5\""
|
||||
powershell -c "$hash = (Get-FileHash -Algorithm SHA256 \"%file%\").Hash; Out-File -InputObject $hash\" %file_name%\" -FilePath \"%file%.sha256\"")
|
||||
powershell -c "$hash = (Get-FileHash -Algorithm MD5 \"%file%\").Hash; Out-File -InputObject $hash\" %file_name%\" -FilePath \"%file%.md5\"" -NoNewLine
|
||||
powershell -c "$hash = (Get-FileHash -Algorithm SHA256 \"%file%\").Hash; Out-File -InputObject $hash\" %file_name%\" -FilePath \"%file%.sha256\"" -NoNewLine)
|
||||
|
||||
set "file_name=Salt-Minion-%Version%-Py2-x86-Setup.exe"
|
||||
set "file=.\%Series%\%file_name%"
|
||||
if exist "%file%" (
|
||||
echo - %file_name%
|
||||
powershell -c "$hash = (Get-FileHash -Algorithm MD5 \"%file%\").Hash; Out-File -InputObject $hash\" %file_name%\" -FilePath \"%file%.md5\""
|
||||
powershell -c "$hash = (Get-FileHash -Algorithm SHA256 \"%file%\").Hash; Out-File -InputObject $hash\" %file_name%\" -FilePath \"%file%.sha256\"")
|
||||
powershell -c "$hash = (Get-FileHash -Algorithm MD5 \"%file%\").Hash; Out-File -InputObject $hash\" %file_name%\" -FilePath \"%file%.md5\"" -NoNewLine
|
||||
powershell -c "$hash = (Get-FileHash -Algorithm SHA256 \"%file%\").Hash; Out-File -InputObject $hash\" %file_name%\" -FilePath \"%file%.sha256\"" -NoNewLine)
|
||||
|
||||
set "file_name=Salt-Minion-%Version%-Py3-AMD64-Setup.exe"
|
||||
set "file=.\%Series%\%file_name%"
|
||||
if exist "%file%" (
|
||||
echo - %file_name%
|
||||
powershell -c "$hash = (Get-FileHash -Algorithm MD5 \"%file%\").Hash; Out-File -InputObject $hash\" %file_name%\" -FilePath \"%file%.md5\""
|
||||
powershell -c "$hash = (Get-FileHash -Algorithm SHA256 \"%file%\").Hash; Out-File -InputObject $hash\" %file_name%\" -FilePath \"%file%.sha256\"")
|
||||
powershell -c "$hash = (Get-FileHash -Algorithm MD5 \"%file%\").Hash; Out-File -InputObject $hash\" %file_name%\" -FilePath \"%file%.md5\"" -NoNewLine
|
||||
powershell -c "$hash = (Get-FileHash -Algorithm SHA256 \"%file%\").Hash; Out-File -InputObject $hash\" %file_name%\" -FilePath \"%file%.sha256\"" -NoNewLine)
|
||||
|
||||
set "file_name=Salt-Minion-%Version%-Py3-x86-Setup.exe"
|
||||
set "file=.\%Series%\%file_name%"
|
||||
if exist "%file%" (
|
||||
echo - %file_name%
|
||||
powershell -c "$hash = (Get-FileHash -Algorithm MD5 \"%file%\").Hash; Out-File -InputObject $hash\" %file_name%\" -FilePath \"%file%.md5\""
|
||||
powershell -c "$hash = (Get-FileHash -Algorithm SHA256 \"%file%\").Hash; Out-File -InputObject $hash\" %file_name%\" -FilePath \"%file%.sha256\"")
|
||||
powershell -c "$hash = (Get-FileHash -Algorithm MD5 \"%file%\").Hash; Out-File -InputObject $hash\" %file_name%\" -FilePath \"%file%.md5\"" -NoNewLine
|
||||
powershell -c "$hash = (Get-FileHash -Algorithm SHA256 \"%file%\").Hash; Out-File -InputObject $hash\" %file_name%\" -FilePath \"%file%.sha256\"" -NoNewLine)
|
||||
|
||||
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
echo Hashing Complete
|
||||
|
|
Loading…
Add table
Reference in a new issue