AXO
AXO

Reputation: 9076

Installing Python executable in /quiet mode with a specific TargetDir

I'm having trouble installing python 3.5.0+ on AppVeyor. The arguments I'm using to call subprocess.check_output are:

[u'python-3.6.3-amd64.exe',
 u'/quiet',
 u'TargetDir=C:\\Python363-x64',
 u'AssociateFiles=0',
 u'Shortcuts=0',
 u'Include_doc=0',
 u'Include_launcher=0',
 u'InstallLauncherAllUsers=0',
 u'Include_tcltk=0',
 u'Include_test=0']

The installer returns a non-zero status code with the following log file:

https://pastebin.com/jmMpiXmH

(sorry for using the pastebin, it's long and apparently stackoverflow has a character limit)

After the installer exits, no python is installed in the requested TargetDir (C:\\Python363-x64). Actually the directory is not even created and it does not help if I create it manually beforehand.

I've tried to first run /uninstall (thought that it might skip installation because of the already installed versions of appveyor), but the same issue persists. I've tried both /passive and /quiet options. I've also tried this on other python versions (3.5.0+) with no luck. (earlier versions have .msi installers and they install properly)

I would like to know if anyone else can reproduce this issue or if you know what I'm doing wrong.

Upvotes: 2

Views: 3288

Answers (2)

Ril Dank
Ril Dank

Reputation: 115

In my case, using DefaultAllUsersTargetDir and/or DefaultJustForMeTargetDir instead of TargetDir worked in a Powershell script.

Upvotes: 0

Feodor Fitsner
Feodor Fitsner

Reputation: 2354

This is a sample PowerShell script installing Python 3.6.4 on AppVeyor environment:

Write-Host "Installing Python 3.6.4 x64..." -ForegroundColor Cyan
Write-Host "Downloading..."
$exePath = "$env:TEMP\python-3.6.4-amd64.exe"
(New-Object Net.WebClient).DownloadFile('https://www.python.org/ftp/python/3.6.4/python-3.6.4-amd64.exe', $exePath)
Write-Host "Installing..."
cmd /c start /wait $exePath /quiet TargetDir=C:\Python36-x64 Shortcuts=0 Include_launcher=1 InstallLauncherAllUsers=1

Feel free to adopt it for your needs.

Upvotes: 4

Related Questions