How to change TARGET DIRECTORY/path of installation for EXE file during SILENT installation

7.7k Views Asked by At

I am trying to silent install exe softwares while changing the target directory during installation.

I am not able to change the path/directoy during installment.

I am aware of switches available for exe files, i have attached the same for the exe i am trying to install , it seem to come under EDITED Advanced Installer>> (Self-Extracting Microsoft CAB archive)

Command Switches: /extract:path ; /log[:path] ; /lang:lcid ;/quiet ; /passive ; /norestart ; /forcerestat

The various commands/block i tried: Python

p = subprocess.Popen(r'path\file.exe /quiet /v"INSTALLDIR=\"path""', shell=True)
p = subprocess.Popen(r'path\file.exe /quiet TARGETDIR="path""')

I am facing the same problem with powershell.

Any help is appreciated. enter image description here

3

There are 3 best solutions below

0
joy On BEST ANSWER

There dosent seem to be any Target/path usable with AccessDatabaseEngine_X64.exe, the only workaround i found was to use /extract to get the msi out of the exe then use @mklement0 suggestion.

3
Mike L'Angelo On

Switches are available according to installer software the product is built with. As an example, Puppet installer exe can be passed parameters via Powershell this way - you may be able to leverage this syntax with your installer.

            Start-Process -FilePath C:\temp\puppet-agent-x64-latest.msi -ArgumentList "/qn /norestart -L* c:\temp\mylog.txt" -wait
8
mklement0 On

Note: This answer does not solve joy's problem, but it should work for MSI-based (Windows Installer-based) installer executables created with Advanced Installer.


The Advanced Installer documentation indicates that APPDIR is the name of the property that for MSI-based executables you can override from the command line (untested):

Python:

p = subprocess.Popen(r'path\file.exe /quiet APPDIR="path"', shell=True)

PowerShell, assuming you want to wait for the installation to finish:

Start-Process -Wait 'path\file.exe' '/quiet APPDIR="path"'