2

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

joy
  • 51
  • 1
  • 6

3 Answers3

3

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"'
mklement0
  • 382,024
  • 64
  • 607
  • 775
  • Thanks for the update, i tried setting APPDIR but it does not seem to work. later I came across this software **Ultimate Silent Switch Finder** using it i surprisingly found the packaging technology to be **Self-Extracting Microsoft CAB archive** not advance installer which i mistakenly took while comparing the switches.. and worst i cant seem to find the exact documentation regarding this . I have modified my question above including the exe driver i am working with -**AccessDatabaseEngine_X64.exe** – joy Sep 15 '20 at 13:03
  • 1
    @joy, I've updated the answer to clarify that it only applies to MSI-based Advanced Installer executables, which may still be helpful to future readers. As for documentation: It is [here](https://support.microsoft.com/en-us/help/912203/description-of-the-command-line-switches-that-are-supported-by-a-softw), but it doesn't tell you much more than you already know. Have you experimented with `/extract`? I'm unclear on its exact purpose (temporary extraction location vs. installation dir.) – mklement0 Sep 15 '20 at 15:24
  • 1
    Thats great. As for the exact function of ` /extract` it seems to extract software update package, you might like to check here for clarification [link](https://support.microsoft.com/en-in/help/832475/description-of-the-new-features-in-the-package-installer-for-windows-s). However i dont think any of the switches provided under the exe helps to change target directory. – joy Sep 15 '20 at 15:38
  • Thanks for the link, @joy. So the answer may be that you simply cannot change the install directory at installation time. It may not be an option for you, but creating MSI-based executables instead could solve the problem. – mklement0 Sep 15 '20 at 15:51
  • sadly i am starting to feel the same, ill keep the post open hopefully someone can shed some light in near future. About creating MSI-based executables as far as i know i can make use of some free utility tool like msi wrapper or advance installer itself, else get the MSI package for the exe, which i highly doubt is available incase of my exe. Apart from the mentioned is there anything else i can work with for easy conversion/creation of MSI-based executables as per your understanding – joy Sep 15 '20 at 16:35
  • @joy: Sorry, I'm also out of ideas, but I'm not well-versed in installer technologies. The only other thing I can think of is to move the installation directory _after_ the installation, but I presume that is impractical, because it would require you to modify any registry entries / configuration-file entries that refer to the original directory. One more though - no idea if it would work: create a symlink that points to your custom location in the original location, but that would only work if the installer uses that link as-is, without trying to recreate the dir. – mklement0 Sep 15 '20 at 16:40
  • No issue, thanks for your time and help. As for creating a symlink i have never tied that but if its for pointing to the already created directory than that would be impractical for me as i dont plan on utilizing any space in the default directory. – joy Sep 15 '20 at 16:50
  • 1
    My pleasure, @joy. Re symlink: I meant the other way around: create a symlink where the installer will try to write to, and hope that it uses that symlink and therefore causes the files copied there to be redirected to your custom location. – mklement0 Sep 15 '20 at 16:52
0

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
Mike L'Angelo
  • 854
  • 6
  • 16
  • thanks for the immediate answer, yes i tried the same syntax it worked for silent installation, but what i am looking for is to change the path/directory of installation. – joy Sep 14 '20 at 17:30
  • As @mklement0 said, you need to set the value of the property APPDIR, just as you can see in his examples above. – Bogdan Mitrache Sep 15 '20 at 07:17
  • @BogdanMitrache it did not work as the packaging technology seem to be **Self-Extracting Microsoft CAB archive** and not advance installer, i have updated my earlier question along with the exact driver i am working with. – joy Sep 15 '20 at 13:08
0

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.

joy
  • 51
  • 1
  • 6