Silent install in powershell

Hello, I need help…
I’m trying to do a silent install in powershell and I’m stuck with an APP that doesn’t work.
The APP is an old Seagate Crystal Reports v8x and the executable is unfortunately an exe and not an msi.
The argument I’m using is /quiet as reported in the executable’s help, but every time I try to run the code it opens the executable’s help again.
The complete code I’m using is this below, if anyone can help me I’d be grateful.
The Installer has EULA acceptance and installation number

$install = Start-Process "D:\path to file\setup.exe" -ArgumentList /quiet -WindowStyle Hidden -PassThru
While($install.ExitCode -eq $null){Sleep 1}

Boa noite Mauricio and Welcome to the forum. :wave:t3:

Have you tried quoting the argument? And actually you don’t need to use Start-Process at all. You may try …

& 'D:\path to file\setup.exe' '/quiet'

If that does not work either you may share the executables help you mentioned. Please post it as plain text formatted as code.

When you post code, sample data, console output or error messages please format it as code using the preformatted text button ( </> ). Simply place your cursor on an empty line, click the button and paste your code.

Thanks in advance

How to format code in PowerShell.org 1 <---- Click :point_up_2:t4: :wink:

( !! Sometimes the preformatted text button hides behind the settings gear symbol. :wink: )

Regardless of that … sometimes there is an option to extract the contained files from an install executable. Mostly they contain an MSI file. This may be easier to handle. :wink:

I tried '/quiet' and it doesn’t work
File Help is below

Windows (R) Installer. V 5.0.19041.2193

msiexec /Option <Required_Parameter> [Optional Parameter]

Installation Options
  </package | /i> <Product.msi>
  Install or configure a product
  /a <Product.msi>
  Administrative installation - Installs a product on the network
  /j<u|m> <Product.msi> [/t <Transform List>] [/g <Language_ID>]
  Promotes a product - m for all users, u for current user
  </uninstall | /x> <Product.msi | ProductCode>
  Uninstall the product
Display Options
  /quiet
  Silent mode, no user interaction
  /passive
  Standalone mode - progress bar only
  /q[n|b|r|f]
  Sets the user interface level
  n - No UI
  b - Basic User Interface
  r - Reduced User Interface
  f - Full UI (default)
  /help
  Help Information
reboot options
  /norestart
  Does not restart after installation completes
  /promptrestart
  Prompts the user to restart if necessary
  /forcerestart
  Always restarts the computer after installation
Log Options
  /l[i|w|e|a|r|u|c|m|o|p|v|x|+|!|*] <LogFile>
  i - Status messages
  w - Non-fatal warnings
  e - All error messages
  a - Initialization of actions
  r - Action-specific records
  u - User requests
  c - Initial Interface Parameters
  m - Out of memory information or fatal exit
  o - Insufficient disk space messages
  p - Terminal properties
  v - Verbose output
  x - Additional debug information
  + - Append to existing log file
  ! - Move each line to the log
  * - Record all information except for the v and x options
  /log <LogFile>
  Equivalent to /l* <LogFile>
Update Options
  /update <Update1.msp>[;Update2.msp]
  Apply update(s)
  /uninstall <GuidCodePatch>[;Update2.msp] /package <Product.msi | ProductCode>
  Remove update(s) from a product
Repair Options
  /f[p|e|c|m|s|o|d|a|u|v] <Product.msi | ProductCode>
  repair a product
  p - only if the file is missing
  o - if the file is missing or an older version is installed (default)
  and - if the file is missing or if an equal or older version is installed
  d - if the file is missing or a different version is installed
  c - if file is missing or checksum does not match calculated value
  a - force all files to be reinstalled
  u - all required user-specific inputs (default)
  m - all required computer-specific registry entries (default)
  s - all existing shortcuts (default)
  v - run from source and re-cache the local package
Definition of Public Properties
  [PROPERTY=PropertyValue]

See the Windows (R) Installer SDK for additional documentation on
command line syntax.

Copyright (C) Microsoft Corporation. All rights reserved.
Portions of this software are based on the work of the Independent JPEG Group.
Opções de Instalação
 </package | /i> <Produto.msi>
 Instala ou configura um produto
 /a <Produto.msi>
 Instalação administrativa - Instala um produto na rede
 /j<u|m> <Produto.msi> [/t <Lista de Transformação>] [/g <ID_Idioma>]
 Divulga um produto - m para todos os usuários, u para o usuário atual
 </uninstall | /x> <Produto.msi | CódigoProduto>
 Desinstala o produto
Opções de Exibição
 /quiet
 Modo silencioso, sem interação do usuário
 /passive
 Modo autônomo - somente barra de progresso
 /q[n|b|r|f]
 Define o nível da interface do usuário
 n - Sem interface do usuário
 b - Interface do Usuário básica
 r - Interface do Usuário reduzida
 f - Interface do Usuário completa (padrão)
 /help
 Informações de Ajuda
Opções de reinicialização
 /norestart
 Não reinicia depois que a instalação for concluída
 /promptrestart
 Solicita que o usuário reinicie, caso necessário
 /forcerestart
 Sempre reinicia o computador após a instalação
Opções de Log
 /l[i|w|e|a|r|u|c|m|o|p|v|x|+|!|*] <ArquivoLog>
 i - Mensagens de status
 w - Avisos não fatais
 e - Todas as mensagens de erro
 a - Inicialização de ações
 r - Registros específicos de ações
 u - Solicitações do usuário
 c - Parâmetros iniciais de Interface
 m - Informações de memória insuficiente ou saída fatal
 o - Mensagens de espaço em disco insuficiente
 p - Propriedades do terminal
 v - Saída detalhada
 x - Informações adicionais de depuração
 + - Acrescentar ao arquivo de log existente
 ! - Mover cada linha para o log
 * - Registrar todas as informações, exceto para as opções v e x
 /log <ArquivoLog>
 Equivalente a /l* <ArquivoLog>
Opções de Atualização
 /update <Atualização1.msp>[;Atualização2.msp]
 Aplica atualização(ões)
 /uninstall <GuidCódigoPatch>[;Update2.msp] /package <Produto.msi | CódigoProduto>
 Remove atualização(ões) de um produto
Opções de Reparo
 /f[p|e|c|m|s|o|d|a|u|v] <Produto.msi | CódigoProduto>
 Repara um produto
 p - somente se o arquivo estiver ausente
 o - se o arquivo estiver ausente ou uma versão mais antiga estiver instalada (padrão)
 e - se o arquivo estiver ausente ou se uma versão igual ou mais antiga estiver instalada
 d - se o arquivo estiver ausente ou uma versão diferente estiver instalada
 c - se o arquivo estiver ausente ou checksum não corresponder ao valor calculado
 a - força todos os arquivos e serem reinstalados
 u - todas as entradas específicas do usuário necessárias (padrão)
 m - todas as entradas do Registro específicas do computador necessárias (padrão)
 s - todos os atalhos existentes (padrão)
 v - executa da origem e rearmazena em cache o pacote local
Definição de Propriedades Públicas
 [PROPERTY=PropertyValue]

Consulte o SDK do Windows (R) Installer para obter documentação adicional sobre a
sintaxe de linha de comando.

Copyright (C) Microsoft Corporation. Todos os direitos reservados.
Partes deste software são baseadas no trabalho do Independent JPEG Group.

Sounds like the exe is just a wrapper around a MSI. I would first consult the docs for the install if available. Worse case you may need to extract the MSI from the exe. Then you need a tool to view the property table of the MSI. The hope is there is a propery you can pass to the installer to auto acknowledge the EULA. If not you may be out of luck.

That’s actually not a PowerShell issue.

Try running the “setup.exe” manually. And when it shows the first interactive dialog box, do not interact with it - leave it as it is. On the system search a newly created folder with the msi file. Usually this folder should be in “C:\Users\<USERNAME>\AppData\LocalLow” and should have the name of the vender/creator of the software. Now you can copy this folder to a save place and cancel the installation on the dialog box.
Now that you have the MSI file you can install the software more easily. :wink:

I did what you told me, went to appdata and found the MSI installer.
With this installer the installation worked perfectly.
The only thing missing that I haven’t found is a way to add the installation number to the process.
But it’s already 95% great for me.

??? :thinking: What?

sorry, user and licence number

<offTopic>

You can do that by creating a manifest/transform file for the MSI, however, that is a tad complicated and would require a second file aside from the MSI. Might not be worth the effort. Basically, you need ORCA which allows you to modify MSI files and create the manifest from that tool. This is likely not going to work for you unless the user you mention is the same for all installations.

Here is an example that might steer you in the right direction for creating the manifest/transform file:
https://community.tenable.com/s/article/Nessus-Agent-Deployment-for-GPO

</offTopic>

Why not to used PSDT ?
If you planned more work with application, there is not better option to install any software with Powershell.

Even using the PowerShell App Deployment Toolkit you have to know how to install the application you want to install. :man_shrugging:t3:

Sure, but when you know it it’s better to use working wrapper then make it own from scratch :slight_smile: