Problem installing PyCharm pro

Hi guys,

I have this batch file that install PyCharm professional successfully.
No matter i do, the installation with ps1 fails.

batch file: 
"%~dp0source\pycharm-professional-2021.1.1.exe" /S /CONFIG=%~dp0source\silent.config /LOG=c:\install\logs\pycharm-professional-2021.1.1.log /D=C:\Program Files\JetBrains\pycharm professional 2021.1.1
Execute-Process -path "$dirfiles\pycharm-professional-2021.1.1.exe" -parameters "/S /CONFIG=^"$dirfiles\silent.config^" /LOG=c:\install\logs\pycharm-professional-2021.1.1.log /D=C:\Program Files\JetBrains\pycharm professional 2021.1.1' -windowstyle 'hidden'

I am getting an error:

Message
Cannot process argument transformation on parameter 'MsiExecWaitTime'. Cannot convert value
"/D=C:\pycharm" to type "System.Int32". Error: "Input string was not in a correct format."
InnerException : System.Management.Automation.ArgumentTransformationMetadataException: Cannot convert value
"/D=C:\pycharm" to type "System.Int32". Error: "Input string was not in a correct format." --->
System.Management.Automation.PSInvalidCastException: Cannot convert value "/D=C:\pycharm" to type
"System.Int32". Error: "Input string was not in a correct format." ---> System.FormatException: Input

Thanks for any help :slight_smile:

I think it is all about quote usage…
Your Powershell has the wrong escape character ^, it should be ` and you have not quoted the paths with spaces in them, Yours:

I would suggest trying this (Note the changes especially the escaped double quotes):

Execute-Process -path "$($dirfiles)\pycharm-professional-2021.1.1.exe" -parameters "/S /CONFIG=`"$($dirfiles)\silent.config`" /LOG=`"c:\install\logs\pycharm-professional-2021.1.1.log`" /D=`"C:\Program Files\JetBrains\pycharm professional 2021.1.1`"" -windowstyle 'hidden'
2 Likes

Oh my god it worked :grinning:
Thank you so much for your help.
Amir

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.