Problem installing into program files

Hi to all,
I am using PS deploy toolkit version 3.9.3.
I have created a new package for silent installation for JetBrains PyCharm Community Edition_v2024.2.
If i run the command with a batch file, the installation succussed and installed in:
“C:\Program Files\JetBrains\PyCharm Community Edition 2024.2”

"%~dp0source\pycharm-community-2024.2.exe" /S /CONFIG=%~dp0source\silent.config /LOG=c:\install\logs\pycharm-community setup-2024.2.log /D=C:\Program Files\JetBrains\PyCharm Community Edition 2024.2

If i run from Deploy-Application.ps1, the installation succussed but the installation is installed under:
C:\Program Files (x86)\JetBrains\PyCharm Community Edition 2024.2

Execute-Process -path "$dirfiles\pycharm-community-2024.2.exe" -parameters "/S /CONFIG=`"$($dirfiles)\silent.config`" /LOG=`"c:\install\logs\pycharm-community_setup-2024.2.log`" /D=`"C:\Program Files\JetBrains\PyCharm Community Edition 2024.2`""

Do you have any idea why its installing in program files (x86)?

Thank you very much
Amir

Hey,

Execute-Process -path "$dirfiles\pycharm-community-2024.2.exe" -parameters "/S /CONFIG=`"$($dirfiles)\silent.config`" /LOG=`"c:\install\logs\pycharm-community_setup-2024.2.log`" /D=`"C:\Program Files\JetBrains\PyCharm Community Edition 2024.2`""

Try…

Execute-Process -Path "$dirFiles\pycharm-community-2024.2.exe" -Parameters "/S /CONFIG=`"$($dirfiles)\silent.config`" /LOG=`"$envSystemDrive\install\logs\pycharm-community_setup-2024.2.log`" /D=`"$envProgramFiles\JetBrains\PyCharm Community Edition 2024.2`"" -WindowStyle Hidden

Also, check if you’re running PS as 32/64 and in variables section do put x64 if you want it in reg progfiles.

I had an issue with PSADT and having something written to the x64 vs x86 part of the registry. I was deploying the application with Intune, and I had to ensure I was calling PowerShell with the sysnative keyword. Idk if that’s related to your issue.
%windir%\SysNative\WindowsPowershell\v1.0\PowerShell.exe
File System Redirector

You didn’t use quotes to wrap the paths in the batch file example, and some installers actually don’t work if you wrap the paths in quotes (I have no idea if this is one of them). So if the original batch example does work, I’d try removing them in the PowerShell version.