diff --git a/pkg/windows/build_env_2.ps1 b/pkg/windows/build_env_2.ps1 index 6e73f36c70..b87b8685a5 100644 --- a/pkg/windows/build_env_2.ps1 +++ b/pkg/windows/build_env_2.ps1 @@ -22,22 +22,10 @@ # Load parameters param( - [switch]$Silent + [switch]$Silent, + [switch]$NoPipDependencies ) -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: dev_env.ps1 -Silent" -Write-Output "" -Write-Output "=================================================================" -Write-Output "" - #============================================================================== # Get the Directory of actual script #============================================================================== @@ -49,6 +37,22 @@ $script_path = $script_path.DirectoryName #============================================================================== $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 #============================================================================== @@ -199,12 +203,23 @@ Start_Process_and_test_exitcode "cmd" "/c $($ini['Settings']['Python2Dir'])\pyth #============================================================================== -# Install pypi resources using pip +# Install windows specific pypi resources using pip #============================================================================== Write-Output " ----------------------------------------------------------------" -Write-Output " - $script_name :: Installing pypi resources using pip . . ." +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.txt" "pip install" +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" +} #============================================================================== diff --git a/pkg/windows/build_env_3.ps1 b/pkg/windows/build_env_3.ps1 index b88a0c9fd7..34e83e6953 100644 --- a/pkg/windows/build_env_3.ps1 +++ b/pkg/windows/build_env_3.ps1 @@ -22,22 +22,10 @@ # Load parameters param( - [switch]$Silent + [switch]$Silent, + [switch]$NoPipDependencies ) -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: dev_env.ps1 -Silent" -Write-Output "" -Write-Output "=================================================================" -Write-Output "" - #============================================================================== # Get the Directory of actual script #============================================================================== @@ -49,6 +37,22 @@ $script_path = $script_path.DirectoryName #============================================================================== $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 #============================================================================== @@ -197,13 +201,24 @@ 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" + +#============================================================================== +# 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']['Python3Dir'])\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 #============================================================================== -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" +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" +} #============================================================================== # Cleaning Up PyWin32 @@ -237,11 +252,13 @@ Remove-Item "$($ini['Settings']['Scripts3Dir'])\pywin32_*" -Force -Recurse #============================================================================== # Fix PyCrypto #============================================================================== -Write-Output " ----------------------------------------------------------------" -Write-Output " - $script_name :: Fixing PyCrypto . . ." -Write-Output " ----------------------------------------------------------------" -$nt_file = "$($ini['Settings']['Python3Dir'])\Lib\site-packages\Crypto\Random\OSRNG\nt.py" -(Get-Content $nt_file) | Foreach-Object {$_ -replace '^import winrandom$', 'from Crypto.Random.OSRNG import winrandom'} | Set-Content $nt_file +If ($NoPipDependencies -eq $false) { + Write-Output " ----------------------------------------------------------------" + Write-Output " - $script_name :: Fixing PyCrypto . . ." + Write-Output " ----------------------------------------------------------------" + $nt_file = "$($ini['Settings']['Python3Dir'])\Lib\site-packages\Crypto\Random\OSRNG\nt.py" + (Get-Content $nt_file) | Foreach-Object {$_ -replace '^import winrandom$', 'from Crypto.Random.OSRNG import winrandom'} | Set-Content $nt_file +} #============================================================================== # Copy DLLs to Python Directory diff --git a/pkg/windows/req.txt b/pkg/windows/req.txt index b9c3488ce8..e106df20b0 100644 --- a/pkg/windows/req.txt +++ b/pkg/windows/req.txt @@ -1,3 +1,4 @@ +-r req_win.txt backports-abc==0.5 backports.ssl-match-hostname==3.7.0.1 certifi @@ -28,7 +29,6 @@ pyOpenSSL==18.0.0 python-dateutil==2.7.5 python-gnupg==0.4.3 pythonnet==2.3.0 -pywin32==224 PyYAML==3.13 pyzmq==17.1.2 requests==2.21.0 @@ -37,4 +37,3 @@ smmap==0.9.0 timelib==0.2.4 tornado==4.5.3 wheel==0.32.3 -WMI==1.4.9 diff --git a/pkg/windows/req_win.txt b/pkg/windows/req_win.txt new file mode 100644 index 0000000000..7f279af526 --- /dev/null +++ b/pkg/windows/req_win.txt @@ -0,0 +1,2 @@ +pywin32==224 +WMI==1.4.9