Is it possible to log update to command line instead of file - Advanced Installer Community
jak6jak
Posts: 1
Joined: Thu Jul 30, 2020 7:46 pm

Is it possible to log update to command line instead of file

I am running the installer through powershell by using the Start-Process command.

Code: Select all

Start-Process -Wait -FilePath
 'Path-to-Installer' -ArgumentList /quiet, /L*+X, "C:\path\testing.txt"
This command doesn't seem to work and it just hangs. My program is running as a windows service so perhaps that has something to do with it?
I have read the docs on how to create a log here: https://www.advancedinstaller.com/user- ... a-log.html I think it would be easier if I could get result of the install through powershell output and have my program insert it into the log file instead of the installer writing to the log. Is there an argument that I could pass that does this?
Catalin
Posts: 7852
Joined: Wed Jun 13, 2018 7:49 am

Re: Is it possible to log update to command line instead of file

Hello and welcome to our forums,

First of all, please note that, in order to install a setup silently, the process must start elevated. With that being said, the PowerShell prompt should be run using the "Run as administrator" option.

Now, regarding your issue:

1. in order to generate the most out of the log file, a verbose log should be created (e.g. /L*V option). WIth that being said, I would suggest using that instead of the "X" parameter. Additionally, the "+" parameter will try to append the information to an already existing log file, therefore the "C:\path\testing.txt" file should already exist.

Now, there are two different scenarios here:

2. if your setup file is an executable file ("Builds" page --> "Single EXE"), then the used cmdlet is indeed correct:

execmdlet.png
execmdlet.png (296.78 KiB) Viewed 1628 times
3. however, if the setup file is an MSI file, then the cmdlet is not correct, as the start-process cmdlet should be pointing out to the msiexec.exe executable. In order to install an MSI from command line (e.g. cmd.exe), a command line as it follows should be used:

Code: Select all

msiexec /i <path_to_msi> <other_parameters_here>
therefore the command should look similar to this:

Code: Select all

start-process msiexec.exe  -argumentlist '/i "C:\Users\Catalin\Desktop\Your Application-SetupFiles\Your Application.msi" /qn /L*V C:\logTestMSI.txt'
Hope this helps.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”